You are not logged in.

#1 2021-02-13 23:37:08

FranticHaze
Member
Registered: 2021-02-13
Posts: 2

passmenu broken | pinentry-curses bug | how to auto unlock gpg key

I use password-store to manage my passwords, I rely heavily on
passmenu to fill-out my passwords. On Ubuntu, my ignorance of how this
worked was blissful, somehow the GPG password for my password store
was always cached, passmenu always worked when I logged in. On Arch,
clearly I need to improve my knowledge, because passmenu often fails
while pipeing to xdotool, I suspect because pinentry-curses is
interacting badly with the process.

https://bbs.archlinux.org/viewtopic.php?id=179856
https://forums.gentoo.org/viewtopic-t-639272.html

My goal is to have my GPG key unlocked forever when I login, and for
pinentry-curses to never pop-up at me and break my X tools.

The problem presents after passmenu pops up correctly, but when I
select a password, "nothing happens". No input is pasted by xdotool as
expected. After some investigation, I find there is a gpg-agent
process that I don't know where it came from,

frantic   323504     753  0 22:59 ?        00:00:00 /usr/bin/gpg-agent --supervised

I kill this process, and try using pass from the command line. This
time, I get a pinetry dialog on the terminal and sometimes that
unblocks me (I suspect it was "doing nothing" because that stray
gpg-agent had its controlling TTY behind my window manager). However,
once the GPG unlock timeout expires, I'm back to square one. Furhter, I
often get this bugged situation with pinetry,

          ┌────────────────────────────────────────────────────────────────┐         
          │ Please enter the passphrase to unlock the OpenPGP secret key:  │         
          │ "frantic"                                                      │         
          │ 3072-bit RSA key, ID LOLOLOLOLOLOLOLO,                         │         
          │ created 2019-11-11 (main key ID LOLOLOLOLOLOLOLO).             │         
          │                                                                │         
          │                                                                │         
          │ Bad Passphrase (try 3 of 3)                                    │         
          │                                                                │         
          │ Passphrase: \^C_______________________________________________ │         
dell-laptop[~]> ^C                                                         │         
dell-laptop[~]> ^C  <OK>                                    <Cancel>       │         
dell-laptop[~]> ^C─────────────────────────────────────────────────────────┘         
dell-laptop[~]> ^C                                                                   
dell-laptop[~]> ^C                                                                   
dell-laptop[~]> ^C                                                                   
dell-laptop[~]> ^C                                                                   
dell-laptop[~]> ^C                                                                   
dell-laptop[~]> ^C


I press Ctrl-L to try and clear the terminal and the prompt
reappears. However, the input is corrupted when I start typing, so it
doesn't even handle the correct password properly. In short, this
program is really, really bugged.

Sometimes, when it gets into this state, I find pinetry-curses using
100% CPU... I'm really confused what is happening. GPG_TTY appears to
be involved somehow. I've noticed the dialog occassionally opens on
the tty from which I typed "startx", not the PTY in i3 (my window
manager).

Clearly I've really messed up the configuration somewhere, but having
searched the forum and ransacked the wiki in vein, I ask for some
suggestions on debugging this sorry situation, and getting back to
Just Working.

Thank you for reading.

Best,
  Frantic.

Offline

#2 2021-02-14 05:17:42

smudge
Member
Registered: 2011-03-20
Posts: 158

Re: passmenu broken | pinentry-curses bug | how to auto unlock gpg key

Offline

#3 2021-02-14 16:29:11

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,700

Re: passmenu broken | pinentry-curses bug | how to auto unlock gpg key

First, allow me to recommend rofi-pass

Are you really using X. or are you using Wayland?  I had all kinds of issues with passmenu on Wayland


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#4 2021-02-15 10:40:21

FranticHaze
Member
Registered: 2021-02-13
Posts: 2

Re: passmenu broken | pinentry-curses bug | how to auto unlock gpg key

Thank you for the replies. Perhaps the difference was the default cache time on Ubuntu, hence why I wasn't having this issue there. Thank you smudge for the suggestion.

I am really using X, the UI itself shows up perfectly, it's the pinentry-curses asking for input on the wrong TTY that seems the issue. I guess another option for me would be to install a GUI pinentry dialog, that wouldn't get confused and request its input from something *behind* my window manager. Anyway, I can mark this as solved with the cache time increase.

Best,
   Frantic.

Offline

Board footer

Powered by FluxBB