diff options
author | tb <> | 2023-11-22 15:53:53 +0000 |
---|---|---|
committer | tb <> | 2023-11-22 15:53:53 +0000 |
commit | 1583f08c4441aba39b088e4c57878f02431b5798 (patch) | |
tree | 64cd654c9c27175595ff5b7ada41630953d53089 /src/lib | |
parent | 4c0a26334ce1124fb6f4671a6e30c9ac2b1e2d12 (diff) | |
download | openbsd-1583f08c4441aba39b088e4c57878f02431b5798.tar.gz openbsd-1583f08c4441aba39b088e4c57878f02431b5798.tar.bz2 openbsd-1583f08c4441aba39b088e4c57878f02431b5798.zip |
Make SSL_library_init() a wrapper of OPENSSL_init_ssl()
This way it doesn't do nonsensical work for all those who cargo culted an
init sequence. There's no point in having SSL_library_init() as a cheaper
version of OPENSSL_init_ssl(): once you do crypto, you'll init crypto...
Also move the now trivial implementation to ssl_init.c which has a good
license.
ok jsing
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libssl/ssl_algs.c | 61 | ||||
-rw-r--r-- | src/lib/libssl/ssl_init.c | 9 |
2 files changed, 9 insertions, 61 deletions
diff --git a/src/lib/libssl/ssl_algs.c b/src/lib/libssl/ssl_algs.c index 684697df51..c5c3619cc6 100644 --- a/src/lib/libssl/ssl_algs.c +++ b/src/lib/libssl/ssl_algs.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_algs.c,v 1.32 2023/07/08 16:40:13 beck Exp $ */ | 1 | /* $OpenBSD: ssl_algs.c,v 1.33 2023/11/22 15:53:53 tb 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 | * |
@@ -64,62 +64,3 @@ | |||
64 | 64 | ||
65 | #include "ssl_local.h" | 65 | #include "ssl_local.h" |
66 | 66 | ||
67 | int | ||
68 | SSL_library_init(void) | ||
69 | { | ||
70 | |||
71 | #ifndef OPENSSL_NO_DES | ||
72 | EVP_add_cipher(EVP_des_cbc()); | ||
73 | EVP_add_cipher(EVP_des_ede3_cbc()); | ||
74 | #endif | ||
75 | #ifndef OPENSSL_NO_RC4 | ||
76 | EVP_add_cipher(EVP_rc4()); | ||
77 | #if !defined(OPENSSL_NO_MD5) && (defined(__x86_64) || defined(__x86_64__)) | ||
78 | EVP_add_cipher(EVP_rc4_hmac_md5()); | ||
79 | #endif | ||
80 | #endif | ||
81 | #ifndef OPENSSL_NO_RC2 | ||
82 | EVP_add_cipher(EVP_rc2_cbc()); | ||
83 | /* Not actually used for SSL/TLS but this makes PKCS#12 work | ||
84 | * if an application only calls SSL_library_init(). | ||
85 | */ | ||
86 | EVP_add_cipher(EVP_rc2_40_cbc()); | ||
87 | #endif | ||
88 | EVP_add_cipher(EVP_aes_128_cbc()); | ||
89 | EVP_add_cipher(EVP_aes_192_cbc()); | ||
90 | EVP_add_cipher(EVP_aes_256_cbc()); | ||
91 | EVP_add_cipher(EVP_aes_128_gcm()); | ||
92 | EVP_add_cipher(EVP_aes_256_gcm()); | ||
93 | EVP_add_cipher(EVP_aes_128_cbc_hmac_sha1()); | ||
94 | EVP_add_cipher(EVP_aes_256_cbc_hmac_sha1()); | ||
95 | #ifndef OPENSSL_NO_CAMELLIA | ||
96 | EVP_add_cipher(EVP_camellia_128_cbc()); | ||
97 | EVP_add_cipher(EVP_camellia_256_cbc()); | ||
98 | #endif | ||
99 | #ifndef OPENSSL_NO_GOST | ||
100 | EVP_add_cipher(EVP_gost2814789_cfb64()); | ||
101 | EVP_add_cipher(EVP_gost2814789_cnt()); | ||
102 | #endif | ||
103 | |||
104 | EVP_add_digest(EVP_md5()); | ||
105 | EVP_add_digest(EVP_md5_sha1()); | ||
106 | EVP_add_digest_alias(SN_md5, "ssl2-md5"); | ||
107 | EVP_add_digest_alias(SN_md5, "ssl3-md5"); | ||
108 | |||
109 | EVP_add_digest(EVP_sha1()); /* RSA with sha1 */ | ||
110 | EVP_add_digest_alias(SN_sha1, "ssl3-sha1"); | ||
111 | EVP_add_digest_alias(SN_sha1WithRSAEncryption, SN_sha1WithRSA); | ||
112 | EVP_add_digest(EVP_sha224()); | ||
113 | EVP_add_digest(EVP_sha256()); | ||
114 | EVP_add_digest(EVP_sha384()); | ||
115 | EVP_add_digest(EVP_sha512()); | ||
116 | #ifndef OPENSSL_NO_GOST | ||
117 | EVP_add_digest(EVP_gostr341194()); | ||
118 | EVP_add_digest(EVP_gost2814789imit()); | ||
119 | EVP_add_digest(EVP_streebog256()); | ||
120 | EVP_add_digest(EVP_streebog512()); | ||
121 | #endif | ||
122 | |||
123 | return (1); | ||
124 | } | ||
125 | LSSL_ALIAS(SSL_library_init); | ||
diff --git a/src/lib/libssl/ssl_init.c b/src/lib/libssl/ssl_init.c index 7df48fb6a0..b314e714c1 100644 --- a/src/lib/libssl/ssl_init.c +++ b/src/lib/libssl/ssl_init.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_init.c,v 1.5 2023/11/22 15:49:47 tb Exp $ */ | 1 | /* $OpenBSD: ssl_init.c,v 1.6 2023/11/22 15:53:53 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2018 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
@@ -26,6 +26,13 @@ | |||
26 | 26 | ||
27 | static pthread_t ssl_init_thread; | 27 | static pthread_t ssl_init_thread; |
28 | 28 | ||
29 | int | ||
30 | SSL_library_init(void) | ||
31 | { | ||
32 | return OPENSSL_init_ssl(0, NULL); | ||
33 | } | ||
34 | LSSL_ALIAS(SSL_library_init); | ||
35 | |||
29 | static void | 36 | static void |
30 | OPENSSL_init_ssl_internal(void) | 37 | OPENSSL_init_ssl_internal(void) |
31 | { | 38 | { |