mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-01 10:06:53 +03:00
SSL: fix test failures
1. Change USE_PSA_CRYPTO_INIT/DONE to MD_OR_USE. 2. Add missing occurrences - some of these were already necessary in principle (in one form or another) but where missing and this was not detected so far as `psa_hash` doesn't complain in case of a missing init, but now MD makes it visible. 3. Add missing include in ssl_test_lib.h. Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
@ -59,6 +59,8 @@ void debug_print_msg_threshold(int threshold, int level, char *file,
|
||||
mbedtls_ssl_config conf;
|
||||
struct buffer_data buffer;
|
||||
|
||||
MD_PSA_INIT();
|
||||
|
||||
mbedtls_ssl_init(&ssl);
|
||||
mbedtls_ssl_config_init(&conf);
|
||||
memset(buffer.buf, 0, 2000);
|
||||
@ -83,6 +85,7 @@ void debug_print_msg_threshold(int threshold, int level, char *file,
|
||||
exit:
|
||||
mbedtls_ssl_free(&ssl);
|
||||
mbedtls_ssl_config_free(&conf);
|
||||
MD_PSA_DONE();
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
@ -94,6 +97,8 @@ void mbedtls_debug_print_ret(char *file, int line, char *text, int value,
|
||||
mbedtls_ssl_config conf;
|
||||
struct buffer_data buffer;
|
||||
|
||||
MD_PSA_INIT();
|
||||
|
||||
mbedtls_ssl_init(&ssl);
|
||||
mbedtls_ssl_config_init(&conf);
|
||||
memset(buffer.buf, 0, 2000);
|
||||
@ -115,6 +120,7 @@ void mbedtls_debug_print_ret(char *file, int line, char *text, int value,
|
||||
exit:
|
||||
mbedtls_ssl_free(&ssl);
|
||||
mbedtls_ssl_config_free(&conf);
|
||||
MD_PSA_DONE();
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
@ -126,6 +132,8 @@ void mbedtls_debug_print_buf(char *file, int line, char *text,
|
||||
mbedtls_ssl_config conf;
|
||||
struct buffer_data buffer;
|
||||
|
||||
MD_PSA_INIT();
|
||||
|
||||
mbedtls_ssl_init(&ssl);
|
||||
mbedtls_ssl_config_init(&conf);
|
||||
memset(buffer.buf, 0, 2000);
|
||||
@ -147,6 +155,7 @@ void mbedtls_debug_print_buf(char *file, int line, char *text,
|
||||
exit:
|
||||
mbedtls_ssl_free(&ssl);
|
||||
mbedtls_ssl_config_free(&conf);
|
||||
MD_PSA_DONE();
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
@ -159,6 +168,8 @@ void mbedtls_debug_print_crt(char *crt_file, char *file, int line,
|
||||
mbedtls_ssl_config conf;
|
||||
struct buffer_data buffer;
|
||||
|
||||
MD_PSA_INIT();
|
||||
|
||||
mbedtls_ssl_init(&ssl);
|
||||
mbedtls_ssl_config_init(&conf);
|
||||
mbedtls_x509_crt_init(&crt);
|
||||
@ -183,6 +194,7 @@ exit:
|
||||
mbedtls_x509_crt_free(&crt);
|
||||
mbedtls_ssl_free(&ssl);
|
||||
mbedtls_ssl_config_free(&conf);
|
||||
MD_PSA_DONE();
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
@ -195,6 +207,8 @@ void mbedtls_debug_print_mpi(char *value, char *file, int line,
|
||||
struct buffer_data buffer;
|
||||
mbedtls_mpi val;
|
||||
|
||||
MD_PSA_INIT();
|
||||
|
||||
mbedtls_ssl_init(&ssl);
|
||||
mbedtls_ssl_config_init(&conf);
|
||||
mbedtls_mpi_init(&val);
|
||||
@ -220,5 +234,6 @@ exit:
|
||||
mbedtls_mpi_free(&val);
|
||||
mbedtls_ssl_free(&ssl);
|
||||
mbedtls_ssl_config_free(&conf);
|
||||
MD_PSA_DONE();
|
||||
}
|
||||
/* END_CASE */
|
||||
|
Reference in New Issue
Block a user