>From ab782725636d3819e354eb2870e3b42f62f38235 Mon Sep 17 00:00:00 2001 From: Frank Dittrich Date: Sun, 8 Jul 2012 18:49:14 +0200 Subject: [PATCH] Fix salt size of dynamic formats in --list=format-details For the new logic of dynamic formats, the --list=format-details output needed to be changed in a similar way as the output of --list=format-all-details has been changed The --list=format-all-details logic has also been changed to use one printf with ? : instead of if ... printf() else ... printf() --- src/john.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/john.c b/src/john.c index ce98a92..2135d84 100644 --- a/src/john.c +++ b/src/john.c @@ -875,7 +875,10 @@ static void john_init(char *name, int argc, char **argv) format->params.benchmark_comment, format->params.benchmark_length, format->params.binary_size, - format->params.salt_size); + ((format->params.flags & FMT_DYNAMIC) && format->params.salt_size) ? + // salts are handled internally within the format. We want to know the 'real' salt size + // dynamic will alway set params.salt_size to 0 or sizeof a pointer. + dynamic_real_salt_length(format) : format->params.salt_size); } while ((format = format->next)); exit(0); } @@ -916,12 +919,11 @@ static void john_init(char *name, int argc, char **argv) printf("Benchmark comment \t%s\n", format->params.benchmark_comment); printf("Benchmark length \t%d\n", format->params.benchmark_length); printf("Binary size \t%d\n", format->params.binary_size); - if ( (format->params.flags & FMT_DYNAMIC) && format->params.salt_size) { - // salts are handled internally within the format. We want to know the 'real' salt size/ + printf("Salt size \t%d\n", + ((format->params.flags & FMT_DYNAMIC) && format->params.salt_size) ? + // salts are handled internally within the format. We want to know the 'real' salt size // dynamic will alway set params.salt_size to 0 or sizeof a pointer. - printf("Salt size \t%d\n", dynamic_real_salt_length(format)); - } else - printf("Salt size \t%d\n", format->params.salt_size); + dynamic_real_salt_length(format) : format->params.salt_size); printf("\n"); } while ((format = format->next)); exit(0); -- 1.7.7.6