All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Jiangshan Yi <yijiangshan@kylinos.cn>
Cc: dhowells@redhat.com, ignat@linux.win,
	herbert@gondor.apana.org.au, davem@davemloft.net,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
	keyrings@vger.kernel.org, 13667453960@163.com
Subject: Re: [PATCH] crypto: pkcs7 - Use constant-time message digest comparison
Date: Mon, 20 Jul 2026 08:21:17 +0200	[thread overview]
Message-ID: <al2-XdcuEYRbnFLw@wunner.de> (raw)
In-Reply-To: <20260720032316.210113-1-yijiangshan@kylinos.cn>

On Mon, Jul 20, 2026 at 11:23:16AM +0800, Jiangshan Yi wrote:
> +++ b/crypto/asymmetric_keys/pkcs7_verify.c
> @@ -93,8 +94,8 @@ static int pkcs7_digest(struct pkcs7_message *pkcs7,
>  			goto error;
>  		}
>  
> -		if (memcmp(sig->m, sinfo->msgdigest,
> -			   sinfo->msgdigest_len) != 0) {
> +		if (crypto_memneq(sig->m, sinfo->msgdigest,
> +				  sinfo->msgdigest_len)) {
>  			pr_warn("Sig %u: Message digest doesn't match\n",
>  				sinfo->index);
>  			ret = -EKEYREJECTED;

The exact same patch was previously submitted by someone else
and rejected:

https://lore.kernel.org/all/alEsSl8i1_FpoU0f@fudgebox/T/#u

      reply	other threads:[~2026-07-20  6:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20  3:23 [PATCH] crypto: pkcs7 - Use constant-time message digest comparison Jiangshan Yi
2026-07-20  6:21 ` Lukas Wunner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=al2-XdcuEYRbnFLw@wunner.de \
    --to=lukas@wunner.de \
    --cc=13667453960@163.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=ignat@linux.win \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yijiangshan@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.