mirror of
https://github.com/element-hq/matrix-authentication-service.git
synced 2026-06-07 15:22:44 +00:00
Allow applying unicode normalisation to passwords before hashing
This commit is contained in:
@@ -199,9 +199,9 @@ pub async fn synapse_config_check_against_mas_config(
|
||||
// Look for the MAS password hashing scheme that will be used for imported
|
||||
// Synapse passwords, then check the configuration matches so that Synapse
|
||||
// passwords will be compatible with MAS.
|
||||
if let Some((_, algorithm, _, secret)) = mas_password_schemes
|
||||
if let Some((_, algorithm, _, secret, _)) = mas_password_schemes
|
||||
.iter()
|
||||
.find(|(version, _, _, _)| *version == MIGRATED_PASSWORD_VERSION)
|
||||
.find(|(version, _, _, _, _)| *version == MIGRATED_PASSWORD_VERSION)
|
||||
{
|
||||
if algorithm != &PasswordAlgorithm::Bcrypt {
|
||||
errors.push(CheckError::PasswordSchemeNotBcrypt);
|
||||
|
||||
@@ -179,6 +179,7 @@ impl Config {
|
||||
cost: self.bcrypt_rounds,
|
||||
secret: self.password_config.pepper,
|
||||
secret_file: None,
|
||||
unicode_normalization: true,
|
||||
},
|
||||
// Use the default algorithm MAS uses as a second hashing scheme, so that users
|
||||
// will get their password hash upgraded to a more modern algorithm over time
|
||||
@@ -188,6 +189,7 @@ impl Config {
|
||||
cost: None,
|
||||
secret: None,
|
||||
secret_file: None,
|
||||
unicode_normalization: false,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user