From 6214b2ff3c13b37581fe2cccaa200e429a1e7ff2 Mon Sep 17 00:00:00 2001 From: tb Date: Sat, 2 Mar 2024 09:36:40 +0000 Subject: [PATCH] Remove EVP_add_{cipher,digest}() from public API Ciphers and digests are now handled in a static lookup table and no longer by the associative array that used to underlie the OBJ_NAME API. Adding ciphers is no longer possible. What uses this API does so for historic reasons coming from a time where SHA-2 and some AES variants needed to be enabled explicitly. Ports doing this (PHP and DANE code) were fixed. ok jsing --- lib/libcrypto/Symbols.list | 2 -- lib/libcrypto/evp/evp.h | 5 +---- lib/libcrypto/evp/evp_names.c | 14 +------------- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index f9df2c28e7e..2acd158dd66 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -1425,8 +1425,6 @@ EVP_SealFinal EVP_SealInit EVP_SignFinal EVP_VerifyFinal -EVP_add_cipher -EVP_add_digest EVP_aead_aes_128_gcm EVP_aead_aes_256_gcm EVP_aead_chacha20_poly1305 diff --git a/lib/libcrypto/evp/evp.h b/lib/libcrypto/evp/evp.h index 4acd9facbc5..01d4907233f 100644 --- a/lib/libcrypto/evp/evp.h +++ b/lib/libcrypto/evp/evp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: evp.h,v 1.121 2024/02/18 15:47:48 tb Exp $ */ +/* $OpenBSD: evp.h,v 1.122 2024/03/02 09:36:40 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -813,9 +813,6 @@ void OpenSSL_add_all_digests(void); #define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers() #define SSLeay_add_all_digests() OpenSSL_add_all_digests() -int EVP_add_cipher(const EVP_CIPHER *cipher); -int EVP_add_digest(const EVP_MD *digest); - const EVP_CIPHER *EVP_get_cipherbyname(const char *name); const EVP_MD *EVP_get_digestbyname(const char *name); void EVP_cleanup(void); diff --git a/lib/libcrypto/evp/evp_names.c b/lib/libcrypto/evp/evp_names.c index cf57a4aa56f..a3af2ed1a65 100644 --- a/lib/libcrypto/evp/evp_names.c +++ b/lib/libcrypto/evp/evp_names.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_names.c,v 1.8 2024/01/27 18:12:27 tb Exp $ */ +/* $OpenBSD: evp_names.c,v 1.9 2024/03/02 09:36:40 tb Exp $ */ /* * Copyright (c) 2023 Theo Buehler * @@ -1919,18 +1919,6 @@ EVP_cleanup(void) * XXX - Remove all the garbage below in the next bump. */ -int -EVP_add_cipher(const EVP_CIPHER *c) -{ - return 1; -} - -int -EVP_add_digest(const EVP_MD *md) -{ - return 1; -} - int OBJ_NAME_init(void) { -- 2.20.1