Skip to content

Commit 8d46245

Browse files
committed
Merge pull request #2490 from rust-openssl/botovq-rm-libressl-3.3
2 parents 5e8044d + 22ac44b commit 8d46245

File tree

16 files changed

+71
-93
lines changed

16 files changed

+71
-93
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ jobs:
190190
bindgen: true
191191
library:
192192
name: libressl
193-
version: 3.3.6
193+
version: 3.4.3
194194
- target: x86_64-unknown-linux-gnu
195195
bindgen: true
196196
library:
@@ -210,7 +210,7 @@ jobs:
210210
bindgen: false
211211
library:
212212
name: libressl
213-
version: 3.3.6
213+
version: 3.4.3
214214
- target: x86_64-unknown-linux-gnu
215215
bindgen: false
216216
library:

openssl-sys/build/cfgs.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,9 @@ pub fn get(openssl_version: Option<u64>, libressl_version: Option<u64>) -> Vec<&
1616
cfgs.push("libressl291");
1717
cfgs.push("libressl310");
1818
cfgs.push("libressl321");
19+
cfgs.push("libressl332");
20+
cfgs.push("libressl340");
1921

20-
if libressl_version >= 0x3_03_02_00_0 {
21-
cfgs.push("libressl332");
22-
}
23-
if libressl_version >= 0x3_04_00_00_0 {
24-
cfgs.push("libressl340");
25-
}
2622
if libressl_version >= 0x3_05_00_00_0 {
2723
cfgs.push("libressl350");
2824
}

