From ffa17714e966833766f8f0403ac8e178f26fbbed Mon Sep 17 00:00:00 2001 From: jsing <> Date: Fri, 2 Aug 2024 10:48:54 +0000 Subject: Rewrite CRYPTO_EX_DATA. CRYPTO_EX_DATA exists as a way to allow an application to attach data to various components in libcrypto and libssl. The general idea is that there are various "classes" (e.g. RSA) and an application can get an "index" (which can have new/dup/free functions provided). The application can then use the index to store a pointer to some form of data within that class, for later retrieval. However, even by OpenSSL standards, this is an insane API. The current implementation allows for data to be set without calling new, indexes can be used without allocation, new can be called without actually getting an index and dup can be called either after new or without new (see regress and RSA_get_ex_new_index(3)/CRYPTO_set_ex_data(3) for more details). On top of this, the previous "overhaul" of the code was written to be infinitely extensible. For now, the rewrite intends to maintain the existing behaviour - once we bed this down we can attempt to ratchet the API requirements and require some sort of sensible sequence. The only intentional change is that there is now a hard limit on the number of indexes that can be allocated (previously there was none, relying only on ENOMEM). ok tb@ --- src/lib/libcrypto/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/libcrypto/Makefile') diff --git a/src/lib/libcrypto/Makefile b/src/lib/libcrypto/Makefile index ef26b0c5f5..26e76bba2d 100644 --- a/src/lib/libcrypto/Makefile +++ b/src/lib/libcrypto/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.200 2024/07/10 13:30:14 beck Exp $ +# $OpenBSD: Makefile,v 1.201 2024/08/02 10:48:54 jsing Exp $ LIB= crypto LIBREBUILD=y @@ -61,10 +61,10 @@ SYMBOL_LIST+= ${.CURDIR}/arch/${MACHINE_CPU}/Symbols.list # crypto/ SRCS+= cpt_err.c SRCS+= cryptlib.c +SRCS+= crypto_ex_data.c SRCS+= crypto_init.c SRCS+= crypto_lock.c SRCS+= cversion.c -SRCS+= ex_data.c SRCS+= malloc-wrapper.c SRCS+= mem_clr.c SRCS+= mem_dbg.c -- cgit v1.2.3-55-g6feb