summaryrefslogtreecommitdiffstats
path: root/crypto/ec/ec_mult.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-05-21 15:24:56 +0100
committerMatt Caswell <matt@openssl.org>2018-05-24 17:17:44 +0100
commitb14e60155009f4f1d168e220fa01cd2b75557b72 (patch)
tree5a9d75432d7308b24eaaee50d402133e05c92507 /crypto/ec/ec_mult.c
parent2de108dfa343c3e06eb98beb122cd06306bb12fd (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_mult.c')
-rw-r--r--crypto/ec/ec_mult.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/ec/ec_mult.c b/crypto/ec/ec_mult.c
index 1f34329182..05a3aca0a4 100644
--- a/crypto/ec/ec_mult.c
+++ b/crypto/ec/ec_mult.c
@@ -368,7 +368,7 @@ int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
* precomputation is not available */
int ret = 0;
- if (group->meth != r->meth) {
+ if (!ec_point_is_compat(r, group)) {
ECerr(EC_F_EC_WNAF_MUL, EC_R_INCOMPATIBLE_OBJECTS);
return 0;
}
@@ -404,7 +404,7 @@ int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
}
for (i = 0; i < num; i++) {
- if (group->meth != points[i]->meth) {
+ if (!ec_point_is_compat(points[i], group)) {
ECerr(EC_F_EC_WNAF_MUL, EC_R_INCOMPATIBLE_OBJECTS);
return 0;
}