Skip to content

Commit 5283d7c

Browse files
committed
Fix some deprecated patterns when using BoringSSL
The RSA and DSA changes will be needed to avoid build breakage soon. The others are mostly tidying up. There's another place around BIO that we'd ideally also switch over, but that depends on resolving the __fixed_rust mess first. This addresses a symptom of #1944, but not the root cause.
1 parent 9ef1fe3 commit 5283d7c

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

openssl/src/asn1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ impl fmt::Debug for Asn1ObjectRef {
738738
}
739739

740740
cfg_if! {
741-
if #[cfg(any(ossl110, libressl273))] {
741+
if #[cfg(any(ossl110, libressl273, boringssl))] {
742742
use ffi::ASN1_STRING_get0_data;
743743
} else {
744744
#[allow(bad_style)]

openssl/src/dsa.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
88
use cfg_if::cfg_if;
99
use foreign_types::{ForeignType, ForeignTypeRef};
10+
#[cfg(not(boringssl))]
1011
use libc::c_int;
1112
use std::fmt;
1213
use std::mem;
@@ -314,7 +315,7 @@ impl<T> fmt::Debug for Dsa<T> {
314315
}
315316

316317
cfg_if! {
317-
if #[cfg(any(ossl110, libressl273))] {
318+
if #[cfg(any(ossl110, libressl273, boringssl))] {
318319
use ffi::{DSA_get0_key, DSA_get0_pqg, DSA_set0_key, DSA_set0_pqg};
319320
} else {
320321
#[allow(bad_style)]
@@ -493,7 +494,7 @@ impl DsaSigRef {
493494
}
494495

495496
cfg_if! {
496-
if #[cfg(any(ossl110, libressl273))] {
497+
if #[cfg(any(ossl110, libressl273, boringssl))] {
497498
use ffi::{DSA_SIG_set0, DSA_SIG_get0};
498499
} else {
499500
#[allow(bad_style)]

openssl/src/ecdsa.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl EcdsaSigRef {
110110
}
111111

112112
cfg_if! {
113-
if #[cfg(any(ossl110, libressl273))] {
113+
if #[cfg(any(ossl110, libressl273, boringssl))] {
114114
use ffi::{ECDSA_SIG_set0, ECDSA_SIG_get0};
115115
} else {
116116
#[allow(bad_style)]

openssl/src/hash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use crate::nid::Nid;
4343
use crate::{cvt, cvt_p};
4444

4545
cfg_if! {
46-
if #[cfg(ossl110)] {
46+
if #[cfg(any(ossl110, boringssl))] {
4747
use ffi::{EVP_MD_CTX_free, EVP_MD_CTX_new};
4848
} else {
4949
use ffi::{EVP_MD_CTX_create as EVP_MD_CTX_new, EVP_MD_CTX_destroy as EVP_MD_CTX_free};

openssl/src/md_ctx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ use std::convert::TryFrom;
9393
use std::ptr;
9494

9595
cfg_if! {
96-
if #[cfg(ossl110)] {
96+
if #[cfg(any(ossl110, boringssl))] {
9797
use ffi::{EVP_MD_CTX_free, EVP_MD_CTX_new};
9898
} else {
9999
use ffi::{EVP_MD_CTX_create as EVP_MD_CTX_new, EVP_MD_CTX_destroy as EVP_MD_CTX_free};

openssl/src/rsa.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ impl<T> fmt::Debug for Rsa<T> {
581581
}
582582

583583
cfg_if! {
584-
if #[cfg(any(ossl110, libressl273))] {
584+
if #[cfg(any(ossl110, libressl273, boringssl))] {
585585
use ffi::{
586586
RSA_get0_key, RSA_get0_factors, RSA_get0_crt_params, RSA_set0_key, RSA_set0_factors,
587587
RSA_set0_crt_params,

0 commit comments

Comments
 (0)