Purexo-GoogleExportation / javascript-bcrypt

Automatically exported from code.google.com/p/javascript-bcrypt
0 stars 0 forks source link

Not "thread safe" - multiple hashpw requests conflict #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run multiple overlapping hashpw on different instances

Please provide any additional information below.

the fix is changing

obj = this

to 

var obj = this 

here in crypt_raw:

rounds = 1 << log_rounds;
  one_percent = Math.floor(rounds / 100) + 1;
  this.init_key();
  this.ekskey(salt, password);

  obj = this;  <------- HERE accidental Global use
  var i = 0;
  setTimeout(function(){
    if(i < rounds){
      var start = new Date();
      for (; i < rounds;) {

Original issue reported on code.google.com by daves...@gmail.com on 9 Feb 2012 at 3:57

GoogleCodeExporter commented 9 years ago
This has been resolved with the patch from issue 6

Original comment by nevins.bartolomeo@gmail.com on 28 Jun 2012 at 2:30