Initialize PSA Crypto implementation in ssl_client2.c

This commit is contained in:
Hanno Becker 2018-11-12 17:46:59 +00:00
parent 1cfc5ddb11
commit b2b468ba45

View file

@ -59,6 +59,10 @@ int main( void )
#include "mbedtls/debug.h"
#include "mbedtls/timing.h"
#if defined(MBEDTLS_USE_PSA_CRYPTO)
#include "psa/crypto.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -555,6 +559,9 @@ int main( int argc, char *argv[] )
#endif
char *p, *q;
const int *list;
#if defined(MBEDTLS_USE_PSA_CRYPTO)
psa_status_t status;
#endif
/*
* Make sure memory references are valid.
@ -573,6 +580,17 @@ int main( int argc, char *argv[] )
memset( (void * ) alpn_list, 0, sizeof( alpn_list ) );
#endif
#if defined(MBEDTLS_USE_PSA_CRYPTO)
status = psa_crypto_init();
if( status != PSA_SUCCESS )
{
mbedtls_fprintf( stderr, "Failed to initialize PSA Crypto implementation: %d\n",
(int) status );
ret = MBEDTLS_ERR_SSL_HW_ACCEL_FAILED;
goto exit;
}
#endif
if( argc == 0 )
{
usage: