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