From 6709f66650ec4cc4a22d7bb4d0e809eab119cbe9 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 13 Jun 2012 23:23:49 +0200 Subject: Correct network state message Improve logging framework a bit Add logging of certificates received from Keystore --- src/de/blinkt/openvpn/VpnProfile.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/de/blinkt/openvpn/VpnProfile.java') diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java index d74701f5..e9cb994a 100644 --- a/src/de/blinkt/openvpn/VpnProfile.java +++ b/src/de/blinkt/openvpn/VpnProfile.java @@ -23,6 +23,7 @@ import android.content.Intent; import android.content.pm.ApplicationInfo; import android.security.KeyChain; import android.security.KeyChainException; +import android.util.Log; public class VpnProfile implements Serializable{ // Parcable @@ -473,7 +474,14 @@ public class VpnProfile implements Serializable{ try { privateKey = KeyChain.getPrivateKey(context,mAlias); cachain = KeyChain.getCertificateChain(context, mAlias); + if(cachain.length <= 1) + OpenVPN.logMessage(0, "", context.getString(R.string.keychain_nocacert)); + + for(X509Certificate cert:cachain) { + OpenVPN.logInfo(R.string.cert_from_keystore,cert.getSubjectDN()); + } + KeyStore ks = KeyStore.getInstance("PKCS12"); ks.load(null, null); ks.setKeyEntry("usercert", privateKey, null, cachain); -- cgit v1.2.3