Skip to content

Commit 16e4176

Browse files
committed
fixes
1 parent 6654131 commit 16e4176

File tree

4 files changed

+32
-6
lines changed

4 files changed

+32
-6
lines changed

openssl-sys/build/cfgs.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ pub fn get(openssl_version: Option<u64>, libressl_version: Option<u64>) -> Vec<&
7171
} else {
7272
let openssl_version = openssl_version.unwrap();
7373

74+
if openssl_version >= 0x3_04_00_00_0 {
75+
cfgs.push("ossl340");
76+
}
7477
if openssl_version >= 0x3_03_00_00_0 {
7578
cfgs.push("ossl330");
7679
}

openssl-sys/build/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ fn main() {
120120
println!("cargo:rustc-check-cfg=cfg(ossl310)");
121121
println!("cargo:rustc-check-cfg=cfg(ossl320)");
122122
println!("cargo:rustc-check-cfg=cfg(ossl330)");
123+
println!("cargo:rustc-check-cfg=cfg(ossl340)");
123124

124125
check_ssl_kind();
125126

openssl-sys/src/evp.rs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,28 @@ cfg_if! {
184184
pub const EVP_PKEY_OP_DERIVE: c_int = 1 << 10;
185185
}
186186
}
187+
#[cfg(ossl340)]
188+
pub const EVP_PKEY_OP_SIGNMSG: c_int = 1 << 14;
189+
#[cfg(ossl340)]
190+
pub const EVP_PKEY_OP_VERIFYMSG: c_int = 1 << 15;
187191

188-
pub const EVP_PKEY_OP_TYPE_SIG: c_int = EVP_PKEY_OP_SIGN
189-
| EVP_PKEY_OP_VERIFY
190-
| EVP_PKEY_OP_VERIFYRECOVER
191-
| EVP_PKEY_OP_SIGNCTX
192-
| EVP_PKEY_OP_VERIFYCTX;
192+
cfg_if! {
193+
if #[cfg(ossl340)] {
194+
pub const EVP_PKEY_OP_TYPE_SIG: c_int = EVP_PKEY_OP_SIGN
195+
| EVP_PKEY_OP_SIGNMSG
196+
| EVP_PKEY_OP_VERIFY
197+
| EVP_PKEY_OP_VERIFYMSG
198+
| EVP_PKEY_OP_VERIFYRECOVER
199+
| EVP_PKEY_OP_SIGNCTX
200+
| EVP_PKEY_OP_VERIFYCTX;
201+
} else {
202+
pub const EVP_PKEY_OP_TYPE_SIG: c_int = EVP_PKEY_OP_SIGN
203+
| EVP_PKEY_OP_VERIFY
204+
| EVP_PKEY_OP_VERIFYRECOVER
205+
| EVP_PKEY_OP_SIGNCTX
206+
| EVP_PKEY_OP_VERIFYCTX;
207+
}
208+
}
193209

194210
pub const EVP_PKEY_OP_TYPE_CRYPT: c_int = EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT;
195211

openssl-sys/src/obj_mac.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ pub const NID_id_mod_cmp2000: c_int = 284;
346346
pub const NID_info_access: c_int = 177;
347347
pub const NID_biometricInfo: c_int = 285;
348348
pub const NID_qcStatements: c_int = 286;
349-
pub const NID_ac_auditEntity: c_int = 287;
350349
pub const NID_ac_targeting: c_int = 288;
351350
pub const NID_aaControls: c_int = 289;
352351
pub const NID_sbgp_ipAddrBlock: c_int = 290;
@@ -1015,3 +1014,10 @@ pub const NID_shake256: c_int = 1101;
10151014
pub const NID_chacha20_poly1305: c_int = 1018;
10161015
#[cfg(libressl271)]
10171016
pub const NID_chacha20_poly1305: c_int = 967;
1017+
cfg_if! {
1018+
if #[cfg(ossl340)] {
1019+
pub const NID_ac_auditEntity: c_int = 1323;
1020+
} else {
1021+
pub const NID_ac_auditEntity: c_int = 287;
1022+
}
1023+
}

0 commit comments

Comments
 (0)