diff options
author | Cy Schubert <cy@FreeBSD.org> | 2024-01-12 07:39:02 +0000 |
---|---|---|
committer | Cy Schubert <cy@FreeBSD.org> | 2024-01-12 07:42:33 +0000 |
commit | 3091cdb11fb05e554a54710116be87ee1f55c287 (patch) | |
tree | a052b6300197a5ecc389d236d9f98afda107bb96 /kerberos5/lib/libroken/fbsd_ossl_provider_load.c | |
parent | 91dc2374661d717a30d646e5c4200508dfd24a4c (diff) | |
download | src-3091cdb11fb05e554a54710116be87ee1f55c287.tar.gz src-3091cdb11fb05e554a54710116be87ee1f55c287.zip |
Diffstat (limited to 'kerberos5/lib/libroken/fbsd_ossl_provider_load.c')
-rw-r--r-- | kerberos5/lib/libroken/fbsd_ossl_provider_load.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c b/kerberos5/lib/libroken/fbsd_ossl_provider_load.c deleted file mode 100644 index f49c8746c9e4..000000000000 --- a/kerberos5/lib/libroken/fbsd_ossl_provider_load.c +++ /dev/null @@ -1,41 +0,0 @@ -#include <errno.h> -#include <krb5_locl.h> - -static void fbsd_ossl_provider_unload(void); - -static OSSL_PROVIDER *legacy; -static OSSL_PROVIDER *deflt; -static int providers_loaded = 0; - -int -fbsd_ossl_provider_load(void) -{ -#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3) - if (providers_loaded == 0) { - if ((legacy = OSSL_PROVIDER_load(NULL, "legacy")) == NULL) - return (EINVAL); - if ((deflt = OSSL_PROVIDER_load(NULL, "default")) == NULL) { - OSSL_PROVIDER_unload(legacy); - return (EINVAL); - } - if (atexit(fbsd_ossl_provider_unload)) { - fbsd_ossl_provider_unload(); - return (errno); - } - providers_loaded = 1; - } -#endif - return (0); -} - -static void -fbsd_ossl_provider_unload(void) -{ -#if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3) - if (providers_loaded == 1) { - OSSL_PROVIDER_unload(legacy); - OSSL_PROVIDER_unload(deflt); - providers_loaded = 0; - } -#endif -} |