mirror of
https://github.com/AuxXxilium/kmod.git
synced 2025-02-21 17:07:18 +07:00
libkmod: Support SM3 hash algorithm
SM3 has been supported in kernel and cryptographic libraries like openssl. This patch adds support for the SM3 algorithm of kmod. Signed-off-by: HuaxinLu <luhuaxin1@huawei.com>
This commit is contained in:
parent
edc7f3a2d3
commit
f609cb5185
@ -56,6 +56,7 @@ enum pkey_hash_algo {
|
||||
PKEY_HASH_SHA384,
|
||||
PKEY_HASH_SHA512,
|
||||
PKEY_HASH_SHA224,
|
||||
PKEY_HASH_SM3,
|
||||
PKEY_HASH__LAST
|
||||
};
|
||||
|
||||
@ -68,6 +69,7 @@ const char *const pkey_hash_algo[PKEY_HASH__LAST] = {
|
||||
[PKEY_HASH_SHA384] = "sha384",
|
||||
[PKEY_HASH_SHA512] = "sha512",
|
||||
[PKEY_HASH_SHA224] = "sha224",
|
||||
[PKEY_HASH_SM3] = "sm3",
|
||||
};
|
||||
|
||||
enum pkey_id_type {
|
||||
@ -161,6 +163,10 @@ static int obj_to_hash_algo(const ASN1_OBJECT *o)
|
||||
return PKEY_HASH_SHA512;
|
||||
case NID_sha224:
|
||||
return PKEY_HASH_SHA224;
|
||||
# ifndef OPENSSL_NO_SM3
|
||||
case NID_sm3:
|
||||
return PKEY_HASH_SM3;
|
||||
# endif
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user