linux-yocto/include/crypto/internal
Stefan Berger 55779f26ea crypto: ecc - Prevent ecc_digits_from_bytes from reading too many bytes
[ Upstream commit c6ab5c915d ]

Prevent ecc_digits_from_bytes from reading too many bytes from the input
byte array in case an insufficient number of bytes is provided to fill the
output digit array of ndigits. Therefore, initialize the most significant
digits with 0 to avoid trying to read too many bytes later on. Convert the
function into a regular function since it is getting too big for an inline
function.

If too many bytes are provided on the input byte array the extra bytes
are ignored since the input variable 'ndigits' limits the number of digits
that will be filled.

Fixes: d67c96fb97 ("crypto: ecdsa - Convert byte arrays with key coordinates to digits")
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-01-09 13:31:52 +01:00
..
acompress.h crypto: acomp - Count error stats differently 2023-03-14 17:06:42 +08:00
aead.h crypto: aead - Use crypto_request_complete 2023-02-13 18:34:48 +08:00
akcipher.h crypto: akcipher - Use crypto_request_complete 2023-02-13 18:34:48 +08:00
blake2b.h
blake2s.h crypto: blake2s - remove shash module 2022-06-10 16:43:49 +08:00
chacha.h
cipher.h crypto: cipher - Add crypto_clone_cipher 2023-05-24 18:12:33 +08:00
cryptouser.h
des.h
ecc.h crypto: ecc - Prevent ecc_digits_from_bytes from reading too many bytes 2025-01-09 13:31:52 +01:00
engine.h crypto: engine - Move struct crypto_engine into internal/engine.h 2023-08-18 17:01:10 +08:00
geniv.h
hash.h crypto: hash - Make crypto_ahash_alg helper available 2023-05-12 18:48:01 +08:00
kdf_selftest.h
kpp.h crypto: kpp - Use crypto_request_complete 2023-02-13 18:34:48 +08:00
poly1305.h
rng.h
rsa.h
scompress.h crypto: acomp - Count error stats differently 2023-03-14 17:06:42 +08:00
sig.h crypto: sig - Add interface for sign/verify 2023-06-23 16:15:36 +08:00
simd.h crypto: simd - Do not call crypto_alloc_tfm during registration 2024-10-10 11:57:26 +02:00
skcipher.h crypto: skcipher - Use crypto_request_complete 2023-02-13 18:34:49 +08:00