mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-10-28 18:07:34 +08:00
Merge 64b0a840fef0de0802a4c34be96aab19afd5a984 into 03e1438089654fb884ac48e0f3cd0049cfe2c102
This commit is contained in:
commit
7c770ac383
3
ChangeLog.d/fix-client-fuzzing.txt
Normal file
3
ChangeLog.d/fix-client-fuzzing.txt
Normal file
@ -0,0 +1,3 @@
|
||||
Bugfix
|
||||
* Call to `psa_crypto_init()` before parsing the test CA certificate in the
|
||||
fuzzing programs for TLS and DTLS clients.
|
||||
@ -37,6 +37,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
|
||||
fuzzBufferOffset_t biomemfuzz;
|
||||
uint16_t options;
|
||||
|
||||
psa_status_t status = psa_crypto_init();
|
||||
if (status != PSA_SUCCESS) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (initialized == 0) {
|
||||
#if defined(MBEDTLS_X509_CRT_PARSE_C) && defined(MBEDTLS_PEM_PARSE_C)
|
||||
mbedtls_x509_crt_init(&cacert);
|
||||
@ -66,11 +71,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
|
||||
mbedtls_ssl_init(&ssl);
|
||||
mbedtls_ssl_config_init(&conf);
|
||||
|
||||
psa_status_t status = psa_crypto_init();
|
||||
if (status != PSA_SUCCESS) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (mbedtls_ssl_config_defaults(&conf,
|
||||
MBEDTLS_SSL_IS_CLIENT,
|
||||
MBEDTLS_SSL_TRANSPORT_STREAM,
|
||||
|
||||
@ -33,6 +33,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
|
||||
unsigned char buf[4096];
|
||||
fuzzBufferOffset_t biomemfuzz;
|
||||
|
||||
psa_status_t status = psa_crypto_init();
|
||||
if (status != PSA_SUCCESS) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (initialized == 0) {
|
||||
#if defined(MBEDTLS_X509_CRT_PARSE_C) && defined(MBEDTLS_PEM_PARSE_C)
|
||||
mbedtls_x509_crt_init(&cacert);
|
||||
@ -49,11 +54,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
|
||||
mbedtls_ssl_init(&ssl);
|
||||
mbedtls_ssl_config_init(&conf);
|
||||
|
||||
psa_status_t status = psa_crypto_init();
|
||||
if (status != PSA_SUCCESS) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (mbedtls_ssl_config_defaults(&conf,
|
||||
MBEDTLS_SSL_IS_CLIENT,
|
||||
MBEDTLS_SSL_TRANSPORT_DATAGRAM,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user