cpm icon indicating copy to clipboard operation
cpm copied to clipboard

Cannot modify database: "You did not specify any encryption keys. "

Open PinkPandaKatie opened this issue 6 years ago • 2 comments

I have been using CPM with Ubuntu 14.04 for years now. I upgraded to 18.04, and while I can still open CPM to read my password database, I can no longer make changes to it. Every time I try to write to the database, I get the following error:

You did not specify any encryption keys.
Quit without saving?
Error encrypting the data.      

I tried to add my key using ^K, and entering the hash of the key that I got using 'gpg -K', and that seemed to work (it showed the associated data), but when I try to save using ^W, I get this message:

cpm: key.c:332: gpgme_key_unref: Assertion `key->_refs > 0' failed.

If I add the key with ^K, and then try to exit and save, I get this dialog:

Data has been modified                                      
Do you want to save the database encrypted for these keys?

BC33884C0325A426 jspenguin <[email protected]>

but if I select Yes, I get this message:

GpgMe encrypt error
Invalid value

I have no idea what's going on. It worked perfectly before, I don't know what changed.

PinkPandaKatie avatar Apr 04 '19 01:04 PinkPandaKatie

I don't know what could be happening here. will try to reproduce

comotion avatar Apr 08 '19 15:04 comotion

I fixed this in the pull request #62. The issue was that gpg doesn't match the pattern "BC33884C0325A426 jspenguin [email protected]" anymore. It matches "BC33884C0325A426" or "jspenguin [email protected]" only, so the fix is to remove the key id from that pattern that is used in the key lookup.

sujo avatar Aug 08 '20 16:08 sujo