Removing incorrect context free

After deriving JSEncKey we were wrongly clearing the AES context.
We shouldn't clear the context until the function is done doing its job.
That was why JSINtKey derivation was wrong which would result in MIC
failures.
feature-lorawan-1-1
Hasnain Virk 2018-10-18 18:53:41 +03:00 committed by Antti Kauppila
parent e490fbf991
commit ce6733edc0
1 changed files with 0 additions and 2 deletions

View File

@ -31,7 +31,6 @@
#include "system/lorawan_data_structures.h" #include "system/lorawan_data_structures.h"
#include "mbedtls/platform.h" #include "mbedtls/platform.h"
#if defined(MBEDTLS_CMAC_C) && defined(MBEDTLS_AES_C) && defined(MBEDTLS_CIPHER_C) #if defined(MBEDTLS_CMAC_C) && defined(MBEDTLS_AES_C) && defined(MBEDTLS_CIPHER_C)
LoRaMacCrypto::LoRaMacCrypto() LoRaMacCrypto::LoRaMacCrypto()
@ -360,7 +359,6 @@ int LoRaMacCrypto::compute_join_server_keys(const uint8_t *key, uint32_t key_len
if (0 != ret) if (0 != ret)
goto exit; goto exit;
mbedtls_aes_free(&aes_ctx);
memset(nonce, 0, sizeof(nonce)); memset(nonce, 0, sizeof(nonce));
nonce[0] = 0x06; nonce[0] = 0x06;
memcpy(nonce + 1, eui, 8); memcpy(nonce + 1, eui, 8);