diff options
Diffstat (limited to 'src/lib/libcrypto/evp/c_all.c')
| -rw-r--r-- | src/lib/libcrypto/evp/c_all.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/lib/libcrypto/evp/c_all.c b/src/lib/libcrypto/evp/c_all.c index 8ab93fece8..87657eded3 100644 --- a/src/lib/libcrypto/evp/c_all.c +++ b/src/lib/libcrypto/evp/c_all.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: c_all.c,v 1.21 2017/03/01 13:53:58 jsing Exp $ */ | 1 | /* $OpenBSD: c_all.c,v 1.22 2018/03/17 16:20:01 beck Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -57,6 +57,7 @@ | |||
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #include <stdio.h> | 59 | #include <stdio.h> |
| 60 | #include <pthread.h> | ||
| 60 | 61 | ||
| 61 | #include <openssl/opensslconf.h> | 62 | #include <openssl/opensslconf.h> |
| 62 | 63 | ||
| @@ -66,8 +67,8 @@ | |||
| 66 | 67 | ||
| 67 | #include "cryptlib.h" | 68 | #include "cryptlib.h" |
| 68 | 69 | ||
| 69 | void | 70 | static void |
| 70 | OpenSSL_add_all_ciphers(void) | 71 | OpenSSL_add_all_ciphers_internal(void) |
| 71 | { | 72 | { |
| 72 | #ifndef OPENSSL_NO_DES | 73 | #ifndef OPENSSL_NO_DES |
| 73 | EVP_add_cipher(EVP_des_cfb()); | 74 | EVP_add_cipher(EVP_des_cfb()); |
| @@ -226,7 +227,14 @@ OpenSSL_add_all_ciphers(void) | |||
| 226 | } | 227 | } |
| 227 | 228 | ||
| 228 | void | 229 | void |
| 229 | OpenSSL_add_all_digests(void) | 230 | OpenSSL_add_all_ciphers(void) |
| 231 | { | ||
| 232 | static pthread_once_t add_all_ciphers_once = PTHREAD_ONCE_INIT; | ||
| 233 | (void) pthread_once(&add_all_ciphers_once, OpenSSL_add_all_ciphers_internal); | ||
| 234 | } | ||
| 235 | |||
| 236 | static void | ||
| 237 | OpenSSL_add_all_digests_internal(void) | ||
| 230 | { | 238 | { |
| 231 | #ifndef OPENSSL_NO_MD4 | 239 | #ifndef OPENSSL_NO_MD4 |
| 232 | EVP_add_digest(EVP_md4()); | 240 | EVP_add_digest(EVP_md4()); |
| @@ -284,6 +292,13 @@ OpenSSL_add_all_digests(void) | |||
| 284 | } | 292 | } |
| 285 | 293 | ||
| 286 | void | 294 | void |
| 295 | OpenSSL_add_all_digests(void) | ||
| 296 | { | ||
| 297 | static pthread_once_t add_all_digests_once = PTHREAD_ONCE_INIT; | ||
| 298 | (void) pthread_once(&add_all_digests_once, OpenSSL_add_all_digests_internal); | ||
| 299 | } | ||
| 300 | |||
| 301 | void | ||
| 287 | OPENSSL_add_all_algorithms_noconf(void) | 302 | OPENSSL_add_all_algorithms_noconf(void) |
| 288 | { | 303 | { |
| 289 | OPENSSL_cpuid_setup(); | 304 | OPENSSL_cpuid_setup(); |
