Loading app/core/src/main/java/com/fsck/k9/helper/DefaultTrustedSocketFactory.java +9 −7 Original line number Diff line number Diff line Loading @@ -11,26 +11,23 @@ import java.util.List; import android.content.Context; import android.net.SSLCertificateSocketFactory; import android.os.Build; import android.text.TextUtils; import com.fsck.k9.mail.MessagingException; import com.fsck.k9.mail.ssl.TrustManagerFactory; import com.fsck.k9.mail.ssl.TrustedSocketFactory; import javax.net.ssl.KeyManager; import javax.net.ssl.SNIHostName; import javax.net.ssl.SNIServerName; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLParameters; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManager; import timber.log.Timber; /** * Prior to API 21 (and notably from API 10 - 2.3.4) Android weakened it's cipher list * by ordering them badly such that RC4-MD5 was preferred. To work around this we * remove the insecure ciphers and reorder them so the latest more secure ciphers are at the top. * * On more modern versions of Android we keep the system configuration. */ public class DefaultTrustedSocketFactory implements TrustedSocketFactory { private static final String[] ENABLED_CIPHERS; private static final String[] ENABLED_PROTOCOLS; Loading Loading @@ -150,6 +147,11 @@ public class DefaultTrustedSocketFactory implements TrustedSocketFactory { if (factory instanceof android.net.SSLCertificateSocketFactory) { SSLCertificateSocketFactory sslCertificateSocketFactory = (SSLCertificateSocketFactory) factory; sslCertificateSocketFactory.setHostname(socket, hostname); } else if (Build.VERSION.SDK_INT >= 24) { SSLParameters sslParameters = socket.getSSLParameters(); List<SNIServerName> sniServerNames = Collections.singletonList(new SNIHostName(hostname)); sslParameters.setServerNames(sniServerNames); socket.setSSLParameters(sslParameters); } else { setHostnameViaReflection(socket, hostname); } Loading app/core/src/main/java/com/fsck/k9/message/TextBodyBuilder.java +1 −2 Original line number Diff line number Diff line Loading @@ -188,8 +188,7 @@ class TextBodyBuilder { private String getSignatureHtml() { String signature = ""; if (!isEmpty(mSignature)) { signature = "<div style='white-space: pre-wrap'>" + HtmlConverter.textToHtmlFragmentWithOriginalWhitespace(mSignature) + "</div>"; signature = HtmlConverter.textToHtmlFragment(mSignature); } return signature; } Loading app/core/src/test/java/com/fsck/k9/message/TextBodyBuilderTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -18,8 +18,8 @@ class TextBodyBuilderTest(val testData: TestData) { private const val QUOTED_HTML_TAGS_END = "</body>\n</html>" private const val QUOTED_HTML_TAGS_START = "<!DOCTYPE html><html><head></head><body>" private const val SIGNATURE_TEXT = "-- \r\n\r\nsignature\r\n indented second line" private const val SIGNATURE_TEXT_HTML = "<div style='white-space: pre-wrap'>" + "<div class='k9mail-signature'>-- <br><br>signature<br> indented second line</div></div>" private const val SIGNATURE_TEXT_HTML = "<div class='k9mail-signature'>-- <br><br>signature<br>\u00A0 indented second line</div>" @JvmStatic @Parameterized.Parameters(name = "{index}: {0}") Loading app/k9mail/build.gradle +2 −2 Original line number Diff line number Diff line Loading @@ -50,8 +50,8 @@ android { applicationId "com.fsck.k9" testApplicationId "com.fsck.k9.tests" versionCode 33008 versionName '6.309-SNAPSHOT' versionCode 33009 versionName '6.310-SNAPSHOT' // Keep in sync with the resource string array 'supported_languages' resConfigs "in", "br", "ca", "cs", "cy", "da", "de", "et", "en", "en_GB", "es", "eo", "eu", "fr", "gd", "gl", Loading app/k9mail/src/main/java/com/fsck/k9/backends/WebDavBackendFactory.kt +1 −3 Original line number Diff line number Diff line Loading @@ -8,7 +8,6 @@ import com.fsck.k9.mail.ssl.TrustManagerFactory import com.fsck.k9.mail.store.webdav.DraftsFolderProvider import com.fsck.k9.mail.store.webdav.SniHostSetter import com.fsck.k9.mail.store.webdav.WebDavStore import com.fsck.k9.mail.transport.WebDavTransport import com.fsck.k9.mailstore.FolderRepository import com.fsck.k9.mailstore.K9BackendStorageFactory Loading @@ -24,8 +23,7 @@ class WebDavBackendFactory( val serverSettings = account.incomingServerSettings val draftsFolderProvider = createDraftsFolderProvider(account) val webDavStore = WebDavStore(trustManagerFactory, sniHostSetter, serverSettings, draftsFolderProvider) val webDavTransport = WebDavTransport(trustManagerFactory, sniHostSetter, serverSettings, draftsFolderProvider) return WebDavBackend(accountName, backendStorage, webDavStore, webDavTransport) return WebDavBackend(accountName, backendStorage, webDavStore) } private fun createDraftsFolderProvider(account: Account): DraftsFolderProvider { Loading Loading
app/core/src/main/java/com/fsck/k9/helper/DefaultTrustedSocketFactory.java +9 −7 Original line number Diff line number Diff line Loading @@ -11,26 +11,23 @@ import java.util.List; import android.content.Context; import android.net.SSLCertificateSocketFactory; import android.os.Build; import android.text.TextUtils; import com.fsck.k9.mail.MessagingException; import com.fsck.k9.mail.ssl.TrustManagerFactory; import com.fsck.k9.mail.ssl.TrustedSocketFactory; import javax.net.ssl.KeyManager; import javax.net.ssl.SNIHostName; import javax.net.ssl.SNIServerName; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLParameters; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManager; import timber.log.Timber; /** * Prior to API 21 (and notably from API 10 - 2.3.4) Android weakened it's cipher list * by ordering them badly such that RC4-MD5 was preferred. To work around this we * remove the insecure ciphers and reorder them so the latest more secure ciphers are at the top. * * On more modern versions of Android we keep the system configuration. */ public class DefaultTrustedSocketFactory implements TrustedSocketFactory { private static final String[] ENABLED_CIPHERS; private static final String[] ENABLED_PROTOCOLS; Loading Loading @@ -150,6 +147,11 @@ public class DefaultTrustedSocketFactory implements TrustedSocketFactory { if (factory instanceof android.net.SSLCertificateSocketFactory) { SSLCertificateSocketFactory sslCertificateSocketFactory = (SSLCertificateSocketFactory) factory; sslCertificateSocketFactory.setHostname(socket, hostname); } else if (Build.VERSION.SDK_INT >= 24) { SSLParameters sslParameters = socket.getSSLParameters(); List<SNIServerName> sniServerNames = Collections.singletonList(new SNIHostName(hostname)); sslParameters.setServerNames(sniServerNames); socket.setSSLParameters(sslParameters); } else { setHostnameViaReflection(socket, hostname); } Loading
app/core/src/main/java/com/fsck/k9/message/TextBodyBuilder.java +1 −2 Original line number Diff line number Diff line Loading @@ -188,8 +188,7 @@ class TextBodyBuilder { private String getSignatureHtml() { String signature = ""; if (!isEmpty(mSignature)) { signature = "<div style='white-space: pre-wrap'>" + HtmlConverter.textToHtmlFragmentWithOriginalWhitespace(mSignature) + "</div>"; signature = HtmlConverter.textToHtmlFragment(mSignature); } return signature; } Loading
app/core/src/test/java/com/fsck/k9/message/TextBodyBuilderTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -18,8 +18,8 @@ class TextBodyBuilderTest(val testData: TestData) { private const val QUOTED_HTML_TAGS_END = "</body>\n</html>" private const val QUOTED_HTML_TAGS_START = "<!DOCTYPE html><html><head></head><body>" private const val SIGNATURE_TEXT = "-- \r\n\r\nsignature\r\n indented second line" private const val SIGNATURE_TEXT_HTML = "<div style='white-space: pre-wrap'>" + "<div class='k9mail-signature'>-- <br><br>signature<br> indented second line</div></div>" private const val SIGNATURE_TEXT_HTML = "<div class='k9mail-signature'>-- <br><br>signature<br>\u00A0 indented second line</div>" @JvmStatic @Parameterized.Parameters(name = "{index}: {0}") Loading
app/k9mail/build.gradle +2 −2 Original line number Diff line number Diff line Loading @@ -50,8 +50,8 @@ android { applicationId "com.fsck.k9" testApplicationId "com.fsck.k9.tests" versionCode 33008 versionName '6.309-SNAPSHOT' versionCode 33009 versionName '6.310-SNAPSHOT' // Keep in sync with the resource string array 'supported_languages' resConfigs "in", "br", "ca", "cs", "cy", "da", "de", "et", "en", "en_GB", "es", "eo", "eu", "fr", "gd", "gl", Loading
app/k9mail/src/main/java/com/fsck/k9/backends/WebDavBackendFactory.kt +1 −3 Original line number Diff line number Diff line Loading @@ -8,7 +8,6 @@ import com.fsck.k9.mail.ssl.TrustManagerFactory import com.fsck.k9.mail.store.webdav.DraftsFolderProvider import com.fsck.k9.mail.store.webdav.SniHostSetter import com.fsck.k9.mail.store.webdav.WebDavStore import com.fsck.k9.mail.transport.WebDavTransport import com.fsck.k9.mailstore.FolderRepository import com.fsck.k9.mailstore.K9BackendStorageFactory Loading @@ -24,8 +23,7 @@ class WebDavBackendFactory( val serverSettings = account.incomingServerSettings val draftsFolderProvider = createDraftsFolderProvider(account) val webDavStore = WebDavStore(trustManagerFactory, sniHostSetter, serverSettings, draftsFolderProvider) val webDavTransport = WebDavTransport(trustManagerFactory, sniHostSetter, serverSettings, draftsFolderProvider) return WebDavBackend(accountName, backendStorage, webDavStore, webDavTransport) return WebDavBackend(accountName, backendStorage, webDavStore) } private fun createDraftsFolderProvider(account: Account): DraftsFolderProvider { Loading