aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/utils
diff options
context:
space:
mode:
authorSam Whited <sam@samwhited.com>2015-02-02 08:33:55 -0500
committerSam Whited <sam@samwhited.com>2015-02-02 11:16:22 -0500
commit03d30e4fdb0b60c4c4531703495a385c97cfbe10 (patch)
tree6ade59a4618348c3213ff00565d910ef696a80e4 /src/main/java/eu/siacs/conversations/utils
parentecbceae88b7a7aa871e5396efec1e2ff8d056d46 (diff)
Use platform ciphers as well, just prefer ours
Diffstat (limited to 'src/main/java/eu/siacs/conversations/utils')
-rw-r--r--src/main/java/eu/siacs/conversations/utils/CryptoHelper.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/CryptoHelper.java b/src/main/java/eu/siacs/conversations/utils/CryptoHelper.java
index fc21acbc..31fe2c11 100644
--- a/src/main/java/eu/siacs/conversations/utils/CryptoHelper.java
+++ b/src/main/java/eu/siacs/conversations/utils/CryptoHelper.java
@@ -5,6 +5,7 @@ import java.text.Normalizer;
import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedHashSet;
+import java.util.List;
import eu.siacs.conversations.Config;
@@ -97,10 +98,11 @@ public final class CryptoHelper {
return builder.toString();
}
- public static String[] getSupportedCipherSuites(final String[] platformSupportedCipherSuites) {
- //final Collection<String> cipherSuites = new LinkedHashSet<>(Arrays.asList(Config.ENABLED_CIPHERS));
- //cipherSuites.retainAll(Arrays.asList(platformSupportedCipherSuites));
- //return cipherSuites.toArray(new String[cipherSuites.size()]);
- return platformSupportedCipherSuites;
+ public static String[] getOrderedCipherSuites(final String[] platformSupportedCipherSuites) {
+ final Collection<String> cipherSuites = new LinkedHashSet<>(Arrays.asList(Config.ENABLED_CIPHERS));
+ final List<String> platformCiphers = Arrays.asList(platformSupportedCipherSuites);
+ cipherSuites.retainAll(platformCiphers);
+ cipherSuites.addAll(platformCiphers);
+ return cipherSuites.toArray(new String[cipherSuites.size()]);
}
}