fix build 267, case 743 blak2b w/o md5

This commit is contained in:
toddouska
2015-07-31 16:29:35 -07:00
parent 16b0120028
commit 3fb10301f6

View File

@@ -310,7 +310,7 @@ static int PRF(byte* digest, word32 digLen, const byte* secret, word32 secLen,
/* If a cipher suite wants an algorithm better than sha256, it /* If a cipher suite wants an algorithm better than sha256, it
* should use better. */ * should use better. */
if (hash_type < sha256_mac) if (hash_type < sha256_mac || hash_type == blake2b_mac)
hash_type = sha256_mac; hash_type = sha256_mac;
ret = p_hash(digest, digLen, secret, secLen, labelSeed, ret = p_hash(digest, digLen, secret, secLen, labelSeed,
labLen + seedLen, hash_type); labLen + seedLen, hash_type);
@@ -350,7 +350,7 @@ int BuildTlsFinished(WOLFSSL* ssl, Hashes* hashes, const byte* sender)
if (IsAtLeastTLSv1_2(ssl)) { if (IsAtLeastTLSv1_2(ssl)) {
#ifndef NO_SHA256 #ifndef NO_SHA256
if (ssl->specs.mac_algorithm <= sha256_mac) { if (ssl->specs.mac_algorithm <= sha256_mac || ssl->specs.mac_algorithm == blake2b_mac) {
int ret = wc_Sha256GetHash(&ssl->hsHashes->hashSha256,handshake_hash); int ret = wc_Sha256GetHash(&ssl->hsHashes->hashSha256,handshake_hash);
if (ret != 0) if (ret != 0)