diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-07-10 23:00:52 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-07-10 23:00:52 +0200 |
commit | ef61fcea1d89b43b443c9faa6211a5a497fa78d1 (patch) | |
tree | b6b6722c27254bf41fe6f8af828f545280df60ec /src/de/blinkt/openvpn/ConfigParser.java | |
parent | 7a2b9b1880612c78699f03f62697cdab4a7c6747 (diff) |
Fine tune config convert messages
Import tls-auth [inline] dir correctly (closes issue #55)
Diffstat (limited to 'src/de/blinkt/openvpn/ConfigParser.java')
-rw-r--r-- | src/de/blinkt/openvpn/ConfigParser.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/de/blinkt/openvpn/ConfigParser.java b/src/de/blinkt/openvpn/ConfigParser.java index 1b07178e..e1b426fa 100644 --- a/src/de/blinkt/openvpn/ConfigParser.java +++ b/src/de/blinkt/openvpn/ConfigParser.java @@ -279,14 +279,19 @@ public class ConfigParser { } np.mCustomRoutes=routeopt; } - - Vector<String> tlsauth = getOption("tls-auth", 1, 2); - if(tlsauth!=null) - { - np.mUseTLSAuth=true; - np.mTLSAuthFilename=tlsauth.get(1); - if(tlsauth.size()==3) - np.mTLSAuthDirection=tlsauth.get(2); + + // Also recognize tls-auth [inline] direction ... + Vector<Vector<String>> tlsauthoptions = getAllOption("tls-auth", 1, 2); + for(Vector<String> tlsauth:tlsauthoptions) { + if(tlsauth!=null) + { + if(!tlsauth.get(1).equals("[inline]")) { + np.mTLSAuthFilename=tlsauth.get(1); + np.mUseTLSAuth=true; + } + if(tlsauth.size()==3) + np.mTLSAuthDirection=tlsauth.get(2); + } } Vector<String> direction = getOption("key-direction", 1, 1); |