From f481f5508518f172a39c81829264df8686fe7872 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Fri, 23 Aug 2013 12:35:11 +0200 Subject: Fix TLS 1.2 and Android 4.1 --- src/de/blinkt/openvpn/VpnProfile.java | 1 + src/de/blinkt/openvpn/core/OpenVpnManagementThread.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/de/blinkt/openvpn') diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java index a8c6825f..3a2f2bbf 100644 --- a/src/de/blinkt/openvpn/VpnProfile.java +++ b/src/de/blinkt/openvpn/VpnProfile.java @@ -838,6 +838,7 @@ public class VpnProfile implements Serializable { int pkey = (Integer) getPkeyContext.invoke(opensslkey); getPkeyContext.setAccessible(false); + // 112 with TLS 1.2 (172 back with 4.3), 36 with TLS 1.0 byte[] signed_bytes = NativeUtils.rsasign(data, pkey); return Base64.encodeToString(signed_bytes, Base64.NO_WRAP); diff --git a/src/de/blinkt/openvpn/core/OpenVpnManagementThread.java b/src/de/blinkt/openvpn/core/OpenVpnManagementThread.java index 7e436f79..9497f18b 100644 --- a/src/de/blinkt/openvpn/core/OpenVpnManagementThread.java +++ b/src/de/blinkt/openvpn/core/OpenVpnManagementThread.java @@ -504,9 +504,15 @@ public class OpenVpnManagementThread implements Runnable, OpenVPNManagement { private void processSignCommand(String b64data) { String signed_string = mProfile.getSignedData(b64data); - managmentCommand("rsa-sig\n"); + if(signed_string==null) { + managmentCommand("rsa-sig\n"); + managmentCommand("\nEND\n"); + stopOpenVPN(); + return; + } + managmentCommand("rsa-sig\n"); managmentCommand(signed_string); - managmentCommand("\nEND\n"); + managmentCommand("\nEND\n"); } @Override -- cgit v1.2.3