wpa_supplicant: Cleanup fast_xxx modules that use duplicate code

wpa_supplicant is using MbedTLS API's for crypto algorithms. For
calling them a duplicate set of modules is maintained prepended
with 'fast_'. Remove these and use flag USE_MBEDTLS_CRYPTO
instead to separate modules calling MbedTLS API's from native
implementation.
This commit is contained in:
Nachiket Kukade
2019-07-03 17:39:52 +05:30
parent c8f5f47d5d
commit 900df44546
42 changed files with 506 additions and 1335 deletions

View File

@@ -221,9 +221,9 @@ int tls_verify_hash_init(struct tls_verify_hash *verify)
return -1;
}
#ifdef CONFIG_TLSV12
verify->sha256_client = fast_crypto_hash_init(CRYPTO_HASH_ALG_SHA256, NULL, 0);
verify->sha256_server = fast_crypto_hash_init(CRYPTO_HASH_ALG_SHA256, NULL, 0);
verify->sha256_cert = fast_crypto_hash_init(CRYPTO_HASH_ALG_SHA256, NULL, 0);
verify->sha256_client = crypto_hash_init(CRYPTO_HASH_ALG_SHA256, NULL, 0);
verify->sha256_server = crypto_hash_init(CRYPTO_HASH_ALG_SHA256, NULL, 0);
verify->sha256_cert = crypto_hash_init(CRYPTO_HASH_ALG_SHA256, NULL, 0);
if (verify->sha256_client == NULL ||
verify->sha256_server == NULL ||
@@ -253,11 +253,11 @@ void tls_verify_hash_add(struct tls_verify_hash *verify, const u8 *buf,
}
#ifdef CONFIG_TLSV12
if (verify->sha256_client)
fast_crypto_hash_update(verify->sha256_client, buf, len);
crypto_hash_update(verify->sha256_client, buf, len);
if (verify->sha256_server)
fast_crypto_hash_update(verify->sha256_server, buf, len);
crypto_hash_update(verify->sha256_server, buf, len);
if (verify->sha256_cert)
fast_crypto_hash_update(verify->sha256_cert, buf, len);
crypto_hash_update(verify->sha256_cert, buf, len);
#endif /* CONFIG_TLSV12 */
}
@@ -277,9 +277,9 @@ void tls_verify_hash_free(struct tls_verify_hash *verify)
verify->sha1_server = NULL;
verify->sha1_cert = NULL;
#ifdef CONFIG_TLSV12
fast_crypto_hash_finish(verify->sha256_client, NULL, NULL);
fast_crypto_hash_finish(verify->sha256_server, NULL, NULL);
fast_crypto_hash_finish(verify->sha256_cert, NULL, NULL);
crypto_hash_finish(verify->sha256_client, NULL, NULL);
crypto_hash_finish(verify->sha256_server, NULL, NULL);
crypto_hash_finish(verify->sha256_cert, NULL, NULL);
verify->sha256_client = NULL;
verify->sha256_server = NULL;
verify->sha256_cert = NULL;