mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03: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)
|
private function cryptPassword($sPassword, $oPdo)
|
||||||
{
|
{
|
||||||
$sResult = '';
|
$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))
|
switch (strtolower($this->sEncrypt))
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue