Skip to content

Commit d703c7a

Browse files
toromanoSTMherbertx
authored andcommitted
crypto: stm32/cryp - fix xts and race condition in crypto_engine requests
Don't erase key: If key is erased before the crypto_finalize_.*_request() call, some pending process will run with a key={ 0 }. Moreover if the key is reset at end of request, it breaks xts chaining mode, as for last xts block (in case input len is not a multiple of block) a new AES request is started without calling again set_key(). Fixes: 9e054ec ("crypto: stm32 - Support for STM32 CRYP crypto module") Signed-off-by: Nicolas Toromanoff <nicolas.toromanoff@foss.st.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 41c7669 commit d703c7a

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

‎drivers/crypto/stm32/stm32-cryp.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,8 +674,6 @@ static void stm32_cryp_finish_req(struct stm32_cryp *cryp, int err)
674674
else
675675
crypto_finalize_skcipher_request(cryp->engine, cryp->req,
676676
err);
677-
678-
memset(cryp->ctx->key, 0, cryp->ctx->keylen);
679677
}
680678

681679
static int stm32_cryp_cpu_start(struct stm32_cryp *cryp)

0 commit comments

Comments
 (0)