From 908cf7cefbb2a4c2a8ea1dd4798d1e689db6e3ed Mon Sep 17 00:00:00 2001 From: jwalch Date: Thu, 29 Oct 2020 10:52:52 -0400 Subject: [PATCH] Patch leak in EVP_PKEY2PKCS8() error path Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell Reviewed-by: Dmitry Belyavskiy (Merged from https://github.com/openssl/openssl/pull/13278) --- crypto/evp/evp_pkey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/evp/evp_pkey.c b/crypto/evp/evp_pkey.c index 9e7c978656..b5a8f1cd72 100644 --- a/crypto/evp/evp_pkey.c +++ b/crypto/evp/evp_pkey.c @@ -78,7 +78,7 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(const EVP_PKEY *pkey) /* Force a key downgrade if that's possible */ /* TODO(3.0) Is there a better way for provider-native keys? */ if (EVP_PKEY_get0(pkey) == NULL) - return NULL; + goto error; if (pkey->ameth) { if (pkey->ameth->priv_encode) {