summaryrefslogtreecommitdiff
path: root/src/srp_session.js
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2012-11-20 10:51:54 +0100
committerAzul <azul@riseup.net>2012-11-20 10:51:54 +0100
commit555491c4420a3b8b23b74fb081b76a5bf7778049 (patch)
treefd280571682a640d248c6b714c2831633031052c /src/srp_session.js
parent2859af0287d7672df0a8965be43fb9859fca8bf8 (diff)
parent082f859bbdaedf4f03eb85aea9b8f88ffda2fe6d (diff)
Merge branch 'feature/clean-srp' into develop
Diffstat (limited to 'src/srp_session.js')
-rw-r--r--src/srp_session.js21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/srp_session.js b/src/srp_session.js
index 8f45a44..b278993 100644
--- a/src/srp_session.js
+++ b/src/srp_session.js
@@ -1,4 +1,4 @@
-SRP.prototype.Session = function(login, password) {
+srp.Session = function(login, password) {
// Variables session will be used in the SRP protocol
var Nstr = "eeaf0ab9adb38dd69c33f80afa8fc5e86072618775ff3c0b9ea2314c9c256576d674df7496ea81d3383b4813d692c6e0e0d5d8e250b98be48e495c1d6089dad15dc7d7b46154d6b6ce8ef4ad69b15d4982559b297bcf1885c529f566660e57ec68edbc3c05726cc02fd4cbf4976eaa9afd5138fe8376435b9fc61d2fc0eb06e3";
@@ -35,6 +35,22 @@ SRP.prototype.Session = function(login, password) {
return Astr;
};
+ this.signup = function() {
+ var salt = this.getSalt();
+ return {
+ login: this.getI(),
+ password_salt: salt,
+ password_verifier: this.getV(salt).toString(16)
+ };
+ };
+
+ this.handshake = function() {
+ return {
+ login: this.getI(),
+ A: this.getAstr()
+ };
+ };
+
this.getAstr = function() {
return Astr;
}
@@ -154,6 +170,5 @@ SRP.prototype.Session = function(login, password) {
}
return str;
}
+};
-
-}