Added
Link Here
|
1 |
--- src/vendor/openssl-sys/src/lib.rs.orig 2018-03-25 15:53:20 UTC |
2 |
+++ src/vendor/openssl-sys/src/lib.rs |
3 |
@@ -18,6 +18,11 @@ mod ossl110; |
4 |
#[cfg(ossl110)] |
5 |
pub use ossl110::*; |
6 |
|
7 |
+#[cfg(ossl111)] |
8 |
+mod ossl111; |
9 |
+#[cfg(ossl111)] |
10 |
+pub use ossl111::*; |
11 |
+ |
12 |
#[cfg(libressl)] |
13 |
mod libressl; |
14 |
#[cfg(libressl)] |
15 |
@@ -216,6 +221,7 @@ pub const PEM_R_NO_START_LINE: c_int = 108; |
16 |
pub const EVP_MAX_MD_SIZE: c_uint = 64; |
17 |
pub const EVP_PKEY_RSA: c_int = NID_rsaEncryption; |
18 |
pub const EVP_PKEY_HMAC: c_int = NID_hmac; |
19 |
+pub const EVP_PKEY_CMAC: c_int = NID_cmac; |
20 |
pub const EVP_PKEY_DSA: c_int = NID_dsa; |
21 |
pub const EVP_PKEY_DH: c_int = NID_dhKeyAgreement; |
22 |
pub const EVP_PKEY_EC: c_int = NID_X9_62_id_ecPublicKey; |
23 |
@@ -223,9 +229,29 @@ pub const EVP_PKEY_EC: c_int = NID_X9_62_id_ecPublicKe |
24 |
pub const EVP_PKEY_ALG_CTRL: c_int = 0x1000; |
25 |
|
26 |
pub const EVP_PKEY_CTRL_RSA_PADDING: c_int = EVP_PKEY_ALG_CTRL + 1; |
27 |
+pub const EVP_PKEY_CTRL_RSA_PSS_SALTLEN: c_int = EVP_PKEY_ALG_CTRL + 2; |
28 |
|
29 |
+pub const EVP_PKEY_CTRL_RSA_MGF1_MD: c_int = EVP_PKEY_ALG_CTRL + 5; |
30 |
pub const EVP_PKEY_CTRL_GET_RSA_PADDING: c_int = EVP_PKEY_ALG_CTRL + 6; |
31 |
|
32 |
+pub const EVP_PKEY_CTRL_SET_MAC_KEY: c_int = 6; |
33 |
+pub const EVP_PKEY_CTRL_CIPHER: c_int = 12; |
34 |
+ |
35 |
+pub const EVP_PKEY_OP_KEYGEN: c_int = 1 << 2; |
36 |
+pub const EVP_PKEY_OP_SIGN: c_int = 1 << 3; |
37 |
+pub const EVP_PKEY_OP_VERIFY: c_int = 1 << 4; |
38 |
+pub const EVP_PKEY_OP_VERIFYRECOVER: c_int = 1 << 5; |
39 |
+pub const EVP_PKEY_OP_SIGNCTX: c_int = 1 << 6; |
40 |
+pub const EVP_PKEY_OP_VERIFYCTX: c_int = 1 << 7; |
41 |
+pub const EVP_PKEY_OP_ENCRYPT: c_int = 1 << 8; |
42 |
+pub const EVP_PKEY_OP_DECRYPT: c_int = 1 << 9; |
43 |
+ |
44 |
+pub const EVP_PKEY_OP_TYPE_SIG: c_int = EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY |
45 |
+ | EVP_PKEY_OP_VERIFYRECOVER | EVP_PKEY_OP_SIGNCTX |
46 |
+ | EVP_PKEY_OP_VERIFYCTX; |
47 |
+ |
48 |
+pub const EVP_PKEY_OP_TYPE_CRYPT: c_int = EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT; |
49 |
+ |
50 |
pub const EVP_CTRL_GCM_SET_IVLEN: c_int = 0x9; |
51 |
pub const EVP_CTRL_GCM_GET_TAG: c_int = 0x10; |
52 |
pub const EVP_CTRL_GCM_SET_TAG: c_int = 0x11; |
53 |
@@ -1195,9 +1221,16 @@ pub const RSA_SSLV23_PADDING: c_int = 2; |
54 |
pub const RSA_NO_PADDING: c_int = 3; |
55 |
pub const RSA_PKCS1_OAEP_PADDING: c_int = 4; |
56 |
pub const RSA_X931_PADDING: c_int = 5; |
57 |
+pub const RSA_PKCS1_PSS_PADDING: c_int = 6; |
58 |
|
59 |
pub const SHA_LBLOCK: c_int = 16; |
60 |
|
61 |
+pub const SSL3_AD_ILLEGAL_PARAMETER: c_int = 47; |
62 |
+pub const SSL_AD_ILLEGAL_PARAMETER: c_int = SSL3_AD_ILLEGAL_PARAMETER; |
63 |
+ |
64 |
+pub const TLS1_AD_DECODE_ERROR: c_int = 50; |
65 |
+pub const SSL_AD_DECODE_ERROR: c_int = TLS1_AD_DECODE_ERROR; |
66 |
+ |
67 |
pub const TLS1_AD_UNRECOGNIZED_NAME: c_int = 112; |
68 |
pub const SSL_AD_UNRECOGNIZED_NAME: c_int = TLS1_AD_UNRECOGNIZED_NAME; |
69 |
|
70 |
@@ -1206,6 +1239,7 @@ pub const SSL_CTRL_SET_TMP_ECDH: c_int = 4; |
71 |
pub const SSL_CTRL_EXTRA_CHAIN_CERT: c_int = 14; |
72 |
pub const SSL_CTRL_MODE: c_int = 33; |
73 |
pub const SSL_CTRL_SET_READ_AHEAD: c_int = 41; |
74 |
+pub const SSL_CTRL_SET_SESS_CACHE_MODE: c_int = 44; |
75 |
pub const SSL_CTRL_SET_TLSEXT_SERVERNAME_CB: c_int = 53; |
76 |
pub const SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG: c_int = 54; |
77 |
pub const SSL_CTRL_SET_TLSEXT_HOSTNAME: c_int = 55; |
78 |
@@ -1243,21 +1277,21 @@ pub const SSL_VERIFY_NONE: c_int = 0; |
79 |
pub const SSL_VERIFY_PEER: c_int = 1; |
80 |
pub const SSL_VERIFY_FAIL_IF_NO_PEER_CERT: c_int = 2; |
81 |
|
82 |
-#[cfg(not(any(libressl261, libressl262, libressl26x, ossl101)))] |
83 |
+#[cfg(not(any(libressl261, libressl262, libressl26x, libressl27, ossl101)))] |
84 |
pub const SSL_OP_TLSEXT_PADDING: c_ulong = 0x00000010; |
85 |
-#[cfg(any(libressl261, libressl262, libressl26x))] |
86 |
+#[cfg(any(libressl261, libressl262, libressl26x, libressl27))] |
87 |
pub const SSL_OP_TLSEXT_PADDING: c_ulong = 0x0; |
88 |
pub const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: c_ulong = 0x00000800; |
89 |
-#[cfg(not(any(libressl261, libressl262, libressl26x)))] |
90 |
+#[cfg(not(any(libressl261, libressl262, libressl26x, libressl27)))] |
91 |
pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG: c_ulong = 0x80000000; |
92 |
-#[cfg(any(libressl261, libressl262, libressl26x))] |
93 |
+#[cfg(any(libressl261, libressl262, libressl26x, libressl27))] |
94 |
pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG: c_ulong = 0x0; |
95 |
pub const SSL_OP_LEGACY_SERVER_CONNECT: c_ulong = 0x00000004; |
96 |
#[cfg(not(libressl))] |
97 |
pub const SSL_OP_SAFARI_ECDHE_ECDSA_BUG: c_ulong = 0x00000040; |
98 |
-#[cfg(not(any(libressl, ossl110f)))] |
99 |
+#[cfg(not(any(libressl, ossl110f, ossl111)))] |
100 |
pub const SSL_OP_ALL: c_ulong = 0x80000BFF; |
101 |
-#[cfg(ossl110f)] |
102 |
+#[cfg(any(ossl110f, ossl111))] |
103 |
pub const SSL_OP_ALL: c_ulong = SSL_OP_CRYPTOPRO_TLSEXT_BUG | SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS |
104 |
| SSL_OP_LEGACY_SERVER_CONNECT | SSL_OP_TLSEXT_PADDING |
105 |
| SSL_OP_SAFARI_ECDHE_ECDSA_BUG; |
106 |
@@ -1276,20 +1310,41 @@ pub const SSL_OP_TLS_ROLLBACK_BUG: c_ulong = 0x0080000 |
107 |
#[cfg(not(libressl))] |
108 |
pub const SSL_OP_NO_SSLv3: c_ulong = 0x02000000; |
109 |
pub const SSL_OP_NO_TLSv1: c_ulong = 0x04000000; |
110 |
-pub const SSL_OP_NO_TLSv1_2: c_ulong = 0x08000000; |
111 |
pub const SSL_OP_NO_TLSv1_1: c_ulong = 0x10000000; |
112 |
+pub const SSL_OP_NO_TLSv1_2: c_ulong = 0x08000000; |
113 |
+#[cfg(ossl111)] |
114 |
+pub const SSL_OP_NO_TLSv1_3: c_ulong = 0x20000000; |
115 |
|
116 |
#[cfg(not(any(ossl101, libressl)))] |
117 |
pub const SSL_OP_NO_DTLSv1: c_ulong = 0x04000000; |
118 |
#[cfg(not(any(ossl101, libressl)))] |
119 |
pub const SSL_OP_NO_DTLSv1_2: c_ulong = 0x08000000; |
120 |
-#[cfg(not(any(ossl101, libressl)))] |
121 |
+#[cfg(not(any(ossl101, libressl, ossl111)))] |
122 |
pub const SSL_OP_NO_SSL_MASK: c_ulong = |
123 |
SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2; |
124 |
+#[cfg(ossl111)] |
125 |
+pub const SSL_OP_NO_SSL_MASK: c_ulong = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 |
126 |
+ | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2 |
127 |
+ | SSL_OP_NO_TLSv1_3; |
128 |
|
129 |
pub const SSL_FILETYPE_PEM: c_int = X509_FILETYPE_PEM; |
130 |
pub const SSL_FILETYPE_ASN1: c_int = X509_FILETYPE_ASN1; |
131 |
|
132 |
+pub const SSL_SESS_CACHE_OFF: c_long = 0; |
133 |
+pub const SSL_SESS_CACHE_CLIENT: c_long = 0x1; |
134 |
+pub const SSL_SESS_CACHE_SERVER: c_long = 0x2; |
135 |
+pub const SSL_SESS_CACHE_BOTH: c_long = SSL_SESS_CACHE_CLIENT | SSL_SESS_CACHE_SERVER; |
136 |
+pub const SSL_SESS_CACHE_NO_AUTO_CLEAR: c_long = 0x80; |
137 |
+pub const SSL_SESS_CACHE_NO_INTERNAL_LOOKUP: c_long = 0x100; |
138 |
+pub const SSL_SESS_CACHE_NO_INTERNAL_STORE: c_long = 0x200; |
139 |
+pub const SSL_SESS_CACHE_NO_INTERNAL: c_long = |
140 |
+ SSL_SESS_CACHE_NO_INTERNAL_LOOKUP | SSL_SESS_CACHE_NO_INTERNAL_STORE; |
141 |
+ |
142 |
+pub const SSL3_VERSION: c_int = 0x300; |
143 |
+pub const TLS1_VERSION: c_int = 0x301; |
144 |
+pub const TLS1_1_VERSION: c_int = 0x302; |
145 |
+pub const TLS1_2_VERSION: c_int = 0x303; |
146 |
+ |
147 |
pub const TLSEXT_NAMETYPE_host_name: c_int = 0; |
148 |
|
149 |
pub const TLSEXT_STATUSTYPE_ocsp: c_int = 1; |
150 |
@@ -1408,6 +1463,8 @@ pub const GEN_URI: c_int = 6; |
151 |
pub const GEN_IPADD: c_int = 7; |
152 |
pub const GEN_RID: c_int = 8; |
153 |
|
154 |
+pub const DTLS1_COOKIE_LENGTH: c_uint = 256; |
155 |
+ |
156 |
// macros |
157 |
pub unsafe fn BIO_get_mem_data(b: *mut BIO, pp: *mut *mut c_char) -> c_long { |
158 |
BIO_ctrl(b, BIO_CTRL_INFO, 0, pp as *mut c_void) |
159 |
@@ -1448,6 +1505,28 @@ pub unsafe fn EVP_PKEY_CTX_get_rsa_padding(ctx: *mut E |
160 |
) |
161 |
} |
162 |
|
163 |
+pub unsafe fn EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx: *mut EVP_PKEY_CTX, len: c_int) -> c_int { |
164 |
+ EVP_PKEY_CTX_ctrl( |
165 |
+ ctx, |
166 |
+ EVP_PKEY_RSA, |
167 |
+ EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY, |
168 |
+ EVP_PKEY_CTRL_RSA_PSS_SALTLEN, |
169 |
+ len, |
170 |
+ ptr::null_mut(), |
171 |
+ ) |
172 |
+} |
173 |
+ |
174 |
+pub unsafe fn EVP_PKEY_CTX_set_rsa_mgf1_md(ctx: *mut EVP_PKEY_CTX, md: *mut EVP_MD) -> c_int { |
175 |
+ EVP_PKEY_CTX_ctrl( |
176 |
+ ctx, |
177 |
+ EVP_PKEY_RSA, |
178 |
+ EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, |
179 |
+ EVP_PKEY_CTRL_RSA_MGF1_MD, |
180 |
+ 0, |
181 |
+ md as *mut c_void, |
182 |
+ ) |
183 |
+} |
184 |
+ |
185 |
pub unsafe fn SSL_CTX_set_mode(ctx: *mut SSL_CTX, op: c_long) -> c_long { |
186 |
SSL_CTX_ctrl(ctx, SSL_CTRL_MODE, op, ptr::null_mut()) |
187 |
} |
188 |
@@ -1524,6 +1603,10 @@ pub unsafe fn SSL_CTX_get_extra_chain_certs( |
189 |
SSL_CTX_ctrl(ctx, SSL_CTRL_GET_EXTRA_CHAIN_CERTS, 0, chain as *mut c_void) |
190 |
} |
191 |
|
192 |
+pub unsafe fn SSL_CTX_set_session_cache_mode(ctx: *mut SSL_CTX, m: c_long) -> c_long { |
193 |
+ SSL_CTX_ctrl(ctx, SSL_CTRL_SET_SESS_CACHE_MODE, m, ptr::null_mut()) |
194 |
+} |
195 |
+ |
196 |
pub unsafe fn SSL_get_tlsext_status_ocsp_resp(ssl: *mut SSL, resp: *mut *mut c_uchar) -> c_long { |
197 |
SSL_ctrl( |
198 |
ssl, |
199 |
@@ -1572,6 +1655,7 @@ extern "C" { |
200 |
|
201 |
pub fn ASN1_INTEGER_get(dest: *const ASN1_INTEGER) -> c_long; |
202 |
pub fn ASN1_INTEGER_set(dest: *mut ASN1_INTEGER, value: c_long) -> c_int; |
203 |
+ pub fn ASN1_INTEGER_to_BN(ai: *const ASN1_INTEGER, bn: *mut BIGNUM) -> *mut BIGNUM; |
204 |
pub fn ASN1_GENERALIZEDTIME_free(tm: *mut ASN1_GENERALIZEDTIME); |
205 |
pub fn ASN1_GENERALIZEDTIME_print(b: *mut BIO, tm: *const ASN1_GENERALIZEDTIME) -> c_int; |
206 |
pub fn ASN1_STRING_type_new(ty: c_int) -> *mut ASN1_STRING; |
207 |
@@ -1843,6 +1927,20 @@ extern "C" { |
208 |
ctx: *mut BN_CTX, |
209 |
) -> c_int; |
210 |
|
211 |
+ pub fn ECDSA_SIG_new() -> *mut ECDSA_SIG; |
212 |
+ pub fn ECDSA_SIG_free(sig: *mut ECDSA_SIG); |
213 |
+ pub fn ECDSA_do_verify( |
214 |
+ dgst: *const c_uchar, |
215 |
+ dgst_len: c_int, |
216 |
+ sig: *const ECDSA_SIG, |
217 |
+ eckey: *mut EC_KEY, |
218 |
+ ) -> c_int; |
219 |
+ pub fn ECDSA_do_sign( |
220 |
+ dgst: *const c_uchar, |
221 |
+ dgst_len: c_int, |
222 |
+ eckey: *mut EC_KEY, |
223 |
+ ) -> *mut ECDSA_SIG; |
224 |
+ |
225 |
pub fn ERR_peek_last_error() -> c_ulong; |
226 |
pub fn ERR_get_error() -> c_ulong; |
227 |
pub fn ERR_get_error_line_data( |
228 |
@@ -1855,6 +1953,8 @@ extern "C" { |
229 |
pub fn ERR_func_error_string(err: c_ulong) -> *const c_char; |
230 |
pub fn ERR_reason_error_string(err: c_ulong) -> *const c_char; |
231 |
pub fn ERR_clear_error(); |
232 |
+ pub fn ERR_put_error(lib: c_int, func: c_int, reason: c_int, file: *const c_char, line: c_int); |
233 |
+ pub fn ERR_set_error_data(data: *mut c_char, flags: c_int); |
234 |
|
235 |
pub fn EVP_md5() -> *const EVP_MD; |
236 |
pub fn EVP_ripemd160() -> *const EVP_MD; |
237 |
@@ -1869,6 +1969,7 @@ extern "C" { |
238 |
pub fn EVP_aes_128_xts() -> *const EVP_CIPHER; |
239 |
pub fn EVP_aes_128_ctr() -> *const EVP_CIPHER; |
240 |
pub fn EVP_aes_128_gcm() -> *const EVP_CIPHER; |
241 |
+ pub fn EVP_aes_128_ccm() -> *const EVP_CIPHER; |
242 |
pub fn EVP_aes_128_cfb1() -> *const EVP_CIPHER; |
243 |
pub fn EVP_aes_128_cfb128() -> *const EVP_CIPHER; |
244 |
pub fn EVP_aes_128_cfb8() -> *const EVP_CIPHER; |
245 |
@@ -1877,6 +1978,7 @@ extern "C" { |
246 |
pub fn EVP_aes_256_xts() -> *const EVP_CIPHER; |
247 |
pub fn EVP_aes_256_ctr() -> *const EVP_CIPHER; |
248 |
pub fn EVP_aes_256_gcm() -> *const EVP_CIPHER; |
249 |
+ pub fn EVP_aes_256_ccm() -> *const EVP_CIPHER; |
250 |
pub fn EVP_aes_256_cfb1() -> *const EVP_CIPHER; |
251 |
pub fn EVP_aes_256_cfb128() -> *const EVP_CIPHER; |
252 |
pub fn EVP_aes_256_cfb8() -> *const EVP_CIPHER; |
253 |
@@ -1888,6 +1990,8 @@ extern "C" { |
254 |
|
255 |
pub fn EVP_des_cbc() -> *const EVP_CIPHER; |
256 |
pub fn EVP_des_ecb() -> *const EVP_CIPHER; |
257 |
+ pub fn EVP_des_ede3() -> *const EVP_CIPHER; |
258 |
+ pub fn EVP_des_ede3_cbc() -> *const EVP_CIPHER; |
259 |
|
260 |
pub fn EVP_BytesToKey( |
261 |
typ: *const EVP_CIPHER, |
262 |
@@ -1986,6 +2090,7 @@ extern "C" { |
263 |
pub fn EVP_PKEY_get1_DH(k: *mut EVP_PKEY) -> *mut DH; |
264 |
pub fn EVP_PKEY_get1_EC_KEY(k: *mut EVP_PKEY) -> *mut EC_KEY; |
265 |
pub fn EVP_PKEY_cmp(a: *const EVP_PKEY, b: *const EVP_PKEY) -> c_int; |
266 |
+ pub fn EVP_PKEY_id(pkey: *const EVP_PKEY) -> c_int; |
267 |
pub fn EVP_PKEY_new_mac_key( |
268 |
type_: c_int, |
269 |
e: *mut ENGINE, |
270 |
@@ -2003,6 +2108,7 @@ extern "C" { |
271 |
) -> *mut EVP_PKEY; |
272 |
|
273 |
pub fn EVP_PKEY_CTX_new(k: *mut EVP_PKEY, e: *mut ENGINE) -> *mut EVP_PKEY_CTX; |
274 |
+ pub fn EVP_PKEY_CTX_new_id(id: c_int, e: *mut ENGINE) -> *mut EVP_PKEY_CTX; |
275 |
pub fn EVP_PKEY_CTX_free(ctx: *mut EVP_PKEY_CTX); |
276 |
pub fn EVP_PKEY_CTX_ctrl( |
277 |
ctx: *mut EVP_PKEY_CTX, |
278 |
@@ -2013,6 +2119,9 @@ extern "C" { |
279 |
p2: *mut c_void, |
280 |
) -> c_int; |
281 |
|
282 |
+ pub fn EVP_PKEY_keygen_init(ctx: *mut EVP_PKEY_CTX) -> c_int; |
283 |
+ pub fn EVP_PKEY_keygen(ctx: *mut EVP_PKEY_CTX, key: *mut *mut EVP_PKEY) -> c_int; |
284 |
+ |
285 |
pub fn HMAC_CTX_copy(dst: *mut HMAC_CTX, src: *mut HMAC_CTX) -> c_int; |
286 |
|
287 |
pub fn OBJ_obj2nid(o: *const ASN1_OBJECT) -> c_int; |
288 |
@@ -2022,6 +2131,7 @@ extern "C" { |
289 |
a: *const ASN1_OBJECT, |
290 |
no_name: c_int, |
291 |
) -> c_int; |
292 |
+ pub fn OBJ_nid2sn(nid: c_int) -> *const c_char; |
293 |
|
294 |
pub fn OCSP_BASICRESP_new() -> *mut OCSP_BASICRESP; |
295 |
pub fn OCSP_BASICRESP_free(r: *mut OCSP_BASICRESP); |
296 |
@@ -2110,6 +2220,14 @@ extern "C" { |
297 |
callback: Option<PasswordCallback>, |
298 |
user_data: *mut c_void, |
299 |
) -> *mut RSA; |
300 |
+ |
301 |
+ pub fn PEM_read_bio_RSAPublicKey( |
302 |
+ bio: *mut BIO, |
303 |
+ rsa: *mut *mut RSA, |
304 |
+ callback: Option<PasswordCallback>, |
305 |
+ user_data: *mut c_void, |
306 |
+ ) -> *mut RSA; |
307 |
+ |
308 |
pub fn PEM_read_bio_RSA_PUBKEY( |
309 |
bio: *mut BIO, |
310 |
rsa: *mut *mut RSA, |
311 |
@@ -2344,6 +2462,7 @@ extern "C" { |
312 |
pub fn SSL_get_peer_cert_chain(ssl: *const SSL) -> *mut stack_st_X509; |
313 |
pub fn SSL_get_ssl_method(ssl: *mut SSL) -> *const SSL_METHOD; |
314 |
pub fn SSL_get_version(ssl: *const SSL) -> *const c_char; |
315 |
+ pub fn SSL_version(ssl: *const SSL) -> c_int; |
316 |
pub fn SSL_state_string(ssl: *const SSL) -> *const c_char; |
317 |
pub fn SSL_state_string_long(ssl: *const SSL) -> *const c_char; |
318 |
pub fn SSL_set_verify( |
319 |
@@ -2369,6 +2488,16 @@ extern "C" { |
320 |
ctx: *mut SSL, |
321 |
dh: unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut DH, |
322 |
); |
323 |
+ pub fn SSL_export_keying_material( |
324 |
+ s: *mut SSL, |
325 |
+ out: *mut c_uchar, |
326 |
+ olen: size_t, |
327 |
+ label: *const c_char, |
328 |
+ llen: size_t, |
329 |
+ context: *const c_uchar, |
330 |
+ contextlen: size_t, |
331 |
+ use_context: c_int, |
332 |
+ ) -> c_int; |
333 |
|
334 |
#[cfg(not(any(osslconf = "OPENSSL_NO_COMP", libressl)))] |
335 |
pub fn SSL_COMP_get_name(comp: *const COMP_METHOD) -> *const c_char; |
336 |
@@ -2436,6 +2565,14 @@ extern "C" { |
337 |
ctx: *mut SSL_CTX, |
338 |
dh: unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut DH, |
339 |
); |
340 |
+ pub fn SSL_CTX_sess_set_new_cb( |
341 |
+ ctx: *mut SSL_CTX, |
342 |
+ new_session_cb: Option<unsafe extern "C" fn(*mut SSL, *mut SSL_SESSION) -> c_int>, |
343 |
+ ); |
344 |
+ pub fn SSL_CTX_sess_set_remove_cb( |
345 |
+ ctx: *mut SSL_CTX, |
346 |
+ remove_session_cb: Option<unsafe extern "C" fn(*mut SSL_CTX, *mut SSL_SESSION)>, |
347 |
+ ); |
348 |
|
349 |
#[cfg(not(any(ossl101, libressl)))] |
350 |
pub fn SSL_CTX_get0_certificate(ctx: *const SSL_CTX) -> *mut X509; |
351 |
@@ -2474,6 +2611,7 @@ extern "C" { |
352 |
-> c_uint, |
353 |
>, |
354 |
); |
355 |
+ |
356 |
pub fn SSL_select_next_proto( |
357 |
out: *mut *mut c_uchar, |
358 |
outlen: *mut c_uchar, |
359 |
@@ -2489,9 +2627,9 @@ extern "C" { |
360 |
); |
361 |
pub fn SSL_get_session(s: *const SSL) -> *mut SSL_SESSION; |
362 |
pub fn SSL_set_session(ssl: *mut SSL, session: *mut SSL_SESSION) -> c_int; |
363 |
- #[cfg(not(any(ossl101, libressl, ossl110f)))] |
364 |
+ #[cfg(not(any(ossl101, libressl, ossl110f, ossl111)))] |
365 |
pub fn SSL_is_server(s: *mut SSL) -> c_int; |
366 |
- #[cfg(ossl110f)] |
367 |
+ #[cfg(any(ossl110f, ossl111))] |
368 |
pub fn SSL_is_server(s: *const SSL) -> c_int; |
369 |
|
370 |
pub fn SSL_SESSION_free(s: *mut SSL_SESSION); |
371 |
@@ -2540,6 +2678,7 @@ extern "C" { |
372 |
pub fn X509_sign(x: *mut X509, pkey: *mut EVP_PKEY, md: *const EVP_MD) -> c_int; |
373 |
pub fn X509_get_pubkey(x: *mut X509) -> *mut EVP_PKEY; |
374 |
pub fn X509_to_X509_REQ(x: *mut X509, pkey: *mut EVP_PKEY, md: *const EVP_MD) -> *mut X509_REQ; |
375 |
+ pub fn X509_verify_cert(ctx: *mut X509_STORE_CTX) -> c_int; |
376 |
pub fn X509_verify_cert_error_string(n: c_long) -> *const c_char; |
377 |
pub fn X509_get1_ocsp(x: *mut X509) -> *mut stack_st_OPENSSL_STRING; |
378 |
pub fn X509_check_issued(issuer: *mut X509, subject: *mut X509) -> c_int; |
379 |
@@ -2573,6 +2712,14 @@ extern "C" { |
380 |
pub fn X509_STORE_add_cert(store: *mut X509_STORE, x: *mut X509) -> c_int; |
381 |
pub fn X509_STORE_set_default_paths(store: *mut X509_STORE) -> c_int; |
382 |
|
383 |
+ pub fn X509_STORE_CTX_new() -> *mut X509_STORE_CTX; |
384 |
+ pub fn X509_STORE_CTX_cleanup(ctx: *mut X509_STORE_CTX); |
385 |
+ pub fn X509_STORE_CTX_init( |
386 |
+ ctx: *mut X509_STORE_CTX, |
387 |
+ store: *mut X509_STORE, |
388 |
+ x509: *mut X509, |
389 |
+ chain: *mut stack_st_X509, |
390 |
+ ) -> c_int; |
391 |
pub fn X509_STORE_CTX_free(ctx: *mut X509_STORE_CTX); |
392 |
pub fn X509_STORE_CTX_get_current_cert(ctx: *mut X509_STORE_CTX) -> *mut X509; |
393 |
pub fn X509_STORE_CTX_get_error(ctx: *mut X509_STORE_CTX) -> c_int; |
394 |
@@ -2704,4 +2851,28 @@ extern "C" { |
395 |
pub fn FIPS_mode_set(onoff: c_int) -> c_int; |
396 |
#[cfg(not(libressl))] |
397 |
pub fn FIPS_mode() -> c_int; |
398 |
+ |
399 |
+ pub fn SSL_CTX_set_cookie_generate_cb( |
400 |
+ s: *mut SSL_CTX, |
401 |
+ cb: Option< |
402 |
+ extern "C" fn(ssl: *mut SSL, cookie: *mut c_uchar, cookie_len: *mut c_uint) -> c_int, |
403 |
+ >, |
404 |
+ ); |
405 |
+ |
406 |
+ #[cfg(ossl110)] |
407 |
+ pub fn SSL_CTX_set_cookie_verify_cb( |
408 |
+ s: *mut SSL_CTX, |
409 |
+ cb: Option< |
410 |
+ extern "C" fn(ssl: *mut SSL, cookie: *const c_uchar, cookie_len: c_uint) -> c_int, |
411 |
+ >, |
412 |
+ ); |
413 |
+ |
414 |
+ #[cfg(not(ossl110))] |
415 |
+ pub fn SSL_CTX_set_cookie_verify_cb( |
416 |
+ s: *mut SSL_CTX, |
417 |
+ cb: Option<extern "C" fn(ssl: *mut SSL, cookie: *mut c_uchar, cookie_len: c_uint) -> c_int>, |
418 |
+ ); |
419 |
+ |
420 |
+ pub fn EVP_MD_size(md: *const EVP_MD) -> c_int; |
421 |
+ pub fn EVP_get_cipherbyname(name: *const c_char) -> *const EVP_CIPHER; |
422 |
} |