Fix pinentry loopback and passphrase contraints.
authorBen Kibbey <bjk@luxsci.net>
Sun, 16 Aug 2015 17:46:59 +0000 (13:46 -0400)
committerBen Kibbey <bjk@luxsci.net>
Sun, 16 Aug 2015 20:12:46 +0000 (16:12 -0400)
* agent/command.c (cmd_get_passphrase): Don't repeat passphrase for
pinentry loopback mode.
* agent/genkey.c (check_passphrase_constraints): Immediately return when
pinentry mode is loopback.

--
Fixes endless loop when inquiring a passphrase with
pinentry-mode=loopback that may not satisfy passphrase contraints.

agent/command.c
agent/genkey.c

index 62a4628..f09a2ff 100644 (file)
@@ -1541,6 +1541,9 @@ cmd_get_passphrase (assuan_context_t ctx, char *line)
             {
               char *response2;
 
+              if (ctrl->pinentry_mode == PINENTRY_MODE_LOOPBACK)
+                break;
+
               rc = agent_get_passphrase (ctrl, &response2, desc2, prompt,
                                          errtext, 0,
                                         cacheid, CACHE_MODE_USER);
index df17880..af53c60 100644 (file)
@@ -189,6 +189,9 @@ check_passphrase_constraints (ctrl_t ctrl, const char *pw,
   char *msg2 = NULL;
   char *msg3 = NULL;
 
+  if (ctrl && ctrl->pinentry_mode == PINENTRY_MODE_LOOPBACK)
+    return 0;
+
   if (!pw)
     pw = "";