summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2025-01-21 17:01:25 +0000
committertb <>2025-01-21 17:01:25 +0000
commit0df9d349bb8f02d444758265b4729035cd44ba06 (patch)
treef51c897493856e6a7759ae68e6eafa6667c4b4b1 /src
parent17a30ae982f0a949bc2824786a77746ccdae3f90 (diff)
downloadopenbsd-0df9d349bb8f02d444758265b4729035cd44ba06.tar.gz
openbsd-0df9d349bb8f02d444758265b4729035cd44ba06.tar.bz2
openbsd-0df9d349bb8f02d444758265b4729035cd44ba06.zip
EC_GROUP_check(): use accessor rather than reaching into the group
The API will be removed soon. This prepares moving it to its only consumer.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/ec/ec_lib.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c
index 5bfa16df3c..f906054603 100644
--- a/src/lib/libcrypto/ec/ec_lib.c
+++ b/src/lib/libcrypto/ec/ec_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_lib.c,v 1.111 2025/01/11 15:26:07 tb Exp $ */ 1/* $OpenBSD: ec_lib.c,v 1.112 2025/01/21 17:01:25 tb Exp $ */
2/* 2/*
3 * Originally written by Bodo Moeller for the OpenSSL project. 3 * Originally written by Bodo Moeller for the OpenSSL project.
4 */ 4 */
@@ -667,6 +667,7 @@ EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx_in)
667{ 667{
668 BN_CTX *ctx; 668 BN_CTX *ctx;
669 EC_POINT *point = NULL; 669 EC_POINT *point = NULL;
670 const EC_POINT *generator;
670 const BIGNUM *order; 671 const BIGNUM *order;
671 int ret = 0; 672 int ret = 0;
672 673
@@ -680,11 +681,11 @@ EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx_in)
680 goto err; 681 goto err;
681 } 682 }
682 683
683 if (group->generator == NULL) { 684 if ((generator = EC_GROUP_get0_generator(group)) == NULL) {
684 ECerror(EC_R_UNDEFINED_GENERATOR); 685 ECerror(EC_R_UNDEFINED_GENERATOR);
685 goto err; 686 goto err;
686 } 687 }
687 if (EC_POINT_is_on_curve(group, group->generator, ctx) <= 0) { 688 if (EC_POINT_is_on_curve(group, generator, ctx) <= 0) {
688 ECerror(EC_R_POINT_IS_NOT_ON_CURVE); 689 ECerror(EC_R_POINT_IS_NOT_ON_CURVE);
689 goto err; 690 goto err;
690 } 691 }