[PR #3210] [MERGED] add argon2 kdf fields #3242

Closed
opened 2026-03-03 09:42:03 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/3210
Author: @tessus
Created: 2/1/2023
Status: Merged
Merged: 2/12/2023
Merged by: @dani-garcia

Base: mainHead: feature/kdf-options


📝 Commits (2)

  • 68bcc7a add argon2 kdf fields
  • 5bcee24 Merge branch 'main' into feature/kdf-options

📊 Changes

16 files changed (+131 additions, -25 deletions)

View changed files

migrations/mysql/2023-01-31-222222_add_argon2/down.sql (+0 -0)
migrations/mysql/2023-01-31-222222_add_argon2/up.sql (+7 -0)
migrations/postgresql/2023-01-31-222222_add_argon2/down.sql (+0 -0)
migrations/postgresql/2023-01-31-222222_add_argon2/up.sql (+7 -0)
migrations/sqlite/2023-01-31-222222_add_argon2/down.sql (+0 -0)
migrations/sqlite/2023-01-31-222222_add_argon2/up.sql (+7 -0)
📝 src/api/core/accounts.rs (+46 -11)
📝 src/api/core/emergency_access.rs (+16 -6)
📝 src/api/identity.rs (+29 -4)
📝 src/db/models/mod.rs (+1 -1)
📝 src/db/models/user.rs (+10 -1)
📝 src/db/schemas/mysql/schema.rs (+2 -0)
📝 src/db/schemas/postgresql/schema.rs (+2 -0)
📝 src/db/schemas/sqlite/schema.rs (+2 -0)
📝 src/main.rs (+1 -1)
📝 src/util.rs (+1 -1)

📄 Description

Changes:

  • added columns to db schema with DEFAULT NULL
  • added a pub enum UserKdfType
  • if UserKdfType is Argon2id, server responses will include 2 more KVPs for memory and parallelism

Test plan:

  • used quexten's webvault (which includes the UI changes for Argon2) to switch KDF to argon2 and back to pbkdf2
Previous text (for reference)

This is still a work in progess. The following items have to be clarified first:

  • default db values or NULL?
  • default iterations might have to be changed depending on the type (PBKDF2, ARGON2)
  • enum for kdf type?

During compilation I get an error:

error: recursion limit reached while expanding `__static_cond!`

consider increasing the recursion limit by adding a `#![recursion_limit = "194"]` attribute to your crate (`vaultwarden`)

However in the code it says:

// The recursion_limit is mainly triggered by the json!() macro.
// The more key/value pairs there are the more recursion occurs.
// We want to keep this as low as possible, but not higher then 128.
// If you go above 128 it will cause rust-analyzer to fail,

So, what now?


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/3210 **Author:** [@tessus](https://github.com/tessus) **Created:** 2/1/2023 **Status:** ✅ Merged **Merged:** 2/12/2023 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `main` ← **Head:** `feature/kdf-options` --- ### 📝 Commits (2) - [`68bcc7a`](https://github.com/dani-garcia/vaultwarden/commit/68bcc7a4b8c47ca76eb03a0ce7db22e89afa2ce1) add argon2 kdf fields - [`5bcee24`](https://github.com/dani-garcia/vaultwarden/commit/5bcee24f88ff976930eb7e18d8e672dc1f0d0f8e) Merge branch 'main' into feature/kdf-options ### 📊 Changes **16 files changed** (+131 additions, -25 deletions) <details> <summary>View changed files</summary> ➕ `migrations/mysql/2023-01-31-222222_add_argon2/down.sql` (+0 -0) ➕ `migrations/mysql/2023-01-31-222222_add_argon2/up.sql` (+7 -0) ➕ `migrations/postgresql/2023-01-31-222222_add_argon2/down.sql` (+0 -0) ➕ `migrations/postgresql/2023-01-31-222222_add_argon2/up.sql` (+7 -0) ➕ `migrations/sqlite/2023-01-31-222222_add_argon2/down.sql` (+0 -0) ➕ `migrations/sqlite/2023-01-31-222222_add_argon2/up.sql` (+7 -0) 📝 `src/api/core/accounts.rs` (+46 -11) 📝 `src/api/core/emergency_access.rs` (+16 -6) 📝 `src/api/identity.rs` (+29 -4) 📝 `src/db/models/mod.rs` (+1 -1) 📝 `src/db/models/user.rs` (+10 -1) 📝 `src/db/schemas/mysql/schema.rs` (+2 -0) 📝 `src/db/schemas/postgresql/schema.rs` (+2 -0) 📝 `src/db/schemas/sqlite/schema.rs` (+2 -0) 📝 `src/main.rs` (+1 -1) 📝 `src/util.rs` (+1 -1) </details> ### 📄 Description Changes: - added columns to db schema with DEFAULT NULL - added a pub enum `UserKdfType` - if UserKdfType is Argon2id, server responses will include 2 more KVPs for memory and parallelism Test plan: - used quexten's webvault (which includes the UI changes for Argon2) to switch KDF to argon2 and back to pbkdf2 <details> <summary>Previous text (for reference)</summary> This is still a work in progess. The following items have to be clarified first: - default db values or NULL? - default iterations might have to be changed depending on the type (PBKDF2, ARGON2) - enum for kdf type? During compilation I get an error: ``` error: recursion limit reached while expanding `__static_cond!` consider increasing the recursion limit by adding a `#![recursion_limit = "194"]` attribute to your crate (`vaultwarden`) ``` However in the code it says: ``` // The recursion_limit is mainly triggered by the json!() macro. // The more key/value pairs there are the more recursion occurs. // We want to keep this as low as possible, but not higher then 128. // If you go above 128 it will cause rust-analyzer to fail, ``` So, what now? </details> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 09:42:03 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#3242
No description provided.