mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-11 02:35:39 +00:00
Address PR review comments
set `cache->chain` to NULL, instead of setting the whole structure to zero.
This commit is contained in:
parent
1f311ed587
commit
9f60bc57ce
|
@ -44,12 +44,6 @@
|
|||
#define polarssl_free free
|
||||
#endif
|
||||
|
||||
|
||||
/* Implementation that should never be optimized out by the compiler */
|
||||
static void polarssl_zeroize( void *v, size_t n ) {
|
||||
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
|
||||
}
|
||||
|
||||
void ssl_cache_init( ssl_cache_context *cache )
|
||||
{
|
||||
memset( cache, 0, sizeof( ssl_cache_context ) );
|
||||
|
@ -331,7 +325,7 @@ void ssl_cache_free( ssl_cache_context *cache )
|
|||
polarssl_mutex_free( &cache->mutex );
|
||||
#endif
|
||||
|
||||
polarssl_zeroize( cache, sizeof(ssl_cache_context) );
|
||||
cache->chain = NULL;
|
||||
}
|
||||
|
||||
#endif /* POLARSSL_SSL_CACHE_C */
|
||||
|
|
Loading…
Reference in a new issue