From patchwork Thu Jul 9 03:34:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "tianjia.zhang" X-Patchwork-Id: 11653285 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5302613B4 for ; Thu, 9 Jul 2020 03:34:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 43007206F6 for ; Thu, 9 Jul 2020 03:34:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726245AbgGIDeT (ORCPT ); Wed, 8 Jul 2020 23:34:19 -0400 Received: from out30-43.freemail.mail.aliyun.com ([115.124.30.43]:40586 "EHLO out30-43.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726184AbgGIDeT (ORCPT ); Wed, 8 Jul 2020 23:34:19 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04427;MF=tianjia.zhang@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0U2A3NAd_1594265657; Received: from localhost(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0U2A3NAd_1594265657) by smtp.aliyun-inc.com(127.0.0.1); Thu, 09 Jul 2020 11:34:17 +0800 From: Tianjia Zhang To: zohar@linux.ibm.com, vt@altlinux.org, linux-integrity@vger.kernel.org Cc: tianjia.zhang@linux.alibaba.com Subject: [PATCH ima-evm-utils v2 2/2] ima-evm-utils: add SM3 to pkey_hash_algo algorithm list Date: Thu, 9 Jul 2020 11:34:16 +0800 Message-Id: <20200709033416.16845-2-tianjia.zhang@linux.alibaba.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200709033416.16845-1-tianjia.zhang@linux.alibaba.com> References: <20200709033416.16845-1-tianjia.zhang@linux.alibaba.com> Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org 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 --- 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", };