Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1622475pxv; Fri, 2 Jul 2021 08:13:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy978nwQHPyyL4QLnVsAchGBi1z6yitTyUUtwgppHjf9UE+lxtIWHX+TwH3fxRktkzdzPxA X-Received: by 2002:a5e:a70e:: with SMTP id b14mr384264iod.194.1625238793846; Fri, 02 Jul 2021 08:13:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625238793; cv=none; d=google.com; s=arc-20160816; b=dZvnL/gnbZPPmqMrP5ZYPOi37wS8cvLaNr4goOxeEk2vy0c0KvFqGBBFqE2MC4dwZb /F5jGu4GrVbQC1xkyiRQO9cOzYkn80rtc0hBBx0Iy8UOZpMcr0eWr2197aqTpgMm9n4z FXAxzjj8aafdGItUFOj5npc8mq+RbgZXx537+CxlbwA5yII4HfGLqbB66XTliDJOoeFA KPAeuxFeT4cP4TmbO584iUA+vNbQ5pUURvusNA9XLk5cLkJAcgUIp7avzUBNagxeJCJq jLWNHCyUXnWnKBY0MYx9yaSVecnNL0gmfdNFo0+10neruYgseU7lVcLFIGCJ4sYPUTpK fZBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=u6tnD9BJFQbR85f3eFccHe0CzHxXFtiAVDhpsztQFl8=; b=q0rkEHCosb+ZtP0RmLcDVMDavvTB8sKspfoXynzFq0B9teh3TZnIVRV1j5COAnLotg NFW3V7TZ3cbpBQSYpwRyaYRrgzJpv2qaWgwJR5Oy6Fw5isVOU4a+04HrzsbYIYKFY7qV CGmAnJg84A2PwiXTfIB9DaNiRyXROXURhnwgOULiROd908vZYAFuAJGJ8agWGsBM0FHz OS6kbLVlbUpfh5+zZj1UHK7+y3/QN8Zd7Z5qSAaOon7Mtv507tqFemZQEZ5cPfp1cD+C 8SF65pKg8uj9bh0lISUKWyNe9moSZn2jLE2hU+j3Ne62Kzrm/fg64Ue4Pl0XNA1JmykT jVog== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si3787873jak.4.2021.07.02.08.12.49; Fri, 02 Jul 2021 08:13:13 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231782AbhGBOma (ORCPT + 99 others); Fri, 2 Jul 2021 10:42:30 -0400 Received: from vmicros1.altlinux.org ([194.107.17.57]:50824 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231134AbhGBOma (ORCPT ); Fri, 2 Jul 2021 10:42:30 -0400 Received: from imap.altlinux.org (imap.altlinux.org [194.107.17.38]) by vmicros1.altlinux.org (Postfix) with ESMTP id C611172C8B4; Fri, 2 Jul 2021 17:39:56 +0300 (MSK) Received: from altlinux.org (sole.flsd.net [185.75.180.6]) by imap.altlinux.org (Postfix) with ESMTPSA id 96A5B4A46ED; Fri, 2 Jul 2021 17:39:56 +0300 (MSK) Date: Fri, 2 Jul 2021 17:39:56 +0300 From: Vitaly Chikunov To: Tianjia Zhang Cc: David Howells , Herbert Xu , "David S. Miller" , Eric Biggers , linux-crypto@vger.kernel.org, Jia Zhang , Elvira Khabirova Subject: Re: [PATCH v3] pkcs7: make parser enable SM2 and SM3 algorithms combination Message-ID: <20210702143956.h3d55suhw5ekbag4@altlinux.org> References: <20210624094705.48673-1-tianjia.zhang@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20210624094705.48673-1-tianjia.zhang@linux.alibaba.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Jun 24, 2021 at 05:47:05PM +0800, 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 This will conflict with the patch of Elvira Khabirova adding the same for streebog/ecrdsa. Otherwise, Reviewed-by: Vitaly Chikunov Thanks, > --- > 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; > -- > 2.19.1.3.ge56e4f7