mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-03 20:22:59 -05:00 
			
		
		
		
	Initialize PSA Crypto implementation in ssl_client2.c
This commit is contained in:
		
							parent
							
								
									1cfc5ddb11
								
							
						
					
					
						commit
						b2b468ba45
					
				@ -59,6 +59,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>
 | 
				
			||||||
@ -555,6 +559,9 @@ int main( int argc, char *argv[] )
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
    char *p, *q;
 | 
					    char *p, *q;
 | 
				
			||||||
    const int *list;
 | 
					    const int *list;
 | 
				
			||||||
 | 
					#if defined(MBEDTLS_USE_PSA_CRYPTO)
 | 
				
			||||||
 | 
					    psa_status_t status;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /*
 | 
					    /*
 | 
				
			||||||
     * Make sure memory references are valid.
 | 
					     * Make sure memory references are valid.
 | 
				
			||||||
@ -573,6 +580,17 @@ 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)
 | 
				
			||||||
 | 
					    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 )
 | 
					    if( argc == 0 )
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
    usage:
 | 
					    usage:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user