Skip to content

Commit 364bd8c

Browse files
committed
Remove and simplify a ton of cfgs that weren't required
1 parent a727b2a commit 364bd8c

File tree

11 files changed

+10
-43
lines changed

11 files changed

+10
-43
lines changed

openssl-sys/build/cfgs.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ pub fn get(openssl_version: Option<u64>, libressl_version: Option<u64>) -> Vec<&
5757
}
5858
} else {
5959
let openssl_version = openssl_version.unwrap();
60+
cfgs.push("ossl101");
6061

61-
if openssl_version >= 0x1_00_01_00_0 {
62-
cfgs.push("ossl101");
63-
}
6462
if openssl_version >= 0x1_00_02_00_0 {
6563
cfgs.push("ossl102");
6664
}

openssl-sys/build/run_bindgen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const INCLUDES: &str = "
4141
#include <openssl/srtp.h>
4242
#endif
4343
44-
#if !(defined(LIBRESSL_VERSION_NUMBER) || defined(OPENSSL_IS_BORINGSSL) || defined(OPENSSL_IS_AWSLC))
44+
#if !(defined(OPENSSL_IS_BORINGSSL) || defined(OPENSSL_IS_AWSLC))
4545
#include <openssl/cms.h>
4646
#endif
4747

openssl-sys/src/cms.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,24 @@
11
use libc::*;
22

3-
#[cfg(ossl101)]
43
pub const CMS_TEXT: c_uint = 0x1;
5-
#[cfg(ossl101)]
64
pub const CMS_NOCERTS: c_uint = 0x2;
7-
#[cfg(ossl101)]
85
pub const CMS_NO_CONTENT_VERIFY: c_uint = 0x4;
9-
#[cfg(ossl101)]
106
pub const CMS_NO_ATTR_VERIFY: c_uint = 0x8;
11-
#[cfg(ossl101)]
127
pub const CMS_NOSIGS: c_uint = 0x4 | 0x8;
13-
#[cfg(ossl101)]
148
pub const CMS_NOINTERN: c_uint = 0x10;
15-
#[cfg(ossl101)]
169
pub const CMS_NO_SIGNER_CERT_VERIFY: c_uint = 0x20;
17-
#[cfg(ossl101)]
1810
pub const CMS_NOVERIFY: c_uint = 0x20;
19-
#[cfg(ossl101)]
2011
pub const CMS_DETACHED: c_uint = 0x40;
21-
#[cfg(ossl101)]
2212
pub const CMS_BINARY: c_uint = 0x80;
23-
#[cfg(ossl101)]
2413
pub const CMS_NOATTR: c_uint = 0x100;
25-
#[cfg(ossl101)]
2614
pub const CMS_NOSMIMECAP: c_uint = 0x200;
27-
#[cfg(ossl101)]
2815
pub const CMS_NOOLDMIMETYPE: c_uint = 0x400;
29-
#[cfg(ossl101)]
3016
pub const CMS_CRLFEOL: c_uint = 0x800;
31-
#[cfg(ossl101)]
3217
pub const CMS_STREAM: c_uint = 0x1000;
33-
#[cfg(ossl101)]
3418
pub const CMS_NOCRL: c_uint = 0x2000;
35-
#[cfg(ossl101)]
3619
pub const CMS_PARTIAL: c_uint = 0x4000;
37-
#[cfg(ossl101)]
3820
pub const CMS_REUSE_DIGEST: c_uint = 0x8000;
39-
#[cfg(ossl101)]
4021
pub const CMS_USE_KEYID: c_uint = 0x10000;
41-
#[cfg(ossl101)]
4222
pub const CMS_DEBUG_DECRYPT: c_uint = 0x20000;
4323
#[cfg(ossl102)]
4424
pub const CMS_KEY_PARAM: c_uint = 0x40000;

openssl-sys/src/handwritten/cms.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,19 @@ extern "C" {
1010

1111
const_ptr_api! {
1212
extern "C" {
13-
#[cfg(ossl101)]
1413
pub fn i2d_CMS_ContentInfo(a: #[const_ptr_if(ossl300)] CMS_ContentInfo, pp: *mut *mut c_uchar) -> c_int;
1514
}
1615
}
1716

1817
extern "C" {
19-
#[cfg(ossl101)]
2018
pub fn d2i_CMS_ContentInfo(
2119
a: *mut *mut CMS_ContentInfo,
2220
pp: *mut *const c_uchar,
2321
length: c_long,
2422
) -> *mut CMS_ContentInfo;
2523

26-
#[cfg(ossl101)]
2724
pub fn SMIME_read_CMS(bio: *mut BIO, bcont: *mut *mut BIO) -> *mut CMS_ContentInfo;
2825

29-
#[cfg(ossl101)]
3026
pub fn CMS_sign(
3127
signcert: *mut X509,
3228
pkey: *mut EVP_PKEY,
@@ -35,7 +31,6 @@ extern "C" {
3531
flags: c_uint,
3632
) -> *mut CMS_ContentInfo;
3733

38-
#[cfg(ossl101)]
3934
pub fn CMS_verify(
4035
cms: *mut CMS_ContentInfo,
4136
certs: *mut stack_st_X509,
@@ -45,15 +40,13 @@ extern "C" {
4540
flags: c_uint,
4641
) -> c_int;
4742

48-
#[cfg(ossl101)]
4943
pub fn CMS_encrypt(
5044
certs: *mut stack_st_X509,
5145
data: *mut BIO,
5246
cipher: *const EVP_CIPHER,
5347
flags: c_uint,
5448
) -> *mut CMS_ContentInfo;
5549

56-
#[cfg(ossl101)]
5750
pub fn CMS_decrypt(
5851
cms: *mut CMS_ContentInfo,
5952
pkey: *mut EVP_PKEY,

openssl-sys/src/handwritten/pem.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,12 @@ extern "C" {
9999
u: *mut c_void,
100100
) -> *mut PKCS7;
101101

102-
#[cfg(ossl101)]
103102
pub fn PEM_read_bio_CMS(
104103
bio: *mut BIO,
105104
out: *mut *mut CMS_ContentInfo,
106105
callback: pem_password_cb,
107106
user_data: *mut c_void,
108107
) -> *mut CMS_ContentInfo;
109-
#[cfg(ossl101)]
110108
pub fn PEM_write_bio_CMS(bio: *mut BIO, cms: *const CMS_ContentInfo) -> c_int;
111109
}
112110

openssl-sys/src/handwritten/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ cfg_if! {
686686
))]
687687
next_proto_select_cb_arg: *mut c_void,
688688

689-
#[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), ossl101))]
689+
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
690690
srtp_profiles: *mut c_void,
691691
#[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), ossl102))]
692692
alpn_select_cb: *mut c_void,

openssl-sys/src/pkcs7.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ pub const PKCS7_STREAM: c_int = 0x1000;
1616
pub const PKCS7_NOCRL: c_int = 0x2000;
1717
pub const PKCS7_PARTIAL: c_int = 0x4000;
1818
pub const PKCS7_REUSE_DIGEST: c_int = 0x8000;
19-
#[cfg(not(any(ossl101, ossl102, libressl)))]
19+
#[cfg(ossl110)]
2020
pub const PKCS7_NO_DUAL_CONTENT: c_int = 0x10000;

openssl/build.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,8 @@ fn main() {
126126

127127
if let Ok(version) = env::var("DEP_OPENSSL_VERSION_NUMBER") {
128128
let version = u64::from_str_radix(&version, 16).unwrap();
129+
println!("cargo:rustc-cfg=ossl101");
129130

130-
if version >= 0x1_00_01_00_0 {
131-
println!("cargo:rustc-cfg=ossl101");
132-
}
133131
if version >= 0x1_00_02_00_0 {
134132
println!("cargo:rustc-cfg=ossl102");
135133
}

openssl/src/cms.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ bitflags! {
4343
const REUSE_DIGEST = ffi::CMS_REUSE_DIGEST;
4444
const USE_KEYID = ffi::CMS_USE_KEYID;
4545
const DEBUG_DECRYPT = ffi::CMS_DEBUG_DECRYPT;
46-
#[cfg(all(not(libressl), not(ossl101)))]
46+
#[cfg(ossl102)]
4747
const KEY_PARAM = ffi::CMS_KEY_PARAM;
48-
#[cfg(all(not(libressl), not(ossl101), not(ossl102)))]
48+
#[cfg(ossl110)]
4949
const ASCIICRLF = ffi::CMS_ASCIICRLF;
5050
}
5151
}
@@ -228,7 +228,7 @@ impl CmsContentInfo {
228228
}
229229

230230
/// Verify this CmsContentInfo's signature,
231-
/// This will search the 'certs' list for the signing certificate.
231+
/// This will search the 'certs' list for the signing certificate.
232232
/// Additional certificates, needed for building the certificate chain, may be
233233
/// given in 'store' as well as additional CRLs.
234234
/// A detached signature may be passed in `detached_data`. The signed content

openssl/src/pkcs7.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ bitflags! {
7575
const NOCRL = ffi::PKCS7_NOCRL;
7676
const PARTIAL = ffi::PKCS7_PARTIAL;
7777
const REUSE_DIGEST = ffi::PKCS7_REUSE_DIGEST;
78-
#[cfg(not(any(ossl101, ossl102, libressl)))]
78+
#[cfg(ossl110)]
7979
const NO_DUAL_CONTENT = ffi::PKCS7_NO_DUAL_CONTENT;
8080
}
8181
}

0 commit comments

Comments
 (0)