tls: fix a potential (currently "disabled" by a macro) SHA1-related bug

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2018-12-10 18:49:29 +01:00
parent 63bfe0e4c0
commit c67ff8a1b0

View File

@ -525,7 +525,7 @@ static unsigned hmac(tls_state_t *tls, uint8_t *out, uint8_t *key, unsigned key_
va_start(va, key_size);
hmac_begin(&pre, key, key_size,
(ENABLE_FEATURE_TLS_SHA1 || tls->MAC_size == SHA256_OUTSIZE)
(!ENABLE_FEATURE_TLS_SHA1 || tls->MAC_size == SHA256_OUTSIZE)
? sha256_begin
: sha1_begin
);