Skip to content

Commit

Permalink
Fix broken -O flag with Enroll/GetCertInital
Browse files Browse the repository at this point in the history
The previous fix for GetCRL/GetCert causes a problem when -O/-K is used
for an 'onbehalf' enrollment
  • Loading branch information
oliwel authored and gotthardp committed Nov 20, 2021
1 parent 691a926 commit 30f1c48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sscep.c
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ main(int argc, char **argv) {
rsa = read_key(k_char);


if ((K_flag && !O_flag) || (O_flag && !K_flag && operation_flag == SCEP_OPERATION_ENROLL)) {
if ((K_flag && !O_flag) || (O_flag && !K_flag && (operation_flag == SCEP_OPERATION_ENROLL))) {
fprintf(stderr, "%s: -O also requires -K (and vice-versa)\n", pname);
exit (SCEP_PKISTATUS_FILE);
}
Expand Down Expand Up @@ -1063,7 +1063,7 @@ main(int argc, char **argv) {
X509_get_serialNumber(renewal_cert);
scep_t.ias_getcrl->issuer =
X509_get_issuer_name(renewal_cert);
} else {
} else if (operation_flag != SCEP_OPERATION_ENROLL) {
if (! s_flag ) {
fprintf(stderr, "%s: -O also requires -s for getcert\n", pname);
exit (SCEP_PKISTATUS_FILE);
Expand Down

0 comments on commit 30f1c48

Please sign in to comment.