summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec_mult.c
diff options
context:
space:
mode:
authortb <>2025-12-26 18:44:19 +0000
committertb <>2025-12-26 18:44:19 +0000
commite568a255270032a6a88715db4e3609b6129702ed (patch)
tree0d03de25f717a3b4ea678bc059140fd9bbc00419 /src/lib/libcrypto/ec/ec_mult.c
parent6aad598b27692cde1ada140f0cf7be0f102d2c84 (diff)
downloadopenbsd-e568a255270032a6a88715db4e3609b6129702ed.tar.gz
openbsd-e568a255270032a6a88715db4e3609b6129702ed.tar.bz2
openbsd-e568a255270032a6a88715db4e3609b6129702ed.zip
Replace group->meth != point->meth checks
The method will currently always be identical since all groups use the EC_GFp_mont_method(). Use the ec_group_and_point_compatible() check to ensure this and if both group and point have a nid set, check that they are identical. ok jsing kenjiro
Diffstat (limited to 'src/lib/libcrypto/ec/ec_mult.c')
-rw-r--r--src/lib/libcrypto/ec/ec_mult.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/libcrypto/ec/ec_mult.c b/src/lib/libcrypto/ec/ec_mult.c
index 8816be7501..067df9a2a2 100644
--- a/src/lib/libcrypto/ec/ec_mult.c
+++ b/src/lib/libcrypto/ec/ec_mult.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_mult.c,v 1.60 2025/08/26 14:14:52 tb Exp $ */ 1/* $OpenBSD: ec_mult.c,v 1.61 2025/12/26 18:44:19 tb Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2024 Theo Buehler <tb@openbsd.org> 4 * Copyright (c) 2024 Theo Buehler <tb@openbsd.org>
@@ -287,8 +287,9 @@ ec_wnaf_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar1,
287 ECerror(ERR_R_PASSED_NULL_PARAMETER); 287 ECerror(ERR_R_PASSED_NULL_PARAMETER);
288 goto err; 288 goto err;
289 } 289 }
290 if (group->meth != r->meth || group->meth != point1->meth || 290 if (!ec_group_and_point_compatible(group, r) ||
291 group->meth != point2->meth) { 291 !ec_group_and_point_compatible(group, point1) ||
292 !ec_group_and_point_compatible(group, point2)) {
292 ECerror(EC_R_INCOMPATIBLE_OBJECTS); 293 ECerror(EC_R_INCOMPATIBLE_OBJECTS);
293 goto err; 294 goto err;
294 } 295 }