Skip to content

Commit 4e9f5b4

Browse files
committed
Single.c: Fix a train of weird logic and bugs found at recent tweak
1 parent 37c4651 commit 4e9f5b4

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

src/single.c

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -190,27 +190,18 @@ static void single_init(void)
190190
*
191191
* Bodge for deprecated syntax. When dropping it we'll drop this interim variable
192192
*/
193-
int option_retest = 0;
194-
195-
option_retest = parse_bool(options.single_retest_guess);
196-
197-
if ((retest_guessed = option_retest) == -1) {
193+
int option_retest = parse_bool(options.single_retest_guess);
198194

195+
if ((retest_guessed = option_retest) == -1)
199196
retest_guessed = cfg_get_bool(SECTION_OPTIONS, NULL, "SingleRetestGuessed", 1);
200197

201-
if (!retest_guessed && single_db->salt_count == 1) {
202-
retest_guessed = 0;
203-
if (john_main_process)
204-
fprintf(stderr, "Note: Ignoring SingleRetestGuessed option because only one salt is loaded.\n"
205-
" You can force it with --single-retest-guess\n");
206-
}
207-
}
208-
209-
if (!retest_guessed && john_main_process)
210-
fprintf(stderr, "Will not try cracked passwords against other salts\n");
198+
if (john_main_process && single_db->salt_count > 1) {
199+
if (!retest_guessed)
200+
fprintf(stderr, "Will not try cracked passwords against other salts\n");
211201

212-
if (options.seed_per_user && retest_guessed && option_retest == -1)
213-
fprintf(stderr, "Note: You might want --single-retest-guess when using --single-user-seed\n");
202+
if (options.seed_per_user && !retest_guessed && option_retest == -1)
203+
fprintf(stderr, "Note: You might want --single-retest-guess when using --single-user-seed\n");
204+
}
214205

215206
if ((words_pair_max = options.single_pair_max) < 0)
216207
if ((words_pair_max = cfg_get_int(SECTION_OPTIONS, NULL, "SingleWordsPairMax")) < 0)

0 commit comments

Comments
 (0)