diff options
author | cyBerta <cyberta@riseup.net> | 2019-05-21 11:54:20 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2019-05-21 11:54:20 +0200 |
commit | caadb236f39b4b6139a697eec57aa2796595422f (patch) | |
tree | c6b53be2133d74feb7d982e59d73cc4d29e4b6e7 /app/src/insecure/java | |
parent | 5fd9cd738f26797cf16576bf4011852c9f3052a8 (diff) |
* show error dialog if provider is misconfigured and has not allowed registration nor anonymous usage
* always download provider.json, Use preseeded provider.json only to check if the client
can connect with preseeded certificate. Keeps the provider.json updated if provider changes it's
config
* Tests for both cases
Diffstat (limited to 'app/src/insecure/java')
-rw-r--r-- | app/src/insecure/java/se/leap/bitmaskclient/ProviderApiManager.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/src/insecure/java/se/leap/bitmaskclient/ProviderApiManager.java b/app/src/insecure/java/se/leap/bitmaskclient/ProviderApiManager.java index e3fb549f..3325d82b 100644 --- a/app/src/insecure/java/se/leap/bitmaskclient/ProviderApiManager.java +++ b/app/src/insecure/java/se/leap/bitmaskclient/ProviderApiManager.java @@ -52,13 +52,14 @@ import static android.text.TextUtils.isEmpty; import static se.leap.bitmaskclient.Constants.BROADCAST_RESULT_KEY; import static se.leap.bitmaskclient.Constants.PROVIDER_KEY; import static se.leap.bitmaskclient.Constants.PROVIDER_VPN_CERTIFICATE; +import static se.leap.bitmaskclient.ProviderAPI.ERRORS; import static se.leap.bitmaskclient.ProviderSetupFailedDialog.DOWNLOAD_ERRORS.ERROR_CERTIFICATE_PINNING; import static se.leap.bitmaskclient.ProviderSetupFailedDialog.DOWNLOAD_ERRORS.ERROR_CORRUPTED_PROVIDER_JSON; -import static se.leap.bitmaskclient.ProviderAPI.ERRORS; import static se.leap.bitmaskclient.R.string.certificate_error; import static se.leap.bitmaskclient.R.string.downloading_vpn_certificate_failed; import static se.leap.bitmaskclient.R.string.error_io_exception_user_message; import static se.leap.bitmaskclient.R.string.malformed_url; +import static se.leap.bitmaskclient.R.string.setup_error_text; import static se.leap.bitmaskclient.R.string.warning_corrupted_provider_cert; import static se.leap.bitmaskclient.R.string.warning_corrupted_provider_details; @@ -115,14 +116,16 @@ public class ProviderApiManager extends ProviderApiManagerBase { resetProviderDetails(provider); } - if (!provider.hasDefinition()) - currentDownload = getAndSetProviderJson(provider, lastDangerOn); + currentDownload = getAndSetProviderJson(provider, lastDangerOn); if (provider.hasDefinition() || (currentDownload.containsKey(BROADCAST_RESULT_KEY) && currentDownload.getBoolean(BROADCAST_RESULT_KEY))) { if (!provider.hasCaCert()) currentDownload = downloadCACert(provider, lastDangerOn); if (provider.hasCaCert() || (currentDownload.containsKey(BROADCAST_RESULT_KEY) && currentDownload.getBoolean(BROADCAST_RESULT_KEY))) { currentDownload = getAndSetEipServiceJson(provider); } + if (provider.hasEIP() && !provider.allowsRegistered() && !provider.allowsAnonymous()) { + setErrorResult(currentDownload, setup_error_text, null); + } } currentDownload.putParcelable(PROVIDER_KEY, provider); return currentDownload; |