Using gpg2 without pinentry?

Werner Koch wk at gnupg.org
Tue Jul 6 10:49:51 CEST 2010


On Sat,  3 Jul 2010 05:33, dougb at dougbarton.us said:

> What's needed for this case is a way to tell gpg2 "emulate gpg 1.x
> behavior and prompt for the password in line." I haven't looked at the
> internals in detail so I have no idea how difficult this would be. The

That is not easy but doable; see below.

Assuming that Alpine is a curses application you may use the curses
pinentry (If DISPLAY is not set, the standard pinentries fall back to
curses).  This might overwrite the Alpine screen, thus after the filter
has been run, you should restore the screen (ctrl-L).  If this is not
possible you may make use of the shell's suspend feature.

Using screen(1) and pinning the pinentry to one screen is another
option.

You may write a pinentry which loops back to Alpine or your script.  To
support this GnuPG provides the envvar PINENTRY_USER_DATA which you may
set to an arbitrary string and evaluate in your loopback-pinentry.  Your
pinentry would then use a fifo or another mechanism to ask the
originating process to enter a passpharse and return that one back to
your loopback-pinentry and in turn to gpg-agent.


Salam-Shalom,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.




More information about the Gnupg-users mailing list