You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not a bug, but an usability issue. When adding a new key with gopass recipients add --store <store> <user_id> the secrets will be re-encrypted for every key in .gpg-id. If one of this keys is expired the encryption will fail.
This I think it is a bug, if the encryption failed on the previous step, the new key will be added to .gpg-id even though it can't decrypt anything, running gopass fsck won't fix the issue.
Steps To Reproduce
I had this issue with a key that actually expired, I suppose these steps can reproduce the issue:
Create a new key pair
Add it to the password store and encrypt a secret with it
Edit the previous key and set the expiration in the past
Create a second key pair
Try to add the non-expired key to the keystore
Expected behavior
A nice error message saying that one of the keys is expired, and user intervention is necessary. Either the key has to be removed from the password store, or the owner of the key has to update the expiration.
Environment
OS: Fedora
OS version: Linux .. 5.11.15-200.fc33.x86_64 Add template feature #1 SMP Fri Apr 16 13:41:20 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
gopass Version: gopass 1.8.6 (d5b0d3b 2021-01-27 21:11:07) go1.15.6 linux amd64
Installation method: compiled
Additional context
The text was updated successfully, but these errors were encountered:
We should at least support using an expired key to add a new recipients.
Todo:
Add a test case for this
Add a warning when there is such a thing, and proper documentation about what is possible to do in that case (namely: extend the private key expiration date OR remove the expired key and add a new key with a expiration date in the future)
Add a flag to "ignore" expired keys upon re-encryption as long as there are still valid keys in the recipient list (or maybe provided we are working with a non-expired subkey related to the same master key as the expired key?)
Make sure we cannot add or create or generate new secrets if we have an expired key: Warn the user they need to add a new non-expired key and remove the expired key.
* Check existing recipients before trying to add a new one
Fixes#1918
RELEASE_NOTES=[ENHANCEMENT] Check recipients before adding a new one.
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* Add test for CheckRecipients with an invalid key.
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* Add custom error type and a better error message.
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* Initialize InvalidRecipientsError
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* Skip CheckRecipients tests on Windows
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Summary
There are two things here:
gopass recipients add --store <store> <user_id>
the secrets will be re-encrypted for every key in.gpg-id
. If one of this keys is expired the encryption will fail..gpg-id
even though it can't decrypt anything, runninggopass fsck
won't fix the issue.Steps To Reproduce
I had this issue with a key that actually expired, I suppose these steps can reproduce the issue:
Expected behavior
A nice error message saying that one of the keys is expired, and user intervention is necessary. Either the key has to be removed from the password store, or the owner of the key has to update the expiration.
Environment
Additional context
The text was updated successfully, but these errors were encountered: