13.04 Regression: cpm doesn't ask for gpg key password, but: gpgme error / bad passphrase

Bug #1169121 reported by phaidros
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cpm (Ubuntu)
Opinion
Undecided
comotion

Bug Description

In 12.04 it worked fine. After upgrade to 13.04 (via 12.10) cpm stopped working.

Cpm doesn't ask for a password to use the configured gpg key, instead throws "Gpgme Error, Bad Passphrase".
The .cpmdb seems to be intact, as "gnupg --decrypt file" asks for the password with a gtk window (as expected and as cpm worked before).

Creating a new db in /tmp/cpmdb, the same error happens trying to save to that db.

dpkg -l cpm
ii cpm 0.26-1 amd64 Curses based password manager using PGP-encryption

package:
http://packages.ubuntu.com/raring/cpm

what else information can I provide to help solving this?

priority should be high, as this is a encrypting password manager which probably is in use for many people and with critical passwords.

Revision history for this message
phaidros (phaidros) wrote :

Further investigating I found that:

$ unset GPG_AGENT_INFO

helps solving this issue.

the env var in a fresh gnome terminal is set to:
$ env | grep GPG_AGENT_INFO
GPG_AGENT_INFO=/run/user/phaidros/keyring-xyz123/gpg:0:1

I am not very familiar with the usage of gpg agents (seahorse in the case of ubuntu?), so someone more knowledgeable might have an idea what could be wrong with that env setting, or tell me how to find out if seahorse/gpg-agent/whatever runs as expected.
any hints?

Revision history for this message
comotion (comotion) wrote :

hey phaidros,

I was bitten by this too, on debian.
CPM uses gpgMe, which uses the agent if present.
Turns out this is due to some gpg-agent stupidity. Clearly the interface has changed a bit since 2012.

I haven't investigated how the gpg-agent daemon is started on ubuntu, but it usually started from the .xsession with an 'eval $(gpg-agent --daemon --write-env-file "${HOME}/.gpg-agent-info")' call.
writing GPG_AGENT_INFO to the environment, and also to a file ~/.gpg-agent-info file

in which case those environment variables need to be set and exported in all interactive sessions:

if [ -f "${HOME}/.gpg-agent-info" ]; then
  . "${HOME}/.gpg-agent-info"
  export GPG_AGENT_INFO
  export SSH_AUTH_SOCK
fi

(the last export for --enable-ssh-support)

hope this helps

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cpm (Ubuntu):
status: New → Confirmed
Revision history for this message
phaidros (phaidros) wrote :

Hey comotion,

your solution works nicely for me,

thanx!

Revision history for this message
comotion (comotion) wrote :

I have changed this bug's status as it's not really a bug with CPM, but rather the user's session not starting gpg-agent.

Changed in cpm (Ubuntu):
status: Confirmed → Opinion
comotion (comotion)
Changed in cpm (Ubuntu):
assignee: nobody → comotion (comotion)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.