summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2019-03-24 17:10:54 +0000
committerjsing <>2019-03-24 17:10:54 +0000
commit5c0bfb1931500c779b9393cda45c6aee83714019 (patch)
treefa629a1197d39ea756f1047caa41eef37fdeb468
parent936c5dd90eef8ce9436049c55b76386056708976 (diff)
downloadopenbsd-5c0bfb1931500c779b9393cda45c6aee83714019.tar.gz
openbsd-5c0bfb1931500c779b9393cda45c6aee83714019.tar.bz2
openbsd-5c0bfb1931500c779b9393cda45c6aee83714019.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@
-rw-r--r--src/lib/libssl/ssl_ciph.c7
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 */