-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate an exported secret key is decryptable by Sequoia
When we export a secret key in EncryptionManager, validate the output by checking that it is decryptable by Sequoia using the given passphrase and has the expected fingerprint. A new redwood function, is_valid_secret_key() is the sibling to the eixsting is_valid_public_key(), except that it also takes a passphrase and verifies the secret key can be unlocked using the passphrase. If the key passes all the conditions, only then is it returned by EncryptionManager to be saved in the database, and deleted out of GPG. If, for whatever reason, GPG fails at exporting the key, or exports something Sequoia can't handle, the key will not be stored and it'll continue to fall back to using GPG for decryption. While we're at it, the export function is now named `get_source_secret_key_from_gpg`, to highlight that this specifically just exports the key from GPG and won't work for Sequoia based sources. Refs #7025.
- Loading branch information
Showing
6 changed files
with
75 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters