From 4e848c9c656ab7da22a6ded0d322e4dbd84cc5a3 Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Mon, 6 Aug 2018 13:04:25 +0200 Subject: ssl: Make sure that a correct cipher suite is selected The keyexchange ECDHE-RSA requires an RSA-keyed server cert (corresponding for ECDHE-ECDSA), the code did not assert this resulting in that a incorrect cipher suite could be selected. Alas test code was also wrong hiding the error. --- lib/ssl/src/ssl_cipher.erl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl index 754fc46404..ebdc624ec7 100644 --- a/lib/ssl/src/ssl_cipher.erl +++ b/lib/ssl/src/ssl_cipher.erl @@ -2775,6 +2775,8 @@ ecdsa_signed_suites(Ciphers, Version) -> rsa_keyed(dhe_rsa) -> true; +rsa_keyed(ecdhe_rsa) -> + true; rsa_keyed(rsa) -> true; rsa_keyed(rsa_psk) -> @@ -2838,6 +2840,8 @@ ec_keyed(ecdh_ecdsa) -> true; ec_keyed(ecdh_rsa) -> true; +ec_keyed(ecdhe_ecdsa) -> + true; ec_keyed(_) -> false. -- cgit v1.2.3