summaryrefslogtreecommitdiff
path: root/lib/srp/client.rb
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2012-10-04 10:22:46 +0200
committerAzul <azul@riseup.net>2012-10-04 10:22:46 +0200
commitb889ef34d4fff0d156901ae2aebfcee02339ce77 (patch)
treebb9e6502337e5bef90147d3513a5c2e51c20f7fa /lib/srp/client.rb
parent693b6d1e36828fa17915a9297595f65c739b611a (diff)
some cleanup, sha functions now concat multiple args
also u does not depend on n
Diffstat (limited to 'lib/srp/client.rb')
-rw-r--r--lib/srp/client.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/srp/client.rb b/lib/srp/client.rb
index 947bd7b..65052f5 100644
--- a/lib/srp/client.rb
+++ b/lib/srp/client.rb
@@ -20,7 +20,7 @@ module SRP
a = bigrand(32).hex
aa = modpow(GENERATOR, a, BIG_PRIME_N) # A = g^a (mod N)
bb = server.handshake(username, aa)
- u = calculate_u(aa, bb, BIG_PRIME_N)
+ u = calculate_u(aa, bb)
client_s = calculate_client_s(x, a, bb, u)
server.validate(calculate_m(aa, bb, client_s))
end
@@ -35,7 +35,7 @@ module SRP
def calculate_x(username = @username, password = @password)
shex = '%x' % [@salt]
inner = sha256_str([username, password].join(':'))
- sha256_str([shex].pack('H*') + [inner].pack('H*')).hex
+ sha256_hex(shex, inner).hex
end
def calculate_client_s(x, a, bb, u)