From b25ec2d13304e15fe23e4028a5bac403d52de87c Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Mon, 19 Sep 2016 11:57:00 +0200 Subject: [PATCH] Added cipher list for Android versions between 11 and 21. BUG: 368172 --- .../Helpers/SecurityHelpers/SslHelper.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/org/kde/kdeconnect/Helpers/SecurityHelpers/SslHelper.java b/src/org/kde/kdeconnect/Helpers/SecurityHelpers/SslHelper.java index 5742329f..1b4ff123 100644 --- a/src/org/kde/kdeconnect/Helpers/SecurityHelpers/SslHelper.java +++ b/src/org/kde/kdeconnect/Helpers/SecurityHelpers/SslHelper.java @@ -209,13 +209,17 @@ public class SslHelper { // These cipher suites are most common of them that are accepted by kde and android during handshake ArrayList supportedCiphers = new ArrayList<>(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - supportedCiphers.add("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"); - supportedCiphers.add("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"); - supportedCiphers.add("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"); + supportedCiphers.add("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"); // API 20+ + supportedCiphers.add("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"); // API 20+ + supportedCiphers.add("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"); // API 11+ + } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + supportedCiphers.add("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"); // API 11+ + supportedCiphers.add("SSL_RSA_WITH_RC4_128_SHA"); // API 9+ + supportedCiphers.add("SSL_RSA_WITH_RC4_128_MD5"); // API 9+ } else { // Following ciphers are for and due to old devices - supportedCiphers.add("SSL_RSA_WITH_RC4_128_SHA"); - supportedCiphers.add("SSL_RSA_WITH_RC4_128_MD5"); + supportedCiphers.add("SSL_RSA_WITH_RC4_128_SHA"); // API 9+ + supportedCiphers.add("SSL_RSA_WITH_RC4_128_MD5"); // API 9+ } socket.setEnabledCipherSuites(supportedCiphers.toArray(new String[supportedCiphers.size()]));