openssl-sys/build/main.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,6 @@ See rust-openssl documentation for more information:
418418
let minor = (libressl_version >> 20) as u8;
419419
let fix = (libressl_version >> 12) as u8;
420420
let (major, minor, fix) = match (major, minor, fix) {
421-
(3, 3, 0) => ('3', '3', '0'),
422-
(3, 3, 1) => ('3', '3', '1'),
423-
(3, 3, _) => ('3', '3', 'x'),
424421
(3, 4, 0) => ('3', '4', '0'),
425422
(3, 4, _) => ('3', '4', 'x'),
426423
(3, 5, _) => ('3', '5', 'x'),
@@ -476,7 +473,7 @@ fn version_error() -> ! {
476473
panic!(
477474
"
478475
479-
This crate is only compatible with OpenSSL (version 1.0.2 through 1.1.1, or 3), or LibreSSL 3.3
476+
This crate is only compatible with OpenSSL (version 1.0.2 through 1.1.1, or 3), or LibreSSL 3.4
480477
through 4.1.x, but a different version of OpenSSL was found. The build is now aborting
481478
due to this version mismatch.
482479

openssl-sys/src/handwritten/bn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extern "C" {
2323
pub fn BN_clear_free(bn: *mut BIGNUM);
2424
pub fn BN_bin2bn(s: *const u8, size: c_int, ret: *mut BIGNUM) -> *mut BIGNUM;
2525
pub fn BN_bn2bin(a: *const BIGNUM, to: *mut u8) -> c_int;
26-
#[cfg(any(ossl110, libressl340))]
26+
#[cfg(any(ossl110, libressl))]
2727
pub fn BN_bn2binpad(a: *const BIGNUM, to: *mut u8, tolen: c_int) -> c_int;
2828
pub fn BN_sub(r: *mut BIGNUM, a: *const BIGNUM, b: *const BIGNUM) -> c_int;
2929
pub fn BN_add(r: *mut BIGNUM, a: *const BIGNUM, b: *const BIGNUM) -> c_int;

openssl-sys/src/handwritten/ec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ extern "C" {
5656

5757
pub fn EC_GROUP_get_degree(group: *const EC_GROUP) -> c_int;
5858

59-
#[cfg(any(ossl110, libressl340))]
59+
#[cfg(any(ossl110, libressl))]
6060
pub fn EC_GROUP_order_bits(group: *const EC_GROUP) -> c_int;
6161

6262
pub fn EC_GROUP_new_curve_GFp(

openssl-sys/src/handwritten/ssl.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,13 @@ extern "C" {
353353
#[cfg(ossl111)]
354354
pub fn SSL_CTX_set_keylog_callback(ctx: *mut SSL_CTX, cb: SSL_CTX_keylog_cb_func);
355355

356-
#[cfg(any(ossl111, libressl340))]
356+
#[cfg(any(ossl111, libressl))]
357357
pub fn SSL_CTX_set_max_early_data(ctx: *mut SSL_CTX, max_early_data: u32) -> c_int;
358-
#[cfg(any(ossl111, libressl340))]
358+
#[cfg(any(ossl111, libressl))]
359359
pub fn SSL_CTX_get_max_early_data(ctx: *const SSL_CTX) -> u32;
360-
#[cfg(any(ossl111, libressl340))]
360+
#[cfg(any(ossl111, libressl))]
361361
pub fn SSL_set_max_early_data(ctx: *mut SSL, max_early_data: u32) -> c_int;
362-
#[cfg(any(ossl111, libressl340))]
362+
#[cfg(any(ossl111, libressl))]
363363
pub fn SSL_get_max_early_data(ctx: *const SSL) -> u32;
364364

365365
pub fn SSL_get_finished(s: *const SSL, buf: *mut c_void, count: size_t) -> size_t;
@@ -424,9 +424,9 @@ extern "C" {
424424
pub fn SSL_set_bio(ssl: *mut SSL, rbio: *mut BIO, wbio: *mut BIO);
425425
pub fn SSL_get_rbio(ssl: *const SSL) -> *mut BIO;
426426
pub fn SSL_get_wbio(ssl: *const SSL) -> *mut BIO;
427-
#[cfg(any(ossl111, libressl340))]
427+
#[cfg(any(ossl111, libressl))]
428428
pub fn SSL_CTX_set_ciphersuites(ctx: *mut SSL_CTX, str: *const c_char) -> c_int;
429-
#[cfg(any(ossl111, libressl340))]
429+
#[cfg(any(ossl111, libressl))]
430430
pub fn SSL_set_ciphersuites(ssl: *mut SSL, str: *const c_char) -> c_int;
431431
pub fn SSL_set_cipher_list(ssl: *mut SSL, s: *const c_char) -> c_int;
432432
pub fn SSL_set_ssl_method(s: *mut SSL, method: *const SSL_METHOD) -> c_int;
@@ -456,7 +456,7 @@ extern "C" {
456456
pub fn SSL_use_PrivateKey_file(ssl: *mut SSL, file: *const c_char, type_: c_int) -> c_int;
457457
pub fn SSL_use_PrivateKey(ssl: *mut SSL, pkey: *mut EVP_PKEY) -> c_int;
458458
pub fn SSL_use_certificate(ssl: *mut SSL, x: *mut X509) -> c_int;
459-
#[cfg(any(ossl110, libressl332))]
459+
#[cfg(any(ossl110, libressl))]
460460
pub fn SSL_use_certificate_chain_file(ssl: *mut SSL, file: *const c_char) -> c_int;
461461
pub fn SSL_set_client_CA_list(s: *mut SSL, name_list: *mut stack_st_X509_NAME);
462462
pub fn SSL_add_client_CA(ssl: *mut SSL, x: *mut X509) -> c_int;
@@ -472,9 +472,9 @@ extern "C" {
472472
#[cfg(any(ossl110, libressl))]
473473
pub fn SSL_SESSION_get_protocol_version(s: *const SSL_SESSION) -> c_int;
474474

475-
#[cfg(any(ossl111, libressl340))]
475+
#[cfg(any(ossl111, libressl))]
476476
pub fn SSL_SESSION_set_max_early_data(ctx: *mut SSL_SESSION, max_early_data: u32) -> c_int;
477-
#[cfg(any(ossl111, libressl340))]
477+
#[cfg(any(ossl111, libressl))]
478478
pub fn SSL_SESSION_get_max_early_data(ctx: *const SSL_SESSION) -> u32;
479479

480480
pub fn SSL_SESSION_get_id(s: *const SSL_SESSION, len: *mut c_uint) -> *const c_uchar;
@@ -511,7 +511,7 @@ extern "C" {
511511
);
512512
pub fn SSL_CTX_set_verify_depth(ctx: *mut SSL_CTX, depth: c_int);
513513

514-
#[cfg(any(ossl111, libressl340))]
514+
#[cfg(any(ossl111, libressl))]
515515
pub fn SSL_CTX_set_post_handshake_auth(ctx: *mut SSL_CTX, val: c_int);
516516

517517
pub fn SSL_CTX_check_private_key(ctx: *const SSL_CTX) -> c_int;
@@ -581,7 +581,7 @@ extern "C" {
581581
#[cfg(any(ossl111, libressl350))]
582582
pub fn SSL_peek_ex(ssl: *mut SSL, buf: *mut c_void, num: usize, readbytes: *mut usize)
583583
-> c_int;
584-
#[cfg(any(ossl111, libressl340))]
584+
#[cfg(any(ossl111, libressl))]
585585
pub fn SSL_read_early_data(
586586
s: *mut SSL,
587587
buf: *mut c_void,
@@ -608,7 +608,7 @@ extern "C" {
608608
num: size_t,
609609
written: *mut size_t,
610610
) -> c_int;
611-
#[cfg(any(ossl111, libressl340))]
611+
#[cfg(any(ossl111, libressl))]
612612
pub fn SSL_write_early_data(
613613
s: *mut SSL,
614614
buf: *const c_void,
@@ -709,7 +709,6 @@ extern "C" {
709709

710710
extern "C" {
711711
pub fn SSL_CTX_get0_certificate(ctx: *const SSL_CTX) -> *mut X509;
712-
#[cfg(any(ossl102, libressl340))]
713712
pub fn SSL_CTX_get0_privatekey(ctx: *const SSL_CTX) -> *mut EVP_PKEY;
714713

715714
pub fn SSL_set_shutdown(ss: *mut SSL, mode: c_int);

openssl-sys/src/ssl.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ cfg_if! {
136136
if #[cfg(ossl102)] {
137137
pub const SSL_OP_NO_DTLSv1: ssl_op_type!() = 0x04000000;
138138
pub const SSL_OP_NO_DTLSv1_2: ssl_op_type!() = 0x08000000;
139-
} else if #[cfg(libressl332)] {
139+
} else if #[cfg(libressl)] {
140140
pub const SSL_OP_NO_DTLSv1: ssl_op_type!() = 0x40000000;
141141
pub const SSL_OP_NO_DTLSv1_2: ssl_op_type!() = 0x80000000;
142142
}
143143
}
144-
#[cfg(any(ossl111, libressl340))]
144+
#[cfg(any(ossl111, libressl))]
145145
pub const SSL_OP_NO_TLSv1_3: ssl_op_type!() = 0x20000000;
146146

147147
#[cfg(ossl110h)]
@@ -552,11 +552,11 @@ pub const SSL_CLIENT_HELLO_ERROR: c_int = 0;
552552
#[cfg(ossl111)]
553553
pub const SSL_CLIENT_HELLO_RETRY: c_int = -1;
554554

555-
#[cfg(any(ossl111, libressl340))]
555+
#[cfg(any(ossl111, libressl))]
556556
pub const SSL_READ_EARLY_DATA_ERROR: c_int = 0;
557-
#[cfg(any(ossl111, libressl340))]
557+
#[cfg(any(ossl111, libressl))]
558558
pub const SSL_READ_EARLY_DATA_SUCCESS: c_int = 1;
559-
#[cfg(any(ossl111, libressl340))]
559+
#[cfg(any(ossl111, libressl))]
560560
pub const SSL_READ_EARLY_DATA_FINISH: c_int = 2;
561561

562562
cfg_if! {

openssl-sys/src/tls1.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ use super::*;
77
pub const TLS1_VERSION: c_int = 0x301;
88
pub const TLS1_1_VERSION: c_int = 0x302;
99
pub const TLS1_2_VERSION: c_int = 0x303;
10-
#[cfg(any(ossl111, libressl340))]
10+
#[cfg(any(ossl111, libressl))]
1111
pub const TLS1_3_VERSION: c_int = 0x304;
1212

1313
pub const DTLS1_VERSION: c_int = 0xFEFF;
14-
#[cfg(any(ossl102, libressl332))]
1514
pub const DTLS1_2_VERSION: c_int = 0xFEFD;
1615

1716
pub const TLS1_AD_DECODE_ERROR: c_int = 50;

openssl/build.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,9 @@ fn main() {
8080
println!("cargo:rustc-cfg=libressl291");
8181
println!("cargo:rustc-cfg=libressl310");
8282
println!("cargo:rustc-cfg=libressl321");
83+
println!("cargo:rustc-cfg=libressl332");
84+
println!("cargo:rustc-cfg=libressl340");
8385

84-
if version >= 0x3_03_02_00_0 {
85-
println!("cargo:rustc-cfg=libressl332");
86-
}
87-
if version >= 0x3_04_00_00_0 {
88-
println!("cargo:rustc-cfg=libressl340");
89-
}
9086
if version >= 0x3_05_00_00_0 {
9187
println!("cargo:rustc-cfg=libressl350");
9288
}

openssl/src/bn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ impl BigNumRef {
857857
/// assert_eq!(&bn_vec, &[0, 0, 0x45, 0x43]);
858858
/// ```
859859
#[corresponds(BN_bn2binpad)]
860-
#[cfg(any(ossl110, libressl340, boringssl, awslc))]
860+
#[cfg(any(ossl110, libressl, boringssl, awslc))]
861861
pub fn to_vec_padded(&self, pad_to: i32) -> Result<Vec<u8>, ErrorStack> {
862862
let mut v = Vec::with_capacity(pad_to as usize);
863863
unsafe {

0 commit comments

Comments
 (0)