summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
Diffstat (limited to 'main/src')
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java4
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java4
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/LogItem.java3
3 files changed, 8 insertions, 3 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java b/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java
index d14e643e..57635cf4 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/ConfigParser.java
@@ -554,10 +554,12 @@ public class ConfigParser {
if (verifyx509name.size() > 2) {
if (verifyx509name.get(2).equals("name"))
np.mX509AuthType = VpnProfile.X509_VERIFY_TLSREMOTE_RDN;
+ else if (verifyx509name.get(2).equals("subject"))
+ np.mX509AuthType = VpnProfile.X509_VERIFY_TLSREMOTE_DN;
else if (verifyx509name.get(2).equals("name-prefix"))
np.mX509AuthType = VpnProfile.X509_VERIFY_TLSREMOTE_RDN_PREFIX;
else
- throw new ConfigParseError("Unknown parameter to x509-verify-name: " + verifyx509name.get(2));
+ throw new ConfigParseError("Unknown parameter to verify-x509-name: " + verifyx509name.get(2));
} else {
np.mX509AuthType = VpnProfile.X509_VERIFY_TLSREMOTE_DN;
}
diff --git a/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java b/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java
index 7bb9d134..43a3f30e 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java
@@ -18,6 +18,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
+import java.nio.BufferOverflowException;
import java.nio.ByteBuffer;
import java.util.Locale;
@@ -63,7 +64,7 @@ class LogFileHandler extends Handler {
flushToDisk();
}
- } catch (IOException e) {
+ } catch (IOException| BufferOverflowException e) {
e.printStackTrace();
VpnStatus.logError("Error during log cache: " + msg.what);
VpnStatus.logException(e);
@@ -88,6 +89,7 @@ class LogFileHandler extends Handler {
// We do not really care if the log cache breaks between Android upgrades,
// write binary format to disc
+
byte[] liBytes = li.getMarschaledBytes();
writeEscapedBytes(liBytes);
diff --git a/main/src/main/java/de/blinkt/openvpn/core/LogItem.java b/main/src/main/java/de/blinkt/openvpn/core/LogItem.java
index d767e073..ebe884a8 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/LogItem.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/LogItem.java
@@ -18,6 +18,7 @@ import android.util.Log;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.UnsupportedEncodingException;
+import java.nio.BufferOverflowException;
import java.nio.ByteBuffer;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
@@ -89,7 +90,7 @@ public class LogItem implements Parcelable {
}
- public byte[] getMarschaledBytes() throws UnsupportedEncodingException {
+ public byte[] getMarschaledBytes() throws UnsupportedEncodingException, BufferOverflowException {
ByteBuffer bb = ByteBuffer.allocate(16384);