mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-29 16:14:20 +01:00
Address PR review comments
set `cache->chain` to NULL, instead of setting the whole structure to zero.
This commit is contained in:
parent
e1a9a4a826
commit
22360825ae
@ -43,11 +43,6 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/* Implementation that should never be optimized out by the compiler */
|
|
||||||
static void mbedtls_zeroize( void *v, size_t n ) {
|
|
||||||
volatile unsigned char *p = v; while( n-- ) *p++ = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void mbedtls_ssl_cache_init( mbedtls_ssl_cache_context *cache )
|
void mbedtls_ssl_cache_init( mbedtls_ssl_cache_context *cache )
|
||||||
{
|
{
|
||||||
memset( cache, 0, sizeof( mbedtls_ssl_cache_context ) );
|
memset( cache, 0, sizeof( mbedtls_ssl_cache_context ) );
|
||||||
@ -326,8 +321,7 @@ void mbedtls_ssl_cache_free( mbedtls_ssl_cache_context *cache )
|
|||||||
#if defined(MBEDTLS_THREADING_C)
|
#if defined(MBEDTLS_THREADING_C)
|
||||||
mbedtls_mutex_free( &cache->mutex );
|
mbedtls_mutex_free( &cache->mutex );
|
||||||
#endif
|
#endif
|
||||||
|
cache->chain = NULL;
|
||||||
mbedtls_zeroize( cache, sizeof(mbedtls_ssl_cache_context) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* MBEDTLS_SSL_CACHE_C */
|
#endif /* MBEDTLS_SSL_CACHE_C */
|
||||||
|
Loading…
Reference in New Issue
Block a user