mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-09-18 02:54:24 +08:00
Merge pull request #1833 from TheAssailant/patch-1
Use `random_bytes` if available in postfix plugin
This commit is contained in:
commit
d717b96800
1 changed files with 5 additions and 1 deletions
|
@ -286,7 +286,11 @@ class ChangePasswordPostfixAdminDriver implements \RainLoop\Providers\ChangePass
|
|||
private function cryptPassword($sPassword, $oPdo)
|
||||
{
|
||||
$sResult = '';
|
||||
$sSalt = substr(str_shuffle('./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'), 0, 16);
|
||||
if (function_exists('random_bytes')) {
|
||||
$sSalt = substr(base64_encode(random_bytes(32)), 0, 16);
|
||||
} else {
|
||||
$sSalt = substr(str_shuffle('./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'), 0, 16);
|
||||
}
|
||||
switch (strtolower($this->sEncrypt))
|
||||
{
|
||||
default:
|
||||
|
|
Loading…
Add table
Reference in a new issue