The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Jiangshan Yi <yijiangshan@kylinos.cn>
Cc: ignat@linux.win, herbert@gondor.apana.org.au,
	davem@davemloft.net, linux-kernel@vger.kernel.org,
	linux-crypto@vger.kernel.org, 13667453960@163.com
Subject: Re: [PATCH] crypto: rsassa-pkcs1 - Use constant-time digest comparison
Date: Mon, 20 Jul 2026 08:19:12 +0200	[thread overview]
Message-ID: <al294FVRcs8-ulcZ@wunner.de> (raw)
In-Reply-To: <20260720021322.122784-1-yijiangshan@kylinos.cn>

On Mon, Jul 20, 2026 at 10:13:22AM +0800, Jiangshan Yi wrote:
> +++ b/crypto/rsassa-pkcs1.c
> @@ -291,7 +291,7 @@ static int rsassa_pkcs1_verify(struct crypto_sig *tfm,
>  	/* RFC 8017 sec 8.2.2 step 4 - comparison of digest with out_buf */
>  	if (dlen != dst_len - pos)
>  		return -EKEYREJECTED;
> -	if (memcmp(digest, out_buf + pos, dlen) != 0)
> +	if (crypto_memneq(digest, out_buf + pos, dlen))
>  		return -EKEYREJECTED;
>  
>  	return 0;

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

https://lore.kernel.org/all/alEr_e-G0L2nxxv-@fudgebox/T/#u

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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20  2:13 [PATCH] crypto: rsassa-pkcs1 - Use constant-time digest comparison Jiangshan Yi
2026-07-20  6:19 ` 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=al294FVRcs8-ulcZ@wunner.de \
    --to=lukas@wunner.de \
    --cc=13667453960@163.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=ignat@linux.win \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox