From: Herbert Xu <herbert@gondor.apana.org.au>
To: Lukas Wunner <lukas@wunner.de>
Cc: "David S. Miller" <davem@davemloft.net>,
Stefan Berger <stefanb@linux.ibm.com>,
Vitaly Chikunov <vt@altlinux.org>,
David Howells <dhowells@redhat.com>,
Ignat Korchagin <ignat@cloudflare.com>,
linux-crypto@vger.kernel.org, keyrings@vger.kernel.org,
Dan Carpenter <dan.carpenter@linaro.org>
Subject: Re: [PATCH 3/3] crypto: ecdsa - Fix NIST P521 key size reported by KEYCTL_PKEY_QUERY
Date: Sat, 4 Jan 2025 08:45:10 +0800 [thread overview]
Message-ID: <Z3iElsILmoSu6FuC@gondor.apana.org.au> (raw)
In-Reply-To: <a0e1aa407de754e03a7012049e45e25d7af10e08.1735236227.git.lukas@wunner.de>
On Thu, Dec 26, 2024 at 07:08:03PM +0100, Lukas Wunner wrote:
>
> diff --git a/crypto/ecdsa-p1363.c b/crypto/ecdsa-p1363.c
> index eaae7214d69b..c4f458df18ed 100644
> --- a/crypto/ecdsa-p1363.c
> +++ b/crypto/ecdsa-p1363.c
> @@ -21,7 +21,7 @@ static int ecdsa_p1363_verify(struct crypto_sig *tfm,
> const void *digest, unsigned int dlen)
> {
> struct ecdsa_p1363_ctx *ctx = crypto_sig_ctx(tfm);
> - unsigned int keylen = crypto_sig_keysize(ctx->child);
> + unsigned int keylen = DIV_ROUND_UP(crypto_sig_keysize(ctx->child), 8);
This may overflow unnecessarily, please rewrite these as:
X / 8 + !!(X & 7)
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
next prev parent reply other threads:[~2025-01-04 0:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-26 18:08 [PATCH 0/3] ecdsa KEYCTL_PKEY_QUERY fixes Lukas Wunner
2024-12-26 18:08 ` [PATCH 1/3] crypto: sig - Prepare for algorithms with variable signature size Lukas Wunner
2025-01-02 15:06 ` Stefan Berger
2024-12-26 18:08 ` [PATCH 2/3] crypto: ecdsa - Fix enc/dec size reported by KEYCTL_PKEY_QUERY Lukas Wunner
2025-01-02 14:09 ` Stefan Berger
2024-12-26 18:08 ` [PATCH 3/3] crypto: ecdsa - Fix NIST P521 key " Lukas Wunner
2025-01-02 17:45 ` Stefan Berger
2025-01-03 17:38 ` Lukas Wunner
2025-01-03 18:06 ` Stefan Berger
2025-01-04 0:45 ` Herbert Xu [this message]
2025-01-04 11:31 ` Lukas Wunner
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=Z3iElsILmoSu6FuC@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=ignat@cloudflare.com \
--cc=keyrings@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=stefanb@linux.ibm.com \
--cc=vt@altlinux.org \
/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;
as well as URLs for NNTP newsgroup(s).