From ca2ea4e217bab5fac250a256d4011899982332ba Mon Sep 17 00:00:00 2001 From: Brian J Murray Date: Fri, 6 Jul 2018 10:03:58 -0700 Subject: [PATCH] Fix issue if salt = NULL and salt_len !=0 in mbedtls_hkdf_extract() --- library/hkdf.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/hkdf.c b/library/hkdf.c index 41d7d87641..82d8a429f4 100644 --- a/library/hkdf.c +++ b/library/hkdf.c @@ -62,6 +62,11 @@ int mbedtls_hkdf_extract( const mbedtls_md_info_t *md, { size_t hash_len; + if( salt_len != 0 ) + { + return MBEDTLS_ERR_HKDF_BAD_INPUT_DATA; + } + hash_len = mbedtls_md_get_size( md ); if( hash_len == 0 )