Skip to content

Commit 0acabec

Browse files
ldebieveherbertx
authored andcommitted
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>
1 parent fdbd643 commit 0acabec

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ static int stm32_hash_xmit_cpu(struct stm32_hash_dev *hdev,
363363
return -ETIMEDOUT;
364364

365365
if ((hdev->flags & HASH_FLAGS_HMAC) &&
366-
(hdev->flags & ~HASH_FLAGS_HMAC_KEY)) {
366+
(!(hdev->flags & HASH_FLAGS_HMAC_KEY))) {
367367
hdev->flags |= HASH_FLAGS_HMAC_KEY;
368368
stm32_hash_write_key(hdev);
369369
if (stm32_hash_wait_busy(hdev))

0 commit comments

Comments
 (0)