From 0df9d349bb8f02d444758265b4729035cd44ba06 Mon Sep 17 00:00:00 2001 From: tb <> Date: Tue, 21 Jan 2025 17:01:25 +0000 Subject: 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. --- src/lib/libcrypto/ec/ec_lib.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') 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 @@ -/* $OpenBSD: ec_lib.c,v 1.111 2025/01/11 15:26:07 tb Exp $ */ +/* $OpenBSD: ec_lib.c,v 1.112 2025/01/21 17:01:25 tb Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -667,6 +667,7 @@ EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx_in) { BN_CTX *ctx; EC_POINT *point = NULL; + const EC_POINT *generator; const BIGNUM *order; int ret = 0; @@ -680,11 +681,11 @@ EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx_in) goto err; } - if (group->generator == NULL) { + if ((generator = EC_GROUP_get0_generator(group)) == NULL) { ECerror(EC_R_UNDEFINED_GENERATOR); goto err; } - if (EC_POINT_is_on_curve(group, group->generator, ctx) <= 0) { + if (EC_POINT_is_on_curve(group, generator, ctx) <= 0) { ECerror(EC_R_POINT_IS_NOT_ON_CURVE); goto err; } -- cgit v1.2.3-55-g6feb