From fa1aed9be4e7cffefc5a40174eb97c98d39a9942 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sat, 13 Jan 2024 10:57:08 +0000 Subject: Add a table of cipher names, ciphers and aliases This arranges the data provided by dynamic library initialization in a static table and will help avoid gross code with missing error checking and other defects on every use of the library. This table isn't pretty due to various naming inconsistecies accumulated over the decades. It will significantly simplify the implementation of API such as EVP_get_cipherbyname() and EVP_CIPHER_do_all(). All the table does is map strings to ciphers, typically used on the openssl(1) command line or in code it's the mechanism that underlies the map from NID_chacha20 to the data returned by EVP_chacha20(). It's of course more complicated because it just had to be stupid. This is one of the places where the use of bsearch() is justified. The price to pay for the simplification is that adding custom aliases and custom ciphers to this table will no longer be supported. It is one significant user of the LHASH madness. That's just another piece of the awful "toolkit aspect"-guided misdesign that contributes to making this codebase so terrible. A corresponding table for the digests will be added in the next commit. ok jsing --- src/lib/libcrypto/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib/libcrypto/Makefile') diff --git a/src/lib/libcrypto/Makefile b/src/lib/libcrypto/Makefile index 2a12e43a7c..c308a47c62 100644 --- a/src/lib/libcrypto/Makefile +++ b/src/lib/libcrypto/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.162 2023/12/29 06:56:38 tb Exp $ +# $OpenBSD: Makefile,v 1.163 2024/01/13 10:57:08 tb Exp $ LIB= crypto LIBREBUILD=y @@ -372,6 +372,7 @@ SRCS+= evp_digest.c SRCS+= evp_encode.c SRCS+= evp_err.c SRCS+= evp_key.c +SRCS+= evp_names.c SRCS+= evp_pbe.c SRCS+= evp_pkey.c SRCS+= m_gost2814789.c -- cgit v1.2.3-55-g6feb