Skip to content

Commit

Permalink
use "latest wins" logic for skipnear/warnnear args
Browse files Browse the repository at this point in the history
  • Loading branch information
cathugger committed Sep 5, 2023
1 parent c7a8d75 commit 6c704d2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,14 @@ int main(int argc,char **argv)
else
e_additional();
}
else if (!strcmp(arg,"skipnear"))
else if (!strcmp(arg,"skipnear")) {
pw_skipnear = 1;
else if (!strcmp(arg,"warnnear"))
pw_warnnear = 0;
}
else if (!strcmp(arg,"warnnear")) {
pw_warnnear = 1;
pw_skipnear = 0;
}
#endif // PASSPHRASE
else {
fprintf(stderr,"unrecognised argument: --%s\n",arg);
Expand Down Expand Up @@ -614,8 +618,6 @@ int main(int argc,char **argv)
"CAUTION: avoid using keys generated with the same password for unrelated\n"
" services, as single leaked key may help an attacker to regenerate\n"
" related keys; to silence this warning, pass --skipnear or --warnnear.\n");
if (pw_warnnear)
pw_skipnear = 0;
if (checkpointfile) {
memcpy(orig_determseed,determseed,sizeof(determseed));
// Read current checkpoint position if file exists
Expand Down

0 comments on commit 6c704d2

Please # to comment.