Skip to content

Commit 3bf5d75

Browse files
committed
mark supported OpenSSL version range
Signed-off-by: Markus Theil <[email protected]>
1 parent cc555a8 commit 3bf5d75

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

openssl/src/x509/sbgp.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::mem::MaybeUninit;
22

3+
#[cfg(ossl110)]
34
use ffi::{
45
ASIdOrRange_id, ASIdOrRange_range, ASIdentifierChoice_asIdsOrRanges,
56
ASIdentifierChoice_inherit, IPAddressChoice_addressesOrRanges, X509v3_addr_get_afi,
@@ -15,6 +16,7 @@ use crate::{
1516

1617
use super::X509;
1718

19+
#[cfg(ossl110)]
1820
foreign_type_and_impl_send_sync! {
1921
type CType = ffi::ASIdOrRange;
2022
fn drop = ffi::ASIdOrRange_free;
@@ -24,11 +26,12 @@ foreign_type_and_impl_send_sync! {
2426
/// Reference to `ASIdOrRange`.
2527
pub struct ASIdOrRangeRef;
2628
}
27-
29+
#[cfg(ossl110)]
2830
impl Stackable for ASIdOrRange {
2931
type StackType = ffi::stack_st_ASIdOrRange;
3032
}
3133

34+
#[cfg(ossl110)]
3235
foreign_type_and_impl_send_sync! {
3336
type CType = ffi::ASIdentifiers;
3437
fn drop = ffi::ASIdentifiers_free;
@@ -39,6 +42,7 @@ foreign_type_and_impl_send_sync! {
3942
pub struct ASIdentifiersRef;
4043
}
4144

45+
#[cfg(ossl110)]
4246
impl ASIdentifiers {
4347
pub fn inherited(&self) -> bool {
4448
unsafe {
@@ -109,6 +113,7 @@ foreign_type_and_impl_send_sync! {
109113
pub struct IPAddressFamilyRef;
110114
}
111115

116+
#[cfg(ossl110)]
112117
impl Stackable for IPAddressFamily {
113118
type StackType = ffi::stack_st_IPAddressFamily;
114119
}
@@ -119,6 +124,7 @@ pub enum IPVersion {
119124
V6,
120125
}
121126

127+
#[cfg(ossl110)]
122128
impl IPAddressFamily {
123129
pub fn fam(&self) -> Option<IPVersion> {
124130
let ptr = self.0;
@@ -180,11 +186,13 @@ impl IPAddressFamily {
180186
}
181187
}
182188

189+
#[cfg(ossl110)]
183190
pub trait ExtractSBGPInfo {
184191
fn asn(&self) -> Option<ASIdentifiers>;
185192
fn ip_addresses(&self) -> Option<Stack<IPAddressFamily>>;
186193
}
187194

195+
#[cfg(ossl110)]
188196
impl ExtractSBGPInfo for X509 {
189197
fn asn(&self) -> Option<ASIdentifiers> {
190198
unsafe {

openssl/src/x509/tests.rs

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use crate::x509::extension::{
1515
AuthorityKeyIdentifier, BasicConstraints, ExtendedKeyUsage, KeyUsage, SbgpAsIdentifier,
1616
SbgpIpAddressIdentifier, SubjectAlternativeName, SubjectKeyIdentifier,
1717
};
18+
#[cfg(ossl110)]
1819
use crate::x509::sbgp::ExtractSBGPInfo;
1920
#[cfg(not(boringssl))]
2021
use crate::x509::store::X509Lookup;
@@ -1182,6 +1183,7 @@ fn test_dist_point_null() {
11821183
}
11831184

11841185
#[test]
1186+
#[cfg(ossl110)]
11851187
fn test_sbgp_extensions_parsing() {
11861188
let cert = include_bytes!("../../test/rfc3779.pem");
11871189
let cert = X509::from_pem(cert).unwrap();
@@ -1210,6 +1212,7 @@ fn test_sbgp_extensions_parsing() {
12101212
}
12111213

12121214
#[test]
1215+
#[cfg(ossl110)]
12131216
fn test_sbgp_extensions_builder() {
12141217
let mut builder = X509Builder::new().unwrap();
12151218
let asn_ext = SbgpAsIdentifier::new()

0 commit comments

Comments
 (0)