check for error when creating PKCS#8 structure
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 2849707fa65d2803e6d1c1603fdd3fd1fdc4c6cc)
This commit is contained in:
parent
e2cf18c635
commit
cc74177e71
@ -138,6 +138,8 @@ static int do_pk8pkey(BIO *bp, EVP_PKEY *x, int isder, int nid,
|
|||||||
if (kstr == buf)
|
if (kstr == buf)
|
||||||
OPENSSL_cleanse(buf, klen);
|
OPENSSL_cleanse(buf, klen);
|
||||||
PKCS8_PRIV_KEY_INFO_free(p8inf);
|
PKCS8_PRIV_KEY_INFO_free(p8inf);
|
||||||
|
if (p8 == NULL)
|
||||||
|
return 0;
|
||||||
if (isder)
|
if (isder)
|
||||||
ret = i2d_PKCS8_bio(bp, p8);
|
ret = i2d_PKCS8_bio(bp, p8);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user