View | Details | Raw Unified | Return to bug 266670 | Differences between
and this patch

Collapse All | Expand All

(-)b/lang/rust/files/patch-libressl-3.5 (+252 lines)
Added Link Here
1
Compatibility with LibreSSL 3.5, taken from
2
<https://github.com/sfackler/rust-openssl/commit/ea03bc0200a5>
3
4
--- vendor/openssl-sys/build/cfgs.rs.orig	2022-09-19 15:35:02 UTC
5
+++ vendor/openssl-sys/build/cfgs.rs
6
@@ -34,6 +34,9 @@ pub fn get(openssl_version: Option<u64>, libressl_vers
7
         if libressl_version >= 0x3_03_02_00_0 {
8
             cfgs.push("libressl332");
9
         }
10
+        if libressl_version >= 0x3_05_00_00_0 {
11
+            cfgs.push("libressl350");
12
+        }
13
     } else {
14
         let openssl_version = openssl_version.unwrap();
15
 
16
--- vendor/openssl-sys/build/main.rs.orig	2022-09-19 15:35:02 UTC
17
+++ vendor/openssl-sys/build/main.rs
18
@@ -254,6 +254,7 @@ See rust-openssl README for more information:
19
             (3, 3, _) => ('3', '3', 'x'),
20
             (3, 4, 0) => ('3', '4', '0'),
21
             (3, 4, _) => ('3', '4', 'x'),
22
+            (3, 5, _) => ('3', '5', 'x'),
23
             _ => version_error(),
24
         };
25
 
