summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/VpnProfile.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-07-16 04:29:35 +0200
committerArne Schwabe <arne@rfc2549.org>2012-07-16 04:29:35 +0200
commit1a20bf712119d2a336ba9daa3abbc416a23a81d7 (patch)
tree55412f3d8e07f4ae102d82f2b425e2a2e9627926 /src/de/blinkt/openvpn/VpnProfile.java
parentcb18cf6c0aed926eaad59025efd446a270aea57e (diff)
Fixes error reported on the Android market consolev0.5.12a
- setting 0.0.0.0 as DNS gives NP - Using a invalid keystone key gives a NP in rsa_sign (Seems to happen on 4.0 -> 4.1 upgrade) - stupid config converter bug introduced in 5.12 - bump version to 5.12a
Diffstat (limited to 'src/de/blinkt/openvpn/VpnProfile.java')
-rw-r--r--src/de/blinkt/openvpn/VpnProfile.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java
index 64ca3db6..8d506f9b 100644
--- a/src/de/blinkt/openvpn/VpnProfile.java
+++ b/src/de/blinkt/openvpn/VpnProfile.java
@@ -447,7 +447,8 @@ public class VpnProfile implements Serializable{
Intent intent = new Intent(context,OpenVpnService.class);
if(mAuthenticationType == VpnProfile.TYPE_KEYSTORE || mAuthenticationType == VpnProfile.TYPE_USERPASS_KEYSTORE) {
- saveCertificates(context);
+ if(!saveCertificates(context))
+ return null;
}
intent.putExtra(prefix + ".ARGV" , buildOpenvpnArgv(context.getCacheDir()));
@@ -468,7 +469,7 @@ public class VpnProfile implements Serializable{
return intent;
}
- private void saveCertificates(Context context) {
+ private boolean saveCertificates(Context context) {
PrivateKey privateKey = null;
X509Certificate[] cachain=null;
try {
@@ -521,7 +522,7 @@ public class VpnProfile implements Serializable{
}
- return;
+ return true;
} catch (InterruptedException e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
@@ -533,7 +534,7 @@ public class VpnProfile implements Serializable{
} catch (KeyChainException e) {
OpenVPN.logMessage(0,"",context.getString(R.string.keychain_access));
}
-
+ return false;
}
private Certificate getCacertFromFile() throws FileNotFoundException, CertificateException {
CertificateFactory certFact = CertificateFactory.getInstance("X.509");
@@ -550,7 +551,7 @@ public class VpnProfile implements Serializable{
//! Return an error if somethign is wrong
- int checkProfile() {
+ int checkProfile(Context context) {
if(mAuthenticationType==TYPE_KEYSTORE || mAuthenticationType==TYPE_USERPASS_KEYSTORE) {
if(mAlias==null)
return R.string.no_keystore_cert_selected;
@@ -690,9 +691,6 @@ public class VpnProfile implements Serializable{
public PrivateKey getKeystoreKey() {
return mPrivateKey;
}
-
-
-
}