mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-04 13:20:23 +00:00
Initialize PSA Crypto implementation in ssl_server2
This commit is contained in:
parent
50955d1c18
commit
06b6f34e9f
@ -60,6 +60,10 @@ int main( void )
|
|||||||
#include "mbedtls/debug.h"
|
#include "mbedtls/debug.h"
|
||||||
#include "mbedtls/timing.h"
|
#include "mbedtls/timing.h"
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
||||||
|
#include "psa/crypto.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -1238,6 +1242,9 @@ int main( int argc, char *argv[] )
|
|||||||
int i;
|
int i;
|
||||||
char *p, *q;
|
char *p, *q;
|
||||||
const int *list;
|
const int *list;
|
||||||
|
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
||||||
|
psa_status_t status;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
|
#if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
|
||||||
mbedtls_memory_buffer_alloc_init( alloc_buf, sizeof(alloc_buf) );
|
mbedtls_memory_buffer_alloc_init( alloc_buf, sizeof(alloc_buf) );
|
||||||
@ -1277,6 +1284,17 @@ int main( int argc, char *argv[] )
|
|||||||
mbedtls_ssl_cookie_init( &cookie_ctx );
|
mbedtls_ssl_cookie_init( &cookie_ctx );
|
||||||
#endif
|
#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 !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
/* Abort cleanly on SIGTERM and SIGINT */
|
/* Abort cleanly on SIGTERM and SIGINT */
|
||||||
signal( SIGTERM, term_handler );
|
signal( SIGTERM, term_handler );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user