summaryrefslogtreecommitdiff
path: root/test_srp.py
diff options
context:
space:
mode:
Diffstat (limited to 'test_srp.py')
-rw-r--r--test_srp.py28
1 files changed, 22 insertions, 6 deletions
diff --git a/test_srp.py b/test_srp.py
index f983911..59b7435 100644
--- a/test_srp.py
+++ b/test_srp.py
@@ -13,13 +13,13 @@ g_mod = _pysrp
import _ctsrp
u_mod = _ctsrp
-#v_mod = _ctsrp
+v_mod = _ctsrp
#g_mod = _ctsrp
try:
import _srp
u_mod = _srp
- v_mod = _srp
+# v_mod = _srp
g_mod = _srp
except:
print 'C-module not available'
@@ -32,20 +32,36 @@ Verifier = v_mod.Verifier
gen_sv = g_mod.gen_sv
HASH = srp.SHA256
-NG = srp.NG_2048
+NG = srp.NG_CUSTOM
username = 'testuser'
password = 'testpassword'
-_s, _v = gen_sv( username, password, hash_alg=HASH, ng_type=NG )
+n_hex = ''
+g_hex = ''
+
+if NG == srp.NG_CUSTOM:
+ g_hex = "2"
+ n_hex = '''\
+AC6BDB41324A9A9BF166DE5E1389582FAF72B6651987EE07FC3192943DB56050A37329CBB4\
+A099ED8193E0757767A13DD52312AB4B03310DCD7F48A9DA04FD50E8083969EDB767B0CF60\
+95179A163AB3661A05FBD5FAAAE82918A9962F0B93B855F97993EC975EEAA80D740ADBF4FF\
+747359D041D5C33EA71D281E446B14773BCA97B43A23FB801676BD207A436C6481F1D2B907\
+8717461A5B9D32E688F87748544523B524B0D57D5EA77A2775D2ECFA032CFBDBF52FB37861\
+60279004E57AE6AF874E7303CE53299CCC041C7BC308D82A5698F3A8D0C38271AE35F8E9DB\
+FBB694B5C803D89F7AE435DE236D525F54759B65E372FCD68EF20FA7111F9E4AFF73'''
+
+
+
+_s, _v = gen_sv( username, password, hash_alg=HASH, ng_type=NG, n_hex=n_hex, g_hex=g_hex )
def test_one():
- usr = User( username, password, hash_alg=HASH, ng_type=NG )
+ usr = User( username, password, hash_alg=HASH, ng_type=NG, n_hex=n_hex, g_hex=g_hex )
uname, A = usr.start_authentication()
# username, A => server
- svr = Verifier( uname, _s, _v, A, hash_alg=HASH, ng_type=NG )
+ svr = Verifier( uname, _s, _v, A, hash_alg=HASH, ng_type=NG, n_hex=n_hex, g_hex=g_hex )
s,B = svr.get_challenge()
# s,B => client