Init PSA in fuzz programs
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
parent
6cec5e9d9e
commit
774f9debf2
9 changed files with 103 additions and 15 deletions
|
@ -78,6 +78,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
|
|||
mbedtls_ctr_drbg_init(&ctr_drbg);
|
||||
mbedtls_entropy_init(&entropy);
|
||||
|
||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
||||
psa_status_t status = psa_crypto_init();
|
||||
if (status != PSA_SUCCESS) {
|
||||
goto exit;
|
||||
}
|
||||
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
||||
|
||||
if (mbedtls_ctr_drbg_seed(&ctr_drbg, dummy_entropy, &entropy,
|
||||
(const unsigned char *) pers, strlen(pers)) != 0) {
|
||||
goto exit;
|
||||
|
@ -175,6 +182,7 @@ exit:
|
|||
mbedtls_ctr_drbg_free(&ctr_drbg);
|
||||
mbedtls_ssl_config_free(&conf);
|
||||
mbedtls_ssl_free(&ssl);
|
||||
mbedtls_psa_crypto_free();
|
||||
|
||||
#else
|
||||
(void) Data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue