From f1f5169b19a21b42cbca43cc723b3fc9da5576cf Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Wed, 27 Sep 2023 07:22:21 -0400 Subject: [PATCH] Expose two additional Pkey IDs --- openssl-sys/src/evp.rs | 4 ++++ openssl-sys/src/obj_mac.rs | 2 ++ openssl/src/pkey.rs | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/openssl-sys/src/evp.rs b/openssl-sys/src/evp.rs index d2ca215407..fcbee00ec6 100644 --- a/openssl-sys/src/evp.rs +++ b/openssl-sys/src/evp.rs @@ -7,8 +7,12 @@ pub const PKCS5_SALT_LEN: c_int = 8; pub const PKCS12_DEFAULT_ITER: c_int = 2048; pub const EVP_PKEY_RSA: c_int = NID_rsaEncryption; +#[cfg(any(openssl111, boringssl))] +pub const EVP_PKEY_RSA_PSS: c_int = NID_rsassaPss; pub const EVP_PKEY_DSA: c_int = NID_dsa; pub const EVP_PKEY_DH: c_int = NID_dhKeyAgreement; +#[cfg(ossl110)] +pub const EVP_PKEY_DHX: c_int = NID_dhpublicnumber; pub const EVP_PKEY_EC: c_int = NID_X9_62_id_ecPublicKey; #[cfg(ossl111)] pub const EVP_PKEY_SM2: c_int = NID_sm2; diff --git a/openssl-sys/src/obj_mac.rs b/openssl-sys/src/obj_mac.rs index 6ae48834b5..1b24c3cbd8 100644 --- a/openssl-sys/src/obj_mac.rs +++ b/openssl-sys/src/obj_mac.rs @@ -135,6 +135,8 @@ pub const NID_sha512WithRSAEncryption: c_int = 670; pub const NID_sha224WithRSAEncryption: c_int = 671; pub const NID_pkcs3: c_int = 27; pub const NID_dhKeyAgreement: c_int = 28; +#[cfg(ossl110)] +pub const NID_dhpublicnumber: c_int = 920; pub const NID_pkcs5: c_int = 187; pub const NID_pbeWithMD2AndDES_CBC: c_int = 9; pub const NID_pbeWithMD5AndDES_CBC: c_int = 10; diff --git a/openssl/src/pkey.rs b/openssl/src/pkey.rs index 453aeed72f..fab4f5d118 100644 --- a/openssl/src/pkey.rs +++ b/openssl/src/pkey.rs @@ -78,12 +78,16 @@ pub struct Id(c_int); impl Id { pub const RSA: Id = Id(ffi::EVP_PKEY_RSA); + #[cfg(any(openssl111, boringssl))] + pub const RSA_PSS: Id = Id(ffi::EVP_PKEY_RSA_PSS); #[cfg(not(boringssl))] pub const HMAC: Id = Id(ffi::EVP_PKEY_HMAC); #[cfg(not(boringssl))] pub const CMAC: Id = Id(ffi::EVP_PKEY_CMAC); pub const DSA: Id = Id(ffi::EVP_PKEY_DSA); pub const DH: Id = Id(ffi::EVP_PKEY_DH); + #[cfg(ossl110)] + pub const DHX: Id = Id(ffi::EVP_PKEY_DHX); pub const EC: Id = Id(ffi::EVP_PKEY_EC); #[cfg(ossl111)] pub const SM2: Id = Id(ffi::EVP_PKEY_SM2);