diff -urp john-1.7.9.6/src/formats.c john-1.7.9.6-newform/src/formats.c --- john-1.7.9.6/src/formats.c 2012-07-17 12:44:49 +0000 +++ john-1.7.9.6-newform/src/formats.c 2012-07-17 16:27:05 +0000 @@ -49,6 +49,14 @@ static char *fmt_self_test_body(struct f void *binary, *salt; int binary_align_warned = 0, salt_align_warned = 0; +/* + * Test each format just once unless we're debugging. + */ +#ifndef DEBUG + if (format->private.initialized == 2) + return NULL; +#endif + if (format->params.plaintext_length < 1 || format->params.plaintext_length > PLAINTEXT_BUFFER_SIZE - 3) return "plaintext_length"; @@ -166,6 +174,8 @@ static char *fmt_self_test_body(struct f } } while (done != 3); + format->private.initialized = 2; + return NULL; } diff -urp john-1.7.9.6/src/john.c john-1.7.9.6-newform/src/john.c --- john-1.7.9.6/src/john.c 2011-11-23 02:46:59 +0000 +++ john-1.7.9.6-newform/src/john.c 2012-07-17 15:54:32 +0000 @@ -1,6 +1,6 @@ /* * This file is part of John the Ripper password cracker, - * Copyright (c) 1996-2004,2006,2009-2011 by Solar Designer + * Copyright (c) 1996-2004,2006,2009-2012 by Solar Designer */ #include @@ -316,8 +316,14 @@ static void john_run(void) int remaining = database.password_count; if (!(options.flags & FLG_STDOUT)) { - status_init(NULL, 1); + char *where = fmt_self_test(database.format); + if (where) { + fprintf(stderr, "Self test failed (%s)\n", + where); + error(); + } log_init(LOG_NAME, POT_NAME, options.session); + status_init(NULL, 1); john_log_format(); if (idle_requested(database.format)) log_event("- Configured to use otherwise idle "