summaryrefslogtreecommitdiff
path: root/javascript/srp_register.js
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-07-02 12:20:56 +0200
committerAzul <azul@leap.se>2012-07-02 12:20:56 +0200
commit325e209fb63fd569d703a4106d764c5b371a8f33 (patch)
treea3f27884419988cbb528051374b73ebb7047334b /javascript/srp_register.js
parentd743601c17a650e189f9c4bf1cab926b94363e45 (diff)
changed indentation to the 2 spaces i love
Diffstat (limited to 'javascript/srp_register.js')
-rw-r--r--javascript/srp_register.js90
1 files changed, 45 insertions, 45 deletions
diff --git a/javascript/srp_register.js b/javascript/srp_register.js
index 31b8ab8..670e59d 100644
--- a/javascript/srp_register.js
+++ b/javascript/srp_register.js
@@ -1,52 +1,52 @@
function SRP_REGISTER()
{
- var that;
+ var that;
- // Initiate the registration process
- SRP.prototype.register = function()
- {
- that = this;
- var handshake_url = this.geturl() + this.paths("register/salt/");
- var params = "I="+this.getI();
- this.ajaxRequest(handshake_url, params, this.register_receive_salt);
- };
+ // Initiate the registration process
+ SRP.prototype.register = function()
+ {
+ that = this;
+ var handshake_url = this.geturl() + this.paths("register/salt/");
+ var params = "I="+this.getI();
+ this.ajaxRequest(handshake_url, params, this.register_receive_salt);
+ };
- // Receive the salt for registration
- 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]));
- }
- }
- };
- // Send the verifier to the server
- SRP.prototype.register_send_verifier = function(v)
- {
- var params = "v="+v;
- var auth_url = that.geturl() + that.paths("register/user/");
- that.ajaxRequest(auth_url, params, that.register_user);
- };
+ // Receive the salt for registration
+ 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]));
+ }
+ }
+ };
+ // Send the verifier to the server
+ SRP.prototype.register_send_verifier = function(v)
+ {
+ var params = "v="+v;
+ var auth_url = that.geturl() + that.paths("register/user/");
+ that.ajaxRequest(auth_url, params, that.register_user);
+ };
- // The user has been registered successfully, now login
- 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();
- }
- }
- };
+ // The user has been registered successfully, now login
+ 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();
+ }
+ }
+ };
};
SRP_REGISTER();