mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 13:05:38 +01:00
Zeroize buffers in various modules
This commit is contained in:
parent
c381444c7f
commit
a0ae1db2f7
@ -4140,12 +4140,19 @@ int ssl_set_psk( ssl_context *ssl, const unsigned char *psk, size_t psk_len,
|
||||
return( POLARSSL_ERR_SSL_BAD_INPUT_DATA );
|
||||
}
|
||||
|
||||
if( ssl->psk != NULL || ssl->psk_identity != NULL )
|
||||
if( ssl->psk != NULL )
|
||||
{
|
||||
polarssl_zeroize( ssl->psk, ssl->psk_len );
|
||||
|
||||
polarssl_free( ssl->psk );
|
||||
polarssl_free( ssl->psk_identity );
|
||||
ssl->psk = NULL;
|
||||
ssl->psk_len = 0;
|
||||
}
|
||||
if( ssl->psk_identity != NULL )
|
||||
{
|
||||
polarssl_free( ssl->psk_identity );
|
||||
ssl->psk_identity = NULL;
|
||||
ssl->psk_identity_len = 0;
|
||||
}
|
||||
|
||||
if( ( ssl->psk = polarssl_malloc( psk_len ) ) == NULL ||
|
||||
|
Loading…
Reference in New Issue
Block a user