ssl_client2: init psa crypto for TLS 1.3 build
Signed-off-by: Przemyslaw Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
parent
4f419e55a1
commit
169f115bf0
@ -158,9 +158,6 @@ static int ssl_tls13_generate_and_write_ecdh_key_exchange(
|
|||||||
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG( 1, ( "Perform PSA-based ECDH computation." ) );
|
MBEDTLS_SSL_DEBUG_MSG( 1, ( "Perform PSA-based ECDH computation." ) );
|
||||||
|
|
||||||
// --- Just for now --- !!!
|
|
||||||
psa_crypto_init();
|
|
||||||
|
|
||||||
/* Convert EC group to PSA key type. */
|
/* Convert EC group to PSA key type. */
|
||||||
if( ( handshake->ecdh_psa_type =
|
if( ( handshake->ecdh_psa_type =
|
||||||
mbedtls_psa_parse_tls_ecc_group( named_group, &ecdh_bits ) ) == 0 )
|
mbedtls_psa_parse_tls_ecc_group( named_group, &ecdh_bits ) ) == 0 )
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include "ssl_test_lib.h"
|
#include "ssl_test_lib.h"
|
||||||
|
|
||||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
#if defined(MBEDTLS_USE_PSA_CRYPTO) || defined(MBEDTLS_SSL_PROTO_TLS1_3)
|
||||||
#include "test/psa_crypto_helpers.h"
|
#include "test/psa_crypto_helpers.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -698,6 +698,8 @@ int main( int argc, char *argv[] )
|
|||||||
psa_key_attributes_t key_attributes;
|
psa_key_attributes_t key_attributes;
|
||||||
#endif
|
#endif
|
||||||
psa_status_t status;
|
psa_status_t status;
|
||||||
|
#elif defined(MBEDTLS_SSL_PROTO_TLS1_3)
|
||||||
|
psa_status_t status;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MBEDTLS_X509_CRT_PARSE_C)
|
#if defined(MBEDTLS_X509_CRT_PARSE_C)
|
||||||
@ -770,7 +772,7 @@ int main( int argc, char *argv[] )
|
|||||||
memset( (void * ) alpn_list, 0, sizeof( alpn_list ) );
|
memset( (void * ) alpn_list, 0, sizeof( alpn_list ) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
#if defined(MBEDTLS_USE_PSA_CRYPTO) || defined(MBEDTLS_SSL_PROTO_TLS1_3)
|
||||||
status = psa_crypto_init();
|
status = psa_crypto_init();
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
{
|
{
|
||||||
@ -3085,7 +3087,7 @@ exit:
|
|||||||
#endif /* MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED &&
|
#endif /* MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED &&
|
||||||
MBEDTLS_USE_PSA_CRYPTO */
|
MBEDTLS_USE_PSA_CRYPTO */
|
||||||
|
|
||||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
#if defined(MBEDTLS_USE_PSA_CRYPTO) || defined(MBEDTLS_SSL_PROTO_TLS1_3)
|
||||||
const char* message = mbedtls_test_helper_is_psa_leaking();
|
const char* message = mbedtls_test_helper_is_psa_leaking();
|
||||||
if( message )
|
if( message )
|
||||||
{
|
{
|
||||||
@ -3097,7 +3099,7 @@ exit:
|
|||||||
|
|
||||||
/* For builds with MBEDTLS_TEST_USE_PSA_CRYPTO_RNG psa crypto
|
/* For builds with MBEDTLS_TEST_USE_PSA_CRYPTO_RNG psa crypto
|
||||||
* resources are freed by rng_free(). */
|
* resources are freed by rng_free(). */
|
||||||
#if defined(MBEDTLS_USE_PSA_CRYPTO) && \
|
#if (defined(MBEDTLS_USE_PSA_CRYPTO) || defined(MBEDTLS_SSL_PROTO_TLS1_3)) && \
|
||||||
!defined(MBEDTLS_TEST_USE_PSA_CRYPTO_RNG)
|
!defined(MBEDTLS_TEST_USE_PSA_CRYPTO_RNG)
|
||||||
mbedtls_psa_crypto_free( );
|
mbedtls_psa_crypto_free( );
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user