change(wpa_supplicant): reformat test_fast_pbkdf2 with astyle

This commit is contained in:
Ivan Grokhotkov
2023-10-04 12:49:38 +02:00
parent 191a9021c2
commit 6c27208ade

View File

@@ -21,9 +21,10 @@ TEST_CASE("Test pbkdf2", "[crypto-pbkdf2]")
uint8_t passphrase_len; uint8_t passphrase_len;
uint8_t ssid[MAX_SSID_LEN]; uint8_t ssid[MAX_SSID_LEN];
uint8_t passphrase[MAX_PASSPHRASE_LEN]; uint8_t passphrase[MAX_PASSPHRASE_LEN];
uint8_t expected_pmk1[PMK_LEN] = uint8_t expected_pmk1[PMK_LEN] = {
{0xe7, 0x90, 0xd0, 0x65, 0x67, 0xf0, 0xbf, 0xca, 0xca, 0x10, 0x88, 0x0b, 0x85, 0xb2, 0x33, 0xe5, 0xe7, 0x90, 0xd0, 0x65, 0x67, 0xf0, 0xbf, 0xca, 0xca, 0x10, 0x88, 0x0b, 0x85, 0xb2, 0x33, 0xe5,
0xe1, 0xd5, 0xe5, 0xb8, 0xd0, 0xfd, 0x94, 0x60, 0x56, 0x95, 0x5e, 0x41, 0x5a, 0x7f, 0xfa, 0xfa}; 0xe1, 0xd5, 0xe5, 0xb8, 0xd0, 0xfd, 0x94, 0x60, 0x56, 0x95, 0x5e, 0x41, 0x5a, 0x7f, 0xfa, 0xfa
};
uint8_t expected_pmk[PMK_LEN]; uint8_t expected_pmk[PMK_LEN];
@@ -34,7 +35,7 @@ TEST_CASE("Test pbkdf2", "[crypto-pbkdf2]")
/* Compare fast PBKDF output with mbedtls pbkdf2 function's output */ /* Compare fast PBKDF output with mbedtls pbkdf2 function's output */
pbkdf2_sha1("espressif2", (uint8_t *)"espressif2", strlen("espressif2"), 4096, PMK, PMK_LEN); pbkdf2_sha1("espressif2", (uint8_t *)"espressif2", strlen("espressif2"), 4096, PMK, PMK_LEN);
mbedtls_pkcs5_pbkdf2_hmac_ext(MBEDTLS_MD_SHA1, (const unsigned char *) "espressif2", mbedtls_pkcs5_pbkdf2_hmac_ext(MBEDTLS_MD_SHA1, (const unsigned char *) "espressif2",
strlen("espressif2") , (const unsigned char *)"espressif2", strlen("espressif2"), (const unsigned char *)"espressif2",
strlen("espressif2"), 4096, PMK_LEN, expected_pmk); strlen("espressif2"), 4096, PMK_LEN, expected_pmk);
TEST_ASSERT(memcmp(PMK, expected_pmk, PMK_LEN) == 0); TEST_ASSERT(memcmp(PMK, expected_pmk, PMK_LEN) == 0);
@@ -52,7 +53,7 @@ TEST_CASE("Test pbkdf2", "[crypto-pbkdf2]")
os_get_random(passphrase, passphrase_len); os_get_random(passphrase, passphrase_len);
pbkdf2_sha1((char *)passphrase, ssid, ssid_len, 4096, PMK, PMK_LEN); pbkdf2_sha1((char *)passphrase, ssid, ssid_len, 4096, PMK, PMK_LEN);
mbedtls_pkcs5_pbkdf2_hmac_ext(MBEDTLS_MD_SHA1, (const unsigned char *) passphrase, mbedtls_pkcs5_pbkdf2_hmac_ext(MBEDTLS_MD_SHA1, (const unsigned char *) passphrase,
strlen((char *)passphrase) , (const unsigned char *)ssid, strlen((char *)passphrase), (const unsigned char *)ssid,
ssid_len, 4096, PMK_LEN, expected_pmk); ssid_len, 4096, PMK_LEN, expected_pmk);
/* Dump values if fails */ /* Dump values if fails */