Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: GnuPG: devel

select pinentry-curses/qt depending on situation

 

 

GnuPG devel RSS feed   Index | Next | Previous | View Threaded


petr.uzel at suse

Nov 23, 2008, 8:21 AM

Post #1 of 2 (649 views)
Permalink
select pinentry-curses/qt depending on situation

Hey list!

What is the best way (if any) to select which pinentry (-curses/-qt/-gtk) to
run, depending on situation, i.e. whether X is running and whether we have tty.

What I want is to run pinentry-curses if there is tty (e.g. gpg in virtual
console), and 'graphical' pinentry otherwise (e.g. signing mail in kmail).

Now, I have a shell script named /usr/bin/pinentry, that tries to determine
which pinentry to run and then executes it. The problem is that it can only use
command line options that gpg-agent passes to pinentry. This options either
does or doesn't contain --display option, depending on whether X is running.
The rest of options (namely --ttyname) is passed to pinentry via assuan
protocol, which obviously can not be used in the process of selecting proper
pinentry. Without ttyname I can't distinguish whether I have virtual terminal
or not (calling tty -s in pinentry script does not work).

I have two questions:

1) Is there any way how to pass ttyname (and possibly other options) to
pinentry via command line arguments instead of assuan protocol?

2) More generally, is there any better way how to run various versions of
pinentry depending on situation ?


Thanks in advance,


--
Best regards / s pozdravem

Petr Uzel, Packages maintainer
---------------------------------------------------------------------
SUSE LINUX, s.r.o. e-mail: puzel [at] suse
Lihovarská 1060/12 tel: +420 284 028 964
190 00 Prague 9 fax: +420 284 028 951
Czech Republic http://www.suse.cz

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel


marcus.brinkmann at ruhr-uni-bochum

Dec 8, 2008, 11:06 AM

Post #2 of 2 (558 views)
Permalink
Re: select pinentry-curses/qt depending on situation [In reply to]

Petr Uzel wrote:
> Hey list!
>
> What is the best way (if any) to select which pinentry (-curses/-qt/-gtk) to
> run, depending on situation, i.e. whether X is running and whether we have tty.

The graphical pinentries have a fallback, which detects if no X is
running and runs the curses pinentry (compiled in statically, ie the
pinentry-curses binary is not needed in this case).

> What I want is to run pinentry-curses if there is tty (e.g. gpg in virtual
> console), and 'graphical' pinentry otherwise (e.g. signing mail in kmail).

This should work fine with the pinentry-qt binary. Did you try it? I
know that it works for pinentry-gtk-2.

> Now, I have a shell script named /usr/bin/pinentry, that tries to determine
> which pinentry to run and then executes it. The problem is that it can only use
> command line options that gpg-agent passes to pinentry. This options either
> does or doesn't contain --display option, depending on whether X is running.
> The rest of options (namely --ttyname) is passed to pinentry via assuan
> protocol, which obviously can not be used in the process of selecting proper
> pinentry. Without ttyname I can't distinguish whether I have virtual terminal
> or not (calling tty -s in pinentry script does not work).

pinentry-FOO uses the DISPLAY variable setting to determine if X is
running or not.

> I have two questions:
>
> 1) Is there any way how to pass ttyname (and possibly other options) to
> pinentry via command line arguments instead of assuan protocol?
>
> 2) More generally, is there any better way how to run various versions of
> pinentry depending on situation ?

Thanks,
Marcus



_______________________________________________
Gnupg-devel mailing list
Gnupg-devel [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-devel

GnuPG devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.