This is an automated email from the ASF dual-hosted git repository. coheigea pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cxf.git
commit 143145643b3bb2f0a7ba97ec216bc59de754fd94 Author: Colm O hEigeartaigh <cohei...@apache.org> AuthorDate: Fri Oct 5 16:14:16 2018 +0100 Optimise the ciphersuite filtering --- .../apache/cxf/configuration/jsse/SSLUtils.java | 31 +++++++++------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/core/src/main/java/org/apache/cxf/configuration/jsse/SSLUtils.java b/core/src/main/java/org/apache/cxf/configuration/jsse/SSLUtils.java index 6446719..f6c4963 100644 --- a/core/src/main/java/org/apache/cxf/configuration/jsse/SSLUtils.java +++ b/core/src/main/java/org/apache/cxf/configuration/jsse/SSLUtils.java @@ -422,34 +422,27 @@ public final class SSLUtils { } List<String> filteredCipherSuites = new ArrayList<>(); - List<String> excludedCipherSuites = new ArrayList<>(); - for (int i = 0; i < supportedCipherSuites.length; i++) { - if (matchesOneOf(supportedCipherSuites[i], includes) - && !matchesOneOf(supportedCipherSuites[i], excludes)) { + for (String supportedCipherSuite : supportedCipherSuites) { + if (matchesOneOf(supportedCipherSuite, includes) + && !matchesOneOf(supportedCipherSuite, excludes)) { LogUtils.log(log, Level.FINE, "CIPHERSUITE_INCLUDED", - supportedCipherSuites[i]); - filteredCipherSuites.add(supportedCipherSuites[i]); + supportedCipherSuite); + if (!exclude) { + filteredCipherSuites.add(supportedCipherSuite); + } } else { LogUtils.log(log, Level.FINE, "CIPHERSUITE_EXCLUDED", - supportedCipherSuites[i]); - excludedCipherSuites.add(supportedCipherSuites[i]); + supportedCipherSuite); + if (exclude) { + filteredCipherSuites.add(supportedCipherSuite); + } } } - LogUtils.log(log, - Level.FINE, - "CIPHERSUITES_FILTERED", - filteredCipherSuites); - LogUtils.log(log, - Level.FINE, - "CIPHERSUITES_EXCLUDED", - excludedCipherSuites); - if (exclude) { - return getCiphersFromList(excludedCipherSuites, log, exclude); - } + return getCiphersFromList(filteredCipherSuites, log, exclude); }