Skip to content

Commit 8e16a8b

Browse files
authored
Merge pull request #1962 from zh-jq/ec-sm2
add Nid::SM2 and pkey Id::SM2
2 parents 006afe9 + 9840b53 commit 8e16a8b

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

openssl-sys/src/evp.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ pub const EVP_PKEY_RSA: c_int = NID_rsaEncryption;
1010
pub const EVP_PKEY_DSA: c_int = NID_dsa;
1111
pub const EVP_PKEY_DH: c_int = NID_dhKeyAgreement;
1212
pub const EVP_PKEY_EC: c_int = NID_X9_62_id_ecPublicKey;
13+
#[cfg(ossl111)]
14+
pub const EVP_PKEY_SM2: c_int = NID_sm2;
1315
#[cfg(any(ossl111, libressl370))]
1416
pub const EVP_PKEY_X25519: c_int = NID_X25519;
1517
#[cfg(any(ossl111, libressl370))]

openssl-sys/src/obj_mac.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,8 @@ pub const NID_ED25519: c_int = 952;
935935
#[cfg(ossl111)]
936936
pub const NID_ED448: c_int = 1088;
937937
#[cfg(ossl111)]
938+
pub const NID_sm2: c_int = 1172;
939+
#[cfg(ossl111)]
938940
pub const NID_sm3: c_int = 1143;
939941
#[cfg(libressl291)]
940942
pub const NID_sm3: c_int = 968;

openssl/src/nid.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,8 @@ impl Nid {
10741074
pub const AES_128_CBC_HMAC_SHA1: Nid = Nid(ffi::NID_aes_128_cbc_hmac_sha1);
10751075
pub const AES_192_CBC_HMAC_SHA1: Nid = Nid(ffi::NID_aes_192_cbc_hmac_sha1);
10761076
pub const AES_256_CBC_HMAC_SHA1: Nid = Nid(ffi::NID_aes_256_cbc_hmac_sha1);
1077+
#[cfg(ossl111)]
1078+
pub const SM2: Nid = Nid(ffi::NID_sm2);
10771079
#[cfg(any(ossl111, libressl291))]
10781080
pub const SM3: Nid = Nid(ffi::NID_sm3);
10791081
#[cfg(ossl111)]

openssl/src/pkey.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ impl Id {
8585
pub const DSA: Id = Id(ffi::EVP_PKEY_DSA);
8686
pub const DH: Id = Id(ffi::EVP_PKEY_DH);
8787
pub const EC: Id = Id(ffi::EVP_PKEY_EC);
88+
#[cfg(ossl111)]
89+
pub const SM2: Id = Id(ffi::EVP_PKEY_SM2);
8890

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

0 commit comments

Comments
 (0)