1
0
mirror of https://github.com/bitwarden/cli synced 2025-12-06 04:23:19 +00:00

Set HashPurpose.LocalAuthorization on export password check (#339)

This commit is contained in:
Oscar Hinton
2021-06-30 20:27:47 +02:00
committed by GitHub
parent fc2f4d1a3e
commit 10b4efcb0d

View File

@@ -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';