Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+6 -1
+2
crypto/shash.c
··· 479 479 480 480 if (alg->descsize > HASH_MAX_DESCSIZE) 481 481 return -EINVAL; 482 + if (alg->statesize > HASH_MAX_STATESIZE) 483 + return -EINVAL; 482 484 483 485 return 0; 484 486 }
+4 -1
include/crypto/hash.h
··· 167 167 168 168 #define HASH_MAX_DIGESTSIZE 64 169 169 170 + /* Worst case is sha3-224. */ 171 + #define HASH_MAX_STATESIZE 200 + 144 + 1 172 + 170 173 /* 171 - * Worst case is hmac(sha-224-s390). Its context is a nested 'shash_desc' 174 + * Worst case is hmac(sha3-224-s390). Its context is a nested 'shash_desc' 172 175 * containing a 'struct s390_sha_ctx'. 173 176 */ 174 177 #define HASH_MAX_DESCSIZE (sizeof(struct shash_desc) + 360)