summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/stylesheets/leap.scss6
-rw-r--r--config/defaults.yml8
-rw-r--r--core/config/locales/en.yml2
-rwxr-xr-xusers/test/integration/api/python/umlauts.py79
4 files changed, 87 insertions, 8 deletions
diff --git a/app/assets/stylesheets/leap.scss b/app/assets/stylesheets/leap.scss
index 30f7741..abfea05 100644
--- a/app/assets/stylesheets/leap.scss
+++ b/app/assets/stylesheets/leap.scss
@@ -58,7 +58,7 @@ html.android .os-android {
display: none !important;
}
-html.linux .os-linux32 {
+html.linux32 .os-linux32 {
display: inherit !important;
}
@@ -78,11 +78,11 @@ html.windows .os-windows {
display: inherit !important;
}
-.os-mac {
+.os-osx {
display: none !important;
}
-html.mac .os-mac {
+html.osx .os-osx {
display: inherit !important;
}
diff --git a/config/defaults.yml b/config/defaults.yml
index 6211e37..c7c8502 100644
--- a/config/defaults.yml
+++ b/config/defaults.yml
@@ -18,16 +18,16 @@ downloads: &downloads
available_clients:
- linux32
- linux64
- - mac
+ - osx
- windows
- android
download_paths:
- android: /client/android
+ android: /client/android/Bitmask-Android-latest.apk
linux: /client/linux
linux32: /client/linux/Bitmask-linux32-latest.tar.bz2
linux64: /client/linux/Bitmask-linux64-latest.tar.bz2
- osx: /client/osx/Bitmask-OSC-latest.dmg
- windows: /client/windows
+ osx: /client/osx/Bitmask-OSX-latest.dmg
+ windows: /client/windows/Bitmask-win32-latest.zip
other: /client
common: &common
diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml
index 344eee4..4710a16 100644
--- a/core/config/locales/en.yml
+++ b/core/config/locales/en.yml
@@ -35,6 +35,6 @@ en:
linux64: "Linux (64 bit)"
windows: "Windows"
android: "Android"
- mac: "Mac OSX"
+ osx: "Mac OSX"
other: "(not available for your OS.)"
diff --git a/users/test/integration/api/python/umlauts.py b/users/test/integration/api/python/umlauts.py
new file mode 100755
index 0000000..96fecbf
--- /dev/null
+++ b/users/test/integration/api/python/umlauts.py
@@ -0,0 +1,79 @@
+#!/usr/bin/env python
+# coding: utf-8
+
+# under development
+
+import requests
+import json
+import string
+import random
+import srp._pysrp as srp
+import binascii
+
+safe_unhexlify = lambda x: binascii.unhexlify(x) if (len(x) % 2 == 0) else binascii.unhexlify('0'+x)
+
+# using globals for now
+# server = 'https://dev.bitmask.net/1'
+server = 'http://api.lvh.me:3000/1'
+
+def run_tests():
+ login = 'test_' + id_generator()
+ password = id_generator() + "äöì" + id_generator()
+ usr = srp.User( login, password, srp.SHA256, srp.NG_1024 )
+ print_and_parse(signup(login, password))
+
+ auth = print_and_parse(authenticate(usr))
+ verify_or_debug(auth, usr)
+ assert usr.authenticated()
+
+
+# let's have some random name
+def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
+ return ''.join(random.choice(chars) for x in range(size))
+
+# log the server communication
+def print_and_parse(response):
+ request = response.request
+ print request.method + ': ' + response.url
+ if hasattr(request, 'data'):
+ print " " + json.dumps(response.request.data)
+ print " -> " + response.text
+ try:
+ return json.loads(response.text)
+ except ValueError:
+ return None
+
+def signup(login, password):
+ salt, vkey = srp.create_salted_verification_key( login, password, srp.SHA256, srp.NG_1024 )
+ user_params = {
+ 'user[login]': login,
+ 'user[password_verifier]': binascii.hexlify(vkey),
+ 'user[password_salt]': binascii.hexlify(salt)
+ }
+ print json.dumps(user_params)
+ return requests.post(server + '/users.json', data = user_params, verify = False)
+
+def authenticate(usr):
+ session = requests.session()
+ uname, A = usr.start_authentication()
+ params = {
+ 'login': uname,
+ 'A': binascii.hexlify(A)
+ }
+ init = print_and_parse(session.post(server + '/sessions', data = params, verify=False))
+ M = usr.process_challenge( safe_unhexlify(init['salt']), safe_unhexlify(init['B']) )
+ return session.put(server + '/sessions/' + uname, verify = False,
+ data = {'client_auth': binascii.hexlify(M)})
+
+def verify_or_debug(auth, usr):
+ if ( 'errors' in auth ):
+ print ' u = "%x"' % usr.u
+ print ' x = "%x"' % usr.x
+ print ' v = "%x"' % usr.v
+ print ' S = "%x"' % usr.S
+ print ' K = "' + binascii.hexlify(usr.K) + '"'
+ print ' M = "' + binascii.hexlify(usr.M) + '"'
+ else:
+ usr.verify_session( safe_unhexlify(auth["M2"]) )
+
+run_tests()