From b072588b323baf6e9b6a8ed7e23c9221791ac5ef Mon Sep 17 00:00:00 2001 From: tb Date: Tue, 15 Oct 2024 06:27:43 +0000 Subject: [PATCH] Provide EC_GROUP_get0_cofactor() for internal use While this is public API in OpenSSL, there are no plans to expose it. ok jsing --- lib/libcrypto/ec/ec_lib.c | 8 +++++++- lib/libcrypto/ec/ec_local.h | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/ec/ec_lib.c b/lib/libcrypto/ec/ec_lib.c index 85567a76c11..4b7eb6016c5 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.67 2024/04/23 10:52:08 tb Exp $ */ +/* $OpenBSD: ec_lib.c,v 1.68 2024/10/15 06:27:43 tb Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -393,6 +393,12 @@ EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx) } LCRYPTO_ALIAS(EC_GROUP_get_cofactor); +const BIGNUM * +EC_GROUP_get0_cofactor(const EC_GROUP *group) +{ + return &group->cofactor; +} + void EC_GROUP_set_curve_name(EC_GROUP *group, int nid) { diff --git a/lib/libcrypto/ec/ec_local.h b/lib/libcrypto/ec/ec_local.h index c2befdede7e..ca55770ba83 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.28 2024/10/03 06:24:07 tb Exp $ */ +/* $OpenBSD: ec_local.h,v 1.29 2024/10/15 06:27:43 tb Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -356,6 +356,7 @@ 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_cofactor(const EC_GROUP *group); const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group); __END_HIDDEN_DECLS -- 2.20.1