diff options
author | cyBerta <cyberta@riseup.net> | 2021-11-14 17:42:59 +0100 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2021-11-14 17:42:59 +0100 |
commit | 59931af646b19fd8e206ea10a40e0971b968d620 (patch) | |
tree | 605f7caee14c7d01b68ee230d6cc199ef867dce7 | |
parent | 5b4db114cb35c5c9012c744c82656b1071aacda0 (diff) |
don't allow openvpn configs without --remote or <connection> block
-rw-r--r-- | app/src/main/java/de/blinkt/openvpn/core/ConfigParser.java | 4 |
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."); } |