diff mbox series

[ima-evm-utils,v2,2/2] ima-evm-utils: add SM3 to pkey_hash_algo algorithm list

Message ID 20200709033416.16845-2-tianjia.zhang@linux.alibaba.com (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

tianjia.zhang July 9, 2020, 3:34 a.m. UTC
SM3 was published by State Encryption Management Bureau, China.
It has been well supported in the kernel and openssl.
This patch allows SM3 to be used smoothly by specifying the
parameter `-a sm3` or `--hashalgo sm3`.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
---
 src/libimaevm.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Mimi Zohar July 10, 2020, 5:54 p.m. UTC | #1
On Thu, 2020-07-09 at 11:34 +0800, Tianjia Zhang wrote:
> SM3 was published by State Encryption Management Bureau, China.
> It has been well supported in the kernel and openssl.
> This patch allows SM3 to be used smoothly by specifying the
> parameter `-a sm3` or `--hashalgo sm3`.
> 
> Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
> ---
>  src/libimaevm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/libimaevm.c b/src/libimaevm.c
> index b485171..b8d5769 100644
> --- a/src/libimaevm.c
> +++ b/src/libimaevm.c
> @@ -71,6 +71,7 @@ static const char *const pkey_hash_algo[PKEY_HASH__LAST] = {
>  	[PKEY_HASH_SHA384]	= "sha384",
>  	[PKEY_HASH_SHA512]	= "sha512",
>  	[PKEY_HASH_SHA224]	= "sha224",
> +	[PKEY_HASH_SM3_256]	= "sm3",
>  	[PKEY_HASH_STREEBOG_256] = "md_gost12_256",
>  	[PKEY_HASH_STREEBOG_512] = "md_gost12_512",
>  };

Sorry, I had forgotten the name in hash_info.c was recently changed
from "sm3-256" to just "sm3".

This patch set patch is now in the "next" branch.

thanks,

Mimi
diff mbox series

Patch

diff --git a/src/libimaevm.c b/src/libimaevm.c
index b485171..b8d5769 100644
--- a/src/libimaevm.c
+++ b/src/libimaevm.c
@@ -71,6 +71,7 @@  static const char *const pkey_hash_algo[PKEY_HASH__LAST] = {
 	[PKEY_HASH_SHA384]	= "sha384",
 	[PKEY_HASH_SHA512]	= "sha512",
 	[PKEY_HASH_SHA224]	= "sha224",
+	[PKEY_HASH_SM3_256]	= "sm3",
 	[PKEY_HASH_STREEBOG_256] = "md_gost12_256",
 	[PKEY_HASH_STREEBOG_512] = "md_gost12_512",
 };