Added
Link Here
|
1 |
https://github.com/sfackler/rust-openssl/commit/276577553501 |
2 |
|
3 |
--- cargo-crates/openssl-0.9.24/Cargo.toml.orig 1970-01-01 00:00:00 UTC |
4 |
+++ cargo-crates/openssl-0.9.24/Cargo.toml |
5 |
@@ -56,3 +56,4 @@ version = "0.2" |
6 |
v101 = [] |
7 |
v102 = [] |
8 |
v110 = [] |
9 |
+v111 = ["v110"] |
10 |
--- cargo-crates/openssl-0.9.24/build.rs.orig 2018-02-12 17:30:05 UTC |
11 |
+++ cargo-crates/openssl-0.9.24/build.rs |
12 |
@@ -13,6 +13,10 @@ fn main() { |
13 |
Ok(ref v) if v == "110" => { |
14 |
println!("cargo:rustc-cfg=ossl110"); |
15 |
} |
16 |
+ Ok(ref v) if v == "111" => { |
17 |
+ println!("cargo:rustc-cfg=ossl110"); |
18 |
+ println!("cargo:rustc-cfg=ossl111"); |
19 |
+ } |
20 |
_ => panic!("Unable to detect OpenSSL version"), |
21 |
} |
22 |
|
23 |
--- cargo-crates/openssl-0.9.24/src/dh.rs.orig 2018-02-12 19:02:00 UTC |
24 |
+++ cargo-crates/openssl-0.9.24/src/dh.rs |
25 |
@@ -39,7 +39,7 @@ impl Dh { |
26 |
from_pem!(Dh, ffi::PEM_read_bio_DHparams); |
27 |
from_der!(Dh, ffi::d2i_DHparams); |
28 |
|
29 |
- /// Requires the `v102` or `v110` features and OpenSSL 1.0.2 or OpenSSL 1.1.0. |
30 |
+ /// Requires OpenSSL 1.0.2, 1.1.0, or 1.1.1 and the corresponding Cargo feature. |
31 |
#[cfg(any(all(feature = "v102", ossl102), all(feature = "v110", ossl110)))] |
32 |
pub fn get_1024_160() -> Result<Dh, ErrorStack> { |
33 |
unsafe { |
34 |
@@ -48,7 +48,7 @@ impl Dh { |
35 |
} |
36 |
} |
37 |
|
38 |
- /// Requires the `v102` or `v110` features and OpenSSL 1.0.2 or OpenSSL 1.1.0. |
39 |
+ /// Requires OpenSSL 1.0.2, 1.1.0, or 1.1.1 and the corresponding Cargo feature. |
40 |
#[cfg(any(all(feature = "v102", ossl102), all(feature = "v110", ossl110)))] |
41 |
pub fn get_2048_224() -> Result<Dh, ErrorStack> { |
42 |
unsafe { |
43 |
@@ -57,7 +57,7 @@ impl Dh { |
44 |
} |
45 |
} |
46 |
|
47 |
- /// Requires the `v102` or `v110` features and OpenSSL 1.0.2 or OpenSSL 1.1.0. |
48 |
+ /// Requires OpenSSL 1.0.2, 1.1.0, or 1.1.1 and the corresponding Cargo feature. |
49 |
#[cfg(any(all(feature = "v102", ossl102), all(feature = "v110", ossl110)))] |
50 |
pub fn get_2048_256() -> Result<Dh, ErrorStack> { |
51 |
unsafe { |
52 |
--- cargo-crates/openssl-0.9.24/src/pkcs5.rs.orig 2018-02-12 19:02:00 UTC |
53 |
+++ cargo-crates/openssl-0.9.24/src/pkcs5.rs |
54 |
@@ -59,9 +59,9 @@ pub fn bytes_to_key( |
55 |
))?; |
56 |
|
57 |
let mut key = vec![0; len as usize]; |
58 |
- let iv_ptr = iv.as_mut().map(|v| v.as_mut_ptr()).unwrap_or( |
59 |
- ptr::null_mut(), |
60 |
- ); |
61 |
+ let iv_ptr = iv.as_mut() |
62 |
+ .map(|v| v.as_mut_ptr()) |
63 |
+ .unwrap_or(ptr::null_mut()); |
64 |
|
65 |
cvt(ffi::EVP_BytesToKey( |
66 |
cipher, |
67 |
@@ -107,7 +107,7 @@ pub fn pbkdf2_hmac( |
68 |
|
69 |
/// Derives a key from a password and salt using the scrypt algorithm. |
70 |
/// |
71 |
-/// Requires the `v110` feature and OpenSSL 1.1.0. |
72 |
+/// Requires OpenSSL 1.1.0 or 1.1.1 and the corresponding Cargo feature. |
73 |
#[cfg(all(feature = "v110", ossl110))] |
74 |
pub fn scrypt( |
75 |
pass: &[u8], |
76 |
@@ -150,24 +150,9 @@ mod tests { |
77 |
assert_eq!( |
78 |
buf, |
79 |
&[ |
80 |
- 0x55_u8, |
81 |
- 0xac_u8, |
82 |
- 0x04_u8, |
83 |
- 0x6e_u8, |
84 |
- 0x56_u8, |
85 |
- 0xe3_u8, |
86 |
- 0x08_u8, |
87 |
- 0x9f_u8, |
88 |
- 0xec_u8, |
89 |
- 0x16_u8, |
90 |
- 0x91_u8, |
91 |
- 0xc2_u8, |
92 |
- 0x25_u8, |
93 |
- 0x44_u8, |
94 |
- 0xb6_u8, |
95 |
- 0x05_u8, |
96 |
- ] |
97 |
- [..] |
98 |
+ 0x55_u8, 0xac_u8, 0x04_u8, 0x6e_u8, 0x56_u8, 0xe3_u8, 0x08_u8, 0x9f_u8, 0xec_u8, |
99 |
+ 0x16_u8, 0x91_u8, 0xc2_u8, 0x25_u8, 0x44_u8, 0xb6_u8, 0x05_u8, |
100 |
+ ][..] |
101 |
); |
102 |
|
103 |
super::pbkdf2_hmac( |
104 |
@@ -180,24 +165,9 @@ mod tests { |
105 |
assert_eq!( |
106 |
buf, |
107 |
&[ |
108 |
- 0x4d_u8, |
109 |
- 0xdc_u8, |
110 |
- 0xd8_u8, |
111 |
- 0xf6_u8, |
112 |
- 0x0b_u8, |
113 |
- 0x98_u8, |
114 |
- 0xbe_u8, |
115 |
- 0x21_u8, |
116 |
- 0x83_u8, |
117 |
- 0x0c_u8, |
118 |
- 0xee_u8, |
119 |
- 0x5e_u8, |
120 |
- 0xf2_u8, |
121 |
- 0x27_u8, |
122 |
- 0x01_u8, |
123 |
- 0xf9_u8, |
124 |
- ] |
125 |
- [..] |
126 |
+ 0x4d_u8, 0xdc_u8, 0xd8_u8, 0xf6_u8, 0x0b_u8, 0x98_u8, 0xbe_u8, 0x21_u8, 0x83_u8, |
127 |
+ 0x0c_u8, 0xee_u8, 0x5e_u8, 0xf2_u8, 0x27_u8, 0x01_u8, 0xf9_u8, |
128 |
+ ][..] |
129 |
); |
130 |
} |
131 |
|
132 |
@@ -211,72 +181,15 @@ mod tests { |
133 |
assert_eq!( |
134 |
&buf[..], |
135 |
&[ |
136 |
- 0x73_u8, |
137 |
- 0xde_u8, |
138 |
- 0xcf_u8, |
139 |
- 0xa5_u8, |
140 |
- 0x8a_u8, |
141 |
- 0xa2_u8, |
142 |
- 0xe8_u8, |
143 |
- 0x4f_u8, |
144 |
- 0x94_u8, |
145 |
- 0x77_u8, |
146 |
- 0x1a_u8, |
147 |
- 0x75_u8, |
148 |
- 0x73_u8, |
149 |
- 0x6b_u8, |
150 |
- 0xb8_u8, |
151 |
- 0x8b_u8, |
152 |
- 0xd3_u8, |
153 |
- 0xc7_u8, |
154 |
- 0xb3_u8, |
155 |
- 0x82_u8, |
156 |
- 0x70_u8, |
157 |
- 0xcf_u8, |
158 |
- 0xb5_u8, |
159 |
- 0x0c_u8, |
160 |
- 0xb3_u8, |
161 |
- 0x90_u8, |
162 |
- 0xed_u8, |
163 |
- 0x78_u8, |
164 |
- 0xb3_u8, |
165 |
- 0x05_u8, |
166 |
- 0x65_u8, |
167 |
- 0x6a_u8, |
168 |
- 0xf8_u8, |
169 |
- 0x14_u8, |
170 |
- 0x8e_u8, |
171 |
- 0x52_u8, |
172 |
- 0x45_u8, |
173 |
- 0x2b_u8, |
174 |
- 0x22_u8, |
175 |
- 0x16_u8, |
176 |
- 0xb2_u8, |
177 |
- 0xb8_u8, |
178 |
- 0x09_u8, |
179 |
- 0x8b_u8, |
180 |
- 0x76_u8, |
181 |
- 0x1f_u8, |
182 |
- 0xc6_u8, |
183 |
- 0x33_u8, |
184 |
- 0x60_u8, |
185 |
- 0x60_u8, |
186 |
- 0xa0_u8, |
187 |
- 0x9f_u8, |
188 |
- 0x76_u8, |
189 |
- 0x41_u8, |
190 |
- 0x5e_u8, |
191 |
- 0x9f_u8, |
192 |
- 0x71_u8, |
193 |
- 0xea_u8, |
194 |
- 0x47_u8, |
195 |
- 0xf9_u8, |
196 |
- 0xe9_u8, |
197 |
+ 0x73_u8, 0xde_u8, 0xcf_u8, 0xa5_u8, 0x8a_u8, 0xa2_u8, 0xe8_u8, 0x4f_u8, 0x94_u8, |
198 |
+ 0x77_u8, 0x1a_u8, 0x75_u8, 0x73_u8, 0x6b_u8, 0xb8_u8, 0x8b_u8, 0xd3_u8, 0xc7_u8, |
199 |
+ 0xb3_u8, 0x82_u8, 0x70_u8, 0xcf_u8, 0xb5_u8, 0x0c_u8, 0xb3_u8, 0x90_u8, 0xed_u8, |
200 |
+ 0x78_u8, 0xb3_u8, 0x05_u8, 0x65_u8, 0x6a_u8, 0xf8_u8, 0x14_u8, 0x8e_u8, 0x52_u8, |
201 |
+ 0x45_u8, 0x2b_u8, 0x22_u8, 0x16_u8, 0xb2_u8, 0xb8_u8, 0x09_u8, 0x8b_u8, 0x76_u8, |
202 |
+ 0x1f_u8, 0xc6_u8, 0x33_u8, 0x60_u8, 0x60_u8, 0xa0_u8, 0x9f_u8, 0x76_u8, 0x41_u8, |
203 |
+ 0x5e_u8, 0x9f_u8, 0x71_u8, 0xea_u8, 0x47_u8, 0xf9_u8, 0xe9_u8, 0x06_u8, 0x43_u8, |
204 |
0x06_u8, |
205 |
- 0x43_u8, |
206 |
- 0x06_u8, |
207 |
- ] |
208 |
- [..] |
209 |
+ ][..] |
210 |
); |
211 |
|
212 |
super::pbkdf2_hmac( |
213 |
@@ -289,72 +202,15 @@ mod tests { |
214 |
assert_eq!( |
215 |
&buf[..], |
216 |
&[ |
217 |
- 0x71_u8, |
218 |
- 0xa0_u8, |
219 |
- 0xec_u8, |
220 |
- 0x84_u8, |
221 |
- 0x2a_u8, |
222 |
- 0xbd_u8, |
223 |
- 0x5c_u8, |
224 |
- 0x67_u8, |
225 |
- 0x8b_u8, |
226 |
- 0xcf_u8, |
227 |
- 0xd1_u8, |
228 |
- 0x45_u8, |
229 |
- 0xf0_u8, |
230 |
- 0x9d_u8, |
231 |
- 0x83_u8, |
232 |
- 0x52_u8, |
233 |
- 0x2f_u8, |
234 |
- 0x93_u8, |
235 |
- 0x36_u8, |
236 |
- 0x15_u8, |
237 |
- 0x60_u8, |
238 |
- 0x56_u8, |
239 |
- 0x3c_u8, |
240 |
- 0x4d_u8, |
241 |
- 0x0d_u8, |
242 |
- 0x63_u8, |
243 |
- 0xb8_u8, |
244 |
- 0x83_u8, |
245 |
- 0x29_u8, |
246 |
- 0x87_u8, |
247 |
- 0x10_u8, |
248 |
- 0x90_u8, |
249 |
- 0xe7_u8, |
250 |
- 0x66_u8, |
251 |
- 0x04_u8, |
252 |
- 0xa4_u8, |
253 |
- 0x9a_u8, |
254 |
- 0xf0_u8, |
255 |
- 0x8f_u8, |
256 |
- 0xe7_u8, |
257 |
- 0xc9_u8, |
258 |
- 0xf5_u8, |
259 |
- 0x71_u8, |
260 |
- 0x56_u8, |
261 |
- 0xc8_u8, |
262 |
- 0x79_u8, |
263 |
- 0x09_u8, |
264 |
- 0x96_u8, |
265 |
- 0xb2_u8, |
266 |
- 0x0f_u8, |
267 |
- 0x06_u8, |
268 |
- 0xbc_u8, |
269 |
- 0x53_u8, |
270 |
- 0x5e_u8, |
271 |
- 0x5a_u8, |
272 |
- 0xb5_u8, |
273 |
- 0x44_u8, |
274 |
- 0x0d_u8, |
275 |
- 0xf7_u8, |
276 |
- 0xe8_u8, |
277 |
- 0x78_u8, |
278 |
- 0x29_u8, |
279 |
- 0x6f_u8, |
280 |
+ 0x71_u8, 0xa0_u8, 0xec_u8, 0x84_u8, 0x2a_u8, 0xbd_u8, 0x5c_u8, 0x67_u8, 0x8b_u8, |
281 |
+ 0xcf_u8, 0xd1_u8, 0x45_u8, 0xf0_u8, 0x9d_u8, 0x83_u8, 0x52_u8, 0x2f_u8, 0x93_u8, |
282 |
+ 0x36_u8, 0x15_u8, 0x60_u8, 0x56_u8, 0x3c_u8, 0x4d_u8, 0x0d_u8, 0x63_u8, 0xb8_u8, |
283 |
+ 0x83_u8, 0x29_u8, 0x87_u8, 0x10_u8, 0x90_u8, 0xe7_u8, 0x66_u8, 0x04_u8, 0xa4_u8, |
284 |
+ 0x9a_u8, 0xf0_u8, 0x8f_u8, 0xe7_u8, 0xc9_u8, 0xf5_u8, 0x71_u8, 0x56_u8, 0xc8_u8, |
285 |
+ 0x79_u8, 0x09_u8, 0x96_u8, 0xb2_u8, 0x0f_u8, 0x06_u8, 0xbc_u8, 0x53_u8, 0x5e_u8, |
286 |
+ 0x5a_u8, 0xb5_u8, 0x44_u8, 0x0d_u8, 0xf7_u8, 0xe8_u8, 0x78_u8, 0x29_u8, 0x6f_u8, |
287 |
0xa7_u8, |
288 |
- ] |
289 |
- [..] |
290 |
+ ][..] |
291 |
); |
292 |
|
293 |
super::pbkdf2_hmac( |
294 |
@@ -367,72 +223,15 @@ mod tests { |
295 |
assert_eq!( |
296 |
&buf[..], |
297 |
&[ |
298 |
- 0x01_u8, |
299 |
- 0x68_u8, |
300 |
- 0x71_u8, |
301 |
- 0xa4_u8, |
302 |
- 0xc4_u8, |
303 |
- 0xb7_u8, |
304 |
- 0x5f_u8, |
305 |
- 0x96_u8, |
306 |
- 0x85_u8, |
307 |
- 0x7f_u8, |
308 |
- 0xd2_u8, |
309 |
- 0xb9_u8, |
310 |
- 0xf8_u8, |
311 |
- 0xca_u8, |
312 |
- 0x28_u8, |
313 |
- 0x02_u8, |
314 |
- 0x3b_u8, |
315 |
- 0x30_u8, |
316 |
- 0xee_u8, |
317 |
- 0x2a_u8, |
318 |
+ 0x01_u8, 0x68_u8, 0x71_u8, 0xa4_u8, 0xc4_u8, 0xb7_u8, 0x5f_u8, 0x96_u8, 0x85_u8, |
319 |
+ 0x7f_u8, 0xd2_u8, 0xb9_u8, 0xf8_u8, 0xca_u8, 0x28_u8, 0x02_u8, 0x3b_u8, 0x30_u8, |
320 |
+ 0xee_u8, 0x2a_u8, 0x39_u8, 0xf5_u8, 0xad_u8, 0xca_u8, 0xc8_u8, 0xc9_u8, 0x37_u8, |
321 |
+ 0x5f_u8, 0x9b_u8, 0xda_u8, 0x1c_u8, 0xcd_u8, 0x1b_u8, 0x6f_u8, 0x0b_u8, 0x2f_u8, |
322 |
+ 0xc3_u8, 0xad_u8, 0xda_u8, 0x50_u8, 0x54_u8, 0x12_u8, 0xe7_u8, 0x9d_u8, 0x89_u8, |
323 |
+ 0x00_u8, 0x56_u8, 0xc6_u8, 0x2e_u8, 0x52_u8, 0x4c_u8, 0x7d_u8, 0x51_u8, 0x15_u8, |
324 |
+ 0x4b_u8, 0x1a_u8, 0x85_u8, 0x34_u8, 0x57_u8, 0x5b_u8, 0xd0_u8, 0x2d_u8, 0xee_u8, |
325 |
0x39_u8, |
326 |
- 0xf5_u8, |
327 |
- 0xad_u8, |
328 |
- 0xca_u8, |
329 |
- 0xc8_u8, |
330 |
- 0xc9_u8, |
331 |
- 0x37_u8, |
332 |
- 0x5f_u8, |
333 |
- 0x9b_u8, |
334 |
- 0xda_u8, |
335 |
- 0x1c_u8, |
336 |
- 0xcd_u8, |
337 |
- 0x1b_u8, |
338 |
- 0x6f_u8, |
339 |
- 0x0b_u8, |
340 |
- 0x2f_u8, |
341 |
- 0xc3_u8, |
342 |
- 0xad_u8, |
343 |
- 0xda_u8, |
344 |
- 0x50_u8, |
345 |
- 0x54_u8, |
346 |
- 0x12_u8, |
347 |
- 0xe7_u8, |
348 |
- 0x9d_u8, |
349 |
- 0x89_u8, |
350 |
- 0x00_u8, |
351 |
- 0x56_u8, |
352 |
- 0xc6_u8, |
353 |
- 0x2e_u8, |
354 |
- 0x52_u8, |
355 |
- 0x4c_u8, |
356 |
- 0x7d_u8, |
357 |
- 0x51_u8, |
358 |
- 0x15_u8, |
359 |
- 0x4b_u8, |
360 |
- 0x1a_u8, |
361 |
- 0x85_u8, |
362 |
- 0x34_u8, |
363 |
- 0x57_u8, |
364 |
- 0x5b_u8, |
365 |
- 0xd0_u8, |
366 |
- 0x2d_u8, |
367 |
- 0xee_u8, |
368 |
- 0x39_u8, |
369 |
- ] |
370 |
- [..] |
371 |
+ ][..] |
372 |
); |
373 |
} |
374 |
|
375 |
@@ -441,93 +240,19 @@ mod tests { |
376 |
let salt = [16_u8, 34_u8, 19_u8, 23_u8, 141_u8, 4_u8, 207_u8, 221_u8]; |
377 |
|
378 |
let data = [ |
379 |
- 143_u8, |
380 |
- 210_u8, |
381 |
- 75_u8, |
382 |
- 63_u8, |
383 |
- 214_u8, |
384 |
- 179_u8, |
385 |
- 155_u8, |
386 |
- 241_u8, |
387 |
- 242_u8, |
388 |
- 31_u8, |
389 |
- 154_u8, |
390 |
- 56_u8, |
391 |
- 198_u8, |
392 |
- 145_u8, |
393 |
- 192_u8, |
394 |
- 64_u8, |
395 |
- 2_u8, |
396 |
- 245_u8, |
397 |
- 167_u8, |
398 |
- 220_u8, |
399 |
- 55_u8, |
400 |
- 119_u8, |
401 |
- 233_u8, |
402 |
- 136_u8, |
403 |
- 139_u8, |
404 |
- 27_u8, |
405 |
- 71_u8, |
406 |
- 242_u8, |
407 |
- 119_u8, |
408 |
- 175_u8, |
409 |
- 65_u8, |
410 |
- 207_u8, |
411 |
+ 143_u8, 210_u8, 75_u8, 63_u8, 214_u8, 179_u8, 155_u8, 241_u8, 242_u8, 31_u8, 154_u8, |
412 |
+ 56_u8, 198_u8, 145_u8, 192_u8, 64_u8, 2_u8, 245_u8, 167_u8, 220_u8, 55_u8, 119_u8, |
413 |
+ 233_u8, 136_u8, 139_u8, 27_u8, 71_u8, 242_u8, 119_u8, 175_u8, 65_u8, 207_u8, |
414 |
]; |
415 |
|
416 |
- |
417 |
- |
418 |
let expected_key = vec![ |
419 |
- 249_u8, |
420 |
- 115_u8, |
421 |
- 114_u8, |
422 |
- 97_u8, |
423 |
- 32_u8, |
424 |
- 213_u8, |
425 |
- 165_u8, |
426 |
- 146_u8, |
427 |
- 58_u8, |
428 |
- 87_u8, |
429 |
- 234_u8, |
430 |
- 3_u8, |
431 |
- 43_u8, |
432 |
- 250_u8, |
433 |
- 97_u8, |
434 |
- 114_u8, |
435 |
- 26_u8, |
436 |
- 98_u8, |
437 |
- 245_u8, |
438 |
- 246_u8, |
439 |
- 238_u8, |
440 |
- 177_u8, |
441 |
- 229_u8, |
442 |
- 161_u8, |
443 |
- 183_u8, |
444 |
- 224_u8, |
445 |
- 174_u8, |
446 |
- 3_u8, |
447 |
- 6_u8, |
448 |
- 244_u8, |
449 |
- 236_u8, |
450 |
- 255_u8, |
451 |
+ 249_u8, 115_u8, 114_u8, 97_u8, 32_u8, 213_u8, 165_u8, 146_u8, 58_u8, 87_u8, 234_u8, |
452 |
+ 3_u8, 43_u8, 250_u8, 97_u8, 114_u8, 26_u8, 98_u8, 245_u8, 246_u8, 238_u8, 177_u8, |
453 |
+ 229_u8, 161_u8, 183_u8, 224_u8, 174_u8, 3_u8, 6_u8, 244_u8, 236_u8, 255_u8, |
454 |
]; |
455 |
let expected_iv = vec![ |
456 |
- 4_u8, |
457 |
- 223_u8, |
458 |
- 153_u8, |
459 |
- 219_u8, |
460 |
- 28_u8, |
461 |
- 142_u8, |
462 |
- 234_u8, |
463 |
- 68_u8, |
464 |
- 227_u8, |
465 |
- 69_u8, |
466 |
- 98_u8, |
467 |
- 107_u8, |
468 |
- 208_u8, |
469 |
- 14_u8, |
470 |
- 236_u8, |
471 |
- 60_u8, |
472 |
+ 4_u8, 223_u8, 153_u8, 219_u8, 28_u8, 142_u8, 234_u8, 68_u8, 227_u8, 69_u8, 98_u8, |
473 |
+ 107_u8, 208_u8, 14_u8, 236_u8, 60_u8, |
474 |
]; |
475 |
|
476 |
assert_eq!( |
477 |
@@ -552,8 +277,9 @@ mod tests { |
478 |
|
479 |
let pass = "pleaseletmein"; |
480 |
let salt = "SodiumChloride"; |
481 |
- let expected = "7023bdcb3afd7348461c06cd81fd38ebfda8fbba904f8e3ea9b543f6545da1f2d5432955613\ |
482 |
- f0fcf62d49705242a9af9e61e85dc0d651e40dfcf017b45575887"; |
483 |
+ let expected = |
484 |
+ "7023bdcb3afd7348461c06cd81fd38ebfda8fbba904f8e3ea9b543f6545da1f2d5432955613\ |
485 |
+ f0fcf62d49705242a9af9e61e85dc0d651e40dfcf017b45575887"; |
486 |
|
487 |
let mut actual = [0; 64]; |
488 |
super::scrypt( |
489 |
--- cargo-crates/openssl-0.9.24/src/ssl/connector.rs.orig 2018-02-12 19:02:00 UTC |
490 |
+++ cargo-crates/openssl-0.9.24/src/ssl/connector.rs |
491 |
@@ -3,6 +3,8 @@ use std::ops::{Deref, DerefMut}; |
492 |
|
493 |
use dh::Dh; |
494 |
use error::ErrorStack; |
495 |
+#[cfg(ossl111)] |
496 |
+use ssl::SslOption; |
497 |
use ssl::{self, HandshakeError, Ssl, SslRef, SslContext, SslContextBuilder, SslMethod, SslStream, |
498 |
SSL_VERIFY_PEER}; |
499 |
use pkey::PKeyRef; |
500 |
@@ -271,6 +273,12 @@ impl SslAcceptorBuilder { |
501 |
/// Like `mozilla_intermediate`, but does not load the certificate chain and private key. |
502 |
pub fn mozilla_intermediate_raw(method: SslMethod) -> Result<SslAcceptorBuilder, ErrorStack> { |
503 |
let mut ctx = ctx(method)?; |
504 |
+ #[cfg(ossl111)] |
505 |
+ { |
506 |
+ ctx.set_options(SslOption { |
507 |
+ bits: ::ffi::SSL_OP_NO_TLSv1_3, |
508 |
+ }); |
509 |
+ } |
510 |
let dh = Dh::from_pem(DHPARAM_PEM.as_bytes())?; |
511 |
ctx.set_tmp_dh(&dh)?; |
512 |
setup_curves(&mut ctx)?; |
513 |
@@ -292,6 +300,13 @@ impl SslAcceptorBuilder { |
514 |
/// Like `mozilla_modern`, but does not load the certificate chain and private key. |
515 |
pub fn mozilla_modern_raw(method: SslMethod) -> Result<SslAcceptorBuilder, ErrorStack> { |
516 |
let mut ctx = ctx(method)?; |
517 |
+ ctx.set_options(ssl::SSL_OP_NO_TLSV1 | ssl::SSL_OP_NO_TLSV1_1); |
518 |
+ #[cfg(ossl111)] |
519 |
+ { |
520 |
+ ctx.set_options(SslOption { |
521 |
+ bits: ::ffi::SSL_OP_NO_TLSv1_3, |
522 |
+ }); |
523 |
+ } |
524 |
setup_curves(&mut ctx)?; |
525 |
ctx.set_cipher_list( |
526 |
"ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:\ |
527 |
--- cargo-crates/openssl-0.9.24/src/ssl/mod.rs.orig 2018-02-12 19:02:00 UTC |
528 |
+++ cargo-crates/openssl-0.9.24/src/ssl/mod.rs |
529 |
@@ -211,14 +211,20 @@ bitflags! { |
530 |
/// Disables the use of TLSv1.2. |
531 |
const SSL_OP_NO_TLSV1_2 = ffi::SSL_OP_NO_TLSv1_2; |
532 |
|
533 |
+ /// Disables the use of TLSv1.3. |
534 |
+ /// |
535 |
+ /// Requires the `v111` feature and OpenSSL 1.1.1. |
536 |
+ #[cfg(all(feature = "v111", ossl111))] |
537 |
+ const NO_TLSV1_3 = ffi::SSL_OP_NO_TLSv1_3; |
538 |
+ |
539 |
/// Disables the use of DTLSv1.0 |
540 |
/// |
541 |
- /// Requires the `v102` or `v110` features and OpenSSL 1.0.2 or OpenSSL 1.1.0. |
542 |
+ /// Requires OpenSSL 1.0.2, 1.1.0, or 1.1.1 and the corresponding Cargo feature. |
543 |
#[cfg(any(all(feature = "v102", ossl102), all(feature = "v110", ossl110)))] |
544 |
const SSL_OP_NO_DTLSV1 = ffi::SSL_OP_NO_DTLSv1; |
545 |
|
546 |
/// Disables the use of DTLSv1.2. |
547 |
- /// Requires the `v102` or `v110` features and OpenSSL 1.0.2 or OpenSSL 1.1.0. |
548 |
+ /// Requires OpenSSL 1.0.2, 1.1.0, or 1.1.1 and the corresponding Cargo feature. |
549 |
#[cfg(any(all(feature = "v102", ossl102), all(feature = "v110", ossl110)))] |
550 |
const SSL_OP_NO_DTLSV1_2 = ffi::SSL_OP_NO_DTLSv1_2; |
551 |
|
552 |
@@ -226,7 +232,7 @@ bitflags! { |
553 |
/// |
554 |
/// This can be used as a mask when whitelisting protocol versions. |
555 |
/// |
556 |
- /// Requires the `v102` or `v110` features and OpenSSL 1.0.2 or OpenSSL 1.1.0. |
557 |
+ /// Requires OpenSSL 1.0.2, 1.1.0, or 1.1.1 and the corresponding Cargo feature. |
558 |
/// |
559 |
/// # Examples |
560 |
/// |
561 |
@@ -573,7 +579,7 @@ impl SslContextBuilder { |
562 |
|
563 |
/// Sets a custom certificate store for verifying peer certificates. |
564 |
/// |
565 |
- /// Requires the `v102` feature and OpenSSL 1.0.2, or the `v110` feature and OpenSSL 1.1.0. |
566 |
+ /// Requires OpenSSL 1.0.2, 1.1.0, or 1.1.1 and the corresponding Cargo feature. |
567 |
/// |
568 |
/// This corresponds to [`SSL_CTX_set0_verify_cert_store`]. |
569 |
/// |
570 |
@@ -582,8 +588,7 @@ impl SslContextBuilder { |
571 |
pub fn set_verify_cert_store(&mut self, cert_store: X509Store) -> Result<(), ErrorStack> { |
572 |
unsafe { |
573 |
let ptr = cert_store.as_ptr(); |
574 |
- cvt(ffi::SSL_CTX_set0_verify_cert_store(self.as_ptr(), ptr) |
575 |
- as c_int)?; |
576 |
+ cvt(ffi::SSL_CTX_set0_verify_cert_store(self.as_ptr(), ptr) as c_int)?; |
577 |
mem::forget(cert_store); |
578 |
|
579 |
Ok(()) |
580 |
@@ -613,8 +618,8 @@ impl SslContextBuilder { |
581 |
/// [`SSL_CTX_set_mode`]: https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_mode.html |
582 |
pub fn set_mode(&mut self, mode: SslMode) -> SslMode { |
583 |
unsafe { |
584 |
- let mode = ffi::SSL_CTX_set_mode(self.as_ptr(), mode.bits()); |
585 |
- SslMode::from_bits(mode).unwrap() |
586 |
+ let bits = ffi::SSL_CTX_set_mode(self.as_ptr(), mode.bits()); |
587 |
+ SslMode { bits } |
588 |
} |
589 |
} |
590 |
|
591 |
@@ -657,11 +662,7 @@ impl SslContextBuilder { |
592 |
/// |
593 |
/// This corresponds to `SSL_CTX_set_tmp_ecdh`. |
594 |
pub fn set_tmp_ecdh(&mut self, key: &EcKeyRef) -> Result<(), ErrorStack> { |
595 |
- unsafe { |
596 |
- cvt(ffi::SSL_CTX_set_tmp_ecdh(self.as_ptr(), key.as_ptr()) |
597 |
- as c_int) |
598 |
- .map(|_| ()) |
599 |
- } |
600 |
+ unsafe { cvt(ffi::SSL_CTX_set_tmp_ecdh(self.as_ptr(), key.as_ptr()) as c_int).map(|_| ()) } |
601 |
} |
602 |
|
603 |
/// Sets the callback which will generate parameters to be used during ephemeral elliptic curve |
604 |
@@ -901,8 +902,8 @@ impl SslContextBuilder { |
605 |
/// |
606 |
/// [`SSL_CTX_set_options`]: https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_options.html |
607 |
pub fn set_options(&mut self, option: SslOption) -> SslOption { |
608 |
- let ret = unsafe { compat::SSL_CTX_set_options(self.as_ptr(), option.bits()) }; |
609 |
- SslOption::from_bits(ret).unwrap() |
610 |
+ let bits = unsafe { compat::SSL_CTX_set_options(self.as_ptr(), option.bits()) }; |
611 |
+ SslOption { bits } |
612 |
} |
613 |
|
614 |
/// Returns the options used by the context. |
615 |
@@ -911,8 +912,8 @@ impl SslContextBuilder { |
616 |
/// |
617 |
/// [`SSL_CTX_get_options`]: https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_options.html |
618 |
pub fn options(&self) -> SslOption { |
619 |
- let ret = unsafe { compat::SSL_CTX_get_options(self.as_ptr()) }; |
620 |
- SslOption::from_bits(ret).unwrap() |
621 |
+ let bits = unsafe { compat::SSL_CTX_get_options(self.as_ptr()) }; |
622 |
+ SslOption { bits } |
623 |
} |
624 |
|
625 |
/// Clears the options used by the context, returning the old set. |
626 |
@@ -921,8 +922,8 @@ impl SslContextBuilder { |
627 |
/// |
628 |
/// [`SSL_CTX_clear_options`]: https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_options.html |
629 |
pub fn clear_options(&mut self, option: SslOption) -> SslOption { |
630 |
- let ret = unsafe { compat::SSL_CTX_clear_options(self.as_ptr(), option.bits()) }; |
631 |
- SslOption::from_bits(ret).unwrap() |
632 |
+ let bits = unsafe { compat::SSL_CTX_clear_options(self.as_ptr(), option.bits()) }; |
633 |
+ SslOption { bits } |
634 |
} |
635 |
|
636 |
/// Set the protocols to be used during Next Protocol Negotiation (the protocols |
637 |
@@ -968,7 +969,7 @@ impl SslContextBuilder { |
638 |
/// |
639 |
/// Note that ordering of the protocols controls the priority with which they are chosen. |
640 |
/// |
641 |
- /// Requires the `v102` or `v110` features and OpenSSL 1.0.2 or OpenSSL 1.1.0. |
642 |
+ /// Requires OpenSSL 1.0.2, 1.1.0, or 1.1.1 and the corresponding Cargo feature. |
643 |
// FIXME overhaul |
644 |
#[cfg(any(all(feature = "v102", ossl102), all(feature = "v110", ossl110)))] |
645 |
pub fn set_alpn_protocols(&mut self, protocols: &[&[u8]]) -> Result<(), ErrorStack> { |
646 |
@@ -1059,9 +1060,7 @@ impl SslContextBuilder { |
647 |
Box::into_raw(callback) as *mut c_void, |
648 |
); |
649 |
let f: unsafe extern "C" fn(_, _) -> _ = raw_tlsext_status::<F>; |
650 |
- cvt(ffi::SSL_CTX_set_tlsext_status_cb(self.as_ptr(), Some(f)) |
651 |
- as c_int) |
652 |
- .map(|_| ()) |
653 |
+ cvt(ffi::SSL_CTX_set_tlsext_status_cb(self.as_ptr(), Some(f)) as c_int).map(|_| ()) |
654 |
} |
655 |
} |
656 |
|
657 |
@@ -1185,7 +1184,7 @@ impl SslContext { |
658 |
impl SslContextRef { |
659 |
/// Returns the certificate associated with this `SslContext`, if present. |
660 |
/// |
661 |
- /// Requires the `v102` or `v110` features and OpenSSL 1.0.2 or OpenSSL 1.1.0. |
662 |
+ /// Requires OpenSSL 1.0.2, 1.1.0, or 1.1.1 and the corresponding Cargo feature. |
663 |
/// |
664 |
/// This corresponds to [`SSL_CTX_get0_certificate`]. |
665 |
/// |
666 |
@@ -1204,7 +1203,7 @@ impl SslContextRef { |
667 |
|
668 |
/// Returns the private key associated with this `SslContext`, if present. |
669 |
/// |
670 |
- /// Requires the `v102` or `v110` features and OpenSSL 1.0.2 or OpenSSL 1.1.0. |
671 |
+ /// Requires OpenSSL 1.0.2, 1.1.0, or 1.1.1 and the corresponding Cargo feature. |
672 |
/// |
673 |
/// This corresponds to [`SSL_CTX_get0_privatekey`]. |
674 |
/// |
675 |
@@ -1789,7 +1788,7 @@ impl SslRef { |
676 |
/// The protocol's name is returned is an opaque sequence of bytes. It is up to the client |
677 |
/// to interpret it. |
678 |
/// |
679 |
- /// Requires the `v102` or `v110` features and OpenSSL 1.0.2 or OpenSSL 1.1.0. |
680 |
+ /// Requires OpenSSL 1.0.2, 1.1.0, or 1.1.1 and the corresponding Cargo feature. |
681 |
/// |
682 |
/// This corresponds to [`SSL_get0_alpn_selected`]. |
683 |
/// |
684 |
@@ -1889,7 +1888,7 @@ impl SslRef { |
685 |
|
686 |
/// Returns a mutable reference to the X509 verification configuration. |
687 |
/// |
688 |
- /// Requires the `v102` or `v110` features and OpenSSL 1.0.2 or 1.1.0. |
689 |
+ /// Requires OpenSSL 1.0.2, 1.1.0, or 1.1.1 and the corresponding Cargo feature. |
690 |
/// |
691 |
/// This corresponds to [`SSL_get0_param`]. |
692 |
/// |
693 |
--- cargo-crates/openssl-0.9.24/src/ssl/tests/mod.rs.orig 2018-02-12 19:02:00 UTC |
694 |
+++ cargo-crates/openssl-0.9.24/src/ssl/tests/mod.rs |
695 |
@@ -1084,7 +1084,7 @@ fn connector_no_hostname_can_disable_verify() { |
696 |
|
697 |
#[test] |
698 |
fn connector_client_server_mozilla_intermediate() { |
699 |
- let listener = TcpListener::bind("127.0.0.1:0").unwrap(); |
700 |
+ let listener = TcpListener::bind("127.0.0.1:1234").unwrap(); |
701 |
let port = listener.local_addr().unwrap().port(); |
702 |
|
703 |
let t = thread::spawn(move || { |
704 |
@@ -1231,6 +1231,13 @@ fn tmp_dh_callback() { |
705 |
|
706 |
let stream = TcpStream::connect(("127.0.0.1", port)).unwrap(); |
707 |
let mut ctx = SslContext::builder(SslMethod::tls()).unwrap(); |
708 |
+ // TLS 1.3 has no DH suites, and openssl isn't happy if the max version has no suites :( |
709 |
+ #[cfg(ossl111)] |
710 |
+ { |
711 |
+ ctx.set_options(super::SslOption { |
712 |
+ bits: ::ffi::SSL_OP_NO_TLSv1_3, |
713 |
+ }); |
714 |
+ } |
715 |
ctx.set_cipher_list("EDH").unwrap(); |
716 |
let ssl = Ssl::new(&ctx.build()).unwrap(); |
717 |
ssl.connect(stream).unwrap(); |
718 |
@@ -1298,6 +1305,13 @@ fn tmp_dh_callback_ssl() { |
719 |
|
720 |
let stream = TcpStream::connect(("127.0.0.1", port)).unwrap(); |
721 |
let mut ctx = SslContext::builder(SslMethod::tls()).unwrap(); |
722 |
+ // TLS 1.3 has no DH suites, and openssl isn't happy if the max version has no suites :( |
723 |
+ #[cfg(ossl111)] |
724 |
+ { |
725 |
+ ctx.set_options(super::SslOption { |
726 |
+ bits: ::ffi::SSL_OP_NO_TLSv1_3, |
727 |
+ }); |
728 |
+ } |
729 |
ctx.set_cipher_list("EDH").unwrap(); |
730 |
let ssl = Ssl::new(&ctx.build()).unwrap(); |
731 |
ssl.connect(stream).unwrap(); |
732 |
--- cargo-crates/openssl-0.9.24/src/symm.rs.orig 2018-02-12 19:02:00 UTC |
733 |
+++ cargo-crates/openssl-0.9.24/src/symm.rs |
734 |
@@ -137,13 +137,13 @@ impl Cipher { |
735 |
unsafe { Cipher(ffi::EVP_rc4()) } |
736 |
} |
737 |
|
738 |
- /// Requires the `v110` feature and OpenSSL 1.1.0. |
739 |
+ /// Requires OpenSSL 1.1.0 or 1.1.1 and the corresponding Cargo feature. |
740 |
#[cfg(all(ossl110, feature = "v110"))] |
741 |
pub fn chacha20() -> Cipher { |
742 |
unsafe { Cipher(ffi::EVP_chacha20()) } |
743 |
} |
744 |
|
745 |
- /// Requires the `v110` feature and OpenSSL 1.1.0. |
746 |
+ /// Requires OpenSSL 1.1.0 or 1.1.1 and the corresponding Cargo feature. |
747 |
#[cfg(all(ossl110, feature = "v110"))] |
748 |
pub fn chacha20_poly1305() -> Cipher { |
749 |
unsafe { Cipher(ffi::EVP_chacha20_poly1305()) } |
750 |
@@ -167,7 +167,11 @@ impl Cipher { |
751 |
pub fn iv_len(&self) -> Option<usize> { |
752 |
unsafe { |
753 |
let len = EVP_CIPHER_iv_length(self.0) as usize; |
754 |
- if len == 0 { None } else { Some(len) } |
755 |
+ if len == 0 { |
756 |
+ None |
757 |
+ } else { |
758 |
+ Some(len) |
759 |
+ } |
760 |
} |
761 |
} |
762 |
|
763 |
@@ -590,7 +594,7 @@ pub fn decrypt_aead( |
764 |
} |
765 |
|
766 |
#[cfg(ossl110)] |
767 |
-use ffi::{EVP_CIPHER_iv_length, EVP_CIPHER_block_size, EVP_CIPHER_key_length}; |
768 |
+use ffi::{EVP_CIPHER_block_size, EVP_CIPHER_iv_length, EVP_CIPHER_key_length}; |
769 |
|
770 |
#[cfg(ossl10x)] |
771 |
#[allow(bad_style)] |
772 |
@@ -623,74 +627,17 @@ mod tests { |
773 |
#[test] |
774 |
fn test_aes_256_ecb() { |
775 |
let k0 = [ |
776 |
- 0x00u8, |
777 |
- 0x01u8, |
778 |
- 0x02u8, |
779 |
- 0x03u8, |
780 |
- 0x04u8, |
781 |
- 0x05u8, |
782 |
- 0x06u8, |
783 |
- 0x07u8, |
784 |
- 0x08u8, |
785 |
- 0x09u8, |
786 |
- 0x0au8, |
787 |
- 0x0bu8, |
788 |
- 0x0cu8, |
789 |
- 0x0du8, |
790 |
- 0x0eu8, |
791 |
- 0x0fu8, |
792 |
- 0x10u8, |
793 |
- 0x11u8, |
794 |
- 0x12u8, |
795 |
- 0x13u8, |
796 |
- 0x14u8, |
797 |
- 0x15u8, |
798 |
- 0x16u8, |
799 |
- 0x17u8, |
800 |
- 0x18u8, |
801 |
- 0x19u8, |
802 |
- 0x1au8, |
803 |
- 0x1bu8, |
804 |
- 0x1cu8, |
805 |
- 0x1du8, |
806 |
- 0x1eu8, |
807 |
- 0x1fu8, |
808 |
+ 0x00u8, 0x01u8, 0x02u8, 0x03u8, 0x04u8, 0x05u8, 0x06u8, 0x07u8, 0x08u8, 0x09u8, 0x0au8, |
809 |
+ 0x0bu8, 0x0cu8, 0x0du8, 0x0eu8, 0x0fu8, 0x10u8, 0x11u8, 0x12u8, 0x13u8, 0x14u8, 0x15u8, |
810 |
+ 0x16u8, 0x17u8, 0x18u8, 0x19u8, 0x1au8, 0x1bu8, 0x1cu8, 0x1du8, 0x1eu8, 0x1fu8, |
811 |
]; |
812 |
let p0 = [ |
813 |
- 0x00u8, |
814 |
- 0x11u8, |
815 |
- 0x22u8, |
816 |
- 0x33u8, |
817 |
- 0x44u8, |
818 |
- 0x55u8, |
819 |
- 0x66u8, |
820 |
- 0x77u8, |
821 |
- 0x88u8, |
822 |
- 0x99u8, |
823 |
- 0xaau8, |
824 |
- 0xbbu8, |
825 |
- 0xccu8, |
826 |
- 0xddu8, |
827 |
- 0xeeu8, |
828 |
- 0xffu8, |
829 |
+ 0x00u8, 0x11u8, 0x22u8, 0x33u8, 0x44u8, 0x55u8, 0x66u8, 0x77u8, 0x88u8, 0x99u8, 0xaau8, |
830 |
+ 0xbbu8, 0xccu8, 0xddu8, 0xeeu8, 0xffu8, |
831 |
]; |
832 |
let c0 = [ |
833 |
- 0x8eu8, |
834 |
- 0xa2u8, |
835 |
- 0xb7u8, |
836 |
- 0xcau8, |
837 |
- 0x51u8, |
838 |
- 0x67u8, |
839 |
- 0x45u8, |
840 |
- 0xbfu8, |
841 |
- 0xeau8, |
842 |
- 0xfcu8, |
843 |
- 0x49u8, |
844 |
- 0x90u8, |
845 |
- 0x4bu8, |
846 |
- 0x49u8, |
847 |
- 0x60u8, |
848 |
- 0x89u8, |
849 |
+ 0x8eu8, 0xa2u8, 0xb7u8, 0xcau8, 0x51u8, 0x67u8, 0x45u8, 0xbfu8, 0xeau8, 0xfcu8, 0x49u8, |
850 |
+ 0x90u8, 0x4bu8, 0x49u8, 0x60u8, 0x89u8, |
851 |
]; |
852 |
let mut c = super::Crypter::new( |
853 |
super::Cipher::aes_256_ecb(), |
854 |
@@ -722,74 +669,17 @@ mod tests { |
855 |
#[test] |
856 |
fn test_aes_256_cbc_decrypt() { |
857 |
let iv = [ |
858 |
- 4_u8, |
859 |
- 223_u8, |
860 |
- 153_u8, |
861 |
- 219_u8, |
862 |
- 28_u8, |
863 |
- 142_u8, |
864 |
- 234_u8, |
865 |
- 68_u8, |
866 |
- 227_u8, |
867 |
- 69_u8, |
868 |
- 98_u8, |
869 |
- 107_u8, |
870 |
- 208_u8, |
871 |
- 14_u8, |
872 |
- 236_u8, |
873 |
- 60_u8, |
874 |
+ 4_u8, 223_u8, 153_u8, 219_u8, 28_u8, 142_u8, 234_u8, 68_u8, 227_u8, 69_u8, 98_u8, |
875 |
+ 107_u8, 208_u8, 14_u8, 236_u8, 60_u8, |
876 |
]; |
877 |
let data = [ |
878 |
- 143_u8, |
879 |
- 210_u8, |
880 |
- 75_u8, |
881 |
- 63_u8, |
882 |
- 214_u8, |
883 |
- 179_u8, |
884 |
- 155_u8, |
885 |
- 241_u8, |
886 |
- 242_u8, |
887 |
- 31_u8, |
888 |
- 154_u8, |
889 |
- 56_u8, |
890 |
- 198_u8, |
891 |
- 145_u8, |
892 |
- 192_u8, |
893 |
- 64_u8, |
894 |
- 2_u8, |
895 |
- 245_u8, |
896 |
- 167_u8, |
897 |
- 220_u8, |
898 |
- 55_u8, |
899 |
- 119_u8, |
900 |
- 233_u8, |
901 |
- 136_u8, |
902 |
- 139_u8, |
903 |
- 27_u8, |
904 |
- 71_u8, |
905 |
- 242_u8, |
906 |
- 119_u8, |
907 |
- 175_u8, |
908 |
- 65_u8, |
909 |
- 207_u8, |
910 |
+ 143_u8, 210_u8, 75_u8, 63_u8, 214_u8, 179_u8, 155_u8, 241_u8, 242_u8, 31_u8, 154_u8, |
911 |
+ 56_u8, 198_u8, 145_u8, 192_u8, 64_u8, 2_u8, 245_u8, 167_u8, 220_u8, 55_u8, 119_u8, |
912 |
+ 233_u8, 136_u8, 139_u8, 27_u8, 71_u8, 242_u8, 119_u8, 175_u8, 65_u8, 207_u8, |
913 |
]; |
914 |
let ciphered_data = [ |
915 |
- 0x4a_u8, |
916 |
- 0x2e_u8, |
917 |
- 0xe5_u8, |
918 |
- 0x6_u8, |
919 |
- 0xbf_u8, |
920 |
- 0xcf_u8, |
921 |
- 0xf2_u8, |
922 |
- 0xd7_u8, |
923 |
- 0xea_u8, |
924 |
- 0x2d_u8, |
925 |
- 0xb1_u8, |
926 |
- 0x85_u8, |
927 |
- 0x6c_u8, |
928 |
- 0x93_u8, |
929 |
- 0x65_u8, |
930 |
- 0x6f_u8, |
931 |
+ 0x4a_u8, 0x2e_u8, 0xe5_u8, 0x6_u8, 0xbf_u8, 0xcf_u8, 0xf2_u8, 0xd7_u8, 0xea_u8, |
932 |
+ 0x2d_u8, 0xb1_u8, 0x85_u8, 0x6c_u8, 0x93_u8, 0x65_u8, 0x6f_u8, |
933 |
]; |
934 |
let mut cr = super::Crypter::new( |
935 |
super::Cipher::aes_256_cbc(), |
936 |
@@ -864,7 +754,6 @@ mod tests { |
937 |
|
938 |
#[test] |
939 |
fn test_rc4() { |
940 |
- |
941 |
let pt = "0000000000000000000000000000000000000000000000000000000000000000000000000000"; |
942 |
let ct = "A68686B04D686AA107BD8D4CAB191A3EEC0A6294BC78B60F65C25CB47BD7BB3A48EFC4D26BE4"; |
943 |
let key = "97CD440324DA5FD1F7955C1C13B6B466"; |
944 |
@@ -890,7 +779,6 @@ mod tests { |
945 |
|
946 |
#[test] |
947 |
fn test_aes128_ctr() { |
948 |
- |
949 |
let pt = "6BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411\ |
950 |
E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710"; |
951 |
let ct = "874D6191B620E3261BEF6864990DB6CE9806F66B7970FDFF8617187BB9FFFDFF5AE4DF3EDBD5D35E\ |
952 |
@@ -915,7 +803,6 @@ mod tests { |
953 |
|
954 |
#[test] |
955 |
fn test_aes128_cfb128() { |
956 |
- |
957 |
let pt = "6bc1bee22e409f96e93d7e117393172a"; |
958 |
let ct = "3b3fd92eb72dad20333449f8e83cfb4a"; |
959 |
let key = "2b7e151628aed2a6abf7158809cf4f3c"; |
960 |
@@ -926,7 +813,6 @@ mod tests { |
961 |
|
962 |
#[test] |
963 |
fn test_aes128_cfb8() { |
964 |
- |
965 |
let pt = "6bc1bee22e409f96e93d7e117393172aae2d"; |
966 |
let ct = "3b79424c9c0dd436bace9e0ed4586a4f32b9"; |
967 |
let key = "2b7e151628aed2a6abf7158809cf4f3c"; |
968 |
@@ -937,7 +823,6 @@ mod tests { |
969 |
|
970 |
#[test] |
971 |
fn test_aes256_cfb1() { |
972 |
- |
973 |
let pt = "6bc1"; |
974 |
let ct = "9029"; |
975 |
let key = "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4"; |
976 |
@@ -948,7 +833,6 @@ mod tests { |
977 |
|
978 |
#[test] |
979 |
fn test_aes256_cfb128() { |
980 |
- |
981 |
let pt = "6bc1bee22e409f96e93d7e117393172a"; |
982 |
let ct = "dc7e84bfda79164b7ecd8486985d3860"; |
983 |
let key = "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4"; |
984 |
@@ -959,7 +843,6 @@ mod tests { |
985 |
|
986 |
#[test] |
987 |
fn test_aes256_cfb8() { |
988 |
- |
989 |
let pt = "6bc1bee22e409f96e93d7e117393172aae2d"; |
990 |
let ct = "dc1f1a8520a64db55fcc8ac554844e889700"; |
991 |
let key = "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4"; |
992 |
@@ -982,7 +865,6 @@ mod tests { |
993 |
|
994 |
#[test] |
995 |
fn test_bf_ecb() { |
996 |
- |
997 |
let pt = "5CD54CA83DEF57DA"; |
998 |
let ct = "B1B8CC0B250F09A0"; |
999 |
let key = "0131D9619DC1376E"; |
1000 |
@@ -993,7 +875,6 @@ mod tests { |
1001 |
|
1002 |
#[test] |
1003 |
fn test_bf_cfb64() { |
1004 |
- |
1005 |
let pt = "37363534333231204E6F77206973207468652074696D6520666F722000"; |
1006 |
let ct = "E73214A2822139CAF26ECF6D2EB9E76E3DA3DE04D1517200519D57A6C3"; |
1007 |
let key = "0123456789ABCDEFF0E1D2C3B4A59687"; |
1008 |
@@ -1004,7 +885,6 @@ mod tests { |
1009 |
|
1010 |
#[test] |
1011 |
fn test_bf_ofb() { |
1012 |
- |
1013 |
let pt = "37363534333231204E6F77206973207468652074696D6520666F722000"; |
1014 |
let ct = "E73214A2822139CA62B343CC5B65587310DD908D0C241B2263C2CF80DA"; |
1015 |
let key = "0123456789ABCDEFF0E1D2C3B4A59687"; |
1016 |
@@ -1015,7 +895,6 @@ mod tests { |
1017 |
|
1018 |
#[test] |
1019 |
fn test_des_cbc() { |
1020 |
- |
1021 |
let pt = "54686973206973206120746573742e"; |
1022 |
let ct = "6f2867cfefda048a4046ef7e556c7132"; |
1023 |
let key = "7cb66337f3d3c0fe"; |
1024 |
@@ -1026,7 +905,6 @@ mod tests { |
1025 |
|
1026 |
#[test] |
1027 |
fn test_des_ecb() { |
1028 |
- |
1029 |
let pt = "54686973206973206120746573742e"; |
1030 |
let ct = "0050ab8aecec758843fe157b4dde938c"; |
1031 |
let key = "7cb66337f3d3c0fe"; |
1032 |
@@ -1080,10 +958,12 @@ mod tests { |
1033 |
fn test_chacha20() { |
1034 |
let key = "0000000000000000000000000000000000000000000000000000000000000000"; |
1035 |
let iv = "00000000000000000000000000000000"; |
1036 |
- let pt = "000000000000000000000000000000000000000000000000000000000000000000000000000000000\ |
1037 |
- 00000000000000000000000000000000000000000000000"; |
1038 |
- let ct = "76b8e0ada0f13d90405d6ae55386bd28bdd219b8a08ded1aa836efcc8b770dc7da41597c5157488d7\ |
1039 |
- 724e03fb8d84a376a43b8f41518a11cc387b669b2ee6586"; |
1040 |
+ let pt = |
1041 |
+ "000000000000000000000000000000000000000000000000000000000000000000000000000000000\ |
1042 |
+ 00000000000000000000000000000000000000000000000"; |
1043 |
+ let ct = |
1044 |
+ "76b8e0ada0f13d90405d6ae55386bd28bdd219b8a08ded1aa836efcc8b770dc7da41597c5157488d7\ |
1045 |
+ 724e03fb8d84a376a43b8f41518a11cc387b669b2ee6586"; |
1046 |
|
1047 |
cipher_test(Cipher::chacha20(), pt, ct, key, iv); |
1048 |
} |
1049 |
@@ -1094,12 +974,14 @@ mod tests { |
1050 |
let key = "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f"; |
1051 |
let iv = "070000004041424344454647"; |
1052 |
let aad = "50515253c0c1c2c3c4c5c6c7"; |
1053 |
- let pt = "4c616469657320616e642047656e746c656d656e206f662074686520636c617373206f66202739393\ |
1054 |
- a204966204920636f756c64206f6666657220796f75206f6e6c79206f6e652074697020666f722074\ |
1055 |
- 6865206675747572652c2073756e73637265656e20776f756c642062652069742e"; |
1056 |
- let ct = "d31a8d34648e60db7b86afbc53ef7ec2a4aded51296e08fea9e2b5a736ee62d63dbea45e8ca967128\ |
1057 |
- 2fafb69da92728b1a71de0a9e060b2905d6a5b67ecd3b3692ddbd7f2d778b8c9803aee328091b58fa\ |
1058 |
- b324e4fad675945585808b4831d7bc3ff4def08e4b7a9de576d26586cec64b6116"; |
1059 |
+ let pt = |
1060 |
+ "4c616469657320616e642047656e746c656d656e206f662074686520636c617373206f66202739393\ |
1061 |
+ a204966204920636f756c64206f6666657220796f75206f6e6c79206f6e652074697020666f722074\ |
1062 |
+ 6865206675747572652c2073756e73637265656e20776f756c642062652069742e"; |
1063 |
+ let ct = |
1064 |
+ "d31a8d34648e60db7b86afbc53ef7ec2a4aded51296e08fea9e2b5a736ee62d63dbea45e8ca967128\ |
1065 |
+ 2fafb69da92728b1a71de0a9e060b2905d6a5b67ecd3b3692ddbd7f2d778b8c9803aee328091b58fa\ |
1066 |
+ b324e4fad675945585808b4831d7bc3ff4def08e4b7a9de576d26586cec64b6116"; |
1067 |
let tag = "1ae10b594f09e26a7e902ecbd0600691"; |
1068 |
|
1069 |
let mut actual_tag = [0; 16]; |
1070 |
--- cargo-crates/openssl-0.9.24/src/verify.rs.orig 2018-02-12 19:02:00 UTC |
1071 |
+++ cargo-crates/openssl-0.9.24/src/verify.rs |
1072 |
@@ -14,7 +14,7 @@ bitflags! { |
1073 |
const X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS = ffi::X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS; |
1074 |
const X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS |
1075 |
= ffi::X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS; |
1076 |
- /// Requires the `v110` feature and OpenSSL 1.1.0. |
1077 |
+ /// Requires OpenSSL 1.1.0 or 1.1.1 and the corresponding Cargo feature. |
1078 |
#[cfg(all(feature = "v110", ossl110))] |
1079 |
const X509_CHECK_FLAG_NEVER_CHECK_SUBJECT = ffi::X509_CHECK_FLAG_NEVER_CHECK_SUBJECT; |
1080 |
} |
1081 |
--- cargo-crates/openssl-0.9.24/src/x509/verify.rs.orig 2018-02-12 17:30:05 UTC |
1082 |
+++ cargo-crates/openssl-0.9.24/src/x509/verify.rs |
1083 |
@@ -1,5 +1,5 @@ |
1084 |
//! X509 certificate verification |
1085 |
//! |
1086 |
-//! Requires the `v102` or `v110` features and OpenSSL 1.0.2 or 1.1.0. |
1087 |
+//! Requires OpenSSL 1.0.2, 1.1.0, or 1.1.1 and the corresponding Cargo feature. |
1088 |
|
1089 |
pub use verify::*; |