Skip to content

Commit d27ac33

Browse files
committed
fixes for current master and OpenSSL 3
Signed-off-by: Markus Theil <[email protected]>
1 parent 187ee6d commit d27ac33

File tree

4 files changed

+23
-16
lines changed

4 files changed

+23
-16
lines changed

openssl-sys/src/handwritten/x509_sbgp.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub struct ASRange {
88
}
99

1010
#[repr(C)]
11-
pub struct _ASIdOrRange {
11+
pub struct ASIdOrRange {
1212
pub type_: c_int,
1313
pub u: ASIdOrRange_st_anon_union,
1414
}
@@ -28,7 +28,7 @@ pub struct ASIdentifierChoice {
2828
}
2929

3030
#[repr(C)]
31-
pub struct _ASIdentifiers {
31+
pub struct ASIdentifiers {
3232
pub asnum: *mut ASIdentifierChoice,
3333
pub rdi: *mut ASIdentifierChoice,
3434
}
@@ -40,7 +40,7 @@ pub struct IPAddressRange {
4040
}
4141

4242
#[repr(C)]
43-
pub struct _IPAddressOrRange {
43+
pub struct IPAddressOrRange {
4444
pub type_: c_int,
4545
pub u: IPAddressOrRange_st_anon_union,
4646
}
@@ -60,7 +60,7 @@ pub struct IPAddressChoice {
6060
}
6161

6262
#[repr(C)]
63-
pub struct _IPAddressFamily {
63+
pub struct IPAddressFamily {
6464
pub addressFamily: *mut ASN1_OCTET_STRING,
6565
pub ipAddressChoice: *mut IPAddressChoice,
6666
}
@@ -69,13 +69,13 @@ stack!(stack_st_IPAddressFamily);
6969
type IPAddrBlocks = stack_st_IPAddressFamily;
7070

7171
extern "C" {
72-
pub fn ASIdentifiers_free(asi: *mut _ASIdentifiers);
73-
pub fn ASIdOrRange_free(asi: *mut _ASIdOrRange);
74-
pub fn IPAddressFamily_free(asi: *mut _IPAddressFamily);
75-
pub fn IPAddressOrRange_free(asi: *mut _IPAddressOrRange);
72+
pub fn ASIdentifiers_free(asi: *mut ASIdentifiers);
73+
pub fn ASIdOrRange_free(asi: *mut ASIdOrRange);
74+
pub fn IPAddressFamily_free(asi: *mut IPAddressFamily);
75+
pub fn IPAddressOrRange_free(asi: *mut IPAddressOrRange);
7676
}
7777

78-
pub unsafe fn X509v3_addr_get_afi(f: *mut _IPAddressFamily) -> c_int {
78+
pub unsafe fn X509v3_addr_get_afi(f: *mut IPAddressFamily) -> c_int {
7979
if f.is_null() {
8080
0
8181
} else {
@@ -151,7 +151,7 @@ fn addr_expand(addr: *mut u8, bs: *const ASN1_BIT_STRING, length: isize, fill: u
151151
/*
152152
* Extract min and max values from an IPAddressOrRange.
153153
*/
154-
fn extract_min_max(aor: *mut _IPAddressOrRange, min: *mut u8, max: *mut u8, length: isize) -> bool {
154+
fn extract_min_max(aor: *mut IPAddressOrRange, min: *mut u8, max: *mut u8, length: isize) -> bool {
155155
unsafe {
156156
match (*aor).type_ {
157157
IPAddressOrRange_addressPrefix => {
@@ -168,7 +168,7 @@ fn extract_min_max(aor: *mut _IPAddressOrRange, min: *mut u8, max: *mut u8, leng
168168
}
169169

170170
pub fn X509v3_addr_get_range(
171-
aor: *mut _IPAddressOrRange,
171+
aor: *mut IPAddressOrRange,
172172
afi: c_int,
173173
min: *mut u8,
174174
max: *mut u8,

openssl/src/x509/extension.rs

+2
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ impl SbgpAsIdentifier {
467467
}
468468

469469
/// Return a `SbgpAsIdentifier` extension as an `X509Extension`.
470+
#[allow(deprecated)]
470471
pub fn build(&self, ctx: &X509v3Context<'_>) -> Result<X509Extension, ErrorStack> {
471472
let mut value = String::new();
472473
let mut first = true;
@@ -542,6 +543,7 @@ impl SbgpIpAddressIdentifier {
542543
}
543544

544545
/// Return a `SbgpIpAddressIdentifier` extension as an `X509Extension`.
546+
#[allow(deprecated)]
545547
pub fn build(&self, ctx: &X509v3Context<'_>) -> Result<X509Extension, ErrorStack> {
546548
let mut value = String::new();
547549
let mut first = true;

openssl/src/x509/sbgp.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::{
1616
use super::X509;
1717

1818
foreign_type_and_impl_send_sync! {
19-
type CType = ffi::_ASIdOrRange;
19+
type CType = ffi::ASIdOrRange;
2020
fn drop = ffi::ASIdOrRange_free;
2121

2222
/// The AS number extension of an `X509` certificate.
@@ -30,7 +30,7 @@ impl Stackable for ASIdOrRange {
3030
}
3131

3232
foreign_type_and_impl_send_sync! {
33-
type CType = ffi::_ASIdentifiers;
33+
type CType = ffi::ASIdentifiers;
3434
fn drop = ffi::ASIdentifiers_free;
3535

3636
/// The AS number extension of an `X509` certificate.
@@ -86,7 +86,7 @@ impl ASIdentifiers {
8686
}
8787

8888
foreign_type_and_impl_send_sync! {
89-
type CType = ffi::_IPAddressOrRange;
89+
type CType = ffi::IPAddressOrRange;
9090
fn drop = ffi::IPAddressOrRange_free;
9191

9292
/// The AS number extension of an `X509` certificate.
@@ -100,7 +100,7 @@ impl Stackable for IPAddressOrRange {
100100
}
101101

102102
foreign_type_and_impl_send_sync! {
103-
type CType = ffi::_IPAddressFamily;
103+
type CType = ffi::IPAddressFamily;
104104
fn drop = ffi::IPAddressFamily_free;
105105

106106
/// The AS number extension of an `X509` certificate.

systest/build.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ fn main() {
118118
s == "ProbeResult" ||
119119
s == "X509_OBJECT_data" || // inline union
120120
s == "DIST_POINT_NAME_st_anon_union" || // inline union
121-
s == "_ASIdOrRange_st_anon_union" || // inline union
121+
s == "ASIdOrRange_st_anon_union" || // inline union
122+
s == "ASIdOrRange" ||
123+
s == "ASIdentifierChoice" ||
124+
s == "IPAddressOrRange_st_anon_union" || // inline union
125+
s == "IPAddressOrRange" ||
126+
s == "IPAddressChoice" ||
122127
s == "PKCS7_data" ||
123128
s == "ASN1_TYPE_value"
124129
});

0 commit comments

Comments
 (0)