public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* pinentry-curses not available?
@ 2018-11-02 19:47 David Dombrowsky
  2018-11-02 20:21 ` cyg Simple
  2018-11-03 18:23 ` Marco Atzeri
  0 siblings, 2 replies; 6+ messages in thread
From: David Dombrowsky @ 2018-11-02 19:47 UTC (permalink / raw)
  To: cygwin

I don't see a way to download `pinentry-curses` or `pinentry-tty` for
use with `gpg-agent` (using gnupg v2).  Are these not maintained?  Or
am I just looking at the wrong sources?

In any case, I got pinentry-1.1.0 to compile against a cygwin-supplied
version of ncurses, and it mostly works (you still need to tell it to
not detach from the tty, not sure what's up with that).  This is very
useful when signing git commits, and removing the need for a graphical
console just to input my gpg passphrase.

-- 
David Dombrowsky, Senior Software Engineer
email: davek@6thstreetradio.org
Cell: 518-374-3204
https://www.linkedin.com/in/david-dombrowsky-94334415
http://6thstreetradio.org/

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pinentry-curses not available?
  2018-11-02 19:47 pinentry-curses not available? David Dombrowsky
@ 2018-11-02 20:21 ` cyg Simple
  2018-11-02 20:47   ` David Dombrowsky
  2018-11-03 18:23 ` Marco Atzeri
  1 sibling, 1 reply; 6+ messages in thread
From: cyg Simple @ 2018-11-02 20:21 UTC (permalink / raw)
  To: cygwin

On 11/2/2018 3:47 PM, David Dombrowsky wrote:
> I don't see a way to download `pinentry-curses` or `pinentry-tty` for
> use with `gpg-agent` (using gnupg v2).  Are these not maintained?  Or
> am I just looking at the wrong sources?
> 
> In any case, I got pinentry-1.1.0 to compile against a cygwin-supplied
> version of ncurses, and it mostly works (you still need to tell it to
> not detach from the tty, not sure what's up with that).  This is very
> useful when signing git commits, and removing the need for a graphical
> console just to input my gpg passphrase.

I see from [1] that pinentry-w32 exists which is a replacement for
pinentry-curses which was in [2].  Now both of these are version 1.0.0.
Based on [3] Marco Atzeri can give or point to reasoning.

[1]
https://cygwin.com/cgi-bin2/package-cat.cgi?file=x86_64%2Fpinentry%2Fpinentry-1.0.0-2&grep=pinentry
[2]
https://cygwin.com/cgi-bin2/package-cat.cgi?file=x86_64%2Fpinentry%2Fpinentry-1.0.0-1&grep=pinentry
[3] https://cygwin.com/cygwin-pkg-maint

-- 
cyg Simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pinentry-curses not available?
  2018-11-02 20:21 ` cyg Simple
@ 2018-11-02 20:47   ` David Dombrowsky
  0 siblings, 0 replies; 6+ messages in thread
From: David Dombrowsky @ 2018-11-02 20:47 UTC (permalink / raw)
  To: cygwin

> I see from [1] that pinentry-w32 exists which is a replacement for
> pinentry-curses which was in [2].

pinentry-w32 works great, but it requires you to be logged in to the
GUI, and _then_ invoke gpg-agent, in order for things to work.  And
you need to do this every time the pin times out.  Obviously not the
end of the world, but having a console one is much nicer, because it
works over an ssh connection.
On Fri, Nov 2, 2018 at 4:21 PM cyg Simple <cygsimple@gmail.com> wrote:
>
> On 11/2/2018 3:47 PM, David Dombrowsky wrote:
> > I don't see a way to download `pinentry-curses` or `pinentry-tty` for
> > use with `gpg-agent` (using gnupg v2).  Are these not maintained?  Or
> > am I just looking at the wrong sources?
> >
> > In any case, I got pinentry-1.1.0 to compile against a cygwin-supplied
> > version of ncurses, and it mostly works (you still need to tell it to
> > not detach from the tty, not sure what's up with that).  This is very
> > useful when signing git commits, and removing the need for a graphical
> > console just to input my gpg passphrase.
>
> I see from [1] that pinentry-w32 exists which is a replacement for
> pinentry-curses which was in [2].  Now both of these are version 1.0.0.
> Based on [3] Marco Atzeri can give or point to reasoning.
>
> [1]
> https://cygwin.com/cgi-bin2/package-cat.cgi?file=x86_64%2Fpinentry%2Fpinentry-1.0.0-2&grep=pinentry
> [2]
> https://cygwin.com/cgi-bin2/package-cat.cgi?file=x86_64%2Fpinentry%2Fpinentry-1.0.0-1&grep=pinentry
> [3] https://cygwin.com/cygwin-pkg-maint
>
> --
> cyg Simple
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>


-- 
David Dombrowsky, Senior Software Engineer
email: davek@6thstreetradio.org
Cell: 518-374-3204
https://www.linkedin.com/in/david-dombrowsky-94334415
http://6thstreetradio.org/

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pinentry-curses not available?
  2018-11-02 19:47 pinentry-curses not available? David Dombrowsky
  2018-11-02 20:21 ` cyg Simple
@ 2018-11-03 18:23 ` Marco Atzeri
  2018-11-05 16:06   ` David Dombrowsky
  1 sibling, 1 reply; 6+ messages in thread
From: Marco Atzeri @ 2018-11-03 18:23 UTC (permalink / raw)
  To: cygwin

Am 02.11.2018 um 20:47 schrieb David Dombrowsky:
> I don't see a way to download `pinentry-curses` or `pinentry-tty` for
> use with `gpg-agent` (using gnupg v2).  Are these not maintained?  Or
> am I just looking at the wrong sources?
>
> In any case, I got pinentry-1.1.0 to compile against a cygwin-supplied
> version of ncurses, and it mostly works (you still need to tell it to
> not detach from the tty, not sure what's up with that).

can you clarify ?
May be it was the reason why I and Yaakov found it not functional

> This is very
> useful when signing git commits, and removing the need for a graphical
> console just to input my gpg passphrase.


---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pinentry-curses not available?
  2018-11-03 18:23 ` Marco Atzeri
@ 2018-11-05 16:06   ` David Dombrowsky
  2019-01-22 14:36     ` David Dombrowsky
  0 siblings, 1 reply; 6+ messages in thread
From: David Dombrowsky @ 2018-11-05 16:06 UTC (permalink / raw)
  To: cygwin

On Sat, Nov 3, 2018 at 2:23 PM Marco Atzeri <marco.atzeri@gmail.com> wrote:
> > In any case, I got pinentry-1.1.0 to compile against a cygwin-supplied
> > version of ncurses, and it mostly works (you still need to tell it to
> > not detach from the tty, not sure what's up with that).
>
> can you clarify ?
> May be it was the reason why I and Yaakov found it not functional

That's very possible.

I downloaded the stock source for pinentry 1.1.0 from gnupg.org and
tried to build it.  After "fixing" one of the build errors (ttytype is
a macro and needs to be renamed in the pinentry source, at least on my
cygwin install), I got it to build and install.  But it won't run
unless you pass `--keep-tty` to `gpg-agent`, and even then it's a
little picky and the agent needs to be killed and restarted
frequently.

I was just wondering if anyone had done anything beyond the 20 minutes
of work I put into it.  If not, then my somewhat hack-ish solution is
a sufficient workaround.

This is with cygwin 64-bit, setup 2.893
CYGWIN_NT-6.1 BL-ENG-P01 2.11.1(0.329/5/3) 2018-09-05 10:24 x86_64 Cygwin

-- 
David Dombrowsky, Senior Software Engineer
email: davek@6thstreetradio.org
https://www.linkedin.com/in/david-dombrowsky-94334415
http://6thstreetradio.org/

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pinentry-curses not available?
  2018-11-05 16:06   ` David Dombrowsky
@ 2019-01-22 14:36     ` David Dombrowsky
  0 siblings, 0 replies; 6+ messages in thread
From: David Dombrowsky @ 2019-01-22 14:36 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1362 bytes --]

On 11/5/18 11:06 AM, David Dombrowsky wrote:> On Sat, Nov 3, 2018 at
2:23 PM Marco Atzeri <marco.atzeri@gmail.com> wrote:
>>> In any case, I got pinentry-1.1.0 to compile against a cygwin-supplied
>>> version of ncurses, and it mostly works (you still need to tell it to
>>> not detach from the tty, not sure what's up with that).
>>
>> can you clarify ?
>> May be it was the reason why I and Yaakov found it not functional
>
> That's very possible.
>
> I downloaded the stock source for pinentry 1.1.0 from gnupg.org and
> tried to build it.  After "fixing" one of the build errors (ttytype is
> a macro and needs to be renamed in the pinentry source, at least on my
> cygwin install), I got it to build and install.

For the record, I've had to do this on a couple of machines, so I
figured I'd post the patch.  Still doesn't work reliably.  I need to log
in to the desktop, start a screen session, and then run

gpg-agent --daemon --disable-scdaemon --no-detach -vv --pinentry-program
/usr/local/bin/pinentry-curses > agent.log 2>&1 &

to get it to work.  After that I can sign git commits all day without
having to RDP back into the box.

Not the best, but it works.  If anyone has a better solution, please let
me know.



-- 
David Dombrowsky, Software Engineer
davek@6thstreetradio.org | 518-374-3204
https://www.linkedin.com/in/david-dombrowsky-94334415

[-- Attachment #2: pinentry-1.1.0-cygwin.patch --]
[-- Type: text/x-patch, Size: 3301 bytes --]

diff -ur orig/pinentry-1.1.0/pinentry/pinentry.c pinentry-1.1.0/pinentry/pinentry.c
--- orig/pinentry-1.1.0/pinentry/pinentry.c	2017-12-03 11:13:15.000000000 -0500
+++ pinentry-1.1.0/pinentry/pinentry.c	2018-11-02 15:29:16.945203400 -0400
@@ -97,7 +97,7 @@
      Don't reset them.  */
   int grab = pinentry.grab;
   char *ttyname = pinentry.ttyname;
-  char *ttytype = pinentry.ttytype;
+  char *ttytype_ = pinentry.ttytype_;
   char *ttyalert = pinentry.ttyalert;
   char *lc_ctype = pinentry.lc_ctype;
   char *lc_messages = pinentry.lc_messages;
@@ -135,7 +135,7 @@
   if (use_defaults)
     {
       free (pinentry.ttyname);
-      free (pinentry.ttytype);
+      free (pinentry.ttytype_);
       free (pinentry.ttyalert);
       free (pinentry.lc_ctype);
       free (pinentry.lc_messages);
@@ -194,7 +194,7 @@
     {
       pinentry.grab = grab;
       pinentry.ttyname = ttyname;
-      pinentry.ttytype = ttytype;
+      pinentry.ttytype_ = ttytype_;
       pinentry.ttyalert = ttyalert;
       pinentry.lc_ctype = lc_ctype;
       pinentry.lc_messages = lc_messages;
@@ -950,8 +950,8 @@
 	    }
 	  break;
 	case 'N':
-	  pinentry.ttytype = strdup (pargs.r.ret_str);
-	  if (!pinentry.ttytype)
+	  pinentry.ttytype_ = strdup (pargs.r.ret_str);
+	  if (!pinentry.ttytype_)
 	    {
 #ifndef HAVE_W32CE_SYSTEM
 	      fprintf (stderr, "%s: %s\n", this_pgmname, strerror (errno));
@@ -1070,10 +1070,10 @@
     }
   else if (!strcmp (key, "ttytype"))
     {
-      if (pinentry.ttytype)
-	free (pinentry.ttytype);
-      pinentry.ttytype = strdup (value);
-      if (!pinentry.ttytype)
+      if (pinentry.ttytype_)
+	free (pinentry.ttytype_);
+      pinentry.ttytype_ = strdup (value);
+      if (!pinentry.ttytype_)
 	return gpg_error_from_syserror ();
     }
   else if (!strcmp (key, "ttyalert"))
@@ -1755,7 +1755,7 @@
     {
       snprintf (buffer, sizeof buffer, "%s %s %s",
                 pinentry.ttyname? pinentry.ttyname : "-",
-                pinentry.ttytype? pinentry.ttytype : "-",
+                pinentry.ttytype_? pinentry.ttytype_ : "-",
                 pinentry.display? pinentry.display : "-" );
       buffer[sizeof buffer -1] = 0;
       rc = assuan_send_data (ctx, buffer, strlen (buffer));
diff -ur orig/pinentry-1.1.0/pinentry/pinentry.h pinentry-1.1.0/pinentry/pinentry.h
--- orig/pinentry-1.1.0/pinentry/pinentry.h	2017-12-03 11:13:05.000000000 -0500
+++ pinentry-1.1.0/pinentry/pinentry.h	2018-11-02 15:25:42.578732900 -0400
@@ -75,7 +75,7 @@
      supported.  (Assuan: "OPTION ttyname TTYNAME".)  */
   char *ttyname;
   /* The type of the terminal.  (Assuan: "OPTION ttytype TTYTYPE".)  */
-  char *ttytype;
+  char *ttytype_;
   /* Set the alert mode (none, beep or flash).  */
   char *ttyalert;
   /* The LC_CTYPE value for the terminal.  (Assuan: "OPTION lc-ctype
diff -ur orig/pinentry-1.1.0/pinentry/pinentry-curses.c pinentry-1.1.0/pinentry/pinentry-curses.c
--- orig/pinentry-1.1.0/pinentry/pinentry-curses.c	2017-12-03 11:13:05.000000000 -0500
+++ pinentry-1.1.0/pinentry/pinentry-curses.c	2018-11-02 15:27:00.269222900 -0400
@@ -1188,7 +1188,7 @@
     }
 #endif
 
-  rc = dialog_run (pinentry, pinentry->ttyname, pinentry->ttytype);
+  rc = dialog_run (pinentry, pinentry->ttyname, pinentry->ttytype_);
   do_touch_file (pinentry);
   return rc;
 }


[-- Attachment #3: Type: text/plain, Size: 219 bytes --]


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-01-22 14:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-02 19:47 pinentry-curses not available? David Dombrowsky
2018-11-02 20:21 ` cyg Simple
2018-11-02 20:47   ` David Dombrowsky
2018-11-03 18:23 ` Marco Atzeri
2018-11-05 16:06   ` David Dombrowsky
2019-01-22 14:36     ` David Dombrowsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).