summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/pem/pem_pkey.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/crypto/pem/pem_pkey.c b/crypto/pem/pem_pkey.c
index 3e76852c67..284b144fd6 100644
--- a/crypto/pem/pem_pkey.c
+++ b/crypto/pem/pem_pkey.c
@@ -366,10 +366,19 @@ int PEM_write_bio_PrivateKey_traditional(BIO *bp, const EVP_PKEY *x,
return ret;
}
+static int no_password_cb(char *buf, int num, int rwflag, void *userdata)
+{
+ return -1;
+}
+
EVP_PKEY *PEM_read_bio_Parameters_ex(BIO *bp, EVP_PKEY **x,
OSSL_LIB_CTX *libctx, const char *propq)
{
- return pem_read_bio_key(bp, x, NULL, NULL, libctx, propq,
+ /*
+ * PEM_read_bio_Parameters(_ex) should never ask for a password. Any attempt
+ * to get a password just fails.
+ */
+ return pem_read_bio_key(bp, x, no_password_cb, NULL, libctx, propq,
EVP_PKEY_KEY_PARAMETERS);
}