diff options
author | Andreas Schultz <[email protected]> | 2014-06-16 18:48:39 +0200 |
---|---|---|
committer | Andreas Schultz <[email protected]> | 2014-09-03 15:26:00 +0200 |
commit | d1dcc88aa5b1c749034570eb7c86db7c58d652f9 (patch) | |
tree | 18841d099d0ce2acc3d1d6637cdc7ecc6326330b | |
parent | 955c16cdfd211455e5cdbca28d55d9d77cf17836 (diff) | |
download | otp-d1dcc88aa5b1c749034570eb7c86db7c58d652f9.tar.gz otp-d1dcc88aa5b1c749034570eb7c86db7c58d652f9.tar.bz2 otp-d1dcc88aa5b1c749034570eb7c86db7c58d652f9.zip |
ssl: fix OpenSSL name filter in ssl tests
The OpenSSL name filter would fail for cipher suites that do not
have an offcial OpenSSL name yet.
-rw-r--r-- | lib/ssl/test/ssl_test_lib.erl | 44 |
1 files changed, 15 insertions, 29 deletions
diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl index 9d3b0f4bf7..d2e6e41482 100644 --- a/lib/ssl/test/ssl_test_lib.erl +++ b/lib/ssl/test/ssl_test_lib.erl @@ -811,48 +811,34 @@ openssl_rsa_suites(CounterPart) -> false -> "DSS | ECDHE | ECDH" end, - lists:filter(fun(Str) -> - case re:run(Str, Names,[]) of - nomatch -> - false; - _ -> - true - end - end, Ciphers). + lists:filter(fun(Str) -> string_regex_filter(Str, Names) + end, Ciphers). openssl_dsa_suites() -> Ciphers = ssl:cipher_suites(openssl), - lists:filter(fun(Str) -> - case re:run(Str,"DSS",[]) of - nomatch -> - false; - _ -> - true - end + lists:filter(fun(Str) -> string_regex_filter(Str, "DSS") end, Ciphers). openssl_ecdsa_suites() -> Ciphers = ssl:cipher_suites(openssl), - lists:filter(fun(Str) -> - case re:run(Str,"ECDHE-ECDSA",[]) of - nomatch -> - false; - _ -> - true - end + lists:filter(fun(Str) -> string_regex_filter(Str, "ECDHE-ECDSA") end, Ciphers). openssl_ecdh_rsa_suites() -> Ciphers = ssl:cipher_suites(openssl), - lists:filter(fun(Str) -> - case re:run(Str,"ECDH-RSA",[]) of - nomatch -> - false; - _ -> - true - end + lists:filter(fun(Str) -> string_regex_filter(Str, "ECDH-RSA") end, Ciphers). +string_regex_filter(Str, Search) when is_list(Str) -> + case re:run(Str, Search, []) of + nomatch -> + false; + _ -> + true + end; +string_regex_filter(Str, _Search) -> + false. + anonymous_suites() -> Suites = [{dh_anon, rc4_128, md5}, |