wpa_supplicant: Replace internal RSA APIs by mbedtls APIs

Curretly wpa_supplicant uses internal APIs for RSA operations
which internally uses lots of big num operations.

Big num operations are CPU expensive and can take a lot of time
which can cause watchdog timer to tigger.

This can be optimize by using mbedtls APIs which uses
hardware blocks for big num operations.

To fix this, write new crypto_mbedtls-rsa.c which has APIs
similar to crypto_internal-rsa.c but uses mbedtls APIs.
This commit is contained in:
kapil.gupta
2020-03-17 18:54:30 +05:30
committed by bot
parent 8526cb577c
commit 1cabd06f0c
3 changed files with 359 additions and 1 deletions

View File

@@ -17,6 +17,7 @@
#include "tls/pkcs1.h"
#include "tls/pkcs8.h"
#ifndef USE_MBEDTLS_CRYPTO
/* Dummy structures; these are just typecast to struct crypto_rsa_key */
struct crypto_public_key;
struct crypto_private_key;
@@ -28,7 +29,6 @@ struct crypto_public_key * crypto_public_key_import(const u8 *key, size_t len)
crypto_rsa_import_public_key(key, len);
}
struct crypto_private_key * crypto_private_key_import(const u8 *key,
size_t len,
const char *passwd)
@@ -109,3 +109,4 @@ int crypto_public_key_decrypt_pkcs1(struct crypto_public_key *key,
return pkcs1_decrypt_public_key((struct crypto_rsa_key *) key,
crypt, crypt_len, plain, plain_len);
}
#endif