From 90028f789c9544abf19620f07eea235fb9839e17 Mon Sep 17 00:00:00 2001
From: tb <>
Date: Sat, 2 Mar 2024 09:36:40 +0000
Subject: 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
---
 src/lib/libcrypto/Symbols.list    |  2 --
 src/lib/libcrypto/evp/evp.h       |  5 +----
 src/lib/libcrypto/evp/evp_names.c | 14 +-------------
 3 files changed, 2 insertions(+), 19 deletions(-)

(limited to 'src')

diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list
index f9df2c28e7..2acd158dd6 100644
--- a/src/lib/libcrypto/Symbols.list
+++ b/src/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/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h
index 4acd9facbc..01d4907233 100644
--- a/src/lib/libcrypto/evp/evp.h
+++ b/src/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/src/lib/libcrypto/evp/evp_names.c b/src/lib/libcrypto/evp/evp_names.c
index cf57a4aa56..a3af2ed1a6 100644
--- a/src/lib/libcrypto/evp/evp_names.c
+++ b/src/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 <tb@openbsd.org>
  *
@@ -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)
 {
-- 
cgit v1.2.3-55-g6feb