summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/crypto_ex_data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/crypto_ex_data.c')
-rw-r--r--src/lib/libcrypto/crypto_ex_data.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/libcrypto/crypto_ex_data.c b/src/lib/libcrypto/crypto_ex_data.c
index 233905f888..2066098653 100644
--- a/src/lib/libcrypto/crypto_ex_data.c
+++ b/src/lib/libcrypto/crypto_ex_data.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: crypto_ex_data.c,v 1.6 2025/06/15 15:58:56 tb Exp $ */ 1/* $OpenBSD: crypto_ex_data.c,v 1.7 2026/08/30 12:19:37 kenjiro Exp $ */
2/* 2/*
3 * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2023 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -19,6 +19,8 @@
19 19
20#include <openssl/crypto.h> 20#include <openssl/crypto.h>
21 21
22#include "crypto_internal.h"
23
22#define CRYPTO_EX_DATA_MAX_INDEX 32 24#define CRYPTO_EX_DATA_MAX_INDEX 32
23 25
24struct crypto_ex_data { 26struct crypto_ex_data {
@@ -151,6 +153,16 @@ LCRYPTO_ALIAS(CRYPTO_get_ex_new_index);
151void 153void
152CRYPTO_cleanup_all_ex_data(void) 154CRYPTO_cleanup_all_ex_data(void)
153{ 155{
156}
157LCRYPTO_ALIAS(CRYPTO_cleanup_all_ex_data);
158
159/*
160 * Free process-wide ex_data state during OPENSSL_cleanup(). The caller must
161 * ensure that no other thread is using libcrypto.
162 */
163void
164crypto_ex_data_cleanup(void)
165{
154 struct crypto_ex_data_class *class; 166 struct crypto_ex_data_class *class;
155 int i, j; 167 int i, j;
156 168
@@ -173,7 +185,6 @@ CRYPTO_cleanup_all_ex_data(void)
173 free(classes); 185 free(classes);
174 classes = NULL; 186 classes = NULL;
175} 187}
176LCRYPTO_ALIAS(CRYPTO_cleanup_all_ex_data);
177 188
178static void 189static void
179crypto_ex_data_clear(CRYPTO_EX_DATA *exdata) 190crypto_ex_data_clear(CRYPTO_EX_DATA *exdata)