summaryrefslogtreecommitdiff
path: root/javascript/srp_register.js
diff options
context:
space:
mode:
Diffstat (limited to 'javascript/srp_register.js')
-rw-r--r--javascript/srp_register.js30
1 files changed, 13 insertions, 17 deletions
diff --git a/javascript/srp_register.js b/javascript/srp_register.js
index 670e59d..ffadf81 100644
--- a/javascript/srp_register.js
+++ b/javascript/srp_register.js
@@ -15,18 +15,16 @@ function SRP_REGISTER()
SRP.prototype.register_receive_salt = function()
{
var xhr = that.getxhr();
- if(xhr.readyState == 4 && xhr.status == 200) {
- if(xhr.responseXML.getElementsByTagName("salt").length > 0)
- {
- var s = that.innerxml(xhr.responseXML.getElementsByTagName("salt")[0]);
- var x = that.calcX(s);
- var v = that.getg().modPow(x, that.getN());
- that.register_send_verifier(v.toString(16));
- }
- else if(xhr.responseXML.getElementsByTagName("error").length > 0)
- {
- that.error_message(that.innerxml(xhr.responseXML.getElementsByTagName("error")[0]));
- }
+ if(xhr.responseXML.getElementsByTagName("salt").length > 0)
+ {
+ var s = that.innerxml(xhr.responseXML.getElementsByTagName("salt")[0]);
+ var x = that.calcX(s);
+ var v = that.getg().modPow(x, that.getN());
+ that.register_send_verifier(v.toString(16));
+ }
+ else if(xhr.responseXML.getElementsByTagName("error").length > 0)
+ {
+ that.error_message(that.innerxml(xhr.responseXML.getElementsByTagName("error")[0]));
}
};
// Send the verifier to the server
@@ -41,11 +39,9 @@ function SRP_REGISTER()
SRP.prototype.register_user = function()
{
var xhr = that.getxhr();
- if(xhr.readyState == 4 && xhr.status == 200) {
- if(xhr.responseXML.getElementsByTagName("ok").length > 0)
- {
- that.identify();
- }
+ if(xhr.responseXML.getElementsByTagName("ok").length > 0)
+ {
+ that.identify();
}
};
};