From 40404c3700a4e5bf579e05e9123017d839034f25 Mon Sep 17 00:00:00 2001 From: Joe Steele Date: Mon, 2 Dec 2013 14:07:57 -0500 Subject: [PATCH] Move some classes out of com.fsck.k9.mail.store The classes are just as much related to com.fsck.k9.mail.transport as com.fsck.k9.mail.store, so having them in com.fsck.k9.mail.store doesn't seem appropriate. Move LocalKeyStore to com.fsck.k9.security Move TrustManagerFactory and TrustedSocketFactory to com.fsck.k9.net.ssl --- src/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java | 2 +- src/com/fsck/k9/mail/store/ImapStore.java | 2 ++ src/com/fsck/k9/mail/store/Pop3Store.java | 2 ++ src/com/fsck/k9/mail/store/WebDavSocketFactory.java | 2 ++ src/com/fsck/k9/mail/transport/SmtpTransport.java | 4 ++-- .../fsck/k9/{mail/store => net/ssl}/TrustManagerFactory.java | 3 ++- .../fsck/k9/{mail/store => net/ssl}/TrustedSocketFactory.java | 2 +- src/com/fsck/k9/{mail/store => security}/LocalKeyStore.java | 2 +- tests/src/com/fsck/k9/mail/store/TrustManagerFactoryTest.java | 4 ++++ 9 files changed, 17 insertions(+), 6 deletions(-) rename src/com/fsck/k9/{mail/store => net/ssl}/TrustManagerFactory.java (98%) rename src/com/fsck/k9/{mail/store => net/ssl}/TrustedSocketFactory.java (99%) rename src/com/fsck/k9/{mail/store => security}/LocalKeyStore.java (99%) diff --git a/src/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java b/src/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java index dd4f15c93..9cdef8cb4 100644 --- a/src/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java +++ b/src/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java @@ -22,9 +22,9 @@ import com.fsck.k9.mail.AuthenticationFailedException; import com.fsck.k9.mail.CertificateValidationException; import com.fsck.k9.mail.Store; import com.fsck.k9.mail.Transport; -import com.fsck.k9.mail.store.LocalKeyStore; import com.fsck.k9.mail.store.WebDavStore; import com.fsck.k9.mail.filter.Hex; +import com.fsck.k9.security.LocalKeyStore; import java.security.cert.CertificateException; import java.security.cert.CertificateEncodingException; diff --git a/src/com/fsck/k9/mail/store/ImapStore.java b/src/com/fsck/k9/mail/store/ImapStore.java index 8a0bbf14a..eda66afb9 100644 --- a/src/com/fsck/k9/mail/store/ImapStore.java +++ b/src/com/fsck/k9/mail/store/ImapStore.java @@ -96,6 +96,8 @@ import com.fsck.k9.mail.store.ImapResponseParser.ImapList; import com.fsck.k9.mail.store.ImapResponseParser.ImapResponse; import com.fsck.k9.mail.store.imap.ImapUtility; import com.fsck.k9.mail.transport.imap.ImapSettings; +import com.fsck.k9.net.ssl.TrustManagerFactory; +import com.fsck.k9.net.ssl.TrustedSocketFactory; import com.jcraft.jzlib.JZlib; import com.jcraft.jzlib.ZOutputStream; diff --git a/src/com/fsck/k9/mail/store/Pop3Store.java b/src/com/fsck/k9/mail/store/Pop3Store.java index e4138452b..80711a48f 100644 --- a/src/com/fsck/k9/mail/store/Pop3Store.java +++ b/src/com/fsck/k9/mail/store/Pop3Store.java @@ -10,6 +10,8 @@ import com.fsck.k9.helper.Utility; import com.fsck.k9.mail.*; import com.fsck.k9.mail.internet.MimeMessage; +import com.fsck.k9.net.ssl.TrustManagerFactory; +import com.fsck.k9.net.ssl.TrustedSocketFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLException; diff --git a/src/com/fsck/k9/mail/store/WebDavSocketFactory.java b/src/com/fsck/k9/mail/store/WebDavSocketFactory.java index b465dcf38..9563f510e 100644 --- a/src/com/fsck/k9/mail/store/WebDavSocketFactory.java +++ b/src/com/fsck/k9/mail/store/WebDavSocketFactory.java @@ -4,6 +4,8 @@ import org.apache.http.conn.ConnectTimeoutException; import org.apache.http.conn.scheme.LayeredSocketFactory; import org.apache.http.params.HttpParams; +import com.fsck.k9.net.ssl.TrustManagerFactory; + import java.io.IOException; import java.net.InetAddress; import java.net.Socket; diff --git a/src/com/fsck/k9/mail/transport/SmtpTransport.java b/src/com/fsck/k9/mail/transport/SmtpTransport.java index 33602a37d..6dfa641db 100644 --- a/src/com/fsck/k9/mail/transport/SmtpTransport.java +++ b/src/com/fsck/k9/mail/transport/SmtpTransport.java @@ -12,9 +12,9 @@ import com.fsck.k9.mail.filter.LineWrapOutputStream; import com.fsck.k9.mail.filter.PeekableInputStream; import com.fsck.k9.mail.filter.SmtpDataStuffing; import com.fsck.k9.mail.internet.MimeUtility; -import com.fsck.k9.mail.store.TrustManagerFactory; import com.fsck.k9.mail.store.LocalStore.LocalMessage; -import com.fsck.k9.mail.store.TrustedSocketFactory; +import com.fsck.k9.net.ssl.TrustManagerFactory; +import com.fsck.k9.net.ssl.TrustedSocketFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLException; diff --git a/src/com/fsck/k9/mail/store/TrustManagerFactory.java b/src/com/fsck/k9/net/ssl/TrustManagerFactory.java similarity index 98% rename from src/com/fsck/k9/mail/store/TrustManagerFactory.java rename to src/com/fsck/k9/net/ssl/TrustManagerFactory.java index 91ff7ae8d..a7f4d9902 100644 --- a/src/com/fsck/k9/mail/store/TrustManagerFactory.java +++ b/src/com/fsck/k9/net/ssl/TrustManagerFactory.java @@ -1,9 +1,10 @@ -package com.fsck.k9.mail.store; +package com.fsck.k9.net.ssl; import android.util.Log; import com.fsck.k9.helper.DomainNameChecker; import com.fsck.k9.mail.CertificateChainException; +import com.fsck.k9.security.LocalKeyStore; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; diff --git a/src/com/fsck/k9/mail/store/TrustedSocketFactory.java b/src/com/fsck/k9/net/ssl/TrustedSocketFactory.java similarity index 99% rename from src/com/fsck/k9/mail/store/TrustedSocketFactory.java rename to src/com/fsck/k9/net/ssl/TrustedSocketFactory.java index 2dd319251..acb9c7574 100644 --- a/src/com/fsck/k9/mail/store/TrustedSocketFactory.java +++ b/src/com/fsck/k9/net/ssl/TrustedSocketFactory.java @@ -1,4 +1,4 @@ -package com.fsck.k9.mail.store; +package com.fsck.k9.net.ssl; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocket; diff --git a/src/com/fsck/k9/mail/store/LocalKeyStore.java b/src/com/fsck/k9/security/LocalKeyStore.java similarity index 99% rename from src/com/fsck/k9/mail/store/LocalKeyStore.java rename to src/com/fsck/k9/security/LocalKeyStore.java index a7386ab22..2f3282cbc 100644 --- a/src/com/fsck/k9/mail/store/LocalKeyStore.java +++ b/src/com/fsck/k9/security/LocalKeyStore.java @@ -1,4 +1,4 @@ -package com.fsck.k9.mail.store; +package com.fsck.k9.security; import java.io.File; import java.io.FileInputStream; diff --git a/tests/src/com/fsck/k9/mail/store/TrustManagerFactoryTest.java b/tests/src/com/fsck/k9/mail/store/TrustManagerFactoryTest.java index 12615422d..538ae362b 100644 --- a/tests/src/com/fsck/k9/mail/store/TrustManagerFactoryTest.java +++ b/tests/src/com/fsck/k9/mail/store/TrustManagerFactoryTest.java @@ -1,6 +1,10 @@ package com.fsck.k9.mail.store; import javax.net.ssl.X509TrustManager; + +import com.fsck.k9.net.ssl.TrustManagerFactory; +import com.fsck.k9.security.LocalKeyStore; + import java.io.ByteArrayInputStream; import java.io.File; import java.security.cert.CertificateException;