Refactor TLS1-PRF to create the MAC contexts early
authorRichard Levitte <levitte@openssl.org>
Wed, 18 Sep 2019 09:49:55 +0000 (11:49 +0200)
committerRichard Levitte <levitte@openssl.org>
Wed, 18 Sep 2019 11:15:13 +0000 (13:15 +0200)
commit9a92bf1bffad15ede5ac97d1f1705c3e2c249a98
tree6e7498faeebeaa499c3cc795949401bd0671b6f2
parent18b0042731c739855cddf1f296b0b5a536ef88a3
Refactor TLS1-PRF to create the MAC contexts early

The TLS1-PRF implementation fetched the digest(s) for the underlying
MAC, just to get their names and pass those down to the MAC, which in
turn would fetch those same digests again.

This change circumvents this by fetching the MAC (or MACs in the
MD5-SHA1 special case) and create the MAC contexts for them directly
when this PRF receives the relevant parameters, thus only having to
pass EVP_MAC_CTX pointers around.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/9930)
providers/common/kdfs/tls1_prf.c