diff options
Diffstat (limited to 'apps/req.c')
-rw-r--r-- | apps/req.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/req.c b/apps/req.c index a9769b7452..3b0545fd6e 100644 --- a/apps/req.c +++ b/apps/req.c @@ -1522,6 +1522,12 @@ static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr, if (strncmp(gstr, "param", len) == 0) { expect_paramfile = 1; + if (p == NULL) { + BIO_printf(bio_err, + "Parameter file requested but no path given: %s\n", + gstr); + return NULL; + } } else { keytype = gstr; keytypelen = len; @@ -1569,6 +1575,11 @@ static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr, } if (keytype == NULL) { keytype = EVP_PKEY_get0_type_name(param); + if (keytype == NULL) { + EVP_PKEY_free(param); + BIO_puts(bio_err, "Unable to determine key type\n"); + return NULL; + } } } |