Commit Graph

3094 Commits

Author SHA1 Message Date
Art O Cathain 02c0b5f2a3 Use collections instead of arrays to enable stronger typing and reduce cruft 2014-10-05 10:37:36 +01:00
Art O Cathain 203dcfe2c3 use interfaces, not implementions 2014-10-04 12:00:48 +01:00
tobiasbaum dadf5e0865 Merge pull request #7 from artbristol/art/tidying
Art/tidying
2014-09-29 22:15:59 +02:00
Art O Cathain 010d8c9f7e always use import for UrlEncodingHelper 2014-09-29 18:06:21 +01:00
Art O Cathain 2226ae6a8e fix IDE error 2014-09-28 12:48:46 +01:00
Art O Cathain c438bc1222 remove some more catches 2014-09-28 12:09:34 +01:00
Art O Cathain afb65d5ad7 remove some try-catch cruft 2014-09-28 11:39:32 +01:00
Art O Cathain 46d083bcad fix warnings 2014-09-28 11:19:33 +01:00
Tobias Baum 2be10febf9 Added (still rather shallow) missing Javadocs for classes in BinaryAttachmentBody hierarchy 2014-09-22 21:55:08 +02:00
Tobias Baum 547eb74774 Changed access to mParts in MimeMultipart so that it can be private too 2014-09-22 21:54:02 +02:00
Tobias Baum b6079d6460 UCDetector warnings: Made things private, deleted unused methods and fields 2014-09-22 21:52:59 +02:00
cketti 352fb8fd25 Remove legacy APG interface 2014-09-18 23:20:49 +02:00
cketti 99991e6651 Remove option to select (legacy) APG as crypto provider 2014-09-18 19:15:53 +02:00
cketti 082dd953b2 Remove now unused AccessibleEmailContentActivity 2014-09-18 15:06:00 +02:00
Tobias Baum 1ea34d2378 Flagged some code with TODOs, added Javadoc for Body 2014-09-14 11:20:18 +02:00
Tobias Baum be954d729c Whitespace, Tabs to Spaces 2014-09-14 11:18:57 +02:00
Tobias Baum 7d32b3d462 Removed unnecessary overriding methods 2014-09-14 11:17:02 +02:00
Tobias Baum a9aa4645af Removed unused methods 2014-09-14 11:15:44 +02:00
Tobias Baum 545dd0db06 Added a getBodyparts method to Multipart so that foreach loops can be used. Removed unnecessary mutators from Multipart. 2014-09-14 11:13:34 +02:00
Tobias Baum 5513d5a99b Pulled down getSize from Part to Message which makes ImapBodyPart superfluous 2014-09-14 11:11:48 +02:00
Tobias Baum d467dca32c Added testcases for parsing and removed unused methods for parsing 2014-09-14 11:05:55 +02:00
cketti 601e2880ac Merge remote-tracking branch 'upstream/master'
Conflicts:
	src/com/fsck/k9/mail/transport/SmtpTransport.java
2014-09-12 07:11:32 +02:00
cketti a6fc06f7f9 Fix code style 2014-09-12 06:35:07 +02:00
cketti 3e4beae631 Remove unused 'check mark' color chip 2014-09-12 06:26:03 +02:00
Christian Frommeyer 9dba60c997 Some minor code cleanings and logging for LockableDatabase 2014-09-11 20:26:40 +02:00
Christian Frommeyer eced036d69 Extracting Database Setup Schema definition form LocalStore. 2014-09-11 20:26:40 +02:00
Christian Frommeyer 91ef5fa816 Extracted LocalFolder and LocalMessage definition from LocalStore 2014-09-11 20:26:40 +02:00
Christian Frommeyer 89ba2c510b More nested classes extracted from LocalStore. 2014-09-11 20:26:40 +02:00
Christian Frommeyer f92da3af59 Extracting local attachment classes from LocalStore to reduce file size. 2014-09-11 20:26:39 +02:00
Christian Frommeyer 038fceabf0 Move LocalStore to new subpackage to prepare decomposition of nested
classes.
2014-09-11 20:26:39 +02:00
Joe Steele 0f6719387c Re-enable TLSv1.1/1.2 support
Was disabled in 3fd7470d.

Issue 6238.

