diff options
author | Tudor Ambarus <tudor.ambarus@microchip.com> | 2019-12-13 10:54:56 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-12-20 07:58:35 +0100 |
commit | 27f4adf724e16c0cb49dd015a089d8bdcb18353b (patch) | |
tree | 2a8ce71e7d7f9ea9cdf19de859979a8d6fa4ef61 /drivers/crypto/atmel-tdes.c | |
parent | crypto: atmel-{sha,tdes} - Print warn message even when deferring (diff) | |
download | linux-27f4adf724e16c0cb49dd015a089d8bdcb18353b.tar.xz linux-27f4adf724e16c0cb49dd015a089d8bdcb18353b.zip |
crypto: atmel-{aes,tdes} - Update the IV only when the op succeeds
Do not update the IV in case of errors.
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r-- | drivers/crypto/atmel-tdes.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c index 83a6d42c8921..e7cd7b01b931 100644 --- a/drivers/crypto/atmel-tdes.c +++ b/drivers/crypto/atmel-tdes.c @@ -597,7 +597,7 @@ static void atmel_tdes_finish_req(struct atmel_tdes_dev *dd, int err) dd->flags &= ~TDES_FLAGS_BUSY; - if ((rctx->mode & TDES_FLAGS_OPMODE_MASK) != TDES_FLAGS_ECB) + if (!err && (rctx->mode & TDES_FLAGS_OPMODE_MASK) != TDES_FLAGS_ECB) atmel_tdes_set_iv_as_last_ciphertext_block(dd); req->base.complete(&req->base, err); |