Commit 8a5435c5 authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes #3641 Explicit SHA encoding of tokens to avoid ppolicy messing with it

Showing with 2 additions and 2 deletions
+2 -2
...@@ -334,7 +334,7 @@ class passwordRecovery { ...@@ -334,7 +334,7 @@ class passwordRecovery {
{ {
/* Store it in ldap with the salt */ /* Store it in ldap with the salt */
$salt_temp_password = $this->salt.$temp_password.$this->salt; $salt_temp_password = $this->salt.$temp_password.$this->salt;
$sha1_temp_password = sha1($salt_temp_password); $sha1_temp_password = "{SHA}".base64_encode(pack("H*", sha1($salt_temp_password)));
$ldap = $this->config->get_ldap_link(); $ldap = $this->config->get_ldap_link();
...@@ -380,7 +380,7 @@ class passwordRecovery { ...@@ -380,7 +380,7 @@ class passwordRecovery {
function checkToken($token) function checkToken($token)
{ {
$salt_token = $this->salt.$token.$this->salt; $salt_token = $this->salt.$token.$this->salt;
$sha1_token = sha1($salt_token); $sha1_token = "{SHA}".base64_encode(pack("H*", sha1($salt_token)));
/* Retrieve hash from the ldap */ /* Retrieve hash from the ldap */
$ldap = $this->config->get_ldap_link(); $ldap = $this->config->get_ldap_link();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment