Skip to content

Commit ea03bc0

Browse files
committed
Yet Another Attempt to LibreSSL 3.5.x
1 parent c30d4fd commit ea03bc0

File tree

12 files changed

+43
-25
lines changed

12 files changed

+43
-25
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,11 @@ jobs:
179179
library:
180180
name: libressl
181181
version: 3.4.2
182+
- target: x86_64-unknown-linux-gnu
183+
bindgen: true
184+
library:
185+
name: libressl
186+
version: 3.5.2
182187
- target: x86_64-unknown-linux-gnu
183188
bindgen: false
184189
library:
@@ -189,6 +194,11 @@ jobs:
189194
library:
190195
name: libressl
191196
version: 3.4.2
197+
- target: x86_64-unknown-linux-gnu
198+
bindgen: false
199+
library:
200+
name: libressl
201+
version: 3.5.2
192202
name: ${{ matrix.target }}-${{ matrix.library.name }}-${{ matrix.library.version }}-${{ matrix.bindgen }}
193203
runs-on: ubuntu-latest
194204
env:

openssl-sys/build/cfgs.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ pub fn get(openssl_version: Option<u64>, libressl_version: Option<u64>) -> Vec<&
3434
if libressl_version >= 0x3_03_02_00_0 {
3535
cfgs.push("libressl332");
3636
}
37+
if libressl_version >= 0x3_05_00_00_0 {
38+
cfgs.push("libressl350");
39+
}
3740
} else {
3841
let openssl_version = openssl_version.unwrap();
3942

openssl-sys/build/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ See rust-openssl README for more information:
267267
(3, 3, _) => ('3', '3', 'x'),
268268
(3, 4, 0) => ('3', '4', '0'),
269269
(3, 4, _) => ('3', '4', 'x'),
270+
(3, 5, _) => ('3', '5', 'x'),
270271
_ => version_error(),
271272
};
272273

@@ -309,7 +310,7 @@ fn version_error() -> ! {
309310
"
310311
311312
This crate is only compatible with OpenSSL (version 1.0.1 through 1.1.1, or 3.0.0), or LibreSSL 2.5
312-
through 3.4.1, but a different version of OpenSSL was found. The build is now aborting
313+
through 3.5, but a different version of OpenSSL was found. The build is now aborting
313314
due to this version mismatch.
314315
315316
"

openssl-sys/src/handwritten/bn.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extern "C" {
2828
pub fn BN_mul(r: *mut BIGNUM, a: *const BIGNUM, b: *const BIGNUM, ctx: *mut BN_CTX) -> c_int;
2929
pub fn BN_sqr(r: *mut BIGNUM, a: *const BIGNUM, ctx: *mut BN_CTX) -> c_int;
3030
pub fn BN_set_negative(bn: *mut BIGNUM, n: c_int);
31-
#[cfg(ossl110)]
31+
#[cfg(any(ossl110, libressl350))]
3232
pub fn BN_is_negative(b: *const ::BIGNUM) -> c_int;
3333

3434
pub fn BN_div(
@@ -138,7 +138,7 @@ extern "C" {
138138
}
139139

140140
cfg_if! {
141-
if #[cfg(ossl110)] {
141+
if #[cfg(any(ossl110, libressl350))] {
142142
extern "C" {
143143
pub fn BN_get_rfc2409_prime_768(bn: *mut BIGNUM) -> *mut BIGNUM;
144144
pub fn BN_get_rfc2409_prime_1024(bn: *mut BIGNUM) -> *mut BIGNUM;

openssl-sys/src/handwritten/hmac.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use libc::*;
33
use *;
44

55
cfg_if! {
6-
if #[cfg(ossl110)] {
6+
if #[cfg(any(ossl110, libressl350))] {
77
extern "C" {
88
pub fn HMAC_CTX_new() -> *mut HMAC_CTX;
99
pub fn HMAC_CTX_free(ctx: *mut HMAC_CTX);

openssl-sys/src/handwritten/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ cfg_if! {
4040
}
4141
}
4242
cfg_if! {
43-
if #[cfg(ossl110)] {
43+
if #[cfg(any(ossl110, libressl350))] {
4444
pub enum BIGNUM {}
4545
} else {
4646
#[repr(C)]
@@ -1019,7 +1019,7 @@ cfg_if! {
10191019
pub enum COMP_CTX {}
10201020

10211021
cfg_if! {
1022-
if #[cfg(ossl110)] {
1022+
if #[cfg(any(ossl110, libressl350))] {
10231023
pub enum COMP_METHOD {}
10241024
} else {
10251025
#[repr(C)]

openssl-sys/src/handwritten/x509.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ stack!(stack_st_X509_EXTENSION);
1818
stack!(stack_st_X509_ATTRIBUTE);
1919

2020
cfg_if! {
21-
if #[cfg(ossl110)] {
21+
if #[cfg(any(ossl110, libressl350))] {
2222
pub enum X509_REQ_INFO {}
2323
} else {
2424
#[repr(C)]
@@ -33,7 +33,7 @@ cfg_if! {
3333
}
3434

3535
cfg_if! {
36-
if #[cfg(ossl110)] {
36+
if #[cfg(any(ossl110, libressl350))] {
3737
pub enum X509_CRL {}
3838
} else {
3939
#[repr(C)]
@@ -60,7 +60,7 @@ cfg_if! {
6060
stack!(stack_st_X509_CRL);
6161

6262
cfg_if! {
63-
if #[cfg(ossl110)] {
63+
if #[cfg(any(ossl110, libressl350))] {
6464
pub enum X509_CRL_INFO {}
6565
} else {
6666
#[repr(C)]
@@ -78,7 +78,7 @@ cfg_if! {
7878
}
7979

8080
cfg_if! {
81-
if #[cfg(ossl110)] {
81+
if #[cfg(any(ossl110, libressl350))] {
8282
pub enum X509_REVOKED {}
8383
} else {
8484
#[repr(C)]
@@ -96,7 +96,7 @@ cfg_if! {
9696
stack!(stack_st_X509_REVOKED);
9797

9898
cfg_if! {
99-
if #[cfg(ossl110)] {
99+
if #[cfg(any(ossl110, libressl350))] {
100100
pub enum X509_REQ {}
101101
} else {
102102
#[repr(C)]
@@ -110,7 +110,7 @@ cfg_if! {
110110
}
111111

112112
cfg_if! {
113-
if #[cfg(ossl110)] {
113+
if #[cfg(any(ossl110, libressl350))] {
114114
pub enum X509_CINF {}
115115
} else {
116116
#[repr(C)]
@@ -185,12 +185,12 @@ extern "C" {
185185

186186
const_ptr_api! {
187187
extern "C" {
188-
#[cfg(ossl102)]
188+
#[cfg(any(ossl102, libressl350))]
189189
pub fn X509_ALGOR_get0(
190-
paobj: *mut #[const_ptr_if(ossl110)] ASN1_OBJECT,
190+
paobj: *mut #[const_ptr_if(any(ossl110, libressl350))] ASN1_OBJECT,
191191
pptype: *mut c_int,
192-
ppval: *mut #[const_ptr_if(ossl110)] c_void,
193-
alg: #[const_ptr_if(ossl110)] X509_ALGOR,
192+
ppval: *mut #[const_ptr_if(any(ossl110, libressl350))] c_void,
193+
alg: #[const_ptr_if(any(ossl110, libressl350))] X509_ALGOR,
194194
);
195195
}
196196
}
@@ -317,7 +317,7 @@ const_ptr_api! {
317317
}
318318
}
319319
cfg_if! {
320-
if #[cfg(ossl110)] {
320+
if #[cfg(any(ossl110, libressl350))] {
321321
extern "C" {
322322
pub fn X509_set1_notBefore(x: *mut ::X509, tm: *const ::ASN1_TIME) -> c_int;
323323
pub fn X509_set1_notAfter(x: *mut ::X509, tm: *const ::ASN1_TIME) -> c_int;
@@ -330,10 +330,10 @@ cfg_if! {
330330
}
331331
}
332332
extern "C" {
333-
#[cfg(ossl110)]
333+
#[cfg(any(ossl110, libressl350))]
334334
pub fn X509_REQ_get_version(req: *const X509_REQ) -> c_long;
335335
pub fn X509_REQ_set_version(req: *mut X509_REQ, version: c_long) -> c_int;
336-
#[cfg(ossl110)]
336+
#[cfg(any(ossl110, libressl350))]
337337
pub fn X509_REQ_get_subject_name(req: *const X509_REQ) -> *mut X509_NAME;
338338
}
339339
const_ptr_api! {
@@ -606,7 +606,7 @@ extern "C" {
606606
}
607607

608608
cfg_if! {
609-
if #[cfg(ossl110)] {
609+
if #[cfg(any(ossl110, libressl350))] {
610610
extern "C" {
611611
pub fn X509_OBJECT_free(a: *mut X509_OBJECT);
612612
}

openssl-sys/src/handwritten/x509_vfy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ extern "C" {
5959
pub fn X509_STORE_CTX_set_error(ctx: *mut X509_STORE_CTX, error: c_int);
6060
}
6161
cfg_if! {
62-
if #[cfg(ossl110)] {
62+
if #[cfg(any(ossl110, libressl350))] {
6363
const_ptr_api! {
6464
extern "C" {
6565
pub fn X509_STORE_CTX_get0_chain(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> *mut stack_st_X509;

openssl-sys/src/x509.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub const X509_FILETYPE_DEFAULT: c_int = 3;
99
pub const ASN1_R_HEADER_TOO_LONG: c_int = 123;
1010

1111
cfg_if! {
12-
if #[cfg(not(ossl110))] {
12+
if #[cfg(not(any(ossl110, libressl350)))] {
1313
pub const X509_LU_FAIL: c_int = 0;
1414
pub const X509_LU_X509: c_int = 1;
1515
pub const X509_LU_CRL: c_int = 2;

openssl/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,9 @@ fn main() {
8181
if version >= 0x3_04_00_00_0 {
8282
println!("cargo:rustc-cfg=libressl340");
8383
}
84+
85+
if version >= 0x3_05_00_00_0 {
86+
println!("cargo:rustc-cfg=libressl350");
87+
}
8488
}
8589
}

0 commit comments

Comments
 (0)