From 7fd74d8bfcc786f0e1ab0ac65cb9e7798887c3a4 Mon Sep 17 00:00:00 2001 From: tb Date: Mon, 3 Jul 2023 07:26:40 +0000 Subject: [PATCH] Provide internal-only EC_GROUP_get0_order() ok jsing --- lib/libcrypto/ec/ec_lib.c | 9 +++++++-- lib/libcrypto/ec/ec_local.h | 5 ++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/libcrypto/ec/ec_lib.c b/lib/libcrypto/ec/ec_lib.c index 2e180e96618..8cea0bb95bf 100644 --- a/lib/libcrypto/ec/ec_lib.c +++ b/lib/libcrypto/ec/ec_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_lib.c,v 1.61 2023/06/25 18:52:27 tb Exp $ */ +/* $OpenBSD: ec_lib.c,v 1.62 2023/07/03 07:26:40 tb Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -357,7 +357,6 @@ EC_GROUP_get0_generator(const EC_GROUP *group) return group->generator; } - int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx) { @@ -367,6 +366,12 @@ EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx) return !BN_is_zero(order); } +const BIGNUM * +EC_GROUP_get0_order(const EC_GROUP *group) +{ + return &group->order; +} + int EC_GROUP_order_bits(const EC_GROUP *group) { diff --git a/lib/libcrypto/ec/ec_local.h b/lib/libcrypto/ec/ec_local.h index a058878a696..0d219e8e214 100644 --- a/lib/libcrypto/ec/ec_local.h +++ b/lib/libcrypto/ec/ec_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_local.h,v 1.22 2023/06/27 07:31:18 tb Exp $ */ +/* $OpenBSD: ec_local.h,v 1.23 2023/07/03 07:26:40 tb Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -360,4 +360,7 @@ int EC_POINT_set_Jprojective_coordinates(const EC_GROUP *group, EC_POINT *p, int EC_POINT_get_Jprojective_coordinates(const EC_GROUP *group, const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx); +/* Public API in OpenSSL */ +const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group); + __END_HIDDEN_DECLS -- 2.20.1