1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

Merge pull request #3160 from gilles-peskine-arm/hkdf_expand-initialize_t-development

hkdf_expand: explicitly initialize t
This commit is contained in:
Gilles Peskine
2020-04-06 16:34:31 +02:00
committed by GitHub

View File

@ -115,7 +115,7 @@ int mbedtls_hkdf_expand( const mbedtls_md_info_t *md, const unsigned char *prk,
n = okm_len / hash_len; n = okm_len / hash_len;
if( (okm_len % hash_len) != 0 ) if( okm_len % hash_len != 0 )
{ {
n++; n++;
} }
@ -136,6 +136,8 @@ int mbedtls_hkdf_expand( const mbedtls_md_info_t *md, const unsigned char *prk,
goto exit; goto exit;
} }
memset( t, 0, hash_len );
/* /*
* Compute T = T(1) | T(2) | T(3) | ... | T(N) * Compute T = T(1) | T(2) | T(3) | ... | T(N)
* Where T(N) is defined in RFC 5869 Section 2.3 * Where T(N) is defined in RFC 5869 Section 2.3