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/production | |
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/production')
-rw-r--r-- | app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java b/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java index cdbe5f60..1372fc43 100644 --- a/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java +++ b/app/src/production/java/se/leap/bitmaskclient/ProviderApiManager.java @@ -43,6 +43,7 @@ import static se.leap.bitmaskclient.ProviderSetupFailedDialog.DOWNLOAD_ERRORS.ER 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; @@ -95,15 +96,18 @@ public class ProviderApiManager extends ProviderApiManagerBase { resetProviderDetails(provider); } - if (!provider.hasDefinition()) { - currentDownload = getAndSetProviderJson(provider); - } + currentDownload = getAndSetProviderJson(provider); if (provider.hasDefinition() || (currentDownload.containsKey(BROADCAST_RESULT_KEY) && currentDownload.getBoolean(BROADCAST_RESULT_KEY))) { - if (!provider.hasCaCert()) + if (!provider.hasCaCert()) { currentDownload = downloadCACert(provider); + } 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); + } } return currentDownload; |