Make sure all errors go on the stack in the EVP_PKEY_new*() functions
[openssl.git] / crypto / evp / p_lib.c
index ee121c4a56835c5dd6d330b3bd9f39ecc70ff34f..073d2df8884db3f67d9e3e3e8c8b78546ecb7ae0 100644 (file)
@@ -239,7 +239,7 @@ EVP_PKEY *EVP_PKEY_new_private_key(int type, ENGINE *e,
     }
 
     if (!ret->ameth->set_priv_key(ret, priv, len)) {
-        /* We assume the method function calls EVPerr */
+        EVPerr(EVP_F_EVP_PKEY_NEW_PRIVATE_KEY, EVP_R_KEY_SETUP_FAILED);
         goto err;
     }
 
@@ -269,7 +269,7 @@ EVP_PKEY *EVP_PKEY_new_public_key(int type, ENGINE *e,
     }
 
     if (!ret->ameth->set_pub_key(ret, pub, len)) {
-        /* We assume the method function calls EVPerr */
+        EVPerr(EVP_F_EVP_PKEY_NEW_PUBLIC_KEY, EVP_R_KEY_SETUP_FAILED);
         goto err;
     }