fix(wpa_supplicant): Remove deprecated mbedtls functions used in fast pbkdf2 and fix ci error

pull/13426/head
Shreyas Sheth 2023-11-27 18:17:53 +05:30
rodzic a1b3ef5cef
commit d6f65b1472
3 zmienionych plików z 15 dodań i 14 usunięć

Wyświetl plik

@ -141,6 +141,7 @@ TEST_CASE("Test esp_sha() function with long input", "[hw_crypto]")
#if SOC_SHA_SUPPORT_SHA512
TEST_ASSERT_EQUAL_MEMORY_MESSAGE(sha512_espsha, sha512_mbedtls, sizeof(sha512_espsha), "SHA512 results should match");
#endif
}
#if CONFIG_MBEDTLS_HARDWARE_SHA
@ -160,7 +161,8 @@ TEST_CASE("Test mbedtls_internal_sha_process()", "[hw_crypto]")
0xa4, 0xae, 0x4d, 0xe9 };
mbedtls_sha1_init(&sha1_ctx);
mbedtls_sha1_starts(&sha1_ctx);
ret = mbedtls_sha1_starts_ret(&sha1_ctx);
TEST_ASSERT_EQUAL(0, ret);
ret = mbedtls_internal_sha1_process(&sha1_ctx, buffer);
TEST_ASSERT_EQUAL(0, ret);
@ -180,7 +182,7 @@ TEST_CASE("Test mbedtls_internal_sha_process()", "[hw_crypto]")
// Check if the intermediate states are correct
TEST_ASSERT_EQUAL_HEX8_ARRAY(sha1_expected, output, sizeof(sha1_expected));
ret = mbedtls_sha1_finish(&sha1_ctx, output);
ret = mbedtls_sha1_finish_ret(&sha1_ctx, output);
TEST_ASSERT_EQUAL(0, ret);
mbedtls_sha1_free(&sha1_ctx);
@ -198,7 +200,8 @@ TEST_CASE("Test mbedtls_internal_sha_process()", "[hw_crypto]")
0x07, 0x0a, 0x3a, 0x03, 0x44, 0xf0, 0xb8, 0xfe };
mbedtls_sha512_init(&sha512_ctx);
mbedtls_sha512_starts(&sha512_ctx, 0);
ret = mbedtls_sha512_starts_ret(&sha512_ctx, 0);
TEST_ASSERT_EQUAL(0, ret);
ret = mbedtls_internal_sha512_process(&sha512_ctx, buffer);
TEST_ASSERT_EQUAL(0, ret);
@ -218,7 +221,7 @@ TEST_CASE("Test mbedtls_internal_sha_process()", "[hw_crypto]")
// Check if the intermediate states are correct
TEST_ASSERT_EQUAL_HEX8_ARRAY(sha512_expected, output, sizeof(sha512_expected));
ret = mbedtls_sha512_finish(&sha512_ctx, output);
ret = mbedtls_sha512_finish_ret(&sha512_ctx, output);
TEST_ASSERT_EQUAL(0, ret);
mbedtls_sha512_free(&sha512_ctx);
@ -228,5 +231,3 @@ TEST_CASE("Test mbedtls_internal_sha_process()", "[hw_crypto]")
}
#endif
}

Wyświetl plik

@ -302,7 +302,7 @@ static inline void sha1_xor(mbedtls_sha1_context *restrict out, const mbedtls_sh
static int mbedtls_sha1_init_start(mbedtls_sha1_context *ctx)
{
mbedtls_sha1_init(ctx);
mbedtls_sha1_starts(ctx);
mbedtls_sha1_starts_ret(ctx);
#if defined(CONFIG_IDF_TARGET_ESP32) && defined(MBEDTLS_SHA1_ALT)
/* Use software mode for esp32 since hardware can't give output more than 20 */
esp_mbedtls_set_sha1_mode(ctx, ESP_MBEDTLS_SHA1_SOFTWARE);
@ -374,10 +374,10 @@ DECL_PBKDF2(sha1, // _name
20, // _hashsz
mbedtls_sha1_context, // _ctx
mbedtls_sha1_init_start, // _init
mbedtls_sha1_update, // _update
mbedtls_sha1_update_ret, // _update
mbedtls_internal_sha1_process, // _xform
#if defined(MBEDTLS_SHA1_ALT)
mbedtls_sha1_finish, // _final
mbedtls_sha1_finish_ret, // _final
#else
sha1_finish, // _final
#endif

Wyświetl plik

@ -25,7 +25,7 @@ These third party libraries can be included into the application (firmware) prod
* `wpa_supplicant`_ Copyright (c) 2003-2005 Jouni Malinen and licensed under the BSD license.
* :component_file:`Fast PBKDF2 <wpa_supplicant/esp_supplicant/src/crypto/crypto_mbedtls.c>` Copyright (c) 2015 Joseph Birr-Pixton and licensed under CC0 Public Domain Dedication license.
* :component_file:`Fast PBKDF2 <wpa_supplicant/src/crypto/crypto_mbedtls.c>` Copyright (c) 2015 Joseph Birr-Pixton and licensed under CC0 Public Domain Dedication license.
* `FreeBSD net80211`_ Copyright (c) 2004-2008 Sam Leffler, Errno Consulting and licensed under the BSD license.