summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-05-05 03:08:32 +0200
committerArne Schwabe <arne@rfc2549.org>2012-05-05 03:08:32 +0200
commit21f0e327e0f23b0e76c420d73298dc911408ef96 (patch)
treea08973965af87fac0227171668688df1f88ab5af
parent1c6052df6172f8f4e025fa0934abe58aab640430 (diff)
Error message if keystore cannot be accessed (e.g. after backup)
-rw-r--r--res/values/strings.xml3
-rw-r--r--src/de/blinkt/openvpn/OpenVPN.java2
-rw-r--r--src/de/blinkt/openvpn/VpnProfile.java20
3 files changed, 13 insertions, 12 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index cf8cc5c8..e3d54a8d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -165,5 +165,6 @@
<string name="routes_info">Routes: %s</string>
<string name="ip_not_cidr">Cannot make sense of %1$s and %2$s as local IP with CIDR netmask, assuming second address is peer address of remote. Using /32 netmask for local IP.</string>
<string name="route_not_cidr">Cannot make sense of %1$s and %2$s as IP route with CIDR netmask, using /32 as netmask.</string>
- <string name="route_not_netip">Corrected route %1$s/%2$s to %3$s/%2$s</string>
+ <string name="route_not_netip">Corrected route %1$s/%2$s to %3$s/%2$s</string>
+ <string name="keychain_access">Cannot accces the Android Keychain Certificates. If you restored a backup of the app reselect the certificate</string>
</resources>
diff --git a/src/de/blinkt/openvpn/OpenVPN.java b/src/de/blinkt/openvpn/OpenVPN.java
index a5f60daf..3e660bce 100644
--- a/src/de/blinkt/openvpn/OpenVPN.java
+++ b/src/de/blinkt/openvpn/OpenVPN.java
@@ -17,7 +17,7 @@ public class OpenVPN {
private static int counter=0;
private static Vector<LogListener> logListener=new Vector<OpenVPN.LogListener>();
- private static String[] mBconfig=null;
+ private static String[] mBconfig;
public interface LogListener {
void newLog(String logmessage);
diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java
index f6ece687..572c0c2d 100644
--- a/src/de/blinkt/openvpn/VpnProfile.java
+++ b/src/de/blinkt/openvpn/VpnProfile.java
@@ -38,10 +38,10 @@ public class VpnProfile implements Serializable{
public static final int TYPE_USERPASS_CERTIFICATES = 5;
public static final int TYPE_USERPASS_PKCS12 = 6;
public static final int TYPE_USERPASS_KEYSTORE = 7;
-
-
-
-
+
+
+
+
private static final String OVPNCONFIGFILE = "android.conf";
@@ -186,7 +186,7 @@ public class VpnProfile implements Serializable{
cfg+="tmp-dir ";
cfg+=cacheDir.getAbsolutePath();
cfg+="\n\n";
-
+
boolean useTLSClient = (mAuthenticationType != TYPE_STATICKEYS);
if(useTLSClient && mUsePull)
@@ -455,8 +455,6 @@ public class VpnProfile implements Serializable{
ks.store(fout,mypw.toCharArray());
fout.flush(); fout.close();
return;
- } catch (KeyChainException e) {
- e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (KeyStoreException e) {
@@ -469,6 +467,8 @@ public class VpnProfile implements Serializable{
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
+ } catch (KeyChainException e) {
+ OpenVPN.logMessage(0,"",context.getString(R.string.keychain_access));
}
}
@@ -538,7 +538,7 @@ public class VpnProfile implements Serializable{
if(isUserPWAuth() && (mPassword.equals("") || mPassword == null)) {
if(mTransientPW==null)
return "Password";
-
+
}
return null;
}
@@ -552,8 +552,8 @@ public class VpnProfile implements Serializable{
return mPassword;
}
}
-
-
+
+
// Used by the Array Adapter
@Override
public String toString() {