diff --git a/src/c3_fmt.c b/src/c3_fmt.c index 687d5935c7..6ca5ae4c78 100644 --- a/src/c3_fmt.c +++ b/src/c3_fmt.c @@ -25,6 +25,7 @@ #include "memory.h" #include "common.h" #include "formats.h" +#include "loader.h" #define FORMAT_LABEL "crypt" #define FORMAT_NAME "generic crypt(3)" @@ -144,7 +145,7 @@ static int valid(char *ciphertext) return 1; } - if (id != 10) + if (id != 10 && !ldr_in_pot) fprintf(stderr, "Generic crypt(3) module: " "hash encoding string length %d, type id %c%c\n" "appears to be unsupported on this system; " diff --git a/src/loader.c b/src/loader.c index 93b19d3cf3..6a8b8e2b1d 100644 --- a/src/loader.c +++ b/src/loader.c @@ -21,6 +21,7 @@ #ifdef HAVE_CRYPT extern struct fmt_main fmt_crypt; +int ldr_in_pot = 0; #endif /* @@ -594,8 +595,15 @@ static void ldr_load_pot_line(struct db_main *db, char *line) void ldr_load_pot_file(struct db_main *db, char *name) { - if (db->format) + if (db->format) { +#ifdef HAVE_CRYPT + ldr_in_pot = 1; +#endif read_file(db, name, RF_ALLOW_MISSING, ldr_load_pot_line); +#ifdef HAVE_CRYPT + ldr_in_pot = 0; +#endif + } } /* @@ -849,7 +857,13 @@ static void ldr_show_pot_line(struct db_main *db, char *line) void ldr_show_pot_file(struct db_main *db, char *name) { +#ifdef HAVE_CRYPT + ldr_in_pot = 1; +#endif read_file(db, name, RF_ALLOW_MISSING, ldr_show_pot_line); +#ifdef HAVE_CRYPT + ldr_in_pot = 0; +#endif } static void ldr_show_pw_line(struct db_main *db, char *line) diff --git a/src/loader.h b/src/loader.h index c17f1c63bc..9007e85fba 100644 --- a/src/loader.h +++ b/src/loader.h @@ -194,6 +194,11 @@ struct db_main { struct fmt_main *format; }; +#ifdef HAVE_CRYPT +/* Non-zero while the loader is processing the pot file */ +extern int ldr_in_pot; +#endif + /* * Initializes the database before loading. */