[Brig] Move password verification to the AuthenticationSubsystem, move to Argon2id with new settings.#4271
[Brig] Move password verification to the AuthenticationSubsystem, move to Argon2id with new settings.#4271
Conversation
cdb06a4 to
8189763
Compare
d87fbc1 to
e4cb90f
Compare
mdimjasevic
left a comment
There was a problem hiding this comment.
Here is a partial review
There was a problem hiding this comment.
| PasswordStore.lookupHashedProviderPassword pid | |
| >>= maybe (throw AuthenticationSubsystemBadCredentials) pure | |
| PasswordStore.lookupHashedProviderPassword pid >>= noteS @'AuthenticationSubsystemBadCredentials |
There was a problem hiding this comment.
noteS has a different type signature, forcing us the thread the specific error as a member of every function in the call chain 🤔 is that something we want here?
There was a problem hiding this comment.
The call chain ain't long here. Note that this is in the interpreter, not the application code. I expect we call this interpreter only once.
|
Have you searched for all usages of |
mdimjasevic
left a comment
There was a problem hiding this comment.
Some more comments inlined.
Given that this is changing the default hashing algorithm, and we forgot to do it before in some places, what would be good tests to add to capture this change?
services/brig/src/Brig/Data/User.hs
Outdated
There was a problem hiding this comment.
Don't we have an equivalent in the UserStore effect?
da03847 to
5ced70d
Compare
db9b19b to
c1efb01
Compare
c1efb01 to
0cd22c4
Compare
| VerifyPasswordError :: Local UserId -> PlainTextPassword6 -> AuthenticationSubsystem m () | ||
| CreatePasswordResetCode :: EmailKey -> AuthenticationSubsystem m () | ||
| ResetPassword :: PasswordResetIdentity -> PasswordResetCode -> PlainTextPassword8 -> AuthenticationSubsystem m () | ||
| VerifyPassword :: PlainTextPassword6 -> Password -> AuthenticationSubsystem m (Bool, PasswordStatus) |
There was a problem hiding this comment.
From perspective of the AuthenticationSubsystem API this looks weird, why does anyone else have access to the hashed password outside this subsystem?
There was a problem hiding this comment.
I would consider this a temporary problem. This is used in Brig.API.User, it should go away as we move more of that logic into subsystems.
1cae602 to
14f80e9
Compare
https://wearezeta.atlassian.net/browse/WPB-9746
Checklist
changelog.d