Related Android change for API 20:
1f63d2c223%5E!/
2014-09-10 11:42:14 -04:00
cketti a10b9ae452 Merge pull request #493 from zjw/ssl_changes
SSL changes
2014-09-10 01:44:44 +02:00
Joe Steele 094feced0c Remove unused imports 2014-09-09 18:56:36 -04:00
cketti 9e203b75cc Remove gallery bug work-around
This bug was present in the Gallery app shipped with Android 2.0.
The time has come to say good-bye. We will never forget you! But only because you're part of our Git history.
2014-09-07 23:35:18 +02:00
Joe Steele 43c38a047f Implement SSL file-based session caching
Caching is beneficial because it can eliminate redundant cryptographic
computations and network traffic when re-establishing a connection to
the same server, thus saving time and conserving power.
2014-09-06 19:32:06 -04:00
Joe Steele 7dfbd906c9 Eliminate DomainNameChecker
There's no need to maintain our own implementation when comparable
classes already exist in the Android API.

StrictHostnameVerifier is used instead.
2014-09-06 19:32:03 -04:00
Joe Steele 6f14294164 Remove SslHelper. Don't use SecureRandom.
SslHelper has been removed, and its functionality has been transferred
into TrustedSocketFactory.  The added layer of indirection wasn't really
simplifying anything.  It's now easier to see what happens when
createSocket() is invoked.

A new instance of SecureRandom is no longer passed to SSLContext.init().
Instead, null is passed.

The (default) provider of the TLS SSLContext used is OpenSSLProvider,
which provides an SSLSocket instance of type OpenSSLSocketImpl.  The only
use of SecureRandom is in OpenSSLSocketImpl.startHandshake(), where it is
used to seed the OpenSSL PRNG with additional random data.  But if
SecureRandom is null, then /dev/urandom is used for seeding instead.

Meanwhile, the default provider for the SecureRandom service is
OpenSSLRandom, which uses the OpenSSL PRNG as its data source.  So we were
effectively seeding the OpenSSL PRNG with itself.  That's probably okay
(we trust that the OpenSSL PRNG was properly initialized with random data
before first use), but using /dev/urandom would seem like a better source
(or at least as good a source) for the additional seed data added with
each new connection.

Note that our PRNGFixes class replaces the default SecureRandom service
with one whose data source is /dev/urandom for certain vulnerable API
levels anyway.  (It also makes sure that the OpenSSL PRNG is properly
seeded before first use for certain vulnerable API levels.)
2014-09-06 18:15:25 -04:00
cketti 5f0f4e9c21 Merge pull request #485 from haselwarter
Conflicts:
	src/com/fsck/k9/preferences/Settings.java
2014-09-04 23:55:30 +02:00
cketti f5cfaceef4 Increase settings version in preparation of merge into master 2014-09-04 23:54:06 +02:00
cketti 5802e6a36a Remove getNotifyClass() from Folder 2014-09-04 23:54:06 +02:00
cketti 7edd1cb53c Simplify database upgrade when adding 'notify_class' to 'folders' 2014-09-04 23:54:06 +02:00
cketti bd9efa8d01 Whitespace fixes 2014-09-04 22:58:38 +02:00
cketti cb67a21a93 Remove commented-out code 2014-09-04 21:58:18 +02:00
cketti 759fa77c9a Merge pull request #474 from k9mail/tls-client-cert-auth
Client Certificate Authentication
2014-08-30 01:06:28 +02:00
Joe Steele 9728609c4c Make the foldable container view INVISIBLE, not GONE
Now when toggling the foldable view, the screen no longer
jumps half a line up or down to recenter itself when
the view is displayed.
2014-08-29 10:47:45 -04:00
Joe Steele 8ade424270 Save/Restore the FoldableLinearLayout state 2014-08-29 10:47:43 -04:00
Joe Steele a756fa3683 Use Theme consistent styles in FoldableLinearLayout
For support of the dark and light themes.

Also:

Redefine mFolded and call it mIsFolded.  Previously,
the view started with mFolded = false (which implies to me
the initial state is unfolded) and yet the view
started in a folded state, which seemed contradictory.

