diff options
author | Azul <azul@riseup.net> | 2012-10-04 10:47:19 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2012-10-04 10:47:19 +0200 |
commit | 66c3ed01eb012cae84193b4864c7c48eb77c2a8c (patch) | |
tree | b23d69a19f60cc46a1baa4328cb34c703bea4bbf /test/client_test.rb | |
parent | c73f7c1b4c1270d4d0ca47650a12893a6d13e796 (diff) |
more cleanup - no more duplicate password and username in Client
A client has a set of pwd and login and tries to auth with this.
Diffstat (limited to 'test/client_test.rb')
-rw-r--r-- | test/client_test.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/test/client_test.rb b/test/client_test.rb index 8ef53aa..3a191a8 100644 --- a/test/client_test.rb +++ b/test/client_test.rb @@ -5,22 +5,20 @@ class ClientTest < Test::Unit::TestCase def setup @login = "testuser" @password = "password" - @salt = "7686acb8" - @client = SRP::Client.new("testuser", "password", "7686acb8") end - def test_calculation_of_x + def test_calculation_of_private_key + @client = SRP::Client.new(@login, @password, "7686acb8".hex) assert_equal "84d6bb567ddf584b1d8c8728289644d45dbfbb02deedd05c0f64db96740f0398", - "%x" % @client.send(:calculate_x) + "%x" % @client.send(:private_key) end # using python srp: # s,V = pysrp.create_salted_verification_key("testuser", "password", pysrp.SHA256, pysrp.NG_1024) def test_verifier - s = '4c78c3f8' + @client = SRP::Client.new(@login, @password, '4c78c3f8'.hex) v = '474c26aa42d11f20544a00f7bf9711c4b5cf7aab95ed448df82b95521b96668e7480b16efce81c861870302560ddf6604c67df54f1d04b99d5bb9d0f02c6051ada5dc9d594f0d4314e12f876cfca3dcd99fc9c98c2e6a5e04298b11061fb8549a22cde0564e91514080df79bca1c38c682214d65d590f66b3719f954b078b83c' - @client = SRP::Client.new(@login, @password, s) assert_equal v, "%x" % @client.verifier end end |