diff options
Diffstat (limited to 'src/srp_session.js')
-rw-r--r-- | src/srp_session.js | 21 |
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; } +}; - -} |