summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-08-16 16:23:26 +0200
committerArne Schwabe <arne@rfc2549.org>2013-08-16 16:23:26 +0200
commit75bd326709b5cb640f5206ca1c7128536f9e2bfa (patch)
tree0bedcdc883313663d04dfcee77fd910159beff38
parent6c8337fe114e97b10982a4a30df5a3373a1f39ae (diff)
fix minor code style issues
--HG-- extra : rebase_source : 713a275b9689e1bf413f8e4ee80d115842fa7f31
-rw-r--r--src/de/blinkt/openvpn/VpnProfile.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java
index 6b7cffab..9ee0f9db 100644
--- a/src/de/blinkt/openvpn/VpnProfile.java
+++ b/src/de/blinkt/openvpn/VpnProfile.java
@@ -415,6 +415,7 @@ public class VpnProfile implements Serializable {
PackageInfo packageinfo = c.getPackageManager().getPackageInfo(c.getPackageName(), 0);
version = packageinfo.versionName;
} catch (PackageManager.NameNotFoundException e) {
+ e.printStackTrace();
}
return String.format(Locale.US, "setenv IV_OPENVPN_GUI_VERSION \"%s %s\"\n", c.getPackageName(), version);
@@ -544,7 +545,7 @@ public class VpnProfile implements Serializable {
String[] getKeyStoreCertificates(Context context) {
PrivateKey privateKey = null;
- X509Certificate[] cachain = null;
+ X509Certificate[] cachain;
try {
privateKey = KeyChain.getPrivateKey(context, mAlias);
mPrivateKey = privateKey;
@@ -764,7 +765,7 @@ public class VpnProfile implements Serializable {
public String getSignedData(String b64data) {
PrivateKey privkey = getKeystoreKey();
- Exception err = null;
+ Exception err;
byte[] data = Base64.decode(b64data, Base64.DEFAULT);
@@ -796,15 +797,15 @@ public class VpnProfile implements Serializable {
} catch (BadPaddingException e) {
err = e;
}
- if (err != null) {
- OpenVPN.logError(R.string.error_rsa_sign, err.getClass().toString(), err.getLocalizedMessage());
- }
+
+ OpenVPN.logError(R.string.error_rsa_sign, err.getClass().toString(), err.getLocalizedMessage());
+
return null;
}
private String processSignJellyBeans(PrivateKey privkey, byte[] data) {
- Exception err = null;
+ Exception err;
try {
Method getKey = privkey.getClass().getSuperclass().getDeclaredMethod("getOpenSSLKey");
getKey.setAccessible(true);
@@ -835,9 +836,8 @@ public class VpnProfile implements Serializable {
} catch (InvalidKeyException e) {
err = e;
}
- if (err != null) {
- OpenVPN.logError(R.string.error_rsa_sign, err.getClass().toString(), err.getLocalizedMessage());
- }
+ OpenVPN.logError(R.string.error_rsa_sign, err.getClass().toString(), err.getLocalizedMessage());
+
return null;
}