Filter TLS suite MAC by HMAC algorithm, as the hash is not necessarily the same
authorMartin Willi <martin@revosec.ch>
Tue, 7 Feb 2012 08:37:51 +0000 (09:37 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 7 Feb 2012 09:54:53 +0000 (10:54 +0100)
src/libtls/tls_crypto.c

index 7487da9..2eb0a9b 100644 (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;