mirror of
https://github.com/QuasarApp/openssl.git
synced 2025-04-30 11:44:37 +00:00
evp: fix coverity 1474469: negative return
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14716)
This commit is contained in:
parent
d0ea0eb331
commit
ec3dd97019
@ -73,8 +73,9 @@ EVP_PKEY *EVP_PKCS82PKEY_ex(const PKCS8_PRIV_KEY_INFO *p8, OSSL_LIB_CTX *libctx,
|
|||||||
size_t len;
|
size_t len;
|
||||||
OSSL_DECODER_CTX *dctx = NULL;
|
OSSL_DECODER_CTX *dctx = NULL;
|
||||||
|
|
||||||
if ((encoded_len = i2d_PKCS8_PRIV_KEY_INFO(p8, &encoded_data)) <= 0)
|
if ((encoded_len = i2d_PKCS8_PRIV_KEY_INFO(p8, &encoded_data)) <= 0
|
||||||
goto end;
|
|| encoded_data == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
p8_data = encoded_data;
|
p8_data = encoded_data;
|
||||||
len = encoded_len;
|
len = encoded_len;
|
||||||
@ -85,7 +86,6 @@ EVP_PKEY *EVP_PKCS82PKEY_ex(const PKCS8_PRIV_KEY_INFO *p8, OSSL_LIB_CTX *libctx,
|
|||||||
/* try legacy */
|
/* try legacy */
|
||||||
pkey = evp_pkcs82pkey_legacy(p8, libctx, propq);
|
pkey = evp_pkcs82pkey_legacy(p8, libctx, propq);
|
||||||
|
|
||||||
end:
|
|
||||||
OPENSSL_clear_free(encoded_data, encoded_len);
|
OPENSSL_clear_free(encoded_data, encoded_len);
|
||||||
OSSL_DECODER_CTX_free(dctx);
|
OSSL_DECODER_CTX_free(dctx);
|
||||||
return pkey;
|
return pkey;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user