Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force loopback pinentry-mode #2

Closed
wants to merge 1 commit into from
Closed

Conversation

websecnl
Copy link

@websecnl websecnl commented Apr 5, 2024

Fixes an issue with GPG:

gpg: signing failed: Inappropriate ioctl for device
gpg: [stdin]: clear-sign failed: Inappropriate ioctl for device

Fixes an issue with GPG:

gpg: signing failed: Inappropriate ioctl for device
gpg: [stdin]: clear-sign failed: Inappropriate ioctl for device
@oh2fih oh2fih changed the title Update securitytxt-signer.sh Force loopback pinentry-mode Apr 5, 2024
@oh2fih
Copy link
Owner

oh2fih commented Apr 5, 2024

This is not a general issue with GnuPG that affects everyone. The error is probably caused by a gpg-agent misconfiguration. Furthermore, the suggested patch will override the default settings, disabling the user to choose the desired pinentry mode.

--pinentry-mode mode - -

  • loopback
    Redirect Pinentry queries to the caller. Note that in contrast to Pinentry the user is not prompted again if he enters a bad password.

Not prompting the password again seems hardly a generally desired behavior.

@oh2fih
Copy link
Owner

oh2fih commented Apr 5, 2024

The root cause for Inappropriate ioctl for device is that GnuPG doesn't know where to read the input from. Try:

export GPG_TTY=$(tty)

A proper solution for this with the behavior you suggest would be:

  • In ~/.gnupg/gpg.conf, add:
    use-agent 
    pinentry-mode loopback
    
  • in ~/.gnupg/gpg-agent.conf, add:
    allow-loopback-pinentry
    

Closing as non-issue, cannot reproduce & unwanted change.

@oh2fih oh2fih closed this Apr 5, 2024
@websecnl
Copy link
Author

websecnl commented Apr 5, 2024

Alright :) Well, still good to have this in the history here so other users know.
I had to figure this out the hard way.

@websecnl websecnl deleted the patch-1 branch April 5, 2024 13:01
@oh2fih
Copy link
Owner

oh2fih commented Apr 5, 2024

👍 I agree that this is good for documentation. Could have been opened as an issue, too.

😎 It is also always cool to see someone is using my work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants