#1108495 pinentry-tty: python3's gpg --decrypt gets no PIN dialog, no errors reported

Package:
pinentry-tty
Source:
pinentry-tty
Description:
minimal dumb-terminal PIN or pass-phrase entry for GnuPG
Submitter:
Boca Cavana
Date:
2025-07-07 14:29:02 UTC
Severity:
normal
#1108495#5
Date:
2025-06-29 17:38:14 UTC
From:
To:
Dear Maintainer,

   * What led up to the situation?
Python3 script's gpg code stopped prompting for Passphrase when 12.11 was used.
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
Python3 code needs to discern when decryption is attempted for a message missing a key needed for decyption but that test failed one day.
   * What was the outcome of this action?
My code will overlook an infrequent encryption problem for the decryptor.
   * What outcome did you expect instead?
I expect my code to run like it did in Debian 10, 11 and 12 up to 12.11

#1108495#10
Date:
2025-06-30 02:15:06 UTC
From:
To:
The pinentry bug is coincident with updating to or after a new install to 12.11. Prior to that a python3 script running in a Terminal could call os.system(‘gpg —decrypt file’) and a PIN pop-up window would request a Passphrase. Also, no decryption errors are reported, not even when the key needed for decryption is locally missing.
#1108495#15
Date:
2025-07-07 14:18:58 UTC
From:
To:
[...]

Hello,

could you please elaborate on that? What is "Python3 script's gpg code"
that's on version 12.11?

cu Andreas

#1108495#20
Date:
2025-07-07 14:27:34 UTC
From:
To:

Works for me with both  pinentry-gtk2 and  pinentry-tty.

ametzler@argenau:~$ rm -rf /tmp/gpghome ; install -d -m0700 /tmp/gpghome ; gpg  --homedir /tmp/gpghome --batch --pinentry-mode loopback --passphrase 1234 --quick-generate-key blah@example.com
gpg: keybox '/tmp/gpghome/pubring.kbx' created
gpg: /tmp/gpghome/trustdb.gpg: trustdb created
gpg: directory '/tmp/gpghome/openpgp-revocs.d' created
gpg: revocation certificate stored as '/tmp/gpghome/openpgp-revocs.d/9C7D203179D87C924581E1968507ED6E2CB369C7.rev'
ametzler@argenau:~$ echo content > /tmp/input
ametzler@argenau:~$ gpg --homedir /tmp/gpghome --encrypt --recipient blah@example.com /tmp/input
gpg: checking the trustdb
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: next trustdb check due at 2028-07-06
ametzler@argenau:~$ /tmp/run-py.py
gpg: encrypted with cv25519 key, ID 02D8ABA3508D585F, created 2025-07-07
      "blah@example.com"
Please enter the passphrase to unlock the OpenPGP secret key:
"blah@example.com"
255-bit ECDH key, ID 02D8ABA3508D585F,
created 2025-07-07 (main key ID 8507ED6E2CB369C7).

Passphrase:
content
ametzler@argenau:~$ cat /tmp/run-py.py
#!/usr/bin/python3

import os

# ametzler@argenau:~$ rm -rf /tmp/gpghome ; install -d -m0700 /tmp/gpghome ; gpg --homedir /tmp/gpghome --batch --pinentry-mode loopback --passphrase 1234 --quick-generate-key blah@example.com
#  echo content > /tmp/input
# gpg --homedir /tmp/gpghome --encrypt --recipient blah@example.com /tmp/input

os.system("gpg --homedir /tmp/gpghome --decrypt  /tmp/input.gpg")

cu Andreas