diff options
| author | jsing <> | 2019-03-24 17:10:54 +0000 |
|---|---|---|
| committer | jsing <> | 2019-03-24 17:10:54 +0000 |
| commit | a0d593817357328973d85c93bc7deab836e486b4 (patch) | |
| tree | fa629a1197d39ea756f1047caa41eef37fdeb468 /src/lib/libssl/ssl_ciph.c | |
| parent | 8157056ce15f6a70ad99702f5d20a820a1d6b2f9 (diff) | |
| download | openbsd-a0d593817357328973d85c93bc7deab836e486b4.tar.gz openbsd-a0d593817357328973d85c93bc7deab836e486b4.tar.bz2 openbsd-a0d593817357328973d85c93bc7deab836e486b4.zip | |
If ssl_cipher_apply_rule() is given a specific cipher suite, match on it.
Otherwise matching a specific cipher is performed by matching against
its characteristics, which can result in multiple rather than a single
match.
Found by bluhm@'s regress tests.
ok bluhm@ tb@
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libssl/ssl_ciph.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/libssl/ssl_ciph.c b/src/lib/libssl/ssl_ciph.c index bbae6a63d9..3cbf368ad3 100644 --- a/src/lib/libssl/ssl_ciph.c +++ b/src/lib/libssl/ssl_ciph.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ssl_ciph.c,v 1.106 2018/11/07 01:53:36 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_ciph.c,v 1.107 2019/03/24 17:10:54 jsing Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -921,6 +921,9 @@ ssl_cipher_apply_rule(unsigned long cipher_id, unsigned long alg_mkey, | |||
| 921 | 921 | ||
| 922 | cp = curr->cipher; | 922 | cp = curr->cipher; |
| 923 | 923 | ||
| 924 | if (cipher_id && cp->id != cipher_id) | ||
| 925 | continue; | ||
| 926 | |||
| 924 | /* | 927 | /* |
| 925 | * Selection criteria is either the value of strength_bits | 928 | * Selection criteria is either the value of strength_bits |
| 926 | * or the algorithms used. | 929 | * or the algorithms used. |
| @@ -929,7 +932,6 @@ ssl_cipher_apply_rule(unsigned long cipher_id, unsigned long alg_mkey, | |||
| 929 | if (strength_bits != cp->strength_bits) | 932 | if (strength_bits != cp->strength_bits) |
| 930 | continue; | 933 | continue; |
| 931 | } else { | 934 | } else { |
| 932 | |||
| 933 | if (alg_mkey && !(alg_mkey & cp->algorithm_mkey)) | 935 | if (alg_mkey && !(alg_mkey & cp->algorithm_mkey)) |
| 934 | continue; | 936 | continue; |
| 935 | if (alg_auth && !(alg_auth & cp->algorithm_auth)) | 937 | if (alg_auth && !(alg_auth & cp->algorithm_auth)) |
| @@ -944,7 +946,6 @@ ssl_cipher_apply_rule(unsigned long cipher_id, unsigned long alg_mkey, | |||
| 944 | continue; | 946 | continue; |
| 945 | } | 947 | } |
| 946 | 948 | ||
| 947 | |||
| 948 | /* add the cipher if it has not been added yet. */ | 949 | /* add the cipher if it has not been added yet. */ |
| 949 | if (rule == CIPHER_ADD) { | 950 | if (rule == CIPHER_ADD) { |
| 950 | /* reverse == 0 */ | 951 | /* reverse == 0 */ |
