Modify ENGINE_pkey_asn1_find_str() to use a read lock instead of a write
[openssl.git] / apps / pkeyparam.c
index 3722be4bf67bd7f3a4cb5486307a71fd2fa48352..4fefe69e6b3cd334f57e19db7baeeaab690620d9 100644 (file)
@@ -100,7 +100,8 @@ int pkeyparam_main(int argc, char **argv)
     out = bio_open_default(outfile, 'w', FORMAT_PEM);
     if (out == NULL)
         goto end;
-    pkey = PEM_read_bio_Parameters(in, NULL);
+    pkey = PEM_read_bio_Parameters_ex(in, NULL, app_get0_libctx(),
+                                      app_get0_propq());
     if (pkey == NULL) {
         BIO_printf(bio_err, "Error reading parameters\n");
         ERR_print_errors(bio_err);
@@ -108,7 +109,11 @@ int pkeyparam_main(int argc, char **argv)
     }
 
     if (check) {
-        ctx = EVP_PKEY_CTX_new(pkey, e);
+        if (e == NULL)
+            ctx = EVP_PKEY_CTX_new_from_pkey(app_get0_libctx(), pkey,
+                                             app_get0_propq());
+        else
+            ctx = EVP_PKEY_CTX_new(pkey, e);
         if (ctx == NULL) {
             ERR_print_errors(bio_err);
             goto end;