Create updateFoldedState() with code from onClick() (In
preparation for subsequent commit.)
2014-08-29 10:47:41 -04:00
Joe Steele 348fb4dceb Validate client certificate dates 2014-08-29 10:47:39 -04:00
Joe Steele c80634d501 Format log messages with spaces 2014-08-29 09:06:25 -04:00
cketti ac1ed9eef3 Increment settings version 2014-08-29 01:45:48 +02:00
Dominik Schürmann 05d8fb5e42 Hide client cert option under advanced options dropdown 2014-08-27 11:48:49 +02:00
Dominik Schürmann 2a1733564e Add FoldableLinearLayout for advanced options 2014-08-27 11:30:53 +02:00
Joe Steele e4d26b8c75 Remove code for unsupported API levels
An assortment of miscellaneous changes, each usually limited in scope to a
single file.
2014-08-19 17:17:55 -04:00
Joe Steele bc60c860b8 Remove com.fsck.k9.helper.NotificationBuilder
Only useful on pre-Honeycomb devices.
2014-08-19 17:17:52 -04:00
Joe Steele 786511ed88 Simplify ClipboardManager
No longer API dependent.
2014-08-19 17:17:50 -04:00
Joe Steele 028f6f9055 Remove AccessibleWebView
Only used on pre-ICS devices
2014-08-19 17:17:48 -04:00
Joe Steele 0fba273357 Remove the obsolete "Condensed layout" preference 2014-08-19 17:17:45 -04:00
Joe Steele 8166f03e87 Remove obsolete "Show unread count" preference
Only applies to pre-Honeycomb devices
2014-08-19 17:17:42 -04:00
Joe Steele af77bbd1bc Eliminate obsolete background data sync option
It only applied to pre-ICS devices.

ConnectivityManager.ACTION_BACKGROUND_DATA_SETTING_CHANGED is no longer
broadcast.

ConnectivityManager.getBackgroundDataSetting() always returns true.
2014-08-19 17:14:44 -04:00
Joe Steele c472b89d23 Additional 'Show password' changes after merging master 2014-08-19 16:48:11 -04:00
Joe Steele 1783dd1a63 Merge branch 'master' into tls-client-cert-auth
Conflicts:
	res/layout/account_setup_basics.xml
	res/values/strings.xml
	src/com/fsck/k9/activity/setup/AccountSetupBasics.java
2014-08-19 16:19:02 -04:00
Joe Steele b39f9b95f1 Move initializeViewListeners() to onPostCreate()
Per comments in PR #474

https://github.com/k9mail/k-9/pull/474#commitcomment-7417262
2014-08-19 15:50:32 -04:00
Joe Steele f7fb0cca41 Compare Enum types with ==, !=
Per comments in PR #473

https://github.com/k9mail/k-9/pull/474#commitcomment-7416979

https://github.com/k9mail/k-9/pull/474#commitcomment-7416999
2014-08-18 18:12:39 -04:00
pylerSM a495627d72 Show password feature 2014-08-18 13:06:25 +02:00
cketti a659393326 Make fields in KeyChainKeyManager final 2014-08-18 05:18:38 +02:00
cketti ac08f520ae Remove KeyChainKeyManager's dependency on 'K9.app' 2014-08-18 05:08:01 +02:00
cketti 4ce2a56b0c Synchronize access to sClientCertificateReferenceWorkaround
Also, refactor for easier readability.
2014-08-18 04:59:57 +02:00
Joe Steele c881207295 Use isFinishing() instead
As suggested by @maniac103
https://github.com/k9mail/k-9/commit/41570e4#commitcomment-7388209
2014-08-14 16:22:51 -04:00
Joe Steele c8f6c4d625 Eliminate searching for '3' in exception message
This was dead code.  The exception message will always start with either
"SMTP response is 0 length" from checkLine() or else "Negative SMTP reply"
from NegativeSmtpReplyException().

The problem originated from way back before 4.904.
2014-08-11 11:08:51 -04:00
Joe Steele 21237c3720 KeyChainKeyManager modifications
The constructor now saves the certificate chain, so the code to retrieve
it again or to perform any additional error checking in
getCertificateChain() is no longer needed.

The constructor now retrieves and saves the private key so that any
resulting errors are detected sooner.

Methods that retrieve the alias perform checks to assure that the client
cert. satisfies the requested issuers and key type.  It's known that
Sendmail may provide a list of issuers in its certificate request, but
then may authenticate against a much larger set of CAs, but then later
reject the mail because the client certificate was not acceptable.
Vetting against the issuer list helps detect such certificate problems
sooner (upon connection) rather than later (upon transmission of mail).
Earlier error detection is necessary so that errors may be presented to
the user during account setup.

