From 1e06a7b095576337211c8d4a9ce6ddc08b9f61b6 Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 28 Jul 2023 10:07:30 +0000 Subject: [PATCH] Remove the get_rfc*_prime_*() API Inconsistently named with the rest of the API, so OpenSSL 1.1 introduced the same functions with a BN_ prefix. We'll keep the latter. ok jsing --- lib/libcrypto/Symbols.list | 8 ----- lib/libcrypto/Symbols.namespace | 8 ----- lib/libcrypto/bn/bn.h | 10 +----- lib/libcrypto/bn/bn_const.c | 58 +------------------------------ lib/libcrypto/hidden/openssl/bn.h | 10 +----- 5 files changed, 3 insertions(+), 91 deletions(-) diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index cac15579b51..9f27a695120 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -3435,14 +3435,6 @@ d2i_X509_SIG d2i_X509_VAL d2i_X509_bio d2i_X509_fp -get_rfc2409_prime_1024 -get_rfc2409_prime_768 -get_rfc3526_prime_1536 -get_rfc3526_prime_2048 -get_rfc3526_prime_3072 -get_rfc3526_prime_4096 -get_rfc3526_prime_6144 -get_rfc3526_prime_8192 hex_to_string i2a_ACCESS_DESCRIPTION i2a_ASN1_ENUMERATED diff --git a/lib/libcrypto/Symbols.namespace b/lib/libcrypto/Symbols.namespace index a58eb0b9a1f..e669cc8cc84 100644 --- a/lib/libcrypto/Symbols.namespace +++ b/lib/libcrypto/Symbols.namespace @@ -2293,16 +2293,8 @@ _libre_BN_MONT_CTX_free _libre_BN_MONT_CTX_set _libre_BN_MONT_CTX_copy _libre_BN_MONT_CTX_set_locked -_libre_get_rfc2409_prime_768 -_libre_get_rfc2409_prime_1024 _libre_BN_get_rfc2409_prime_768 _libre_BN_get_rfc2409_prime_1024 -_libre_get_rfc3526_prime_1536 -_libre_get_rfc3526_prime_2048 -_libre_get_rfc3526_prime_3072 -_libre_get_rfc3526_prime_4096 -_libre_get_rfc3526_prime_6144 -_libre_get_rfc3526_prime_8192 _libre_BN_get_rfc3526_prime_1536 _libre_BN_get_rfc3526_prime_2048 _libre_BN_get_rfc3526_prime_3072 diff --git a/lib/libcrypto/bn/bn.h b/lib/libcrypto/bn/bn.h index 689196c911f..62c85d18557 100644 --- a/lib/libcrypto/bn/bn.h +++ b/lib/libcrypto/bn/bn.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bn.h,v 1.73 2023/07/28 10:05:16 tb Exp $ */ +/* $OpenBSD: bn.h,v 1.74 2023/07/28 10:07:30 tb Exp $ */ /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -450,18 +450,10 @@ BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock, const BIGNUM *mod, BN_CTX *ctx); /* Primes from RFC 2409 */ -BIGNUM *get_rfc2409_prime_768(BIGNUM *bn); -BIGNUM *get_rfc2409_prime_1024(BIGNUM *bn); BIGNUM *BN_get_rfc2409_prime_768(BIGNUM *bn); BIGNUM *BN_get_rfc2409_prime_1024(BIGNUM *bn); /* Primes from RFC 3526 */ -BIGNUM *get_rfc3526_prime_1536(BIGNUM *bn); -BIGNUM *get_rfc3526_prime_2048(BIGNUM *bn); -BIGNUM *get_rfc3526_prime_3072(BIGNUM *bn); -BIGNUM *get_rfc3526_prime_4096(BIGNUM *bn); -BIGNUM *get_rfc3526_prime_6144(BIGNUM *bn); -BIGNUM *get_rfc3526_prime_8192(BIGNUM *bn); BIGNUM *BN_get_rfc3526_prime_1536(BIGNUM *bn); BIGNUM *BN_get_rfc3526_prime_2048(BIGNUM *bn); BIGNUM *BN_get_rfc3526_prime_3072(BIGNUM *bn); diff --git a/lib/libcrypto/bn/bn_const.c b/lib/libcrypto/bn/bn_const.c index b204eb0bc02..bf684c8a460 100644 --- a/lib/libcrypto/bn/bn_const.c +++ b/lib/libcrypto/bn/bn_const.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_const.c,v 1.7 2023/07/10 03:26:30 tb Exp $ */ +/* $OpenBSD: bn_const.c,v 1.8 2023/07/28 10:07:30 tb Exp $ */ /* Insert boilerplate */ #include @@ -23,13 +23,6 @@ static const unsigned char RFC2409_PRIME_768[] = { 0xA6, 0x3A, 0x36, 0x20, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; -BIGNUM * -get_rfc2409_prime_768(BIGNUM *bn) -{ - return BN_bin2bn(RFC2409_PRIME_768, sizeof(RFC2409_PRIME_768), bn); -} -LCRYPTO_ALIAS(get_rfc2409_prime_768); - BIGNUM * BN_get_rfc2409_prime_768(BIGNUM *bn) { @@ -60,13 +53,6 @@ static const unsigned char RFC2409_PRIME_1024[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; -BIGNUM * -get_rfc2409_prime_1024(BIGNUM *bn) -{ - return BN_bin2bn(RFC2409_PRIME_1024, sizeof(RFC2409_PRIME_1024), bn); -} -LCRYPTO_ALIAS(get_rfc2409_prime_1024); - BIGNUM * BN_get_rfc2409_prime_1024(BIGNUM *bn) { @@ -102,13 +88,6 @@ static const unsigned char RFC3526_PRIME_1536[] = { 0xCA, 0x23, 0x73, 0x27, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; -BIGNUM * -get_rfc3526_prime_1536(BIGNUM *bn) -{ - return BN_bin2bn(RFC3526_PRIME_1536, sizeof(RFC3526_PRIME_1536), bn); -} -LCRYPTO_ALIAS(get_rfc3526_prime_1536); - BIGNUM * BN_get_rfc3526_prime_1536(BIGNUM *bn) { @@ -149,13 +128,6 @@ static const unsigned char RFC3526_PRIME_2048[] = { 0xFF, 0xFF, 0xFF, 0xFF, }; -BIGNUM * -get_rfc3526_prime_2048(BIGNUM *bn) -{ - return BN_bin2bn(RFC3526_PRIME_2048, sizeof(RFC3526_PRIME_2048), bn); -} -LCRYPTO_ALIAS(get_rfc3526_prime_2048); - BIGNUM * BN_get_rfc3526_prime_2048(BIGNUM *bn) { @@ -206,13 +178,6 @@ static const unsigned char RFC3526_PRIME_3072[] = { 0xA9, 0x3A, 0xD2, 0xCA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; -BIGNUM * -get_rfc3526_prime_3072(BIGNUM *bn) -{ - return BN_bin2bn(RFC3526_PRIME_3072, sizeof(RFC3526_PRIME_3072), bn); -} -LCRYPTO_ALIAS(get_rfc3526_prime_3072); - BIGNUM * BN_get_rfc3526_prime_3072(BIGNUM *bn) { @@ -274,13 +239,6 @@ static const unsigned char RFC3526_PRIME_4096[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; -BIGNUM * -get_rfc3526_prime_4096(BIGNUM *bn) -{ - return BN_bin2bn(RFC3526_PRIME_4096, sizeof(RFC3526_PRIME_4096), bn); -} -LCRYPTO_ALIAS(get_rfc3526_prime_4096); - BIGNUM * BN_get_rfc3526_prime_4096(BIGNUM *bn) { @@ -363,13 +321,6 @@ static const unsigned char RFC3526_PRIME_6144[] = { 0x6D, 0xCC, 0x40, 0x24, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; -BIGNUM * -get_rfc3526_prime_6144(BIGNUM *bn) -{ - return BN_bin2bn(RFC3526_PRIME_6144, sizeof(RFC3526_PRIME_6144), bn); -} -LCRYPTO_ALIAS(get_rfc3526_prime_6144); - BIGNUM * BN_get_rfc3526_prime_6144(BIGNUM *bn) { @@ -474,13 +425,6 @@ static const unsigned char RFC3526_PRIME_8192[] = { 0xFF, 0xFF, 0xFF, 0xFF, }; -BIGNUM * -get_rfc3526_prime_8192(BIGNUM *bn) -{ - return BN_bin2bn(RFC3526_PRIME_8192, sizeof(RFC3526_PRIME_8192), bn); -} -LCRYPTO_ALIAS(get_rfc3526_prime_8192); - BIGNUM * BN_get_rfc3526_prime_8192(BIGNUM *bn) { diff --git a/lib/libcrypto/hidden/openssl/bn.h b/lib/libcrypto/hidden/openssl/bn.h index d58bd10672a..cf3d4769176 100644 --- a/lib/libcrypto/hidden/openssl/bn.h +++ b/lib/libcrypto/hidden/openssl/bn.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bn.h,v 1.2 2023/07/28 10:05:16 tb Exp $ */ +/* $OpenBSD: bn.h,v 1.3 2023/07/28 10:07:30 tb Exp $ */ /* * Copyright (c) 2023 Bob Beck * @@ -131,16 +131,8 @@ LCRYPTO_USED(BN_MONT_CTX_free); LCRYPTO_USED(BN_MONT_CTX_set); LCRYPTO_USED(BN_MONT_CTX_copy); LCRYPTO_USED(BN_MONT_CTX_set_locked); -LCRYPTO_USED(get_rfc2409_prime_768); -LCRYPTO_USED(get_rfc2409_prime_1024); LCRYPTO_USED(BN_get_rfc2409_prime_768); LCRYPTO_USED(BN_get_rfc2409_prime_1024); -LCRYPTO_USED(get_rfc3526_prime_1536); -LCRYPTO_USED(get_rfc3526_prime_2048); -LCRYPTO_USED(get_rfc3526_prime_3072); -LCRYPTO_USED(get_rfc3526_prime_4096); -LCRYPTO_USED(get_rfc3526_prime_6144); -LCRYPTO_USED(get_rfc3526_prime_8192); LCRYPTO_USED(BN_get_rfc3526_prime_1536); LCRYPTO_USED(BN_get_rfc3526_prime_2048); LCRYPTO_USED(BN_get_rfc3526_prime_3072); -- 2.20.1