summaryrefslogtreecommitdiff
path: root/drivers/crypto
diff options
context:
space:
mode:
authorLionel Debieve <lionel.debieve@st.com>2019-06-28 14:26:54 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2019-07-03 17:15:08 +0300
commit0acabecebc912b3ba06289e4ef40476acc499a37 (patch)
tree0f41d09983ed462af63375dfbb6171f200a2013e /drivers/crypto
parentfdbd643a74efb353a20ecde94a2200e13a283b66 (diff)
downloadlinux-0acabecebc912b3ba06289e4ef40476acc499a37.tar.xz
crypto: stm32/hash - Fix hmac issue more than 256 bytes
Correct condition for the second hmac loop. Key must be only set in the first loop. Initial condition was wrong, HMAC_KEY flag was not properly checked. Signed-off-by: Lionel Debieve <lionel.debieve@st.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/stm32/stm32-hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c
index bfc49e67124b..573ff3fad054 100644
--- a/drivers/crypto/stm32/stm32-hash.c
+++ b/drivers/crypto/stm32/stm32-hash.c
@@ -363,7 +363,7 @@ static int stm32_hash_xmit_cpu(struct stm32_hash_dev *hdev,
return -ETIMEDOUT;
if ((hdev->flags & HASH_FLAGS_HMAC) &&
- (hdev->flags & ~HASH_FLAGS_HMAC_KEY)) {
+ (!(hdev->flags & HASH_FLAGS_HMAC_KEY))) {
hdev->flags |= HASH_FLAGS_HMAC_KEY;
stm32_hash_write_key(hdev);
if (stm32_hash_wait_busy(hdev))