summaryrefslogtreecommitdiff
path: root/lib/srp/session.rb
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2012-10-04 13:08:21 +0200
committerAzul <azul@riseup.net>2012-10-04 13:08:21 +0200
commit0c70bc88f14f9cc92a98a902a99b88a9b1f672e6 (patch)
tree7e5a3fa7c863f6e8f1628a45e3d1cebc95cfb88e /lib/srp/session.rb
parent777254f7ba10a0dd8fbee433e6a631d96e9d76f0 (diff)
using the SRP 6a algorithm for calculating M
Diffstat (limited to 'lib/srp/session.rb')
-rw-r--r--lib/srp/session.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/srp/session.rb b/lib/srp/session.rb
index 367f5e2..a1153e0 100644
--- a/lib/srp/session.rb
+++ b/lib/srp/session.rb
@@ -65,8 +65,10 @@ module SRP
# this is outdated - SRP 6a uses
# M = H(H(N) xor H(g), H(I), s, A, B, K)
- def calculate_m(s)
- sha256_int(@aa, @bb, s).hex
+ def calculate_m(secret)
+ n_xor_g_hash = sha256_str(hn_xor_hg).hex
+ username_hash = sha256_str(@user.username).hex
+ sha256_int(n_xor_g_hash, username_hash, @user.salt, @aa, @bb, secret).hex
end
def calculate_m2(m, secret)