diff options
author | 2025-05-04 21:33:14 +0800 | |
---|---|---|
committer | 2025-05-05 18:20:46 +0800 | |
commit | 2b1a29ce3360570aeff053d1315cd504d94eab31 (patch) | |
tree | aac1ec70b8bf61d92f84a0f38250b0237d70e89f /crypto | |
parent | crypto: zynqmp-sha - Fix partial block implementation (diff) | |
download | wireguard-linux-2b1a29ce3360570aeff053d1315cd504d94eab31.tar.xz wireguard-linux-2b1a29ce3360570aeff053d1315cd504d94eab31.zip |
crypto: shash - Cap state size to HASH_MAX_STATESIZE
Now that all shash algorithms have converted over to the generic
export format, limit the shash state size to HASH_MAX_STATESIZE.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/shash.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/shash.c b/crypto/shash.c index c4a724e55d7a..44a6df3132ad 100644 --- a/crypto/shash.c +++ b/crypto/shash.c @@ -479,6 +479,8 @@ static int shash_prepare_alg(struct shash_alg *alg) if (alg->descsize > HASH_MAX_DESCSIZE) return -EINVAL; + if (alg->statesize > HASH_MAX_STATESIZE) + return -EINVAL; return 0; } |