mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
a2471684da
software_key_query() returns the maximum signature and digest size for a given key to user space. When it only supported RSA keys, calculating those sizes was trivial as they were always equivalent to the key size. However when ECDSA was added, the function grew somewhat complicated calculations which take the ASN.1 encoding and curve into account. This doesn't scale well and adjusting the calculations is easily forgotten when adding support for new encodings or curves. In fact, when NIST P521 support was recently added, the function was initially not amended: https://lore.kernel.org/all/b749d5ee-c3b8-4cbd-b252-7773e4536e07@linux.ibm.com/ Introduce a ->max_size() callback to struct sig_alg and take advantage of it to move the signature size calculations to ecdsa-x962.c. Introduce a ->digest_size() callback to struct sig_alg and move the maximum ECDSA digest size to ecdsa.c. It is common across ecdsa-x962.c and the upcoming ecdsa-p1363.c and thus inherited by both of them. For all other algorithms, continue using the key size as maximum signature and digest size. Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> |
||
---|---|---|
.. | ||
internal | ||
acompress.h | ||
aead.h | ||
aes.h | ||
akcipher.h | ||
algapi.h | ||
arc4.h | ||
aria.h | ||
authenc.h | ||
b128ops.h | ||
blake2b.h | ||
blake2s.h | ||
blowfish.h | ||
cast5.h | ||
cast6.h | ||
cast_common.h | ||
chacha20poly1305.h | ||
chacha.h | ||
cryptd.h | ||
ctr.h | ||
curve25519.h | ||
des.h | ||
dh.h | ||
drbg.h | ||
ecc_curve.h | ||
ecdh.h | ||
engine.h | ||
gcm.h | ||
gf128mul.h | ||
ghash.h | ||
hash_info.h | ||
hash.h | ||
hmac.h | ||
if_alg.h | ||
kdf_sp800108.h | ||
kpp.h | ||
md5.h | ||
nhpoly1305.h | ||
null.h | ||
padlock.h | ||
pcrypt.h | ||
pkcs7.h | ||
poly1305.h | ||
polyval.h | ||
public_key.h | ||
rng.h | ||
scatterwalk.h | ||
serpent.h | ||
sha1_base.h | ||
sha1.h | ||
sha2.h | ||
sha3.h | ||
sha256_base.h | ||
sha512_base.h | ||
sig.h | ||
skcipher.h | ||
sm3_base.h | ||
sm3.h | ||
sm4.h | ||
streebog.h | ||
twofish.h | ||
utils.h | ||
xts.h |