Skip to content

Commit

Permalink
Revert "salted hashes, proper restore for the salt, #2082"
Browse files Browse the repository at this point in the history
This reverts commit d6717bf.
  • Loading branch information
jfoug committed Mar 11, 2016
1 parent d6717bf commit 95f75a2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 31 deletions.
16 changes: 0 additions & 16 deletions src/cracker.c
Original file line number Diff line number Diff line change
Expand Up @@ -875,27 +875,11 @@ static int crk_salt_loop(void)
return 1;

salt = crk_db->salts;

/* on first run, right after restore, this can be non-zero */
if (status.salt_idx) {
int i = status.salt_idx;
while (i--) {
salt = salt->next;
if (!salt) {
salt = crk_db->salts;
status.salt_idx = 0;
break;
}
}
}
do {
crk_methods.set_salt(salt->salt);
if ((done = crk_password_loop(salt)))
break;
++status.salt_idx;
} while ((salt = salt->next));
if (!salt)
status.salt_idx = 0;

if (done >= 0) {
#if !HAVE_OPENCL
Expand Down
21 changes: 7 additions & 14 deletions src/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,6 @@ void rec_save(void)
rec_check);

if (rec_save_mode) rec_save_mode(rec_file);

/* these are 'appended' resume blocks */
/* add a v1 record for salt resume, if salt_idx not at start */
if (status.salt_idx)
fprintf(rec_file, "slt-v1\n%x\n", status.salt_idx);
if (rec_save_mode2) rec_save_mode2(rec_file);
if (rec_save_mode3) rec_save_mode3(rec_file);
if (options.flags & FLG_MASK_STACKED)
Expand Down Expand Up @@ -615,19 +610,17 @@ void rec_restore_mode(int (*restore_mode)(FILE *file))
fgetl(buf, sizeof(buf), rec_file);
while (!feof(rec_file)) {
if (!strncmp(buf, "ext-v", 5)) {
if (ext_restore_state_hybrid(buf, rec_file))
rec_format_error("external-hybrid");
if (ext_restore_state_hybrid(buf, rec_file)) rec_format_error("external-hybrid");
fgetl(buf, sizeof(buf), rec_file);
continue;
}
/*
else if (!strncmp(buf, "rex-v", 5)) {
if (rexgen_restore_state_hybrid(buf, rec_file))
rec_format_error("rexgen-hybrid");
if (!strncmp(buf, "rex-v", 5)) {
if (rexgen_restore_state_hybrid(buf, rec_file)) rec_format_error("rexgen-hybrid");
fgetl(buf, sizeof(buf), rec_file);
continue;
}
*/
if (!strcmp(buf, "slt-v1")) {
if (fscanf(rec_file, "%x\n", &status.salt_idx) != 1)
rec_format_error("salt-restore block");
}
fgetl(buf, sizeof(buf), rec_file);
}

Expand Down
1 change: 0 additions & 1 deletion src/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ struct status_main {
int compat;
int pass;
int progress;
int salt_idx;
};

extern struct status_main status;
Expand Down

0 comments on commit 95f75a2

Please sign in to comment.