Added
Link Here
|
1 |
--- src/vendor/openssl-sys/src/lib.rs.orig 2018-05-07 18:50:12 UTC |
2 |
+++ src/vendor/openssl-sys/src/lib.rs |
3 |
@@ -221,6 +221,7 @@ pub const PEM_R_NO_START_LINE: c_int = 108; |
4 |
pub const EVP_MAX_MD_SIZE: c_uint = 64; |
5 |
pub const EVP_PKEY_RSA: c_int = NID_rsaEncryption; |
6 |
pub const EVP_PKEY_HMAC: c_int = NID_hmac; |
7 |
+pub const EVP_PKEY_CMAC: c_int = NID_cmac; |
8 |
pub const EVP_PKEY_DSA: c_int = NID_dsa; |
9 |
pub const EVP_PKEY_DH: c_int = NID_dhKeyAgreement; |
10 |
pub const EVP_PKEY_EC: c_int = NID_X9_62_id_ecPublicKey; |
11 |
@@ -228,9 +229,29 @@ pub const EVP_PKEY_EC: c_int = NID_X9_62_id_ecPublicKe |
12 |
pub const EVP_PKEY_ALG_CTRL: c_int = 0x1000; |
13 |
|
14 |
pub const EVP_PKEY_CTRL_RSA_PADDING: c_int = EVP_PKEY_ALG_CTRL + 1; |
15 |
+pub const EVP_PKEY_CTRL_RSA_PSS_SALTLEN: c_int = EVP_PKEY_ALG_CTRL + 2; |
16 |
|
17 |
+pub const EVP_PKEY_CTRL_RSA_MGF1_MD: c_int = EVP_PKEY_ALG_CTRL + 5; |
18 |
pub const EVP_PKEY_CTRL_GET_RSA_PADDING: c_int = EVP_PKEY_ALG_CTRL + 6; |
19 |
|
20 |
+pub const EVP_PKEY_CTRL_SET_MAC_KEY: c_int = 6; |
21 |
+pub const EVP_PKEY_CTRL_CIPHER: c_int = 12; |
22 |
+ |
23 |
+pub const EVP_PKEY_OP_KEYGEN: c_int = 1 << 2; |
24 |
+pub const EVP_PKEY_OP_SIGN: c_int = 1 << 3; |
25 |
+pub const EVP_PKEY_OP_VERIFY: c_int = 1 << 4; |
26 |
+pub const EVP_PKEY_OP_VERIFYRECOVER: c_int = 1 << 5; |
27 |
+pub const EVP_PKEY_OP_SIGNCTX: c_int = 1 << 6; |
28 |
+pub const EVP_PKEY_OP_VERIFYCTX: c_int = 1 << 7; |
29 |
+pub const EVP_PKEY_OP_ENCRYPT: c_int = 1 << 8; |
30 |
+pub const EVP_PKEY_OP_DECRYPT: c_int = 1 << 9; |
31 |
+ |
32 |
+pub const EVP_PKEY_OP_TYPE_SIG: c_int = EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY |
33 |
+ | EVP_PKEY_OP_VERIFYRECOVER | EVP_PKEY_OP_SIGNCTX |
34 |
+ | EVP_PKEY_OP_VERIFYCTX; |
35 |
+ |
36 |
+pub const EVP_PKEY_OP_TYPE_CRYPT: c_int = EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT; |
37 |
+ |
38 |
pub const EVP_CTRL_GCM_SET_IVLEN: c_int = 0x9; |
39 |
pub const EVP_CTRL_GCM_GET_TAG: c_int = 0x10; |
40 |
pub const EVP_CTRL_GCM_SET_TAG: c_int = 0x11; |
41 |
@@ -1200,9 +1221,16 @@ pub const RSA_SSLV23_PADDING: c_int = 2; |
42 |
pub const RSA_NO_PADDING: c_int = 3; |
43 |
pub const RSA_PKCS1_OAEP_PADDING: c_int = 4; |
44 |
pub const RSA_X931_PADDING: c_int = 5; |
45 |
+pub const RSA_PKCS1_PSS_PADDING: c_int = 6; |
46 |
|
47 |
pub const SHA_LBLOCK: c_int = 16; |
48 |
|
49 |
+pub const SSL3_AD_ILLEGAL_PARAMETER: c_int = 47; |
50 |
+pub const SSL_AD_ILLEGAL_PARAMETER: c_int = SSL3_AD_ILLEGAL_PARAMETER; |
51 |
+ |
52 |
+pub const TLS1_AD_DECODE_ERROR: c_int = 50; |
53 |
+pub const SSL_AD_DECODE_ERROR: c_int = TLS1_AD_DECODE_ERROR; |
54 |
+ |
55 |
pub const TLS1_AD_UNRECOGNIZED_NAME: c_int = 112; |
56 |
pub const SSL_AD_UNRECOGNIZED_NAME: c_int = TLS1_AD_UNRECOGNIZED_NAME; |
57 |
|
58 |
@@ -1249,14 +1277,14 @@ pub const SSL_VERIFY_NONE: c_int = 0; |
59 |
pub const SSL_VERIFY_PEER: c_int = 1; |
60 |
pub const SSL_VERIFY_FAIL_IF_NO_PEER_CERT: c_int = 2; |
61 |
|
62 |
-#[cfg(not(any(libressl261, libressl262, libressl26x, ossl101)))] |
63 |
+#[cfg(not(any(libressl261, libressl262, libressl26x, libressl27, ossl101)))] |
64 |
pub const SSL_OP_TLSEXT_PADDING: c_ulong = 0x00000010; |
65 |
-#[cfg(any(libressl261, libressl262, libressl26x))] |
66 |
+#[cfg(any(libressl261, libressl262, libressl26x, libressl27))] |
67 |
pub const SSL_OP_TLSEXT_PADDING: c_ulong = 0x0; |
68 |
pub const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: c_ulong = 0x00000800; |
69 |
-#[cfg(not(any(libressl261, libressl262, libressl26x)))] |
70 |
+#[cfg(not(any(libressl261, libressl262, libressl26x, libressl27)))] |
71 |
pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG: c_ulong = 0x80000000; |
72 |
-#[cfg(any(libressl261, libressl262, libressl26x))] |
73 |
+#[cfg(any(libressl261, libressl262, libressl26x, libressl27))] |
74 |
pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG: c_ulong = 0x0; |
75 |
pub const SSL_OP_LEGACY_SERVER_CONNECT: c_ulong = 0x00000004; |
76 |
#[cfg(not(libressl))] |
77 |
@@ -1477,6 +1505,28 @@ pub unsafe fn EVP_PKEY_CTX_get_rsa_padding(ctx: *mut E |
78 |
) |
79 |
} |
80 |
|
81 |
+pub unsafe fn EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx: *mut EVP_PKEY_CTX, len: c_int) -> c_int { |
82 |
+ EVP_PKEY_CTX_ctrl( |
83 |
+ ctx, |
84 |
+ EVP_PKEY_RSA, |
85 |
+ EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY, |
86 |
+ EVP_PKEY_CTRL_RSA_PSS_SALTLEN, |
87 |
+ len, |
88 |
+ ptr::null_mut(), |
89 |
+ ) |
90 |
+} |
91 |
+ |
92 |
+pub unsafe fn EVP_PKEY_CTX_set_rsa_mgf1_md(ctx: *mut EVP_PKEY_CTX, md: *mut EVP_MD) -> c_int { |
93 |
+ EVP_PKEY_CTX_ctrl( |
94 |
+ ctx, |
95 |
+ EVP_PKEY_RSA, |
96 |
+ EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, |
97 |
+ EVP_PKEY_CTRL_RSA_MGF1_MD, |
98 |
+ 0, |
99 |
+ md as *mut c_void, |
100 |
+ ) |
101 |
+} |
102 |
+ |
103 |
pub unsafe fn SSL_CTX_set_mode(ctx: *mut SSL_CTX, op: c_long) -> c_long { |
104 |
SSL_CTX_ctrl(ctx, SSL_CTRL_MODE, op, ptr::null_mut()) |
105 |
} |
106 |
@@ -1605,6 +1655,7 @@ extern "C" { |
107 |
|
108 |
pub fn ASN1_INTEGER_get(dest: *const ASN1_INTEGER) -> c_long; |
109 |
pub fn ASN1_INTEGER_set(dest: *mut ASN1_INTEGER, value: c_long) -> c_int; |
110 |
+ pub fn ASN1_INTEGER_to_BN(ai: *const ASN1_INTEGER, bn: *mut BIGNUM) -> *mut BIGNUM; |
111 |
pub fn ASN1_GENERALIZEDTIME_free(tm: *mut ASN1_GENERALIZEDTIME); |
112 |
pub fn ASN1_GENERALIZEDTIME_print(b: *mut BIO, tm: *const ASN1_GENERALIZEDTIME) -> c_int; |
113 |
pub fn ASN1_STRING_type_new(ty: c_int) -> *mut ASN1_STRING; |
114 |
@@ -1876,6 +1927,20 @@ extern "C" { |
115 |
ctx: *mut BN_CTX, |
116 |
) -> c_int; |
117 |
|
118 |
+ pub fn ECDSA_SIG_new() -> *mut ECDSA_SIG; |
119 |
+ pub fn ECDSA_SIG_free(sig: *mut ECDSA_SIG); |
120 |
+ pub fn ECDSA_do_verify( |
121 |
+ dgst: *const c_uchar, |
122 |
+ dgst_len: c_int, |
123 |
+ sig: *const ECDSA_SIG, |
124 |
+ eckey: *mut EC_KEY, |
125 |
+ ) -> c_int; |
126 |
+ pub fn ECDSA_do_sign( |
127 |
+ dgst: *const c_uchar, |
128 |
+ dgst_len: c_int, |
129 |
+ eckey: *mut EC_KEY, |
130 |
+ ) -> *mut ECDSA_SIG; |
131 |
+ |
132 |
pub fn ERR_peek_last_error() -> c_ulong; |
133 |
pub fn ERR_get_error() -> c_ulong; |
134 |
pub fn ERR_get_error_line_data( |
135 |
@@ -1904,6 +1969,7 @@ extern "C" { |
136 |
pub fn EVP_aes_128_xts() -> *const EVP_CIPHER; |
137 |
pub fn EVP_aes_128_ctr() -> *const EVP_CIPHER; |
138 |
pub fn EVP_aes_128_gcm() -> *const EVP_CIPHER; |
139 |
+ pub fn EVP_aes_128_ccm() -> *const EVP_CIPHER; |
140 |
pub fn EVP_aes_128_cfb1() -> *const EVP_CIPHER; |
141 |
pub fn EVP_aes_128_cfb128() -> *const EVP_CIPHER; |
142 |
pub fn EVP_aes_128_cfb8() -> *const EVP_CIPHER; |
143 |
@@ -1912,6 +1978,7 @@ extern "C" { |
144 |
pub fn EVP_aes_256_xts() -> *const EVP_CIPHER; |
145 |
pub fn EVP_aes_256_ctr() -> *const EVP_CIPHER; |
146 |
pub fn EVP_aes_256_gcm() -> *const EVP_CIPHER; |
147 |
+ pub fn EVP_aes_256_ccm() -> *const EVP_CIPHER; |
148 |
pub fn EVP_aes_256_cfb1() -> *const EVP_CIPHER; |
149 |
pub fn EVP_aes_256_cfb128() -> *const EVP_CIPHER; |
150 |
pub fn EVP_aes_256_cfb8() -> *const EVP_CIPHER; |
151 |
@@ -2023,6 +2090,7 @@ extern "C" { |
152 |
pub fn EVP_PKEY_get1_DH(k: *mut EVP_PKEY) -> *mut DH; |
153 |
pub fn EVP_PKEY_get1_EC_KEY(k: *mut EVP_PKEY) -> *mut EC_KEY; |
154 |
pub fn EVP_PKEY_cmp(a: *const EVP_PKEY, b: *const EVP_PKEY) -> c_int; |
155 |
+ pub fn EVP_PKEY_id(pkey: *const EVP_PKEY) -> c_int; |
156 |
pub fn EVP_PKEY_new_mac_key( |
157 |
type_: c_int, |
158 |
e: *mut ENGINE, |
159 |
@@ -2040,6 +2108,7 @@ extern "C" { |
160 |
) -> *mut EVP_PKEY; |
161 |
|
162 |
pub fn EVP_PKEY_CTX_new(k: *mut EVP_PKEY, e: *mut ENGINE) -> *mut EVP_PKEY_CTX; |
163 |
+ pub fn EVP_PKEY_CTX_new_id(id: c_int, e: *mut ENGINE) -> *mut EVP_PKEY_CTX; |
164 |
pub fn EVP_PKEY_CTX_free(ctx: *mut EVP_PKEY_CTX); |
165 |
pub fn EVP_PKEY_CTX_ctrl( |
166 |
ctx: *mut EVP_PKEY_CTX, |
167 |
@@ -2050,6 +2119,9 @@ extern "C" { |
168 |
p2: *mut c_void, |
169 |
) -> c_int; |
170 |
|
171 |
+ pub fn EVP_PKEY_keygen_init(ctx: *mut EVP_PKEY_CTX) -> c_int; |
172 |
+ pub fn EVP_PKEY_keygen(ctx: *mut EVP_PKEY_CTX, key: *mut *mut EVP_PKEY) -> c_int; |
173 |
+ |
174 |
pub fn HMAC_CTX_copy(dst: *mut HMAC_CTX, src: *mut HMAC_CTX) -> c_int; |
175 |
|
176 |
pub fn OBJ_obj2nid(o: *const ASN1_OBJECT) -> c_int; |
177 |
@@ -2059,6 +2131,7 @@ extern "C" { |
178 |
a: *const ASN1_OBJECT, |
179 |
no_name: c_int, |
180 |
) -> c_int; |
181 |
+ pub fn OBJ_nid2sn(nid: c_int) -> *const c_char; |
182 |
|
183 |
pub fn OCSP_BASICRESP_new() -> *mut OCSP_BASICRESP; |
184 |
pub fn OCSP_BASICRESP_free(r: *mut OCSP_BASICRESP); |
185 |
@@ -2605,6 +2678,7 @@ extern "C" { |
186 |
pub fn X509_sign(x: *mut X509, pkey: *mut EVP_PKEY, md: *const EVP_MD) -> c_int; |
187 |
pub fn X509_get_pubkey(x: *mut X509) -> *mut EVP_PKEY; |
188 |
pub fn X509_to_X509_REQ(x: *mut X509, pkey: *mut EVP_PKEY, md: *const EVP_MD) -> *mut X509_REQ; |
189 |
+ pub fn X509_verify_cert(ctx: *mut X509_STORE_CTX) -> c_int; |
190 |
pub fn X509_verify_cert_error_string(n: c_long) -> *const c_char; |
191 |
pub fn X509_get1_ocsp(x: *mut X509) -> *mut stack_st_OPENSSL_STRING; |
192 |
pub fn X509_check_issued(issuer: *mut X509, subject: *mut X509) -> c_int; |
193 |
@@ -2638,6 +2712,14 @@ extern "C" { |
194 |
pub fn X509_STORE_add_cert(store: *mut X509_STORE, x: *mut X509) -> c_int; |
195 |
pub fn X509_STORE_set_default_paths(store: *mut X509_STORE) -> c_int; |
196 |
|
197 |
+ pub fn X509_STORE_CTX_new() -> *mut X509_STORE_CTX; |
198 |
+ pub fn X509_STORE_CTX_cleanup(ctx: *mut X509_STORE_CTX); |
199 |
+ pub fn X509_STORE_CTX_init( |
200 |
+ ctx: *mut X509_STORE_CTX, |
201 |
+ store: *mut X509_STORE, |
202 |
+ x509: *mut X509, |
203 |
+ chain: *mut stack_st_X509, |
204 |
+ ) -> c_int; |
205 |
pub fn X509_STORE_CTX_free(ctx: *mut X509_STORE_CTX); |
206 |
pub fn X509_STORE_CTX_get_current_cert(ctx: *mut X509_STORE_CTX) -> *mut X509; |
207 |
pub fn X509_STORE_CTX_get_error(ctx: *mut X509_STORE_CTX) -> c_int; |
208 |
@@ -2772,30 +2854,25 @@ extern "C" { |
209 |
|
210 |
pub fn SSL_CTX_set_cookie_generate_cb( |
211 |
s: *mut SSL_CTX, |
212 |
- cb: Option<extern "C" fn( |
213 |
- ssl: *mut SSL, |
214 |
- cookie: *mut c_uchar, |
215 |
- cookie_len: *mut c_uint |
216 |
- ) -> c_int> |
217 |
+ cb: Option< |
218 |
+ extern "C" fn(ssl: *mut SSL, cookie: *mut c_uchar, cookie_len: *mut c_uint) -> c_int, |
219 |
+ >, |
220 |
); |
221 |
|
222 |
#[cfg(ossl110)] |
223 |
pub fn SSL_CTX_set_cookie_verify_cb( |
224 |
s: *mut SSL_CTX, |
225 |
- cb: Option<extern "C" fn( |
226 |
- ssl: *mut SSL, |
227 |
- cookie: *const c_uchar, |
228 |
- cookie_len: c_uint |
229 |
- ) -> c_int> |
230 |
+ cb: Option< |
231 |
+ extern "C" fn(ssl: *mut SSL, cookie: *const c_uchar, cookie_len: c_uint) -> c_int, |
232 |
+ >, |
233 |
); |
234 |
|
235 |
#[cfg(not(ossl110))] |
236 |
pub fn SSL_CTX_set_cookie_verify_cb( |
237 |
s: *mut SSL_CTX, |
238 |
- cb: Option<extern "C" fn( |
239 |
- ssl: *mut SSL, |
240 |
- cookie: *mut c_uchar, |
241 |
- cookie_len: c_uint |
242 |
- ) -> c_int> |
243 |
+ cb: Option<extern "C" fn(ssl: *mut SSL, cookie: *mut c_uchar, cookie_len: c_uint) -> c_int>, |
244 |
); |
245 |
+ |
246 |
+ pub fn EVP_MD_size(md: *const EVP_MD) -> c_int; |
247 |
+ pub fn EVP_get_cipherbyname(name: *const c_char) -> *const EVP_CIPHER; |
248 |
} |