Portions of these modifications are based on code from KeyManagerImpl:
https://android.googlesource.com/platform/external/conscrypt/+/master/src/main/java/org/conscrypt/KeyManagerImpl.java
2014-08-11 11:08:26 -04:00
Joe Steele 2b05f90d4d Move KeyChainKeyManager
Move KeyChainKeyManager to com.fsck.k9.net.ssl because it is used by
SslHelper and because the class extends X509ExtendedKeyManager, which is
in javax.net.ssl.
2014-08-11 11:08:24 -04:00
Joe Steele c5085be2ca Restore view visibility based on restored CheckBox state
The problem can be observed if, when modifying the outgoing server
settings, you change the state of the mRequireLoginView check box,
then change the screen orientation.

This is necessary because the OnCheckChanged listener (which
normally updates the view visibility) is not yet set. (The listeners
are set up after view initialization so that they only fire on
user input.)
2014-08-11 11:08:22 -04:00
Joe Steele 346d903ec3 Only trigger certificate chooser on user input
It should not be triggered when the instance state is restored
with an AuthType spinner selection of EXTERNAL.

The logic here for the AuthType spinner is similar to that of
the parent commit for the SecurityType spinner.
2014-08-11 11:08:20 -04:00
Joe Steele 5d5fab3081 Fix default port setting reversion
The problem:  begin modifying the server settings by changing the security
type (which will change the port to a default value), then change the port
to a custom value, then change screen orientation.  The default port value
is restored, wiping out the custom value.

When onRestoreInstanceState() is called, the custom port value is
restored.  But the spinner doesn't actually restore its state at that
time.  Instead, it waits until View.layout(), at which time it posts a
runnable to call onItemSelected() if the restored state doesn't match the
state initialized in onCreate().  When onItemSelected() is eventually run
sometime later, it wipes out the custom port value that was restored.

The solution is to keep track of the spinner state ourselves and only
revert the port to a default when we see the spinner state changed by the
user.

This problem goes back to 4.904 and before.
2014-08-11 11:07:58 -04:00
Joe Steele cf3561da5c Trigger certificate chooser when check box checked
For convenience.  Implemented in onCheckChanged().

As a consequence, onCheckChanged() must not be triggered when the instance
state is restored (would occur if the check box state was checked when
saved), otherwise the certificate chooser would pop up once the state was
restored.  Therefore, all listeners have been moved into
initializeViewListeners() which is invoked after the state has been
restored.

Because onCheckChanged() is no longer triggered in
onRestoreInstanceState(), updateViewVisibility() was implemented to
restore the view visibility.
2014-08-11 11:07:56 -04:00
Joe Steele 301ac48a38 Throw CertificateValidationException if EXTERNAL authentication fails
This is done when the SASL EXTERNAL mechanism isn't advertised (indicating
the possibility that the server did not accept the client certificate) or
when the command for authenticating with SASL EXTERNAL fails.

The CertificateValidationException will trigger a notification to the user
that there's an authentication problem that needs addressing.

