Skip to content

Commit 25df42e

Browse files
committed
Merge remote-tracking branch 'openssl/master'
2 parents 24e2617 + ae0407b commit 25df42e

4 files changed

Lines changed: 20 additions & 7 deletions

File tree

openssl-sys/build/cfgs.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ pub fn get(openssl_version: Option<u64>, libressl_version: Option<u64>) -> Vec<&
8080
if libressl_version >= 0x4_01_00_00_0 {
8181
cfgs.push("libressl410");
8282
}
83+
if libressl_version >= 0x4_02_00_00_0 {
84+
cfgs.push("libressl420");
85+
}
8386
} else {
8487
let openssl_version = openssl_version.unwrap();
8588

openssl-sys/build/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#![allow(
2+
// This can be removed once our MSRV is raised to 1.66.
3+
clippy::uninlined_format_args,
4+
)]
5+
16
#[cfg(feature = "bindgen")]
27
extern crate bindgen;
38
extern crate cc;
@@ -176,6 +181,7 @@ fn main() {
176181
println!("cargo:rustc-check-cfg=cfg(libressl390)");
177182
println!("cargo:rustc-check-cfg=cfg(libressl400)");
178183
println!("cargo:rustc-check-cfg=cfg(libressl410)");
184+
println!("cargo:rustc-check-cfg=cfg(libressl420)");
179185

180186
println!("cargo:rustc-check-cfg=cfg(ossl101)");
181187
println!("cargo:rustc-check-cfg=cfg(ossl102)");

openssl-sys/src/handwritten/evp.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,17 +512,21 @@ cfg_if! {
512512
}
513513
}
514514
}
515+
const_ptr_api! {
516+
extern "C" {
517+
pub fn EVP_PKEY_get1_RSA(k: #[const_ptr_if(libressl420)] EVP_PKEY) -> *mut RSA;
518+
pub fn EVP_PKEY_get1_DSA(k: #[const_ptr_if(libressl420)] EVP_PKEY) -> *mut DSA;
519+
pub fn EVP_PKEY_get1_DH(k: #[const_ptr_if(libressl420)] EVP_PKEY) -> *mut DH;
520+
pub fn EVP_PKEY_get1_EC_KEY(k: #[const_ptr_if(libressl420)] EVP_PKEY) -> *mut EC_KEY;
521+
}
522+
}
515523
extern "C" {
516524
pub fn EVP_PKEY_assign(pkey: *mut EVP_PKEY, typ: c_int, key: *mut c_void) -> c_int;
517525

518526
pub fn EVP_PKEY_set1_RSA(k: *mut EVP_PKEY, r: *mut RSA) -> c_int;
519-
pub fn EVP_PKEY_get1_RSA(k: *mut EVP_PKEY) -> *mut RSA;
520527
pub fn EVP_PKEY_set1_DSA(k: *mut EVP_PKEY, k: *mut DSA) -> c_int;
521-
pub fn EVP_PKEY_get1_DSA(k: *mut EVP_PKEY) -> *mut DSA;
522528
pub fn EVP_PKEY_set1_DH(k: *mut EVP_PKEY, k: *mut DH) -> c_int;
523-
pub fn EVP_PKEY_get1_DH(k: *mut EVP_PKEY) -> *mut DH;
524529
pub fn EVP_PKEY_set1_EC_KEY(k: *mut EVP_PKEY, k: *mut EC_KEY) -> c_int;
525-
pub fn EVP_PKEY_get1_EC_KEY(k: *mut EVP_PKEY) -> *mut EC_KEY;
526530

527531
pub fn EVP_PKEY_new() -> *mut EVP_PKEY;
528532
pub fn EVP_PKEY_free(k: *mut EVP_PKEY);

openssl-sys/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,12 @@ mod openssl {
159159
_file: *const c_char,
160160
_line: c_int,
161161
) {
162-
let mutex = &(*MUTEXES)[n as usize];
162+
let mutex = &(&(*MUTEXES))[n as usize];
163163

164164
if mode & CRYPTO_LOCK != 0 {
165-
(*GUARDS)[n as usize] = Some(mutex.lock().unwrap());
165+
(&mut (*GUARDS))[n as usize] = Some(mutex.lock().unwrap());
166166
} else {
167-
if let None = (*GUARDS)[n as usize].take() {
167+
if let None = (&mut (*GUARDS))[n as usize].take() {
168168
let _ = writeln!(
169169
io::stderr(),
170170
"BUG: rust-openssl lock {} already unlocked, aborting",

0 commit comments

Comments
 (0)