summaryrefslogtreecommitdiff
path: root/app/src/main/java/de
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2021-11-14 17:42:59 +0100
committercyBerta <cyberta@riseup.net>2021-11-14 17:42:59 +0100
commit59931af646b19fd8e206ea10a40e0971b968d620 (patch)
tree605f7caee14c7d01b68ee230d6cc199ef867dce7 /app/src/main/java/de
parent5b4db114cb35c5c9012c744c82656b1071aacda0 (diff)
don't allow openvpn configs without --remote or <connection> block
Diffstat (limited to 'app/src/main/java/de')
-rw-r--r--app/src/main/java/de/blinkt/openvpn/core/ConfigParser.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/src/main/java/de/blinkt/openvpn/core/ConfigParser.java b/app/src/main/java/de/blinkt/openvpn/core/ConfigParser.java
index 5b4ab361..4a8bcf99 100644
--- a/app/src/main/java/de/blinkt/openvpn/core/ConfigParser.java
+++ b/app/src/main/java/de/blinkt/openvpn/core/ConfigParser.java
@@ -714,6 +714,10 @@ public class ConfigParser {
Vector<Vector<String>> connectionBlocks = getAllOption("connection", 1, 1);
+ if (connectionBlocks == null && np.mConnections.length == 0) {
+ throw new ConfigParseError("No --remote or <connection> block found.");
+ }
+
if (np.mConnections.length > 0 && connectionBlocks != null) {
throw new ConfigParseError("Using a <connection> block and --remote is not allowed.");
}