Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp364301pxb; Sat, 18 Sep 2021 05:10:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9CloT4hABZM5r4scta86oGiQeFf8IOrmv3EeCnV49ul57ifFqmIWiP9c+MK1tq+dksQN4 X-Received: by 2002:a05:6e02:1a23:: with SMTP id g3mr11322075ile.139.1631967053118; Sat, 18 Sep 2021 05:10:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631967053; cv=none; d=google.com; s=arc-20160816; b=zNzvz6vcpa+ql4hF7zVSFlFc2IUVrkXlHBpVXeMTWPrqz6bs7kC7tAZ2eMAjntFzc8 b8caOlfzqxtMFNzpwFNJKUYH4AD3BWzRlNuhK1iK57lTa43Y3WCBI7MXylskKE4GekEN DENa5xnfFHT5CfJdYuK+rFgcnIM8UBo2VT7xH+V8oKjUKCZ9LySXGfDLlMQC5p1RWihT KMiU4JC5fNfO0BL+l5MgYvu1+DgXfcJywGN0vSneMIZcVzHxWpL1aJZXC5bwxcG1lgVt NIcS09ED6wNNuoRrT5HqrQr7p0niV68Au1Qn46bcVpT+7T2CvCdf65VWjTuW2nlbPnEa 6VWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject; bh=6QMVcWGp7z8nwFayHxq8RaMZKdFCtAdiYDwV27lKVqk=; b=DVmkoumO3H6Y51sSw4OPa/8IRTe12n3GWpKIQG/8kV7B/cspdvLLaGcTP+bKTjLX6y ingNmjpN9lTX8LeXTG0pcNu53nnn/Vruu0UFFRITO1vQu8Q3VVIfN3h13iz0xuargUXL 19TdR7T+PkjvsgHDjRLzbT0chnkH/9VM5FTbws7t/VJKc86F3a7d9H20HOGVs8QNTkLL znh9ky7x0fcbyX7ErGLwyt+O+RRYIEgdvsiYlaDSxs6Q5jKvETT1aUaLiFwn7V4XeADu 5gIlfLxi2L9Soq6S2ut7xGyYM2fRfVd/hxIuuWlUyET6vsnVRg4mVnffc5jgDY+fl6it qDcw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c1si8699102ilo.83.2021.09.18.05.10.26; Sat, 18 Sep 2021 05:10:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239138AbhIRC0u (ORCPT + 99 others); Fri, 17 Sep 2021 22:26:50 -0400 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]:53677 "EHLO out30-45.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231142AbhIRC0t (ORCPT ); Fri, 17 Sep 2021 22:26:49 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=alimailimapcm10staff010182156082;MF=tianjia.zhang@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0Uojv9nD_1631931922; Received: from B-455UMD6M-2027.local(mailfrom:tianjia.zhang@linux.alibaba.com fp:SMTPD_---0Uojv9nD_1631931922) by smtp.aliyun-inc.com(127.0.0.1); Sat, 18 Sep 2021 10:25:23 +0800 Subject: Re: [PATCH v3] pkcs7: make parser enable SM2 and SM3 algorithms combination To: David Howells , Herbert Xu , "David S. Miller" , Eric Biggers , Eric Biggers , Mimi Zohar , Vitaly Chikunov , Gilad Ben-Yossef , Pascal van Leeuwen , keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Jia Zhang References: <20210624094705.48673-1-tianjia.zhang@linux.alibaba.com> From: Tianjia Zhang Message-ID: Date: Sat, 18 Sep 2021 10:25:22 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20210624094705.48673-1-tianjia.zhang@linux.alibaba.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org ping. On 6/24/21 5:47 PM, Tianjia Zhang wrote: > Support parsing the message signature of the SM2 and SM3 algorithm > combination. This group of algorithms has been well supported. One > of the main users is module signature verification. > > Signed-off-by: Tianjia Zhang > --- > crypto/asymmetric_keys/pkcs7_parser.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/crypto/asymmetric_keys/pkcs7_parser.c b/crypto/asymmetric_keys/pkcs7_parser.c > index 967329e0a07b..6cf6c4552c11 100644 > --- a/crypto/asymmetric_keys/pkcs7_parser.c > +++ b/crypto/asymmetric_keys/pkcs7_parser.c > @@ -248,6 +248,9 @@ int pkcs7_sig_note_digest_algo(void *context, size_t hdrlen, > case OID_sha224: > ctx->sinfo->sig->hash_algo = "sha224"; > break; > + case OID_sm3: > + ctx->sinfo->sig->hash_algo = "sm3"; > + break; > default: > printk("Unsupported digest algo: %u\n", ctx->last_oid); > return -ENOPKG; > @@ -269,6 +272,10 @@ int pkcs7_sig_note_pkey_algo(void *context, size_t hdrlen, > ctx->sinfo->sig->pkey_algo = "rsa"; > ctx->sinfo->sig->encoding = "pkcs1"; > break; > + case OID_SM2_with_SM3: > + ctx->sinfo->sig->pkey_algo = "sm2"; > + ctx->sinfo->sig->encoding = "raw"; > + break; > default: > printk("Unsupported pkey algo: %u\n", ctx->last_oid); > return -ENOPKG; >