summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2012-10-15 12:54:24 +0200
committerAzul <azul@riseup.net>2012-10-15 12:54:24 +0200
commitcb8e9f7b3dec1963e0d985b1b2541b260a132762 (patch)
tree73854991148d794c411a2beee8bebb1ae871cb43 /src
parent6feb77060140fe8026812970c4d5ea83da3cd200 (diff)
expecting the salt to be send with key salt
Diffstat (limited to 'src')
-rw-r--r--src/srp.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/srp.js b/src/srp.js
index 972b211..b348e69 100644
--- a/src/srp.js
+++ b/src/srp.js
@@ -19,9 +19,14 @@ function SRP(remote, session)
// B = 0 will make the algorithm always succeed
// -> refuse such a server answer
if(response.B === 0) {
- srp.error("Server send random number 0 - this is not allowed");
- } else {
- session.calculations(response.s, response.B);
+ srp.error("Server send random number 0 - could not login.");
+ }
+ else if(! response.salt || response.salt === 0) {
+ srp.error("Server failed to send salt - could not login.");
+ }
+ else
+ {
+ session.calculations(response.salt, response.B);
remote.authenticate(session, confirm_authentication);
}
}