Skip to content

Commit b299362

Browse files
ebiggersherbertx
authored andcommitted
crypto: adiantum - propagate CRYPTO_ALG_ASYNC flag to instance
If the stream cipher implementation is asynchronous, then the Adiantum instance must be flagged as asynchronous as well. Otherwise someone asking for a synchronous algorithm can get an asynchronous algorithm. There are no asynchronous xchacha12 or xchacha20 implementations yet which makes this largely a theoretical issue, but it should be fixed. Fixes: 059c2a4 ("crypto: adiantum - add Adiantum support") Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 2fe5598 commit b299362

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎crypto/adiantum.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,8 @@ static int adiantum_create(struct crypto_template *tmpl, struct rtattr **tb)
590590
hash_alg->base.cra_driver_name) >= CRYPTO_MAX_ALG_NAME)
591591
goto out_drop_hash;
592592

593+
inst->alg.base.cra_flags = streamcipher_alg->base.cra_flags &
594+
CRYPTO_ALG_ASYNC;
593595
inst->alg.base.cra_blocksize = BLOCKCIPHER_BLOCK_SIZE;
594596
inst->alg.base.cra_ctxsize = sizeof(struct adiantum_tfm_ctx);
595597
inst->alg.base.cra_alignmask = streamcipher_alg->base.cra_alignmask |

0 commit comments

Comments
 (0)