1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Merge pull request #719 from gabor-mezei-arm/689_zeroising_of_plaintext_buffers

Zeroising of plaintext buffers in mbedtls_ssl_read()
This commit is contained in:
Gilles Peskine
2020-08-12 18:51:42 +02:00
committed by GitHub
2 changed files with 8 additions and 0 deletions

View File

@ -5631,6 +5631,10 @@ int mbedtls_ssl_read( mbedtls_ssl_context *ssl, unsigned char *buf, size_t len )
memcpy( buf, ssl->in_offt, n );
ssl->in_msglen -= n;
/* Zeroising the plaintext buffer to erase unused application data
from the memory. */
mbedtls_platform_zeroize( ssl->in_offt, n );
if( ssl->in_msglen == 0 )
{
/* all bytes consumed */