t-8ch / pinentry-bemenu

Pinentry based on bemenu
GNU General Public License v3.0
49 stars 3 forks source link

doesn't work #1

Closed wh1tevs closed 3 years ago

wh1tevs commented 3 years ago

Hello i install it from aur, and set pinentry-program /usr/bin/pinentry-bemenu in .gnupg/gpg-agent.conf and it's don't work. in pass it's just an error gpg: decryption failed: No secret key, i aslo try to change my gpg key's expire date and have this

gpg: signing failed: Unknown option
gpg: make_keysig_packet failed: Unknown option

i trying to use BEMENU_BACKEND=curses but it's no take effect

t-8ch commented 3 years ago

How are you starting gpg-agent? Does pinentry-gtk-2 work?

If it is running via systemd --user you have to make sure that gpg-agent (and therefore pinentry-bemenu) have access to the WAYLAND_DISPLAY env variable.

wh1tevs commented 3 years ago

How are you starting gpg-agent?

via systemd

``` ● gpg-agent.service - GnuPG cryptographic agent and passphrase cache Loaded: loaded (/usr/lib/systemd/user/gpg-agent.service; static) Active: active (running) since Mon 2021-04-19 02:26:58 +07; 2 days ago TriggeredBy: ● gpg-agent-browser.socket ● gpg-agent-extra.socket ● gpg-agent-ssh.socket ● gpg-agent.socket Docs: man:gpg-agent(1) Main PID: 253128 (gpg-agent) Tasks: 4 (limit: 19038) Memory: 1.9M CPU: 15.761s CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/gpg-agent.service ├─253128 /usr/bin/gpg-agent --supervised └─330615 scdaemon --multi-server Apr 21 17:37:13 zenbook gpg-agent[253128]: command 'PKDECRYPT' failed: Unknown option Apr 21 17:37:31 zenbook gpg-agent[253128]: failed to unprotect the secret key: Unknown option Apr 21 17:37:31 zenbook gpg-agent[253128]: failed to read the secret key Apr 21 17:37:31 zenbook gpg-agent[253128]: command 'PKDECRYPT' failed: Unknown option Apr 21 17:37:37 zenbook gpg-agent[253128]: failed to unprotect the secret key: Unknown option Apr 21 17:37:37 zenbook gpg-agent[253128]: failed to read the secret key Apr 21 17:37:37 zenbook gpg-agent[253128]: command 'PKDECRYPT' failed: Unknown option Apr 21 17:38:22 zenbook gpg-agent[253128]: failed to unprotect the secret key: Unknown option Apr 21 17:38:22 zenbook gpg-agent[253128]: failed to read the secret key Apr 21 17:38:22 zenbook gpg-agent[253128]: command 'PKDECRYPT' failed: Unknown option ```

Does pinentry-gtk-2 work?

gtk-2, qt, gnome3, curses works

If it is running via systemd --user you have to make sure that gpg-agent (and therefore pinentry-bemenu) have access to the WAYLAND_DISPLAY env variable.

$ systemctl --user show-environment | rg -i display 
DISPLAY=:0
WAYLAND_DISPLAY=wayland-1
t-8ch commented 3 years ago

Did you restart gpg-agent after changing the settings? Your running gpg-agent is older than the first commit to pinentry-bemenu :-)

t-8ch commented 3 years ago

Does it work without starting through gpg-agent?


$ pinentry-bemenu
OK pinentry-bemenu v0.4.0
# send the "getpin" command manually, and look if the menu pops up
getpin
wh1tevs commented 3 years ago

Did you restart gpg-agent after changing the settings? Your running gpg-agent is older than the first commit to pinentry-bemenu :-)

rebooted 5 mins ago, nothing changed

Does it work without starting through gpg-agent?

$ pinentry-bemenu
OK pinentry-bemenu v0.4.0
# send the "getpin" command manually, and look if the menu pops up
getpin

this works, popup visible

t-8ch commented 3 years ago

Reading your report more closely I can now reproduce the issue. So far I only used this tool for unlocking ssh keys. For GPG keys it needs to handle more options.

Thanks for the report!

wh1tevs commented 3 years ago

okay, waiting for it. also bemenu from HEAD has password hiding option, but it dont included in latest release in repo. https://github.com/Cloudef/bemenu/commit/52547807b06912d9fce5470bb8ce314e8d5ccc8d

t-8ch commented 3 years ago

This is fixed in v0.5.0

FYI the upcoming password hiding function is already wired up to be used as soon as it's available from bemenu.

wh1tevs commented 3 years ago

now works. Thanks!

oliverwiegers commented 3 years ago

I can confirm that the issue was fixed in 8947943. But the issue was reintroduced in dc74bc5. So current HEAD is not working for GPG keys anymore.