Skip to content

Commit

Permalink
Merge pull request #1962 from zh-jq/ec-sm2
Browse files Browse the repository at this point in the history
add Nid::SM2 and pkey Id::SM2
  • Loading branch information
sfackler committed Jun 14, 2023
2 parents 006afe9 + 9840b53 commit 8e16a8b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions openssl-sys/src/evp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ pub const EVP_PKEY_RSA: c_int = NID_rsaEncryption;
pub const EVP_PKEY_DSA: c_int = NID_dsa;
pub const EVP_PKEY_DH: c_int = NID_dhKeyAgreement;
pub const EVP_PKEY_EC: c_int = NID_X9_62_id_ecPublicKey;
#[cfg(ossl111)]
pub const EVP_PKEY_SM2: c_int = NID_sm2;
#[cfg(any(ossl111, libressl370))]
pub const EVP_PKEY_X25519: c_int = NID_X25519;
#[cfg(any(ossl111, libressl370))]
Expand Down
2 changes: 2 additions & 0 deletions openssl-sys/src/obj_mac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,8 @@ pub const NID_ED25519: c_int = 952;
#[cfg(ossl111)]
pub const NID_ED448: c_int = 1088;
#[cfg(ossl111)]
pub const NID_sm2: c_int = 1172;
#[cfg(ossl111)]
pub const NID_sm3: c_int = 1143;
#[cfg(libressl291)]
pub const NID_sm3: c_int = 968;
Expand Down
2 changes: 2 additions & 0 deletions openssl/src/nid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,8 @@ impl Nid {
pub const AES_128_CBC_HMAC_SHA1: Nid = Nid(ffi::NID_aes_128_cbc_hmac_sha1);
pub const AES_192_CBC_HMAC_SHA1: Nid = Nid(ffi::NID_aes_192_cbc_hmac_sha1);
pub const AES_256_CBC_HMAC_SHA1: Nid = Nid(ffi::NID_aes_256_cbc_hmac_sha1);
#[cfg(ossl111)]
pub const SM2: Nid = Nid(ffi::NID_sm2);
#[cfg(any(ossl111, libressl291))]
pub const SM3: Nid = Nid(ffi::NID_sm3);
#[cfg(ossl111)]
Expand Down
2 changes: 2 additions & 0 deletions openssl/src/pkey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ impl Id {
pub const DSA: Id = Id(ffi::EVP_PKEY_DSA);
pub const DH: Id = Id(ffi::EVP_PKEY_DH);
pub const EC: Id = Id(ffi::EVP_PKEY_EC);
#[cfg(ossl111)]
pub const SM2: Id = Id(ffi::EVP_PKEY_SM2);

#[cfg(any(ossl110, boringssl))]
pub const HKDF: Id = Id(ffi::EVP_PKEY_HKDF);
Expand Down

0 comments on commit 8e16a8b

Please sign in to comment.