Changeset 3979


Ignore:
Timestamp:
05/26/09 14:20:42 (3 years ago)
Author:
CrawfordCurrie
Message:

Item1586: limit the session to a limited number of keys; remove validation_key from the parameters passed through template login, or it confuses the JS because validation_key ends up as multi-valued; check the nonce during login; reduce to one unique key per page rendering, instead of one key per form per unique rendering

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Release01x00/core/pub/System/JavascriptFiles/strikeone.js

    r3976 r3979  
    1 function foswikiStrikeOne() { 
     1function foswikiStrikeOne(form) { 
    22    // Read the cookie to get the secret 
    33    var secret = readCookie('FOSWIKISTRIKEONE'); 
    4     // Find all validation_key inputs 
    5     var inputs = document.getElementsByTagName('input'); 
    6     for (var i in inputs) { 
    7         if (inputs[i].name == 'validation_key') { 
    8             // combine the validation key with the secret in a way that 
    9             // can't easily be reverse-engineered, but can be duplicated 
    10             // on the server (which also knows the secret) 
    11             var key = inputs[i].value; 
    12             var newkey = b64_md5(key + secret); 
    13             inputs[i].value = newkey; 
    14         } 
     4    //console.debug("Submit "+form.name); 
     5    var input = form.validation_key; 
     6    if (input && input.value) { 
     7        // combine the validation key with the secret in a way 
     8        // that can't easily be reverse-engineered, but can be 
     9        // duplicated on the server (which also knows the secret) 
     10        var key = input.value.substring(1); 
     11        var newkey = hex_md5(key + secret); 
     12        input.value = newkey; 
     13        //console.debug("Revise "+key+" + "+secret+" -> "+newkey); 
    1514    } 
    1615} 
Note: See TracChangeset for help on using the changeset viewer.