diff options
author | Matt Caswell <matt@openssl.org> | 2018-05-21 15:24:56 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2018-05-24 17:17:44 +0100 |
commit | b14e60155009f4f1d168e220fa01cd2b75557b72 (patch) | |
tree | 5a9d75432d7308b24eaaee50d402133e05c92507 /crypto/ec/ec_curve.c | |
parent | 2de108dfa343c3e06eb98beb122cd06306bb12fd (diff) |
Improve compatibility of point and curve checks
We check that the curve name associated with the point is the same as that
for the curve.
Fixes #6302
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6323)
Diffstat (limited to 'crypto/ec/ec_curve.c')
-rw-r--r-- | crypto/ec/ec_curve.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/ec/ec_curve.c b/crypto/ec/ec_curve.c index 7d56d26ba9..618ec04c23 100644 --- a/crypto/ec/ec_curve.c +++ b/crypto/ec/ec_curve.c @@ -3066,6 +3066,8 @@ static EC_GROUP *ec_group_new_from_data(const ec_list_element curve) } #endif + EC_GROUP_set_curve_name(group, curve.nid); + if ((P = EC_POINT_new(group)) == NULL) { ECerr(EC_F_EC_GROUP_NEW_FROM_DATA, ERR_R_EC_LIB); goto err; @@ -3131,8 +3133,6 @@ EC_GROUP *EC_GROUP_new_by_curve_name(int nid) return NULL; } - EC_GROUP_set_curve_name(ret, nid); - return ret; } |