crypto: stm32/hash - Fix hmac issue more than 256 bytes
authorLionel Debieve <lionel.debieve@st.com>
Fri, 28 Jun 2019 11:26:54 +0000 (13:26 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 3 Jul 2019 14:15:08 +0000 (22:15 +0800)
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>
drivers/crypto/stm32/stm32-hash.c

index bfc49e67124bb8ef21a9c20b2fca4f630511ef4e..573ff3fad054e0f5a3ec10f12b470cc1d6d7af54 100644 (file)
@@ -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))