mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-03-04 18:09:59 +00:00
Merge pull request #733 from gabor-mezei-arm/689_bp27_zeroising_of_plaintext_buffers
[Backport 2.7] Zeroising of plaintext buffers in mbedtls_ssl_read()
This commit is contained in:
commit
691bed7cce
4
ChangeLog.d/zeroising_of_plaintext_buffer.txt
Normal file
4
ChangeLog.d/zeroising_of_plaintext_buffer.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
Security
|
||||
* Zeroising of plaintext buffers in mbedtls_ssl_read() to erase unused
|
||||
application data from memory. Reported in #689 by
|
||||
Johan Uppman Bruce of Sectra.
|
|
@ -7407,6 +7407,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_zeroize( ssl->in_offt, n );
|
||||
|
||||
if( ssl->in_msglen == 0 )
|
||||
{
|
||||
/* all bytes consumed */
|
||||
|
|
Loading…
Reference in a new issue