aboutsummaryrefslogtreecommitdiff
path: root/apps/spkac.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/spkac.c')
-rw-r--r--apps/spkac.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/spkac.c b/apps/spkac.c
index d92be7d6450e..5a129a7fa775 100644
--- a/apps/spkac.c
+++ b/apps/spkac.c
@@ -1,5 +1,5 @@
/*
- * Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1999-2023 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -133,8 +133,7 @@ int spkac_main(int argc, char **argv)
}
/* No extra arguments. */
- argc = opt_num_rest();
- if (argc != 0)
+ if (!opt_check_rest_arg(NULL))
goto opthelp;
if (!app_passwd(passinarg, NULL, &passin, NULL)) {
@@ -153,9 +152,10 @@ int spkac_main(int argc, char **argv)
spki = NETSCAPE_SPKI_new();
if (spki == NULL)
goto end;
- if (challenge != NULL)
- ASN1_STRING_set(spki->spkac->challenge,
- challenge, (int)strlen(challenge));
+ if (challenge != NULL
+ && !ASN1_STRING_set(spki->spkac->challenge,
+ challenge, (int)strlen(challenge)))
+ goto end;
if (!NETSCAPE_SPKI_set_pubkey(spki, pkey)) {
BIO_printf(bio_err, "Error setting public key\n");
goto end;