-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
gpg throws "You may want to update to a newer pinentry" error during signing git commit (fresh install) #9
Comments
Hi @Dentrax I was able to reproduce this locally when invoking the If instead I specify the
Then That being said I'm not sure why it does not work when starting the daemon from the terminal. |
Thanks, @jorgelbg! I tried this one but still no luck. $ cat ~/.gnupg/gpg-agent.conf
pinentry-program /usr/local/opt/pinentry-touchid/bin/pinentry-touchid
$ gpg-agent --daemon; killall gpg-agent && gpg-agent --daemon --use-standard-socket --pinentry-program /usr/local/bin/pinentry-touchid
$ killall -9 gpg-agent; gpg-connect-agent reloadagent /bye
$ git commit -S
error: gpg failed to sign the data
fatal: failed to write commit object
$ cat /tmp/pinentry-touchid.log
2021/11/17 14:27:05 main.go:105: Ready!
2021/11/17 14:27:05 main.go:285: Duplicated entry in the keychain |
@jorgelbg Hey! Any advices or help here? 🙏 |
@Dentrax You may need to:
Then try again. This workaround saved me from this bug. cc @jorgelbg Hey! You might want to check what's wrong with it? |
I don't know exactly what cc @jorgelbg |
Since it's too long for me to recall every detail, I may try my best to explain it. I think pinentry-touchid is acted as the agent to translate between fingerprint and REAL GPG PASSWORD. This procedure can be securely done by macOS's built-in Keychain Access function, and the GPG suite's In my scenario, when the first time But for an unknown reason, the GPG key password item is already stored in Keychain Access, and it can not be accessed by For removing the keychain item, this may be relevant: #11 (comment) Since you want more explanation and to be honest, I don't really know the principles in these procedures, I did a little more research. For reference,
And other people already mentioned this command, but in the opposite way: #3 (comment) . Based on the information we have known, maybe you can delete the item and try again. If it doesn't work, maybe the BTW, I encountered the same error log blocks as yours, so I assume my solution may also work for you:
|
Just remembered this one, any updates on this? @jorgelbg? 🙏 |
@Dentrax I released v0.0.3 a few minutes ago, would you mind giving it a try? Just to be sure:
should indicate pinentry-mac (the program that we use to get your GPG password when it is not there) to not use the the keychain, as in it acts as a proxy just for getting your password. After pinentry-touchid gets a password from pinentry-mac it stores it by itself in the keychain. This helps prevent the password prompt for accessing the keychain item the next time that pinentry-touchid needs to get the password. In either case if the item in the keychain is there pinentry-touchid should be able to fetch it (give or take one additional password prompt at some point). Also regarding the "You may want to update to a newer pinentry" error I think this happens because pinentry-touchid is not responding to the |
Hi @jorgelbg, thank you for your efforts on this! I just tried the v0.3.0 release by downloading macos-amd64 binary. Here is what I have tried so far:
Log:
It seems the issue still persists. What I'm missing here? 🤔 |
Ohhh, according to this comment and as @SunsetYe66 mentioned deleting it above, I deleted my To make UX better here, pinentry-touchid should check the We can also log some useful instructions such as deleting key in keychain and disabling the gpgtools: WDYT? What should we do to increase the overall UX here? |
Glad that it is working 🥳 I'm all in favour of improving the UX here, I'm just not sure why this is happening in the first place. Did you, by any chance, kept the details of the item that you found when executing the commands in the terminal? I'm curious about why pinentry-touchid tried to add the item again. The first thing that we do is check if, for the given GPG key, we can find a matching item in the keychain (this is based on the generated At this point one of two things should happen: a) the item is persisted directly by pinentry-mac (when the
It would seem as if at some point the item is not found in the keychain but still pinentry-touchid is trying to save it 🤔 and worse, the keychain is complaining about the item already being present 🤷♂️. This is why we have 2 checks in the code: Lines 284 to 333 in 42fe314
Because between checking for the item the first time and after invoking pinentry-mac there is a chance that the item is already in the keychain.
We suggest to not allow pinentry-mac to create the item in the keychain by itself in the README, at the very least this causes that (after the cached pin expires) you need to re-authorize pinentry-touchid to access the item (via the system password dialog). Maybe we can set check/modify |
After I applied the installation instructions step by step, I got an error while signing commit. The problem is in the communication between the gpg-agent and the pinentry program as the following debug output shows: 1
I reload gpg-agent daemon:
This one works:
gpg-agent:
pinentry-mac:
MacBook Pro (16-inch, Late 2019) - macOS 11 - Intel
But the
pinentry-mac
is working:My output logs:
Tried this solution but no luck.
Any ideas here? 🤔
Footnotes
https://bugs.launchpad.net/ubuntu/+source/pinentry-qt4/+bug/281487 ↩
The text was updated successfully, but these errors were encountered: