Use ciphersuite id when matching if we've got one
authorMatt Caswell <matt@openssl.org>
Wed, 2 Nov 2016 11:52:22 +0000 (11:52 +0000)
committerMatt Caswell <matt@openssl.org>
Wed, 2 Nov 2016 13:08:21 +0000 (13:08 +0000)
When matching a ciphersuite if we are given an id, make sure we use it
otherwise we will match another ciphersuite which is identical except for
the TLS version.

Reviewed-by: Rich Salz <rsalz@openssl.org>
ssl/ssl_ciph.c

index 0d46509b190cf3e4884d1c34ea85a72ea5e1586b..adccbfc4d88b3439a197dc73e70b0bfc4c07a64e 100644 (file)
@@ -859,6 +859,8 @@ static void ssl_cipher_apply_rule(uint32_t cipher_id, uint32_t alg_mkey,
                     cp->algorithm_enc, cp->algorithm_mac, cp->min_tls,
                     cp->algo_strength);
 #endif
+            if (cipher_id != 0 && (cipher_id != cp->id))
+                continue;
             if (alg_mkey && !(alg_mkey & cp->algorithm_mkey))
                 continue;
             if (alg_auth && !(alg_auth & cp->algorithm_auth))