Browse Source

Update PFACrypt.php

if you have old hashes like $nr$salt$hash and you migrate to {algoithm}hash
pull/592/head
benchea dan 4 years ago
committed by GitHub
parent
commit
51673118bb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      model/PFACrypt.php

11
model/PFACrypt.php

@ -60,6 +60,17 @@ class PFACrypt
$algorithm = $method_in_hash;
}
}
if (!empty($pw_db) && preg_match('/^\$[0-9]\$/i', $pw_db, $matches)) {
$method_in_hash = $matches[0];
switch ($method_in_hash){
case '$1$':
case '$6$':
$algorithm='SYSTEM';
}
}
if ($algorithm == 'SHA512CRYPT.B64') {
$algorithm = 'SHA512-CRYPT.B64';
}

Loading…
Cancel
Save