Skip to content

Commit 072eb6d

Browse files
authored
Merge pull request #288 from AlexLanzano/demo-fix
Reset key and iv prior to aes decryption in crypto demo
2 parents 6847bf5 + 5637ff0 commit 072eb6d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

examples/demo/client/wh_demo_client_crypto.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -853,10 +853,10 @@ int wh_DemoClient_CryptoAesCbc(whClientContext* clientContext)
853853
}
854854

855855
if (ret == 0) {
856-
/* Reset the IV so we can decrypt */
857-
ret = wc_AesSetIV(aes, NULL);
856+
/* Reset the key schedule for decryption and reset the IV */
857+
ret = wc_AesSetKey(aes, key, sizeof(key), NULL, AES_DECRYPTION);
858858
if (ret != 0) {
859-
WOLFHSM_CFG_PRINTF("Failed to wc_AesSetIV %d\n", ret);
859+
WOLFHSM_CFG_PRINTF("Failed to wc_AesSetKey %d\n", ret);
860860
}
861861
}
862862

0 commit comments

Comments
 (0)