Filter TLS suite MAC by HMAC algorithm, as the hash is not necessarily the same

This commit is contained in:
Martin Willi 2012-02-07 09:37:51 +01:00
parent 269e487567
commit 1dabf5bfc7
1 changed files with 4 additions and 4 deletions

View File

@ -839,25 +839,25 @@ static void filter_mac_config_suites(private_tls_crypto_t *this,
while (enumerator->enumerate(enumerator, &token))
{
if (strcaseeq(token, "md5") &&
suites[i].hash == HASH_MD5)
suites[i].mac == AUTH_HMAC_MD5_128)
{
suites[remaining++] = suites[i];
break;
}
if (strcaseeq(token, "sha1") &&
suites[i].hash == HASH_SHA1)
suites[i].mac == AUTH_HMAC_SHA1_160)
{
suites[remaining++] = suites[i];
break;
}
if (strcaseeq(token, "sha256") &&
suites[i].hash == HASH_SHA256)
suites[i].mac == AUTH_HMAC_SHA2_256_256)
{
suites[remaining++] = suites[i];
break;
}
if (strcaseeq(token, "sha384") &&
suites[i].hash == HASH_SHA384)
suites[i].mac == AUTH_HMAC_SHA2_384_384)
{
suites[remaining++] = suites[i];
break;