mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 01:05:40 +01:00
Rm of memset instead of x509_crt_init()
This commit is contained in:
parent
c559c7a680
commit
b6b0956631
@ -95,7 +95,7 @@ int ssl_cache_get( void *data, ssl_session *session )
|
||||
if( session->peer_cert == NULL )
|
||||
return( 1 );
|
||||
|
||||
memset( session->peer_cert, 0, sizeof(x509_crt) );
|
||||
x509_crt_init( session->peer_cert );
|
||||
if( x509_crt_parse( session->peer_cert, entry->peer_cert.p,
|
||||
entry->peer_cert.len ) != 0 )
|
||||
{
|
||||
|
@ -140,7 +140,7 @@ static int ssl_load_session( ssl_session *session,
|
||||
if( session->peer_cert == NULL )
|
||||
return( POLARSSL_ERR_SSL_MALLOC_FAILED );
|
||||
|
||||
memset( session->peer_cert, 0, sizeof( x509_crt ) );
|
||||
x509_crt_init( session->peer_cert );
|
||||
|
||||
if( ( ret = x509_crt_parse( session->peer_cert, p, cert_len ) ) != 0 )
|
||||
{
|
||||
|
@ -83,7 +83,7 @@ static int ssl_session_copy( ssl_session *dst, const ssl_session *src )
|
||||
if( ( dst->peer_cert = polarssl_malloc( sizeof(x509_crt) ) ) == NULL )
|
||||
return( POLARSSL_ERR_SSL_MALLOC_FAILED );
|
||||
|
||||
memset( dst->peer_cert, 0, sizeof(x509_crt) );
|
||||
x509_crt_init( dst->peer_cert );
|
||||
|
||||
if( ( ret = x509_crt_parse( dst->peer_cert, src->peer_cert->raw.p,
|
||||
src->peer_cert->raw.len ) != 0 ) )
|
||||
@ -2494,7 +2494,7 @@ int ssl_parse_certificate( ssl_context *ssl )
|
||||
return( POLARSSL_ERR_SSL_MALLOC_FAILED );
|
||||
}
|
||||
|
||||
memset( ssl->session_negotiate->peer_cert, 0, sizeof( x509_crt ) );
|
||||
x509_crt_init( ssl->session_negotiate->peer_cert );
|
||||
|
||||
i = 7;
|
||||
|
||||
|
@ -708,7 +708,7 @@ int x509_self_test( int verbose )
|
||||
if( verbose != 0 )
|
||||
printf( " X.509 certificate load: " );
|
||||
|
||||
memset( &clicert, 0, sizeof( x509_crt ) );
|
||||
x509_crt_init( &clicert );
|
||||
|
||||
ret = x509_crt_parse( &clicert, (const unsigned char *) test_cli_crt,
|
||||
strlen( test_cli_crt ) );
|
||||
@ -720,7 +720,7 @@ int x509_self_test( int verbose )
|
||||
return( ret );
|
||||
}
|
||||
|
||||
memset( &cacert, 0, sizeof( x509_crt ) );
|
||||
x509_crt_init( &cacert );
|
||||
|
||||
ret = x509_crt_parse( &cacert, (const unsigned char *) test_ca_crt,
|
||||
strlen( test_ca_crt ) );
|
||||
|
Loading…
Reference in New Issue
Block a user