Merge branch 'bugfix/mbedtls_sha_test_fail_when_run_twice_v5.1' into 'release/v5.1'

fix(mbedtls): sha test will fail when run twice (backport v5.1)

See merge request espressif/esp-idf!24827
This commit is contained in:
Jiang Jiang Jian 2023-08-01 10:57:25 +08:00
commit 4fc329fc10

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -130,6 +130,9 @@ TEST_CASE("Test esp_sha() function with long input", "[hw_crypto]")
TEST_ASSERT_EQUAL(0, r);
#endif
/* munmap() 1MB of flash when the usge of memory-mapped ptr is over */
spi_flash_munmap(handle);
TEST_ASSERT_EQUAL_MEMORY_MESSAGE(sha1_espsha, sha1_mbedtls, sizeof(sha1_espsha), "SHA1 results should match");
TEST_ASSERT_EQUAL_MEMORY_MESSAGE(sha256_espsha, sha256_mbedtls, sizeof(sha256_espsha), "SHA256 results should match");