Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/ssl/ssl_init.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | static int stopped; | - | ||||||||||||
5 | - | |||||||||||||
6 | static void ssl_library_stop(void); | - | ||||||||||||
7 | - | |||||||||||||
8 | static CRYPTO_ONCE ssl_base = | - | ||||||||||||
9 | 0 | - | ||||||||||||
10 | ; | - | ||||||||||||
11 | static int ssl_base_inited = 0; | - | ||||||||||||
12 | static int ossl_init_ssl_base(void); static int ossl_init_ssl_base_ossl_ret_ = 0; static void ossl_init_ssl_base_ossl_(void) { ossl_init_ssl_base_ossl_ret_ = ossl_init_ssl_base(); } executed 1958 times by 2 tests: static int ossl_init_ssl_base(void)end of block Executed by:
| 1958 | ||||||||||||
13 | { | - | ||||||||||||
14 | - | |||||||||||||
15 | - | |||||||||||||
16 | - | |||||||||||||
17 | - | |||||||||||||
18 | - | |||||||||||||
19 | EVP_add_cipher(EVP_des_cbc()); | - | ||||||||||||
20 | EVP_add_cipher(EVP_des_ede3_cbc()); | - | ||||||||||||
21 | - | |||||||||||||
22 | - | |||||||||||||
23 | EVP_add_cipher(EVP_idea_cbc()); | - | ||||||||||||
24 | - | |||||||||||||
25 | - | |||||||||||||
26 | EVP_add_cipher(EVP_rc4()); | - | ||||||||||||
27 | - | |||||||||||||
28 | EVP_add_cipher(EVP_rc4_hmac_md5()); | - | ||||||||||||
29 | - | |||||||||||||
30 | - | |||||||||||||
31 | - | |||||||||||||
32 | EVP_add_cipher(EVP_rc2_cbc()); | - | ||||||||||||
33 | - | |||||||||||||
34 | - | |||||||||||||
35 | - | |||||||||||||
36 | - | |||||||||||||
37 | EVP_add_cipher(EVP_rc2_40_cbc()); | - | ||||||||||||
38 | - | |||||||||||||
39 | EVP_add_cipher(EVP_aes_128_cbc()); | - | ||||||||||||
40 | EVP_add_cipher(EVP_aes_192_cbc()); | - | ||||||||||||
41 | EVP_add_cipher(EVP_aes_256_cbc()); | - | ||||||||||||
42 | EVP_add_cipher(EVP_aes_128_gcm()); | - | ||||||||||||
43 | EVP_add_cipher(EVP_aes_256_gcm()); | - | ||||||||||||
44 | EVP_add_cipher(EVP_aes_128_ccm()); | - | ||||||||||||
45 | EVP_add_cipher(EVP_aes_256_ccm()); | - | ||||||||||||
46 | EVP_add_cipher(EVP_aes_128_cbc_hmac_sha1()); | - | ||||||||||||
47 | EVP_add_cipher(EVP_aes_256_cbc_hmac_sha1()); | - | ||||||||||||
48 | EVP_add_cipher(EVP_aes_128_cbc_hmac_sha256()); | - | ||||||||||||
49 | EVP_add_cipher(EVP_aes_256_cbc_hmac_sha256()); | - | ||||||||||||
50 | - | |||||||||||||
51 | EVP_add_cipher(EVP_aria_128_gcm()); | - | ||||||||||||
52 | EVP_add_cipher(EVP_aria_256_gcm()); | - | ||||||||||||
53 | - | |||||||||||||
54 | - | |||||||||||||
55 | EVP_add_cipher(EVP_camellia_128_cbc()); | - | ||||||||||||
56 | EVP_add_cipher(EVP_camellia_256_cbc()); | - | ||||||||||||
57 | - | |||||||||||||
58 | - | |||||||||||||
59 | EVP_add_cipher(EVP_chacha20_poly1305()); | - | ||||||||||||
60 | - | |||||||||||||
61 | - | |||||||||||||
62 | - | |||||||||||||
63 | EVP_add_cipher(EVP_seed_cbc()); | - | ||||||||||||
64 | - | |||||||||||||
65 | - | |||||||||||||
66 | - | |||||||||||||
67 | EVP_add_digest(EVP_md5()); | - | ||||||||||||
68 | OBJ_NAME_add(("ssl3-md5"),0x01|0x8000,("MD5")); | - | ||||||||||||
69 | EVP_add_digest(EVP_md5_sha1()); | - | ||||||||||||
70 | - | |||||||||||||
71 | EVP_add_digest(EVP_sha1()); | - | ||||||||||||
72 | OBJ_NAME_add(("ssl3-sha1"),0x01|0x8000,("SHA1")); | - | ||||||||||||
73 | OBJ_NAME_add(("RSA-SHA1-2"),0x01|0x8000,("RSA-SHA1")); | - | ||||||||||||
74 | EVP_add_digest(EVP_sha224()); | - | ||||||||||||
75 | EVP_add_digest(EVP_sha256()); | - | ||||||||||||
76 | EVP_add_digest(EVP_sha384()); | - | ||||||||||||
77 | EVP_add_digest(EVP_sha512()); | - | ||||||||||||
78 | SSL_COMP_get_compression_methods(); | - | ||||||||||||
79 | - | |||||||||||||
80 | - | |||||||||||||
81 | if (!ssl_load_ciphers()
| 0-1958 | ||||||||||||
82 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
83 | OPENSSL_atexit(ssl_library_stop); | - | ||||||||||||
84 | ssl_base_inited = 1; | - | ||||||||||||
85 | return executed 1958 times by 2 tests: 1;return 1; Executed by:
executed 1958 times by 2 tests: return 1; Executed by:
| 1958 | ||||||||||||
86 | } | - | ||||||||||||
87 | - | |||||||||||||
88 | static CRYPTO_ONCE ssl_strings = | - | ||||||||||||
89 | 0 | - | ||||||||||||
90 | ; | - | ||||||||||||
91 | static int ssl_strings_inited = 0; | - | ||||||||||||
92 | static int ossl_init_load_ssl_strings(void); static int ossl_init_load_ssl_strings_ossl_ret_ = 0; static void ossl_init_load_ssl_strings_ossl_(void) { ossl_init_load_ssl_strings_ossl_ret_ = ossl_init_load_ssl_strings(); } executed 546 times by 2 tests: static int ossl_init_load_ssl_strings(void)end of block Executed by:
| 546 | ||||||||||||
93 | { | - | ||||||||||||
94 | ERR_load_SSL_strings(); | - | ||||||||||||
95 | ssl_strings_inited = 1; | - | ||||||||||||
96 | - | |||||||||||||
97 | return executed 546 times by 2 tests: 1;return 1; Executed by:
executed 546 times by 2 tests: return 1; Executed by:
| 546 | ||||||||||||
98 | } | - | ||||||||||||
99 | - | |||||||||||||
100 | static int ossl_init_no_load_ssl_strings(void); static int ossl_init_no_load_ssl_strings_ossl_ret_ = 0; static void ossl_init_no_load_ssl_strings_ossl_(void) { ossl_init_no_load_ssl_strings_ossl_ret_ = ossl_init_no_load_ssl_strings(); } never executed: static int ossl_init_no_load_ssl_strings(void)end of block | 0 | ||||||||||||
101 | { | - | ||||||||||||
102 | - | |||||||||||||
103 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||
104 | } | - | ||||||||||||
105 | - | |||||||||||||
106 | static void ssl_library_stop(void) | - | ||||||||||||
107 | { | - | ||||||||||||
108 | - | |||||||||||||
109 | if (stopped
| 0-1958 | ||||||||||||
110 | return; never executed: return; | 0 | ||||||||||||
111 | stopped = 1; | - | ||||||||||||
112 | - | |||||||||||||
113 | if (ssl_base_inited
| 0-1958 | ||||||||||||
114 | - | |||||||||||||
115 | - | |||||||||||||
116 | - | |||||||||||||
117 | - | |||||||||||||
118 | - | |||||||||||||
119 | ssl_comp_free_compression_methods_int(); | - | ||||||||||||
120 | - | |||||||||||||
121 | } executed 1958 times by 2 tests: end of block Executed by:
| 1958 | ||||||||||||
122 | - | |||||||||||||
123 | if (ssl_strings_inited
| 546-1412 | ||||||||||||
124 | err_free_strings_int(); | - | ||||||||||||
125 | } executed 546 times by 2 tests: end of block Executed by:
| 546 | ||||||||||||
126 | } executed 1958 times by 2 tests: end of block Executed by:
| 1958 | ||||||||||||
127 | - | |||||||||||||
128 | - | |||||||||||||
129 | - | |||||||||||||
130 | - | |||||||||||||
131 | - | |||||||||||||
132 | - | |||||||||||||
133 | int OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS * settings) | - | ||||||||||||
134 | { | - | ||||||||||||
135 | static int stoperrset = 0; | - | ||||||||||||
136 | - | |||||||||||||
137 | if (stopped
| 0-18826 | ||||||||||||
138 | if (!stoperrset
| 0 | ||||||||||||
139 | - | |||||||||||||
140 | - | |||||||||||||
141 | - | |||||||||||||
142 | - | |||||||||||||
143 | - | |||||||||||||
144 | stoperrset = 1; | - | ||||||||||||
145 | ERR_put_error(20,(342),((6|64)),__FILE__,192); | - | ||||||||||||
146 | } never executed: end of block | 0 | ||||||||||||
147 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
148 | } | - | ||||||||||||
149 | - | |||||||||||||
150 | if (!OPENSSL_init_crypto(opts
| 0-18826 | ||||||||||||
151 | 0-18826 | |||||||||||||
152 | | 0x00000040L
| 0-18826 | ||||||||||||
153 | 0-18826 | |||||||||||||
154 | | 0x00000004L
| 0-18826 | ||||||||||||
155 | | 0x00000008L,
| 0-18826 | ||||||||||||
156 | settings)
| 0-18826 | ||||||||||||
157 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
158 | - | |||||||||||||
159 | if (!(CRYPTO_THREAD_run_once(&ssl_base, ossl_init_ssl_base_ossl_)
| 0-18826 | ||||||||||||
160 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
161 | - | |||||||||||||
162 | if ((
| 0-18826 | ||||||||||||
163 | && !(CRYPTO_THREAD_run_once(&ssl_strings, ossl_init_no_load_ssl_strings_ossl_) ? ossl_init_no_load_ssl_strings_ossl_ret_ : 0)
| 0 | ||||||||||||
164 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
165 | - | |||||||||||||
166 | if ((
| 1789-17037 | ||||||||||||
167 | && !(CRYPTO_THREAD_run_once(&ssl_strings, ossl_init_load_ssl_strings_ossl_) ? ossl_init_load_ssl_strings_ossl_ret_ : 0)
| 0-17037 | ||||||||||||
168 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||
169 | - | |||||||||||||
170 | return executed 18826 times by 2 tests: 1;return 1; Executed by:
executed 18826 times by 2 tests: return 1; Executed by:
| 18826 | ||||||||||||
171 | } | - | ||||||||||||
Switch to Source code | Preprocessed file |