From 10b4efcb0d7b6c326c173fce97b13bea0194c345 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Wed, 30 Jun 2021 20:27:47 +0200 Subject: [PATCH] Set HashPurpose.LocalAuthorization on export password check (#339) --- src/commands/export.command.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/commands/export.command.ts b/src/commands/export.command.ts index d307916..1b0ab37 100644 --- a/src/commands/export.command.ts +++ b/src/commands/export.command.ts @@ -27,9 +27,7 @@ export class ExportCommand { return Response.badRequest('Master password is required.'); } - const keyHash = await this.cryptoService.hashPassword(password, null); - const storedKeyHash = await this.cryptoService.getKeyHash(); - if (storedKeyHash != null && keyHash != null && storedKeyHash === keyHash) { + if (await this.cryptoService.compareAndUpdateKeyHash(password, null)) { let format = options.format; if (format !== 'encrypted_json' && format !== 'json') { format = 'csv';