Skip to content

Commit

Permalink
Bug 1574220 - Improve controls after errors in tstcln, selfserv and v…
Browse files Browse the repository at this point in the history
…fyserv cmds. r=kjacobs

Differential Revision: https://phabricator.services.mozilla.com/D42165

--HG--
extra : moz-landing-system : lando
  • Loading branch information
Marcus Burghardt committed Aug 15, 2019
1 parent 77deced commit d1f4da5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
8 changes: 5 additions & 3 deletions cmd/selfserv/selfserv.c
Expand Up @@ -882,7 +882,7 @@ lockedVars_WaitForDone(lockedVars *lv)
}

int /* returns count */
lockedVars_AddToCount(lockedVars *lv, int addend)
lockedVars_AddToCount(lockedVars *lv, int addend)
{
int rv;

Expand Down Expand Up @@ -2685,8 +2685,10 @@ main(int argc, char **argv)
}
if (cipher > 0) {
rv = SSL_CipherPrefSetDefault(cipher, SSL_ALLOWED);
if (rv != SECSuccess)
SECU_PrintError(progName, "SSL_CipherPrefSet()");
if (rv != SECSuccess) {
SECU_PrintError(progName, "SSL_CipherPrefSetDefault()");
exit(9);
}
} else {
fprintf(stderr,
"Invalid cipher specification (-c arg).\n");
Expand Down
5 changes: 4 additions & 1 deletion cmd/tstclnt/tstclnt.c
Expand Up @@ -1313,8 +1313,11 @@ run()
}
if (cipher > 0) {
rv = SSL_CipherPrefSet(s, cipher, SSL_ALLOWED);
if (rv != SECSuccess)
if (rv != SECSuccess) {
SECU_PrintError(progName, "SSL_CipherPrefSet()");
error = 1;
goto done;
}
} else {
Usage();
}
Expand Down
7 changes: 6 additions & 1 deletion cmd/vfyserv/vfyserv.c
Expand Up @@ -544,7 +544,12 @@ main(int argc, char **argv)
}
}
if (cipher > 0) {
SSL_CipherPrefSetDefault(cipher, PR_TRUE);
SECStatus rv = SSL_CipherPrefSetDefault(cipher, PR_TRUE);
if (rv != SECSuccess) {
SECU_PrintError(progName,
"error setting cipher default preference");
goto cleanup;
}
} else {
Usage(progName);
}
Expand Down

0 comments on commit d1f4da5

Please sign in to comment.