gpg: decryption failed: No secret key

yanchenko.igor at gmail.com yanchenko.igor at gmail.com
Fri Apr 27 23:28:43 CEST 2018


Hello,

recently I faced with a the issue, I found wht is the problem but it's not
completly clear where it should be fixed, I am using passff + pass + trezor
gpg agent (
https://github.com/romanz/trezor-agent/blob/master/doc/README-GPG.md) and I
am receiving the error "gpg: decryption failed: No secret key" when I try
to decrypt the files.

It appeared that passff uses stdin to communicate with the host application
which starts pass. Because of ths line `export GPG_TTY="${GPG_TTY:-$(tty
2>/dev/null)}"` and empty variable GPG_TTY, GPG_TTY becomes "not a tty",
and for that reason gpg cannot communicate with the agent.

% env GPG_TTY="not a tty" gpg2 -d --quiet --yes --compress-algo=none
--no-encrypt-to --batch --use-agent /home/igor/.password-store/testpass.gpg
gpg: decryption failed: No secret key
% env GPG_TTY="tty" gpg2 -d --quiet --yes --compress-algo=none
--no-encrypt-to --batch --use-agent /home/igor/.password-store/testpass.gpg
Te5tPA55
% echo "" | pass testpass
gpg: decryption failed: No secret key
% pass testpass
Te5tPA55

Where do you think is the proper way to fix the issue?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20180427/8960e837/attachment.html>


More information about the Password-Store mailing list