Skip to content

Commit

Permalink
Merge branch 'bugfix/mem_leak_fastpbkdf2_test' into 'release/v4.4'
Browse files Browse the repository at this point in the history
fix(wpa_supplicant): Resolve memory leak for test case of fast pbkdf2

See merge request espressif/esp-idf!27889
  • Loading branch information
jack0c committed Dec 15, 2023
2 parents 0bb983f + aa8822b commit 3192aca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/wpa_supplicant/test/test_fast_pbkdf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ TEST_CASE("Test pbkdf2", "[crypto-pbkdf2]")
TEST_ASSERT(memcmp(PMK, expected_pmk, PMK_LEN) == 0);
ESP_LOG_BUFFER_HEXDUMP("PMK", PMK, PMK_LEN, ESP_LOG_INFO);
ESP_LOG_BUFFER_HEXDUMP("expected_pmk", expected_pmk, PMK_LEN, ESP_LOG_INFO);
mbedtls_md_free(&sha1_ctx);

/* Calculate PMK using random ssid and passphrase and compare */
os_memset(ssid, 0, MAX_SSID_LEN);
os_memset(passphrase, 0, MAX_PASSPHRASE_LEN);
Expand All @@ -71,4 +73,5 @@ TEST_CASE("Test pbkdf2", "[crypto-pbkdf2]")
ESP_LOG_BUFFER_HEXDUMP("PMK", PMK, PMK_LEN, ESP_LOG_INFO);
ESP_LOG_BUFFER_HEXDUMP("expected_pmk", expected_pmk1, PMK_LEN, ESP_LOG_INFO);
TEST_ASSERT(memcmp(PMK, expected_pmk1, PMK_LEN) == 0);
mbedtls_md_free(&sha1_ctx_1);
}

0 comments on commit 3192aca

Please sign in to comment.