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

gnupg2: gpg: public key decryption failed: Inappropriate ioctl for device #14737

Closed
5 tasks done
olalonde opened this issue Jun 19, 2017 · 11 comments
Closed
5 tasks done
Labels
stale No recent activity

Comments

@olalonde
Copy link

olalonde commented Jun 19, 2017

Please always follow these steps:

  • Confirmed this is a problem with brew installing one, specific formula (not cask) and not every time you run brew? If it's a general brew problem please file this issue at https://github.com/Homebrew/brew/issues/new. If it's a brew cask problem please file this issue at https://github.com/Homebrew/caskroom/homebrew-cask/new
  • Ran brew update and retried your prior step?
  • Ran brew doctor, fixed all issues and retried your prior step?
  • Ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • If brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?

Please note we will close your issue without comment if you delete or do not fill out the issue checklist and provide ALL the requested information.

To help us debug your issue please explain:

  • What you were trying to do (and why)

Decrypt text with gpg2 -d.

  • What happened (include command output)
cat password.txt | base64 --decode | gpg2 -d
gpg: encrypted with 2048-bit RSA key, ID CBD2E04C36A72E45, created 2017-05-13
      "Oli Lalonde <[email protected]>"
gpg: public key decryption failed: Inappropriate ioctl for device
gpg: decryption failed: No secret key
  • What you expected to happen
Get the decrypted text
  • Step-by-step reproduction instructions (by running brew install commands)
brew install gnupg2
cat encrypted-text.txt | base64 --decode | gpg2 -d
@olalonde
Copy link
Author

This workaround fixed the problem: IJHack/QtPass#156 (comment)

brew install pinentry-mac
echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf
killall gpg-agent

@chdiza
Copy link
Contributor

chdiza commented Jun 20, 2017

The pinentry-mac formula already tells you to do that (in the caveats, emitted when the formula is installed).

@chdiza
Copy link
Contributor

chdiza commented Jun 20, 2017

But I find it weird that the gnupg2 formula, which depends on pinentry and compiles it in as the default pinentry, results in a gpg binary that doesn't just call that (console) pinentry out of the box.

@olalonde
Copy link
Author

olalonde commented Jun 20, 2017

Yeah, I just found out about the pinentry-mac workaround by googling for this issue, it's not a pinentry-mac bug report but a gnupg2 one.

@JCount
Copy link
Contributor

JCount commented Jun 20, 2017

I wonder if this has any bearing on the reason why it isn't using the configured pinentry:

You should always add the following lines to your .bashrc
or whatever initialization file is used for all shell invocations:
      GPG_TTY=$(tty)
      export GPG_TTY
It is important that this environment variable always reflects the
output of the tty command. For W32 systems this option is not required.

from here.

@stale stale bot added the stale No recent activity label Jul 12, 2017
@stale
Copy link

stale bot commented Jul 12, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@olalonde
Copy link
Author

Beep boop, might be stale but still an issue ;)

@stale stale bot removed the stale No recent activity label Jul 12, 2017
@stale stale bot added the stale No recent activity label Aug 2, 2017
@stale
Copy link

stale bot commented Aug 2, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@JCount
Copy link
Contributor

JCount commented Aug 2, 2017

This is not a Homebrew issue, but rather one of user configuration. The information I posted before should solve your issue.

The relevant configuration instructions, (the solution), are present both on gnupg.org and towards the beginning of the gpg-agent manpage.

Given these two things, and the fact that the user configuration is predominantly outside of Homebrew's scope in cases like this, this issue is inherently "resolved".

@wenzowski
Copy link
Contributor

Apologies for opening a frivolous ticket @JCount

It was not clear to me from this thicket that your comment represented the community opinion on the matter of bundled pinentry tool.

Thank you for all the hard work you do as a maintainer, and for speedily reviewing community PRs.

@JCount
Copy link
Contributor

JCount commented Sep 13, 2017

My comment represents the opinion and position of the maintainers of this project.

@Homebrew Homebrew locked and limited conversation to collaborators Sep 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale No recent activity
Projects
None yet
Development

No branches or pull requests

4 participants