cocagne / pysrp

Python implementation of the Secure Remote Password protocol (SRP)
MIT License
113 stars 42 forks source link

Python 2 & 3 compatible pure python implementation #17

Closed masihyeganeh closed 7 years ago

cocagne commented 8 years ago

When I tried your changes, running "python srp/test_srp.py" showed several instances of the following error when executed with a Python 2 interpreter:

`

ERROR: test_all1 (main.SRPTests)

Traceback (most recent call last): File "srp/test_srp.py", line 120, in test_all1 self.doit( _srp, _pysrp, _ctsrp, hash_alg=srp.SHA256, ng_type=srp.NG_CUSTOM, n_hex=test_n_hex, g_hex=test_g_hex ) File "srp/test_srp.py", line 69, in doit svr = Verifier( uname, _s, _v, A, hash_alg, ng_type, n_hex, g_hex, True ) File "/home/tcocagne/devel/tom/pysrp/build/lib.linux-x86_64-2.7/srp/_pysrp.py", line 294, in init k = H_nn_rfc5054( hash_class, N, N, g ) File "/home/tcocagne/devel/tom/pysrp/build/lib.linux-x86_64-2.7/srp/_pysrp.py", line 218, in H_nn_rfc5054 return H( hash_class, head, bin_n1, middle, bin_n2 ) File "/home/tcocagne/devel/tom/pysrp/build/lib.linux-x86_64-2.7/srp/_pysrp.py", line 205, in H h.update( long_to_bytes(s) if isinstance(s, (long, int)) else strtobytes(s) ) TypeError: must be string or buffer, not list ` Are you not seeing these errors in your environment?

cocagne commented 7 years ago

completed by another pull request