check for error when creating PKCS#8 structure

Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
Dr. Stephen Henson 2015-05-28 15:44:20 +01:00
parent bca3f06b84
commit 2849707fa6

View File

@ -139,6 +139,8 @@ static int do_pk8pkey(BIO *bp, EVP_PKEY *x, int isder, int nid,
if (kstr == buf)
OPENSSL_cleanse(buf, klen);
PKCS8_PRIV_KEY_INFO_free(p8inf);
if (p8 == NULL)
return 0;
if (isder)
ret = i2d_PKCS8_bio(bp, p8);
else