Commit cc3ad78
committed
feat(auth): configurable Argon2id params with transparent on-login rehash
Introduces `Argon2Config` in config/auth.rs (OWASP 2024+ defaults: m=19456 KiB,
t=2, p=1) and wires it through `CredentialStore`, `LockoutPolicy`, and all
hash-call sites. `hash_password_argon2` and `verify_argon2` now accept the config
instead of using `Argon2::default()`.
Replaces `verify_argon2` with `verify_argon2_with_rehash`, which returns a
`VerifyOutcome` that includes an optional new PHC string when the stored hash is
weaker than the current config. On successful login, `CredentialStore::verify`
writes the stronger hash back under a write lock; failure is non-fatal (logged as
a warning). The no-downgrade rule is enforced: if the stored hash is equal or
stronger, no rehash is performed.
Also adds `zeroize` to the workspace and as a dependency in nodedb, nodedb-wal,
and nodedb-types, and reformats a multi-argument assert in the spatial integration
test to comply with rustfmt.1 parent b546935 commit cc3ad78
11 files changed
Lines changed: 424 additions & 31 deletions
File tree
- nodedb
- src
- config
- control/security
- audit
- credential
- store
- tests
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
3 | 60 | | |
4 | 61 | | |
5 | 62 | | |
| |||
275 | 332 | | |
276 | 333 | | |
277 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
278 | 340 | | |
279 | 341 | | |
280 | 342 | | |
| |||
398 | 460 | | |
399 | 461 | | |
400 | 462 | | |
| 463 | + | |
401 | 464 | | |
402 | 465 | | |
403 | 466 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
| 120 | + | |
122 | 121 | | |
123 | 122 | | |
124 | 123 | | |
| |||
134 | 133 | | |
135 | 134 | | |
136 | 135 | | |
137 | | - | |
138 | | - | |
| 136 | + | |
139 | 137 | | |
140 | 138 | | |
141 | 139 | | |
| |||
0 commit comments