summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient/ProviderAPI.java
AgeCommit message (Collapse)Author
2013-11-09bitmaskclient instead of leapclient in package pathcyBerta
2013-10-03Login dialog requires username.Parménides GV
I've also changed the way we notify that the password should have 8 characters at least, to make it consistent to the way we notify username is required.
2013-10-03Fixed M2 and M1 constants values.Parménides GV
Logging in, it was returning a "Bad response from server" due to the malinterpretation of the received JSON. It was looking for a field named "m2", but it was "M2".
2013-09-30Erroneous CA cert download correctly handled.Parménides GV
If there is an error while downloading CA cert on downloadJsonFiles, false is returned and progress dialog is dismissed.
2013-09-30Moved all constants from ConfigHelper.Parménides GV
They have been relocated to the corresponding classes.
2013-09-30Moved result constants to ProviderAPI.Parménides GV
2013-09-26Replaced Apache HTTP client with HttpURLConnectionParménides GV
I do not manually manage cookies anymore, letting HttpURLConnection manage them via default CookieHandler (using CookiePolicy.ACCEPT_ORIGINAL_SERVER).
2013-09-26Apache HTTP to Android HttpsURLConnection started.Parménides GV
SRP parameter A tries to be sent via HttpsURLConnection. Right now, we have a problem with certificates because I'm not using provider CA cert to get the response. I'm going to merge the branch with better method names to download response using already existing code.
2013-09-26Commented all manual cookie management.Parménides GV
I send session_id cookie in the request for 1/cert, getting it from LeapHttpClient directly.
2013-09-25Removed cookie to logout chain.Parménides GV
2013-09-25Renamed certificate handling methods.Parménides GV
I still let one method to bypass hostname verifier, otherwise dev.bm will not work. I've reduced downloading functions to 3: download without CA, download with commercial CA and download with provider CA. I only download CA cert once, when the user selects the corresponding provider. Each time a user switch provider, the cert is downloaded (along with other json files).
2013-08-13Use java.security classes to validate string certificates and keys from providerSean Leonard
2013-08-13Merge branch 'bug/provider-down-not-differentiated-from-certificate-error' ↵Sean Leonard
into develop
2013-08-13Merge branch 'feature/retry-login-retain-username' into developSean Leonard
2013-08-03FileNotFoundException catched in all downloads.Parménides GV
Added a new catch block in all downloads methods.
2013-08-01ProviderAPI intent receives actions and parameters.Parménides GV
We no longer use BundleExtras named as the action ProviderAPI is intended to perform, but we standardise this name (ProviderAPI.PARAMETERS), and use setAction to pass that action string.
2013-07-30Retains username if login process failed.Parménides GV
New login dialog shows the original username, so that if the user failed writing his/her password, s/he does not have to write again the username.
2013-07-26Include GPLv3+ file and header for files in se.leap.leapclient packageSean Leonard
2013-07-20If IOException, use current provider CA cert.Parménides GV
If the CA cert was correctly downloaded, we assume it can be used to validate the string download. If CA cert cannot validate that connection, then if the trust completely checkbox was checked it will try with the other methods. If it was not checked, a certificate error is shown (telling the user the provider is not trusted).
2013-07-20Certificate message shown when appropiate.Parménides GV
Only if all downloading methods fail and the last one throws an IOException, the certificate error message toast is shown.
2013-07-20Erroneous untrusted provider toast with LEAP fixedParménides GV
I've also rearranged how we handle SSL errors. In first place, if the user checked the "Trust completely" checkbox, leap_android tries to use the CA cert pointed out by provider.json. If that does not succeed, it uses an always-returning-true hostname verifier (this was previously done before using CA cert).
2013-07-12Shows bad user/password message when appropriate.Parménides GV
If an empty json string is received after sending M1 (that means no M2 in return), bad user/password message is shown. This fixes bug 3153.
2013-07-12New certificates are added without creating filesParménides GV
LeapHttpClient can fetch the main CA certificate downloaded from the provider and add it to its in-memory keystore, without saving the certificate in a file. This is a very important feature, I think it can be cherry picked (it has little modifications, and very localized). It's very important because authentication does not work without this bug fix in the latest branches, because I removed the code that saved the certificate in a file but didn't test the authentication part.
2013-07-12Shows certificate error message.Parménides GV
If a download didn't occurr due to an IOException, we assume it was for an SSL error and notify the user telling him/her that LEAP provider is not trusted.
2013-07-12Distinguish non LEAP provider and down provider.Parménides GV
I've set ProviderAPI to show its own toast depending on the exception that getStringFromProvider issues. If the socket timeout reaches its end, a toast different from when an IOException or a MalformedException occur.
2013-07-12User messages are added to the new recovery dialogParménides GV
When login is not successful, a new recovery dialog is prompted with a message about the previous error.
2013-07-12Pressing back button, we don't choose any providerParménides GV
Once in the provider detail fragment, if the user presses the back button, provider.json is removed from sharedpreferences (so that Dashboard does not start as if the user had selected the canceled provider) and ConfigurationWizard gets the focus.
2013-07-12UnknownHostException separated from IOException.Parménides GV
I was treating the former exception simply as a kind of the latter, but user messages are different. Now, each one shows its different error message.
2013-07-12Untrusted message is not shown if danger_on = trueParménides GV
I forgot to add an else in the IOException from getStringFromProvider. This was causing that even if the user checked the trusted completely beckbox and everything was fine, the "not trusted provider" message was being shown.
2013-07-12Back to IOException instead of SSL exception.Parménides GV
The previous commit broke functionality, and instead of discarding it I've decided to undo with a new commit for future references. It would seem that IOException can be substitued by SSLHandshakeException, but the previous commit proves it cannot.
2013-07-12Substituted IOException by SSLHandshakeException.Parménides GV
In getStringFromProvider, there is no IOException but an SSLHandshakeException. Substituing this gives our code more semantics.
2013-07-12Shows certificate error message.Parménides GV
If a download didn't occurr due to an IOException, we assume it was for an SSL error and notify the user telling him/her that LEAP provider is not trusted.
2013-07-12Distinguish non LEAP provider and down provider.Parménides GV
I've set ProviderAPI to show its own toast depending on the exception that getStringFromProvider issues. If the socket timeout reaches its end, a toast different from when an IOException or a MalformedException occur.
2013-07-02We can ignore any certificate.Parménides GV
If ssl errors don't vanish using CA cert from provider, we go further and let the certificate not to be validated at all.
2013-06-26The added provider is selected automatically.Parménides GV
I've also removed a lot of finishes when things go wrong (so that it should be returning to the previous activity/fragment).
2013-06-20Quite basic staring and stopping of VPNSean Leonard
2013-06-20No binary library needed.Parménides GV
I've decided not to include any lib, but to copy the SRPParameters class to our codebase and Util.trim method to ConfigHelper.
2013-06-20User messages are now in string.xmlParménides GV
Some more constants added to ConfigHelper. This solves #2908.
2013-06-19First round of comments.Parménides GV
This resolves the first step from issue #2908. Next step: Put user message strings into an appropiate place.
2013-06-13Bypasses self signed certificates.Parménides GV
It's working against cdev.bitmask.net and bitmask.net. Look at #2840 for further explanation about self signed certificates. I've also removed some file dependant configuration (when a provider was custom, ConfigurationWizard still tried to read from file a provider.json that now I store in memory via ProviderItem class).
2013-06-13bitmask json files are downloaded.Parménides GV
There was a problem on the assets file "bitmask.url". It had an error in the eip-service url. We should use this file only for main url, and proceed as if it were a new provider but with a preseeded main url.
2013-06-11We are not using SD storage anymore.Parménides GV
We were using it to save certificate and provider.json files from chosen provider, so that exporting them was easily done. We don't need that files, because if we wanted to export that files we would be able to recover them easily and updated. This fixes #2783
2013-06-10Removed unused methods and variables.Parménides GV
Variables from LeapSRPSession were there because I used it while testing srp calculations, comparing that strings with the ones from javascript. Unused method from ProviderAPI was there because I foresee I'll have to implement it in the future, but I've removed it since it's already in the history. This fixes #2781.
2013-06-10OpenVPN certificate is downloaded from API_BASE, using api_uri fieldParménides GV
from provider.json. This fixes bug #2780
2013-06-08Improve retrieving and saving SharedPreferences for different types (String, ↵Sean Leonard
boolean, JSONObject)
2013-06-04Fixed 2 important bugs.Parménides GV
LeapSRPSession was doing bad SRP calculations when salt byte array started with a 0. Now I trimmed that array before using it. ProviderAPI was not timing out when a server didn't respond. Now, I use a timeout of 1 second to stop waiting for a response.
2013-05-14Anon certificate is downloaded if possible.Parménides GV
I download the anon certificate only if allow_anonymous is true, and before launching Dashboard. I store it in SharedPreferences, with "cert" key, as a JSON object.
2013-05-13A bit more clean.Parménides GV
I've upper cased ConfigHelper constants. I've created a new method in ConfigHelper, to send requests to a server, that it's used when sending A and M1.
2013-05-09Log in and Log out options are shown only if allow registration is true.Parménides GV
Allow registration is present in provider.json. Provider.json is downloaded from both preseeded and custom providers. Authentication success or fail is notified correctly to the user.
2013-05-08After loggin in successfully, the new client certificate is downloaded.Parménides GV
It is stored in SharedPrefs, with ConfigHelper.cert_key (="cert") key.