Also, there were instances where CertificateValidationException was being
thrown with a new CertificateException as the cause for the purpose of
notifying the user when STARTTLS is not available.  This has been slightly
simplified by eliminating the need to include a new CertificateException
as a cause.
2014-08-11 11:07:54 -04:00
Joe Steele b557ba008c Implement SMTP AUTH EXTERNAL
Also, simplify by using Utility.base64Encode(String) in lieu of
new String(Base64.encodeBase64(String.getBytes())
2014-08-11 11:07:53 -04:00
Joe Steele c0be0eea12 Use the correct POP3 AUTH command 2014-08-11 11:07:51 -04:00
Joe Steele fe033e014f Avoid setting conflict warning when SMTP login not required 2014-08-11 11:07:49 -04:00
Joe Steele 65144e3759 Handle client certificate errors
If the alias is empty or null, don't bother using KeyChainKeyManager.

If the alias is not empty, confirm that it is associated with a
certificate, otherwise throw a CertificateValidationException
which will notify the user of the problem and ask the user to
check the server settings.

Likewise, the user is notified if the client certificate was
not accepted by the server.
2014-08-11 11:07:48 -04:00
Joe Steele 231f3645f9 Trigger certificate chooser on authentication change
If the user chooses client certificate authentication,
immediately pop up the certificate chooser.

If the user chooses password authentication, move the focus to the
password View.
2014-08-11 11:07:46 -04:00
Joe Steele 21cc3d9176 Remove ClientCertificateRequiredException
With this commit, KeyChainKeyManager no longer throws the exception and
AccountSetupCheckSettings no longer catches it.

It was being thrown when the server requested a client certificate but no
client certificate alias had been configured for the server.

The code was making the incorrect assumption that the server would only
request a client certificate when such a certificate was *required*.
However, servers can be configured to accept multiple forms of
authentication, including both password authentication and client
certificate authentication.  So a server may request a certificate without
requiring it.  If a user has not configured a client certificate, then
that should not be treated as an error because the configuration may be
valid and the server may accept it.

The only indication that a certificate is *required* is when a
SSLProtocolException is thrown, caused by a SSLHandshakeException
resulting from a fatal handshake alert message received from the server.
Unfortunately, such a message is fairly generic and only "indicates that
the sender was unable to negotiate an acceptable set of security
parameters given the options available."  So there is no definitive way to
know that a client certificate is required.

Also, KeyChainKeyManager.getCertificateChain() and getPrivateKey() no
longer throw IllegalStateException().  These methods are permitted to
return null, and such a response is appropriate if the user has deleted
client certificates from the device.  Again, this may or may not cause the
server to abort the connection, depending on whether the server *requires*
a client certificate.
2014-08-11 11:07:44 -04:00
Joe Steele fa853f7e1d Remove SslHelper.isClientCertificateSupportAvailable()
The app's minSdkVersion = 15 (Android 4.0.3, Ice Cream Sandwich MR1),
so there's no need to test the API level.

This also removes '@SuppressLint("TrulyRandom")'.  I find no
documentation for it, nor do I find any additional lint errors
with its removal.
2014-08-11 11:07:42 -04:00
Joe Steele b10b13b865 Force manual setup if using client certificates
Presently, auto-setup doesn't support certificates,
resulting in "Cannot connect to server. (Error
while decoding store URI)".
2014-08-11 11:07:41 -04:00
Joe Steele 88016ae52e Revert unused code changes 2014-08-11 11:07:37 -04:00
Joe Steele 38e9af5320 Don't clear widgets when removing
The user may toggle the checkbox, and then decide to toggle it again.

This also fixes a problem when restoring the activity state.  When the
checkbox was restored as checked, the listener was firing and wiping the
the restored alias.
2014-08-11 11:07:35 -04:00
Joe Steele acab554ee5 Save/Restore activity state
This assures that changes made to the port setting and to the chosen
client certificate are saved and restored.
2014-08-11 11:07:34 -04:00
Joe Steele 2e981e0c7d Don't trigger validateFields() except on user input
Previously, with settings of Security=SSL and authentication=certificate,
attempting to change Security=None would (of course) be blocked.  So
Security would remain SSL.  But the authentication options would then
include "Password, transmitted insecurely", whereas the option should
have remained as "Normal password" (because the security remained SSL).

The problem could have been fixed with a simple shuffling in
updatePortFromSecurityType() so that updateAuthPlainTextFromSecurityType()
was invoked before mPortView.setText(), but the logic for requiring that
ordering was not plain to see.  (Although no longer necessary, the
shuffling was done as well.)
2014-08-11 11:06:50 -04:00
Joe Steele c861b27df8 Fix outgoing server settings display
Add test for username == "".

Without it, the mRequireLoginView remains checked, and the empty username
and password boxes are not hidden.

The problem occurs if importing an SMTP server that has an
authenticationType, but no username or password (i.e., no authentication
required).

That's the way settings were exported in 4.904 and before.
2014-08-11 11:06:48 -04:00
Joe Steele 373c7569ed Fix password prompts on account import
Don't prompt if server's AuthType == EXTERNAL

Don't prompt for SMTP servers that don't require authentication
(no user name).
2014-08-11 11:06:46 -04:00
Joe Steele 6d8497a3c3 Fix WebDAV manual account setup
When creating a new account, the Incoming Server Settings screen
was initialized with the user name = PLAIN.
2014-08-11 11:06:45 -04:00
Joe Steele bef10812d3 Fix so WebDAV does not have STARTTLS auth. type option 2014-08-11 11:06:43 -04:00
Joe Steele eb68bc0a9d Avoid NPE on export
Occurs when the SMTP server doesn't require authentication
(authenticationType == null).

