From 3dbb43e18812a6f27e9446f0151727396ffd6ce2 Mon Sep 17 00:00:00 2001 From: Simon Chuu Date: Mon, 18 May 2020 22:59:05 -0400 Subject: [PATCH 1/2] plugins/postfixadmin-change-password: Add "ARGON2I" My mail server was set up with `dovecot:ARGON2I` password encryption option. This allows people who set up argon2i as the encryption method to continue using it when users change their password with the plugin. --- .../ChangePasswordPostfixAdminDriver.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/postfixadmin-change-password/ChangePasswordPostfixAdminDriver.php b/plugins/postfixadmin-change-password/ChangePasswordPostfixAdminDriver.php index 00f1d78c5..384c1c996 100755 --- a/plugins/postfixadmin-change-password/ChangePasswordPostfixAdminDriver.php +++ b/plugins/postfixadmin-change-password/ChangePasswordPostfixAdminDriver.php @@ -319,6 +319,10 @@ class ChangePasswordPostfixAdminDriver implements \RainLoop\Providers\ChangePass case 'sha512-crypt': $sResult = '{SHA512-CRYPT}' . crypt($sPassword,'$6$'.$sSalt); break; + + case 'argon2i': + $sResult = '{ARGON2I}' . password_hash($sPassword, PASSWORD_ARGON2I); + break; case 'mysql_encrypt': if($this->sEngine == 'MySQL'){ From 286e0110503715345e0c7d7ca29d5899afefcd11 Mon Sep 17 00:00:00 2001 From: Simon Chuu Date: Mon, 18 May 2020 23:01:44 -0400 Subject: [PATCH 2/2] plugins/postfixadmin-change-password: Add 'argon2i' configuration option --- plugins/postfixadmin-change-password/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/postfixadmin-change-password/index.php b/plugins/postfixadmin-change-password/index.php index ef2f5eee1..24cfa061e 100755 --- a/plugins/postfixadmin-change-password/index.php +++ b/plugins/postfixadmin-change-password/index.php @@ -89,7 +89,7 @@ class PostfixadminChangePasswordPlugin extends \RainLoop\Plugins\AbstractPlugin ->SetDefaultValue(''), \RainLoop\Plugins\Property::NewInstance('encrypt')->SetLabel('Encrypt') ->SetType(\RainLoop\Enumerations\PluginPropertyType::SELECTION) - ->SetDefaultValue(array('md5crypt', 'md5', 'system', 'cleartext', 'mysql_encrypt', 'SHA256-CRYPT', 'SHA512-CRYPT')) + ->SetDefaultValue(array('md5crypt', 'md5', 'system', 'cleartext', 'argon2i', 'mysql_encrypt', 'SHA256-CRYPT', 'SHA512-CRYPT')) ->SetDescription('In what way do you want the passwords to be crypted ?'), \RainLoop\Plugins\Property::NewInstance('allowed_emails')->SetLabel('Allowed emails') ->SetType(\RainLoop\Enumerations\PluginPropertyType::STRING_TEXT)