>From 710dd37269045b54ae8666c5cd439190f27fa5a2 Mon Sep 17 00:00:00 2001 From: Frank Dittrich Date: Sat, 23 Jun 2012 13:26:15 +0200 Subject: [PATCH] --list=format-details: add number of test cases to output Furthermore, clanup unnecessary code for --list=format-details (which had been copied from the --list=formats code) Added --list=formats and --list=format-details description to doc/OPTIONS --- doc/OPTIONS | 21 +++++++++++++++++++++ src/john.c | 16 ++++++++++------ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/doc/OPTIONS b/doc/OPTIONS index d455f5b..b501bb0 100644 --- a/doc/OPTIONS +++ b/doc/OPTIONS @@ -289,6 +289,27 @@ The different variants of list externals may be worth mentioning: --list=ext-modes list external modes [has a generate()] --list=ext-filters list external filters, including modes with a filter --list=ext-filters-only list external filters [lacks a generate()] +--list=formats list all the supported formats in the sequence they + are registered (this is also the sequence that will + be used to identify the first format which detects + a valid ciphertext (password hash) in the input file + if john is started without the --format=NAME option) +--list=format-details list all the suported formats in the same sequence as + with --list=formats, but with additional details + -format label + this is to be used as NAME in --format=NAME + -maximum supported password length in bytes + for performance reasond, the maximum length + supported by John the Ripper can be shorter than + the maximum length supported by the application + which uses this format + -minimum keys per crypt + -maximum keys per crypt + -format flags + -number of hard coded test cases for --test + -algorithm name + -format name + (the individual columns are separated by [tab]) --regen-lost-salts=N Try to find password AND salt in a set of raw hashes. diff --git a/src/john.c b/src/john.c index ec07aba..97057db 100644 --- a/src/john.c +++ b/src/john.c @@ -774,23 +774,27 @@ static void john_init(char *name, int argc, char **argv) i = 0; format = fmt_list; - while ((format = format->next)) - i++; - - i = 0; - format = fmt_list; do { + int ntests; + struct fmt_tests *current; + ntests = 0; + + if(format->params.tests) { + while (format->params.tests[ntests++].ciphertext); + ntests--; + } /* * FIXME: Are other parameters more important? * Should I use hexadecimal output * for the FMT_flags? */ - printf("%s\t%d\t%d\t%d\t%d\t%s\t%s\n", + printf("%s\t%d\t%d\t%d\t%d\t%d\t%s\t%s\n", format->params.label, format->params.plaintext_length, format->params.min_keys_per_crypt, format->params.max_keys_per_crypt, format->params.flags, + ntests, format->params.algorithm_name, format->params.format_name); } while ((format = format->next)); -- 1.7.7.6