Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VO-780] fix: Enforce stronger encryption for new password hashing #719

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/actions/passphrase.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export const UPDATE_HINT = 'UPDATE_HINT'
export const UPDATE_HINT_SUCCESS = 'UPDATE_HINT_SUCCESS'
export const UPDATE_HINT_FAILURE = 'UPDATE_HINT_FAILURE'

const KDF_ITERATIONS = 650000

const invalidPassphraseErrorAction = {
type: UPDATE_PASSPHRASE_FAILURE,
errors: {
Expand Down Expand Up @@ -76,7 +78,8 @@ export const updatePassphrase = (

const newHashAndKeys = await vaultClient.computeNewHashAndKeys(
currentPassphrase,
newPassphrase
newPassphrase,
KDF_ITERATIONS
)
await cozyFetch(client, 'PUT', '/settings/passphrase', {
current_passphrase: newHashAndKeys.currentPasswordHash,
Expand Down Expand Up @@ -154,7 +157,8 @@ export const updatePassphrase2FASecond = (
await vaultClient.login(currentPassphrase)
const newHashAndKeys = await vaultClient.computeNewHashAndKeys(
currentPassphrase,
newPassphrase
newPassphrase,
KDF_ITERATIONS
)
await cozyFetch(client, 'PUT', '/settings/passphrase', {
new_passphrase: newHashAndKeys.newPasswordHash,
Expand Down