summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2023-07-02 19:52:01 +0000
committertb <>2023-07-02 19:52:01 +0000
commitb84cce7e25d639eff59ba48da36a5ba98bc76845 (patch)
treec190ccba24689602c19b94da6de82eda0586db38 /src
parent4edd92a57f3a74829fe519f35b5c7c79e03ce0b0 (diff)
downloadopenbsd-b84cce7e25d639eff59ba48da36a5ba98bc76845.tar.gz
openbsd-b84cce7e25d639eff59ba48da36a5ba98bc76845.tar.bz2
openbsd-b84cce7e25d639eff59ba48da36a5ba98bc76845.zip
Clean up dynamic tables in OPENSSL_cleanup()
This is not currently done in OpenSSL, but it looks more like something that was mised rather than desired behavior. There are some thread safety issues here, but those are rife in this codebase anyway (although I heard claims on some versions of this lib being "fully threadsafe"). no objection jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/crypto_init.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/libcrypto/crypto_init.c b/src/lib/libcrypto/crypto_init.c
index 347f9542f1..361bef41a3 100644
--- a/src/lib/libcrypto/crypto_init.c
+++ b/src/lib/libcrypto/crypto_init.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: crypto_init.c,v 1.9 2023/06/19 18:32:05 tb Exp $ */ 1/* $OpenBSD: crypto_init.c,v 1.10 2023/07/02 19:52:01 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2018 Bob Beck <beck@openbsd.org> 3 * Copyright (c) 2018 Bob Beck <beck@openbsd.org>
4 * 4 *
@@ -20,6 +20,7 @@
20#include <pthread.h> 20#include <pthread.h>
21#include <stdio.h> 21#include <stdio.h>
22 22
23#include <openssl/asn1.h>
23#include <openssl/conf.h> 24#include <openssl/conf.h>
24#ifndef OPENSSL_NO_ENGINE 25#ifndef OPENSSL_NO_ENGINE
25#include <openssl/engine.h> 26#include <openssl/engine.h>
@@ -27,6 +28,7 @@
27#include <openssl/err.h> 28#include <openssl/err.h>
28#include <openssl/evp.h> 29#include <openssl/evp.h>
29#include <openssl/objects.h> 30#include <openssl/objects.h>
31#include <openssl/x509v3.h>
30 32
31#include "cryptlib.h" 33#include "cryptlib.h"
32#include "x509_issuer_cache.h" 34#include "x509_issuer_cache.h"
@@ -85,6 +87,13 @@ OPENSSL_cleanup(void)
85 ENGINE_cleanup(); 87 ENGINE_cleanup();
86#endif 88#endif
87 EVP_cleanup(); 89 EVP_cleanup();
90
91 ASN1_STRING_TABLE_cleanup();
92 X509V3_EXT_cleanup();
93 X509_PURPOSE_cleanup();
94 X509_TRUST_cleanup();
95 X509_VERIFY_PARAM_table_cleanup();
96
88 x509_issuer_cache_free(); 97 x509_issuer_cache_free();
89 98
90 crypto_init_cleaned_up = 1; 99 crypto_init_cleaned_up = 1;