FreeBSD Bugzilla – Attachment 247536 Details for
Bug 266670
lang/rust: fix build with libressl 3.7+
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
v1_adjustment.patch
patch-libresslNEW (text/plain), 8.66 KB, created by
takefu
on 2024-01-08 23:09:36 UTC
(
hide
)
Description:
v1_adjustment.patch
Filename:
MIME Type:
Creator:
takefu
Created:
2024-01-08 23:09:36 UTC
Size:
8.66 KB
patch
obsolete
>--- vendor/openssl/build.rs.orig 2023-12-04 21:32:19 UTC >+++ vendor/openssl/build.rs >@@ -67,6 +67,12 @@ > if version >= 0x3_07_00_00_0 { > println!("cargo:rustc-cfg=libressl370"); > } >+ if version >= 0x3_08_00_00_0 { >+ println!("cargo:rustc-cfg=libressl380"); >+ } >+ if version >= 0x3_09_00_00_0 { >+ println!("cargo:rustc-cfg=libressl390"); >+ } > } > > if let Ok(vars) = env::var("DEP_OPENSSL_CONF") { >--- vendor/openssl/src/hash.rs.orig 2023-12-04 21:32:19 UTC >+++ vendor/openssl/src/hash.rs >@@ -127,22 +127,22 @@ > unsafe { MessageDigest(ffi::EVP_sha512()) } > } > >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > pub fn sha3_224() -> MessageDigest { > unsafe { MessageDigest(ffi::EVP_sha3_224()) } > } > >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > pub fn sha3_256() -> MessageDigest { > unsafe { MessageDigest(ffi::EVP_sha3_256()) } > } > >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > pub fn sha3_384() -> MessageDigest { > unsafe { MessageDigest(ffi::EVP_sha3_384()) } > } > >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > pub fn sha3_512() -> MessageDigest { > unsafe { MessageDigest(ffi::EVP_sha3_512()) } > } >@@ -624,7 +624,7 @@ > ); > } > >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > #[test] > fn test_sha3_224() { > let tests = [( >@@ -644,7 +644,7 @@ > ); > } > >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > #[test] > fn test_sha3_256() { > let tests = [( >@@ -664,7 +664,7 @@ > ); > } > >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > #[test] > fn test_sha3_384() { > let tests = [("416c6c20796f75722062617365206172652062656c6f6e6720746f207573", >@@ -684,7 +684,7 @@ > ); > } > >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > #[test] > fn test_sha3_512() { > let tests = [("416c6c20796f75722062617365206172652062656c6f6e6720746f207573", >--- vendor/openssl/src/md.rs.orig 2023-12-04 21:32:19 UTC >+++ vendor/openssl/src/md.rs >@@ -150,25 +150,25 @@ > unsafe { MdRef::from_ptr(ffi::EVP_sha512() as *mut _) } > } > >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > #[inline] > pub fn sha3_224() -> &'static MdRef { > unsafe { MdRef::from_ptr(ffi::EVP_sha3_224() as *mut _) } > } > >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > #[inline] > pub fn sha3_256() -> &'static MdRef { > unsafe { MdRef::from_ptr(ffi::EVP_sha3_256() as *mut _) } > } > >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > #[inline] > pub fn sha3_384() -> &'static MdRef { > unsafe { MdRef::from_ptr(ffi::EVP_sha3_384() as *mut _) } > } > >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > #[inline] > pub fn sha3_512() -> &'static MdRef { > unsafe { MdRef::from_ptr(ffi::EVP_sha3_512() as *mut _) } >--- vendor/openssl/src/nid.rs.orig 2023-12-04 21:32:19 UTC >+++ vendor/openssl/src/nid.rs >@@ -1078,13 +1078,13 @@ > pub const SM2: Nid = Nid(ffi::NID_sm2); > #[cfg(any(ossl111, libressl291))] > pub const SM3: Nid = Nid(ffi::NID_sm3); >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > pub const SHA3_224: Nid = Nid(ffi::NID_sha3_224); >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > pub const SHA3_256: Nid = Nid(ffi::NID_sha3_256); >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > pub const SHA3_384: Nid = Nid(ffi::NID_sha3_384); >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > pub const SHA3_512: Nid = Nid(ffi::NID_sha3_512); > #[cfg(ossl111)] > pub const SHAKE128: Nid = Nid(ffi::NID_shake128); >--- vendor/openssl/src/x509/mod.rs.orig 2023-12-04 21:32:19 UTC >+++ vendor/openssl/src/x509/mod.rs >@@ -1022,6 +1022,7 @@ > /// # Safety > /// > /// This method modifies global state without locking and therefore is not thread safe >+ #[cfg(not(libressl390))] > #[corresponds(X509V3_EXT_add_alias)] > #[deprecated( > note = "Use x509::extension types or new_from_der and then this is not necessary", >--- vendor/openssl-sys/build/cfgs.rs.orig 2023-12-04 21:32:19 UTC >+++ vendor/openssl-sys/build/cfgs.rs >@@ -53,6 +53,18 @@ > if libressl_version >= 0x3_07_00_00_0 { > cfgs.push("libressl370"); > } >+ if libressl_version >= 0x3_08_00_00_0 { >+ cfgs.push("libressl380"); >+ } >+ if libressl_version >= 0x3_08_01_00_0 { >+ cfgs.push("libressl381"); >+ } >+ if libressl_version >= 0x3_08_02_00_0 { >+ cfgs.push("libressl382"); >+ } >+ if libressl_version >= 0x3_09_00_00_0 { >+ cfgs.push("libressl390"); >+ } > } else { > let openssl_version = openssl_version.unwrap(); > >--- vendor/openssl-sys/build/main.rs.orig 2023-12-04 21:32:19 UTC >+++ vendor/openssl-sys/build/main.rs >@@ -273,6 +273,8 @@ > (3, 7, 1) => ('3', '7', '1'), > (3, 7, _) => ('3', '7', 'x'), > (3, 8, 0) => ('3', '8', '0'), >+ (3, 8, 1) => ('3', '8', '1'), >+ (3, 8, _) => ('3', '8', 'x'), > _ => version_error(), > }; > >@@ -314,8 +316,8 @@ > panic!( > " > >-This crate is only compatible with OpenSSL (version 1.0.1 through 1.1.1, or 3.0.0), or LibreSSL 2.5 >-through 3.8.0, but a different version of OpenSSL was found. The build is now aborting >+This crate is only compatible with OpenSSL (version 1.0.1 through 1.1.1, or 3), or LibreSSL 2.5 >+through 3.8.1, but a different version of OpenSSL was found. The build is now aborting > due to this version mismatch. > > " >--- vendor/openssl-sys/src/crypto.rs.orig 2023-12-04 21:32:19 UTC >+++ vendor/openssl-sys/src/crypto.rs >@@ -106,7 +106,7 @@ > pub const CRYPTO_LOCK_SSL_SESSION: c_int = 14; > > cfg_if! { >- if #[cfg(ossl110)] { >+ if #[cfg(any(ossl110, libressl381))] { > pub const CRYPTO_EX_INDEX_SSL: c_int = 0; > pub const CRYPTO_EX_INDEX_SSL_CTX: c_int = 1; > } else if #[cfg(libressl)] { >--- vendor/openssl-sys/src/handwritten/evp.rs.orig 2023-12-04 21:32:19 UTC >+++ vendor/openssl-sys/src/handwritten/evp.rs >@@ -294,13 +294,13 @@ > pub fn EVP_sha256() -> *const EVP_MD; > pub fn EVP_sha384() -> *const EVP_MD; > pub fn EVP_sha512() -> *const EVP_MD; >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > pub fn EVP_sha3_224() -> *const EVP_MD; >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > pub fn EVP_sha3_256() -> *const EVP_MD; >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > pub fn EVP_sha3_384() -> *const EVP_MD; >- #[cfg(ossl111)] >+ #[cfg(any(ossl111, libressl380))] > pub fn EVP_sha3_512() -> *const EVP_MD; > #[cfg(ossl111)] > pub fn EVP_shake128() -> *const EVP_MD; >--- vendor/openssl-sys/src/handwritten/types.rs.orig 2023-12-04 21:32:19 UTC >+++ vendor/openssl-sys/src/handwritten/types.rs >@@ -329,7 +329,7 @@ > } > } > cfg_if! { >- if #[cfg(ossl110)] { >+ if #[cfg(any(ossl110, libressl382))] { > pub enum X509_ALGOR {} > } else { > #[repr(C)] >--- vendor/openssl-sys/src/handwritten/x509.rs.orig 2023-12-04 21:32:19 UTC >+++ vendor/openssl-sys/src/handwritten/x509.rs >@@ -700,10 +700,8 @@ > const_ptr_api! { > extern "C" { > pub fn X509_PURPOSE_get_by_sname(sname: #[const_ptr_if(any(ossl110, libressl280))] c_char) -> c_int; >+ pub fn X509_PURPOSE_get0(idx: c_int) -> #[const_ptr_if(libressl390)] X509_PURPOSE; > } >-} >-extern "C" { >- pub fn X509_PURPOSE_get0(idx: c_int) -> *mut X509_PURPOSE; > } > > extern "C" { >--- vendor/openssl-sys/src/handwritten/x509v3.rs.orig 2023-12-04 21:32:19 UTC >+++ vendor/openssl-sys/src/handwritten/x509v3.rs >@@ -84,6 +84,7 @@ > } > > extern "C" { >+ #[cfg(not(libressl390))] > pub fn X509V3_EXT_add_alias(nid_to: c_int, nid_from: c_int) -> c_int; > pub fn X509V3_EXT_d2i(ext: *mut X509_EXTENSION) -> *mut c_void; > pub fn X509V3_EXT_i2d(ext_nid: c_int, crit: c_int, ext: *mut c_void) -> *mut X509_EXTENSION; >--- vendor/openssl-sys/src/obj_mac.rs.orig 2023-12-04 21:32:19 UTC >+++ vendor/openssl-sys/src/obj_mac.rs >@@ -974,12 +974,20 @@ > pub const NID_sm4_ctr: c_int = 979; > #[cfg(ossl111)] > pub const NID_sha3_224: c_int = 1096; >+#[cfg(libressl380)] >+pub const NID_sha3_224: c_int = 1031; > #[cfg(ossl111)] > pub const NID_sha3_256: c_int = 1097; >+#[cfg(libressl380)] >+pub const NID_sha3_256: c_int = 1032; > #[cfg(ossl111)] > pub const NID_sha3_384: c_int = 1098; >+#[cfg(libressl380)] >+pub const NID_sha3_384: c_int = 1033; > #[cfg(ossl111)] > pub const NID_sha3_512: c_int = 1099; >+#[cfg(libressl380)] >+pub const NID_sha3_512: c_int = 1034; > #[cfg(ossl111)] > pub const NID_shake128: c_int = 1100; > #[cfg(ossl111)]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 266670
:
236898
|
237869
|
240956
|
241050
|
242702
|
243073
|
244725
|
246136
|
246529
|
246931
|
247053
| 247536 |
249461
|
251577
|
254621