Skip to content

Commit 37c6fc3

Browse files
committed
crypto: skcipher - Pass statesize for simple lskcipher instances
When ecb is used to wrap an lskcipher, the statesize isn't set correctly. Fix this by making the simple instance creator set the statesize. Reported-by: syzbot+8ffb0839a24e9c6bfa76@syzkaller.appspotmail.com Reported-by: Edward Adam Davis <eadavis@qq.com> Fixes: 662ea18 ("crypto: skcipher - Make use of internal state") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 0eaef67 commit 37c6fc3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crypto/lskcipher.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ struct lskcipher_instance *lskcipher_alloc_instance_simple(
642642
inst->alg.co.min_keysize = cipher_alg->co.min_keysize;
643643
inst->alg.co.max_keysize = cipher_alg->co.max_keysize;
644644
inst->alg.co.ivsize = cipher_alg->co.base.cra_blocksize;
645+
inst->alg.co.statesize = cipher_alg->co.statesize;
645646

646647
/* Use struct crypto_lskcipher * by default, can be overridden */
647648
inst->alg.co.base.cra_ctxsize = sizeof(struct crypto_lskcipher *);

0 commit comments

Comments
 (0)