mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-12-05 08:12:35 -08:00
keepassxc-cli db-edit ignored the result of Database::setKey(). On a KDBX 4 database whose key includes a challenge-response component, the new key keeps that component, so db-edit challenged the hardware key twice: once to transform the new key and again when saving. If the first challenge failed, for example because the key was not touched in time, but the second one succeeded, the database kept its old key. The command then saved the database with the old credentials and printed "Successfully edited the database.", although the requested password or key file change had not been applied. Report the failure, with the reason given by the key, and exit without saving instead. Challenge-response keys can now set their error, so that the mock key used by the tests reports why a challenge failed.