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:18:14 +0100 |
commit | 926b21117df939241f1cd63f2f9e3ab87819f0ed (patch) | |
tree | 58ec07df41f366ffc24ad3ea40bba973b2318697 /crypto/ec/ecp_nistz256.c | |
parent | 6d3cfd13a904a03fc3522da935136dcdd12e9014 (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)
(cherry picked from commit b14e60155009f4f1d168e220fa01cd2b75557b72)
Diffstat (limited to 'crypto/ec/ecp_nistz256.c')
-rw-r--r-- | crypto/ec/ecp_nistz256.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/ec/ecp_nistz256.c b/crypto/ec/ecp_nistz256.c index 246189833e..153f39012a 100644 --- a/crypto/ec/ecp_nistz256.c +++ b/crypto/ec/ecp_nistz256.c @@ -1168,7 +1168,7 @@ __owur static int ecp_nistz256_points_mul(const EC_GROUP *group, return 0; } - if (group->meth != r->meth) { + if (!ec_point_is_compat(r, group)) { ECerr(EC_F_ECP_NISTZ256_POINTS_MUL, EC_R_INCOMPATIBLE_OBJECTS); return 0; } @@ -1177,7 +1177,7 @@ __owur static int ecp_nistz256_points_mul(const EC_GROUP *group, return EC_POINT_set_to_infinity(group, r); for (j = 0; j < num; j++) { - if (group->meth != points[j]->meth) { + if (!ec_point_is_compat(points[j], group)) { ECerr(EC_F_ECP_NISTZ256_POINTS_MUL, EC_R_INCOMPATIBLE_OBJECTS); return 0; } |