summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/services/eip/eipconfig.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2014-11-24 17:16:44 +0100
committerKali Kaneko <kali@leap.se>2014-11-24 17:16:44 +0100
commit0473359c06362889d8e58947343aa3cac67a5d82 (patch)
treebf8f37d15cbe84267d2bba53005f7d9e00a96c90 /src/leap/bitmask/services/eip/eipconfig.py
parent90021cc3cfb55e30ad3a20a12257fdf386e3653f (diff)
parent704e6bd60c1979a6a997bbe13eac4d30e3188887 (diff)
Merge tag '0.7.0rc5' into debian/experimental
Tag leap.bitmask version 0.7.0rc5
Diffstat (limited to 'src/leap/bitmask/services/eip/eipconfig.py')
-rw-r--r--src/leap/bitmask/services/eip/eipconfig.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/leap/bitmask/services/eip/eipconfig.py b/src/leap/bitmask/services/eip/eipconfig.py
index 5b51d12e..659ca1b1 100644
--- a/src/leap/bitmask/services/eip/eipconfig.py
+++ b/src/leap/bitmask/services/eip/eipconfig.py
@@ -216,7 +216,7 @@ class EIPConfig(ServiceConfig):
"""
_service_name = "eip"
- OPENVPN_ALLOWED_KEYS = ("auth", "cipher", "tls-cipher")
+ OPENVPN_ALLOWED_KEYS = ("auth", "cipher", "tls-cipher", "fragment")
OPENVPN_CIPHERS_REGEX = re.compile("[A-Z0-9\-]+")
def __init__(self):
@@ -255,6 +255,11 @@ class EIPConfig(ServiceConfig):
These are sanitized with alphanumeric whitelist.
+ NOTE: some openvpn config option don't take a value, but
+ this method currently requires that every option has a value.
+ Also, this does not yet work with values with spaces, like
+ `keepalive 10 30`
+
:returns: openvpn configuration dict
:rtype: C{dict}
"""
@@ -262,7 +267,7 @@ class EIPConfig(ServiceConfig):
config = {}
for key, value in ovpncfg.items():
if key in self.OPENVPN_ALLOWED_KEYS and value is not None:
- sanitized_val = self.OPENVPN_CIPHERS_REGEX.findall(value)
+ sanitized_val = self.OPENVPN_CIPHERS_REGEX.findall(str(value))
if len(sanitized_val) != 0:
_val = sanitized_val[0]
config[str(key)] = str(_val)