comotion / cpm

Console Password Manager

Home Page:http://www.harry-b.de/dokuwiki/doku.php?id=harry:cpm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

PinkPandaKatie opened this issue · 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 <jspenguin@jspenguin.org>

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.

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

commented

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