aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTodd Short <tshort@akamai.com>2019-02-04 16:04:11 -0500
committerMatt Caswell <matt@openssl.org>2019-02-08 09:57:26 +0000
commit2aa2beb06cc25c1f8accdc3d87b946205becfd86 (patch)
treea22305411b94124c9e99118632874847b74743af /test
parentb1522fa5ef676b7af0128eab3eee608af3416182 (diff)
downloadopenssl-2aa2beb06cc25c1f8accdc3d87b946205becfd86.zip
openssl-2aa2beb06cc25c1f8accdc3d87b946205becfd86.tar.gz
openssl-2aa2beb06cc25c1f8accdc3d87b946205becfd86.tar.bz2
Fix d2i_PublicKey() for EC keys
o2i_ECPublicKey() requires an EC_KEY structure filled with an EC_GROUP. o2i_ECPublicKey() is called by d2i_PublicKey(). In order to fulfill the o2i_ECPublicKey()'s requirement, d2i_PublicKey() needs to be called with an EVP_PKEY with an EC_KEY containing an EC_GROUP. However, the call to EVP_PKEY_set_type() frees any existing key structure inside the EVP_PKEY, thus freeing the EC_KEY with the EC_GROUP that o2i_ECPublicKey() needs. This means you can't d2i_PublicKey() for an EC key... The fix is to check to see if the type is already set appropriately, and if so, not call EVP_PKEY_set_type(). Reviewed-by: Paul Yang <yang.yang@baishancloud.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8168)
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions