From b14e60155009f4f1d168e220fa01cd2b75557b72 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Mon, 21 May 2018 15:24:56 +0100 Subject: 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 (Merged from https://github.com/openssl/openssl/pull/6323) --- crypto/ec/ec_curve.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crypto/ec/ec_curve.c') 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; } -- cgit v1.2.3