Skip to content

Commit

Permalink
more type fiddling
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Theil <[email protected]>
  • Loading branch information
thillux committed Oct 12, 2023
1 parent 8472aff commit 11f2721
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions openssl/src/x509/sbgp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ impl ASIdentifiers {
if (*asnum).type_ != ASIdentifierChoice_asIdsOrRanges {
return None;
}
if let Some(s) = StackRef::<ASIdOrRange>::from_const_ptr_opt((*asnum).u.asIdsOrRanges) {
#[cfg(ossl320)]
let asRange = StackRef::<ASIdOrRange>::from_const_ptr_opt((*asnum).u.asIdsOrRanges);
#[cfg(not(ossl320))]
let as_range = StackRef::<ASIdOrRange>::from_const_ptr_opt((*asnum).asIdsOrRanges);
if let Some(s) = as_range {
for a_ptr in s {
let a = a_ptr.as_ptr();
if (*a).type_ == ASIdOrRange_id {
Expand Down Expand Up @@ -133,7 +137,7 @@ impl IPAddressFamily {
pub fn fam(&self) -> Option<IPVersion> {
let ptr = self.0;
unsafe {
match X509v3_addr_get_afi(ptr) {
match X509v3_addr_get_afi(ptr) as libc::c_int {
IANA_AFI_IPV4 => Some(IPVersion::V4),
IANA_AFI_IPV6 => Some(IPVersion::V6),
_ => None,
Expand All @@ -149,8 +153,12 @@ impl IPAddressFamily {
if (*choice).type_ != IPAddressChoice_addressesOrRanges {
return None;
}
#[cfg(ossl320)]
let stack =
StackRef::<IPAddressOrRange>::from_const_ptr_opt((*choice).u.addressesOrRanges)?;
#[cfg(not(ossl320))]
let stack =
StackRef::<IPAddressOrRange>::from_const_ptr_opt((*choice).addressesOrRanges)?;
for e in stack {
let mut min = MaybeUninit::<[u8; 16]>::uninit();
let mut max = MaybeUninit::<[u8; 16]>::uninit();
Expand Down

0 comments on commit 11f2721

Please sign in to comment.