The javadoc for ServerSettings says that both authenticationType and
connectionSecurity may be null.
2014-08-11 11:06:42 -04:00
Joe Steele 34fd6d3ea7 Import/Export client certificate alias setting 2014-08-11 11:06:40 -04:00
Joe Steele ada74db8d5 Refactor KeyChainKeyManager()'s sClientCertificateReferenceWorkaround
The referenced issue states that it is only applicable to Android < 4.2
(testing confirms the problem on 4.1.2, but not on 4.2.2).

A test was added for the version code, primarily as a finder's aid for a
day when K-9 Mail no longer supports Android < 4.2 and the work-around can
be removed.

The referenced issue also states that it is only necessary to hold a
reference to the first PrivateKey retrieved. (Testing indicates that the
problem is avoided so long at least one reference is always maintained to
a PrivateKey -- it doesn't actually need to be a continuous reference to
the first PrivateKey.)

From my understanding, a normal class loader never unloads a class, so the
static reference can be safely kept privately in KeyChainKeyManager.
2014-08-11 11:06:38 -04:00
Philipp Haselwarter 7aa4c1308e Configure mail notifications by folder class
In response to Issue 1794,
- add a configuration option in the account preferences to show
  notifications only for 1st/2nd/etc class folders
- add an option in the folder preferences to set the notification class
  as 1st, 2nd or inherited from the folder's push class

The default behaviour remains unchanged.
2014-08-06 11:04:07 +02:00
Joe Steele 41570e4305 Fix leaked window error in FolderList
Observed after wiping data and then tapping a launcher shortcut
for an account.
2014-07-30 19:26:43 -04:00
Joe Steele fe49a5f005 Avoid NPE in MessageOpenPgpView.handleError()
E/AndroidRuntime(25655): FATAL EXCEPTION: main
E/AndroidRuntime(25655): Process: com.fsck.k9, PID: 25655
E/AndroidRuntime(25655): java.lang.NullPointerException
E/AndroidRuntime(25655):     at com.fsck.k9.view.MessageOpenPgpView.handleError(MessageOpenPgpView.java:385)
E/AndroidRuntime(25655):     at com.fsck.k9.view.MessageOpenPgpView.access$3(MessageOpenPgpView.java:384)
E/AndroidRuntime(25655):     at com.fsck.k9.view.MessageOpenPgpView$DecryptVerifyCallback.onReturn(MessageOpenPgpView.java:357)
E/AndroidRuntime(25655):     at org.openintents.openpgp.util.OpenPgpApi$OpenPgpAsyncTask.onPostExecute(OpenPgpApi.java:195)
E/AndroidRuntime(25655):     at org.openintents.openpgp.util.OpenPgpApi$OpenPgpAsyncTask.onPostExecute(OpenPgpApi.java:1)
E/AndroidRuntime(25655):     at android.os.AsyncTask.finish(AsyncTask.java:632)
E/AndroidRuntime(25655):     at android.os.AsyncTask.access$600(AsyncTask.java:177)
E/AndroidRuntime(25655):     at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
E/AndroidRuntime(25655):     at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(25655):     at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(25655):     at android.app.ActivityThread.main(ActivityThread.java:5128)
E/AndroidRuntime(25655):     at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(25655):     at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(25655):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
E/AndroidRuntime(25655):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:611)
E/AndroidRuntime(25655):     at dalvik.system.NativeStart.main(Native Method)
2014-07-30 19:26:41 -04:00
Joe Steele 710e7a4430 Notify user of invalid account-setup settings combo
Specifically, warn and block them when attempting to configure Client
Certificate Authentication in combination with Connection Security = None.

If this were not made obvious to the user, they might not understand why
they are not permitted to tap "Next".

Also, move the initialization of all view listeners out of onCreate() into
initializeViewListeners() which is then called near the end of onCreate(),
helping to assure that the listeners won't be triggered during the
initialization of views inside onCreate().
2014-07-28 22:55:34 -04:00
Joe Steele 3c025379d4 Rework validateFields() and updateViewFromAuthType()
Previously, it was possible to have "Require sign-in" unchecked and a
"Security = None" setting for the outgoing server and still not be able to
tap "Next" because of a hidden (and irrelevant) "Authentication = Client
certificate" setting.

Check that the user has actually chosen a client certificate in
AccountSetupOutgoing.validateFields().

Also, there's no need to clear the password and certificate fields when
hiding them.  The user may accidentally change settings and want to change
them back without wiping out the existing settings.
2014-07-13 16:02:21 -04:00