26
@@ -296,7 +297,7 @@ fn version_error() -> ! {
27
         "
28
 
29
 This crate is only compatible with OpenSSL (version 1.0.1 through 1.1.1, or 3.0.0), or LibreSSL 2.5
30
-through 3.4.1, but a different version of OpenSSL was found. The build is now aborting
31
+through 3.5, but a different version of OpenSSL was found. The build is now aborting
32
 due to this version mismatch.
33
 
34
 "
35
--- vendor/openssl-sys/src/bn.rs.orig	2022-09-19 15:35:02 UTC
36
+++ vendor/openssl-sys/src/bn.rs
37
@@ -43,7 +43,7 @@ extern "C" {
38
     pub fn BN_mul(r: *mut BIGNUM, a: *const BIGNUM, b: *const BIGNUM, ctx: *mut BN_CTX) -> c_int;
39
     pub fn BN_sqr(r: *mut BIGNUM, a: *const BIGNUM, ctx: *mut BN_CTX) -> c_int;
40
     pub fn BN_set_negative(bn: *mut BIGNUM, n: c_int);
41
-    #[cfg(ossl110)]
42
+    #[cfg(any(ossl110, libressl350))]
43
     pub fn BN_is_negative(b: *const ::BIGNUM) -> c_int;
44
 
45
     pub fn BN_div(
46
@@ -153,7 +153,7 @@ extern "C" {
47
 }
48
 
49
 cfg_if! {
50
-    if #[cfg(ossl110)] {
51
+    if #[cfg(any(ossl110, libressl350))] {
52
         extern "C" {
53
             pub fn BN_get_rfc2409_prime_768(bn: *mut BIGNUM) -> *mut BIGNUM;
54
             pub fn BN_get_rfc2409_prime_1024(bn: *mut BIGNUM) -> *mut BIGNUM;
55
--- vendor/openssl-sys/src/hmac.rs.orig	2022-09-19 15:35:02 UTC
56
+++ vendor/openssl-sys/src/hmac.rs
57
@@ -3,7 +3,7 @@ use libc::*;
58
 use *;
59
 
60
 cfg_if! {
61
-    if #[cfg(ossl110)] {
62
+    if #[cfg(any(ossl110, libressl350))] {
63
         extern "C" {
64
             pub fn HMAC_CTX_new() -> *mut HMAC_CTX;
65
             pub fn HMAC_CTX_free(ctx: *mut HMAC_CTX);
66
--- vendor/openssl-sys/src/ossl_typ.rs.orig	2022-09-19 15:35:02 UTC
67
+++ vendor/openssl-sys/src/ossl_typ.rs
68
@@ -40,7 +40,7 @@ cfg_if! {
69
     }
70
 }
71
 cfg_if! {
72
-    if #[cfg(ossl110)] {
73
+    if #[cfg(any(ossl110, libressl350))] {
74
         pub enum BIGNUM {}
75
     } else {
76
         #[repr(C)]
77
@@ -1015,7 +1015,7 @@ cfg_if! {
78
 pub enum COMP_CTX {}
79
 
80
 cfg_if! {
81
-    if #[cfg(ossl110)] {
82
+    if #[cfg(any(ossl110, libressl350))] {
83
         pub enum COMP_METHOD {}
84
     } else {
85
         #[repr(C)]
86
--- vendor/openssl-sys/src/x509.rs.orig	2022-09-19 15:35:02 UTC
87
+++ vendor/openssl-sys/src/x509.rs
88
@@ -25,7 +25,7 @@ stack!(stack_st_X509_EXTENSION);
89
 stack!(stack_st_X509_ATTRIBUTE);
90
 
91
 cfg_if! {
92
-    if #[cfg(ossl110)] {
93
+    if #[cfg(any(ossl110, libressl350))] {
94
         pub enum X509_REQ_INFO {}
95
     } else {
96
         #[repr(C)]
97
@@ -40,7 +40,7 @@ cfg_if! {
98
 }
99
 
100
 cfg_if! {
101
-    if #[cfg(ossl110)] {
102
+    if #[cfg(any(ossl110, libressl350))] {
103
         pub enum X509_CRL {}
104
     } else {
105
         #[repr(C)]
106
@@ -67,7 +67,7 @@ cfg_if! {
107
 stack!(stack_st_X509_CRL);
108
 
109
 cfg_if! {
110
-    if #[cfg(ossl110)] {
111
+    if #[cfg(any(ossl110, libressl350))] {
112
         pub enum X509_CRL_INFO {}
113
     } else {
114
         #[repr(C)]
115
@@ -85,7 +85,7 @@ cfg_if! {
116
 }
117
 
118
 cfg_if! {
119
-    if #[cfg(ossl110)] {
120
+    if #[cfg(any(ossl110, libressl350))] {
121
         pub enum X509_REVOKED {}
122
     } else {
123
         #[repr(C)]
124
@@ -103,7 +103,7 @@ cfg_if! {
125
 stack!(stack_st_X509_REVOKED);
126
 
127
 cfg_if! {
128
-    if #[cfg(ossl110)] {
129
+    if #[cfg(any(ossl110, libressl350))] {
130
         pub enum X509_REQ {}
131
     } else {
132
         #[repr(C)]
133
@@ -117,7 +117,7 @@ cfg_if! {
134
 }
135
 
136
 cfg_if! {
137
-    if #[cfg(ossl110)] {
138
+    if #[cfg(any(ossl110, libressl350))] {
139
         pub enum X509_CINF {}
140
     } else {
141
         #[repr(C)]
142
@@ -140,7 +140,7 @@ cfg_if! {
143
 stack!(stack_st_X509);
144
 
145
 cfg_if! {
146
-    if #[cfg(not(ossl110))] {
147
+    if #[cfg(not(any(ossl110, libressl350)))] {
148
         pub const X509_LU_FAIL: c_int = 0;
149
         pub const X509_LU_X509: c_int = 1;
150
         pub const X509_LU_CRL: c_int = 2;
151
@@ -221,12 +221,12 @@ extern "C" {
152
 
153
 const_ptr_api! {
154
     extern "C" {
155
-        #[cfg(ossl102)]
156
+        #[cfg(any(ossl102, libressl350))]
157
         pub fn X509_ALGOR_get0(
158
-            paobj: *mut #[const_ptr_if(ossl110)] ASN1_OBJECT,
159
+            paobj: *mut #[const_ptr_if(any(ossl110, libressl350))] ASN1_OBJECT,
160
             pptype: *mut c_int,
161
-            ppval: *mut #[const_ptr_if(ossl110)] c_void,
162
-            alg: #[const_ptr_if(ossl110)] X509_ALGOR,
163
+            ppval: *mut #[const_ptr_if(any(ossl110, libressl350))] c_void,
164
+            alg: #[const_ptr_if(any(ossl110, libressl350))] X509_ALGOR,
165
         );
166
     }
167
 }
168
@@ -343,7 +343,7 @@ const_ptr_api! {
169
     }
170
 }
171
 cfg_if! {
172
-    if #[cfg(ossl110)] {
173
+    if #[cfg(any(ossl110, libressl350))] {
174
         extern "C" {
175
             pub fn X509_set1_notBefore(x: *mut ::X509, tm: *const ::ASN1_TIME) -> c_int;
176
             pub fn X509_set1_notAfter(x: *mut ::X509, tm: *const ::ASN1_TIME) -> c_int;
177
@@ -356,10 +356,10 @@ cfg_if! {
178
     }
179
 }
180
 extern "C" {
181
-    #[cfg(ossl110)]
182
+    #[cfg(any(ossl110, libressl350))]
183
     pub fn X509_REQ_get_version(req: *const X509_REQ) -> c_long;
184
     pub fn X509_REQ_set_version(req: *mut X509_REQ, version: c_long) -> c_int;
185
-    #[cfg(ossl110)]
186
+    #[cfg(any(ossl110, libressl350))]
187
     pub fn X509_REQ_get_subject_name(req: *const X509_REQ) -> *mut X509_NAME;
188
 }
189
 const_ptr_api! {
190
@@ -632,7 +632,7 @@ extern "C" {
191
 }
192
 
193
 cfg_if! {
194
-    if #[cfg(ossl110)] {
195
+    if #[cfg(any(ossl110, libressl350))] {
196
         extern "C" {
197
             pub fn X509_OBJECT_free(a: *mut X509_OBJECT);
198
         }
199
--- vendor/openssl-sys/src/x509_vfy.rs.orig	2022-09-19 15:35:02 UTC
200
+++ vendor/openssl-sys/src/x509_vfy.rs
201
@@ -204,7 +204,7 @@ extern "C" {
202
     pub fn X509_STORE_CTX_set_error(ctx: *mut X509_STORE_CTX, error: c_int);
203
 }
204
 cfg_if! {
205
-    if #[cfg(ossl110)] {
206
+    if #[cfg(any(ossl110, libressl350))] {
207
         const_ptr_api! {
208
             extern "C" {
209
                 pub fn X509_STORE_CTX_get0_chain(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> *mut stack_st_X509;
210
--- vendor/openssl/build.rs.orig	2022-09-19 15:35:02 UTC
211
+++ vendor/openssl/build.rs
212
@@ -78,5 +78,9 @@ fn main() {
213
         if version >= 0x3_04_00_00_0 {
214
             println!("cargo:rustc-cfg=libressl340");
215
         }
216
+
217
+        if version >= 0x3_05_00_00_0 {
218
+            println!("cargo:rustc-cfg=libressl350");
219
+        }
220
     }
221
 }
222
--- vendor/openssl/src/bn.rs.orig	2022-09-19 15:35:02 UTC
223
+++ vendor/openssl/src/bn.rs
224
@@ -36,7 +36,7 @@ use crate::string::OpensslString;
225
 use crate::{cvt, cvt_n, cvt_p};
226
 
227
 cfg_if! {
228
-    if #[cfg(ossl110)] {
229
+    if #[cfg(any(ossl110, libressl350))] {
230
         use ffi::{
231
             BN_get_rfc2409_prime_1024, BN_get_rfc2409_prime_768, BN_get_rfc3526_prime_1536,
232
             BN_get_rfc3526_prime_2048, BN_get_rfc3526_prime_3072, BN_get_rfc3526_prime_4096,
233
--- vendor/openssl/src/x509/mod.rs.orig	2022-09-19 15:35:02 UTC
234
+++ vendor/openssl/src/x509/mod.rs
235
@@ -1568,7 +1568,7 @@ cfg_if! {
236
 }
237
 
238
 cfg_if! {
239
-    if #[cfg(ossl110)] {
240
+    if #[cfg(any(ossl110, libressl350))] {
241
         use ffi::{
242
             X509_ALGOR_get0, ASN1_STRING_get0_data, X509_STORE_CTX_get0_chain, X509_set1_notAfter,
243
             X509_set1_notBefore, X509_REQ_get_version, X509_REQ_get_subject_name,
244
@@ -1623,7 +1623,7 @@ cfg_if! {
245
 }
246
 
247
 cfg_if! {
248
-    if #[cfg(ossl110)] {
249
+    if #[cfg(any(ossl110, libressl350))] {
250
         use ffi::X509_OBJECT_free;
251
     } else {
252
         #[allow(bad_style)]
(-)b/lang/rust/files/patch-libssh2-libressl-3.5 (-1 / +24 lines)
Added Link Here
0
- 
1
--- vendor/libssh2-sys/libssh2/src/openssl.c.orig	2022-10-17 08:20:24 UTC
2
+++ vendor/libssh2-sys/libssh2/src/openssl.c
3
@@ -653,8 +653,7 @@ _libssh2_EVP_aes_256_ctr(void)
4
 
5
 void _libssh2_openssl_crypto_init(void)
6
 {
7
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && \
8
-    !defined(LIBRESSL_VERSION_NUMBER)
9
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
10
 #ifndef OPENSSL_NO_ENGINE
11
     ENGINE_load_builtin_engines();
12
     ENGINE_register_all_complete();
13
--- vendor/libssh2-sys/libssh2/src/openssl.h.orig	2022-10-17 08:18:24 UTC
14
+++ vendor/libssh2-sys/libssh2/src/openssl.h
15
@@ -57,8 +57,7 @@
16
 #include <openssl/pem.h>
17
 #include <openssl/rand.h>
18
 
19
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && \
20
-    !defined(LIBRESSL_VERSION_NUMBER)
21
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
22
 # define HAVE_OPAQUE_STRUCTS 1
23
 #endif
24
 

Return to bug 266670