about pinentry-tty (gpg-agent)

Ken SATO ken.294946@outlook.jp
Sat Jul 24 05:06:17 GMT 2021


Hello everyone,

I tried using pinentry-tty to enter the passphrase for the gpg2 command,
but it ended with an error without waiting for the passphrase.

It's like this.
---8X----+---8X----+---8X----+---8X----+---8X----+---8X----+---8X----+
$ gpg2 -o AAA -d AAA.gpg
Please enter the passphrase to unlock the OpenPGP secret key:
"XXXXX YYYYY <xxxxxyyyyy@mail.domain>"
4096-bit RSA key, ID 0xAABBCCDDEEFFGGHH,
created 2021-06-15 (main key ID 0xAABBCCDDEEFFGGHH).

Passphrase:
gpg: encrypted with 4096-bit RSA key, ID 0xAABBCCDDEEFFGGHH, created 2021-06-15
      "XXXXX YYYYY <xxxxxyyyyy@mail.domain>"
gpg: public key decryption failed: Operation cancelled
gpg: decryption failed: No secret key
---8X----+---8X----+---8X----+---8X----+---8X----+---8X----+---8X----+

# I made pinentry-tty from pinentry-1.0.0-2-src.tar.xz and the
development library it requires. They were obtained from the Cygwin
download site.

# Also, I specified that pinentry-tty in the pinentry-program option of
the ~/.gnupg/gpg-agent.conf file.

As a test, I quit gpg-agent ($ gpgconf --kill gpg-agent) and started it
as follows. Next, when I executed the same gpg2 command as above, I was
able to enter the passphrase and decrypt it.

$ (trap '' SIGTTOU SIGTTIN; gpg-connect-agent /bye)

I'm not sure why the pinentry module doesn't include pinentry-tty, but
it seems to work by chance. Is it okay to ignore SIGTTOU and SIGTTIN?

Thank you.



More information about the Cygwin mailing list