summaryrefslogtreecommitdiff
path: root/src/leap/bitmask
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2017-02-01 17:29:22 +0100
committerKali Kaneko (leap communications) <kali@leap.se>2017-02-23 00:40:34 +0100
commit9551ff71ce976f04e98f1c19c667bc5f9f402ae9 (patch)
treefe0319627f3394f0d4da5f5a0cbc63b37ee539f4 /src/leap/bitmask
parentb509a5f353f706fab31189b352d6ffa24bd1c3e5 (diff)
[bug] fix parsing of vpn status
Diffstat (limited to 'src/leap/bitmask')
-rwxr-xr-xsrc/leap/bitmask/cli/bitmask_cli.py2
-rw-r--r--src/leap/bitmask/vpn/_management.py5
-rw-r--r--src/leap/bitmask/vpn/_observer.py2
-rw-r--r--src/leap/bitmask/vpn/launcher.py8
-rw-r--r--src/leap/bitmask/vpn/service.py6
5 files changed, 13 insertions, 10 deletions
diff --git a/src/leap/bitmask/cli/bitmask_cli.py b/src/leap/bitmask/cli/bitmask_cli.py
index 67c6d2c..933b824 100755
--- a/src/leap/bitmask/cli/bitmask_cli.py
+++ b/src/leap/bitmask/cli/bitmask_cli.py
@@ -141,7 +141,7 @@ def execute():
cli = BitmaskCLI(cfg)
cli.data = ['core', 'version']
- args = ['--verbose'] if '--verbose' in sys.argv else None
+ args = None if '--noverbose' in sys.argv else ['--verbose']
yield cli._send(
timeout=0.1, printer=_null_printer,
errb=lambda: cli.start(args))
diff --git a/src/leap/bitmask/vpn/_management.py b/src/leap/bitmask/vpn/_management.py
index 9ae9011..920bd9d 100644
--- a/src/leap/bitmask/vpn/_management.py
+++ b/src/leap/bitmask/vpn/_management.py
@@ -241,7 +241,10 @@ class VPNManagement(object):
parts = stripped.split(",")
if len(parts) < 5:
continue
- ts, status_step, ok, ip, remote = parts
+ try:
+ ts, status_step, ok, ip, remote, port, _, _, _ = parts
+ except ValueError:
+ ts, status_step, ok, ip, remote, port, _, _ = parts
state = status_step
if state != self._last_state:
diff --git a/src/leap/bitmask/vpn/_observer.py b/src/leap/bitmask/vpn/_observer.py
index 1bb363d..c50a50d 100644
--- a/src/leap/bitmask/vpn/_observer.py
+++ b/src/leap/bitmask/vpn/_observer.py
@@ -1,3 +1,4 @@
+from itertools import chain, repeat
from twisted.logger import Logger
logger = Logger()
@@ -70,4 +71,3 @@ class VPNObserver(object):
"initialization_completed": sig.eip_connected
}
return signals.get(event.lower())
-
diff --git a/src/leap/bitmask/vpn/launcher.py b/src/leap/bitmask/vpn/launcher.py
index c049596..b869132 100644
--- a/src/leap/bitmask/vpn/launcher.py
+++ b/src/leap/bitmask/vpn/launcher.py
@@ -220,7 +220,7 @@ class VPNLauncher(object):
args += [
'--client',
- '--dev', 'tun',
+ '--dev', ' tun',
'--persist-key',
'--tls-client',
'--remote-cert-tls',
@@ -262,9 +262,9 @@ class VPNLauncher(object):
'--ca', providerconfig.get_ca_cert_path()
]
- args += [
- '--ping', '10',
- '--ping-restart', '30']
+ #args += [
+ # '--ping', '10',
+ # '--ping-restart', '30']
command_and_args = [openvpn_path] + args
return command_and_args
diff --git a/src/leap/bitmask/vpn/service.py b/src/leap/bitmask/vpn/service.py
index 59e251d..3550b4b 100644
--- a/src/leap/bitmask/vpn/service.py
+++ b/src/leap/bitmask/vpn/service.py
@@ -103,11 +103,12 @@ class EIPService(HookableService):
:param provider: the provider to use, e.g. 'demo.bitmask.net'
:type provider: str"""
+
# FIXME
# XXX picked manually from eip-service.json
remotes = (
- ("198.252.153.84", "1194 "),
- ("46.165.242.169", "1194 "),
+ ("198.252.153.84", "1194"),
+ ("46.165.242.169", "1194"),
)
prefix = os.path.join(self._basepath,
@@ -122,7 +123,6 @@ class EIPService(HookableService):
"cipher": "AES-128-CBC",
"keepalive": "10 30",
"tls-cipher": "DHE-RSA-AES128-SHA",
- "tun-ipv6": "true",
}
self._eip = EIPManager(remotes, cert_path, key_path, ca_path,