GNUPG-1-9-BRANCH gnupg/sm (ChangeLog call-dirmngr.c)

cvs user wk cvs at cvs.gnupg.org
Wed Dec 15 15:34:14 CET 2004


    Date: Wednesday, December 15, 2004 @ 15:38:37
  Author: wk
    Path: /cvs/gnupg/gnupg/sm
     Tag: GNUPG-1-9-BRANCH

Modified: ChangeLog call-dirmngr.c

(lookup_status_cb): Send progress messages
upstream.
(isvalid_status_cb): Ditto.
(gpgsm_dirmngr_isvalid): Put CTRL into status CB parameters.
(gpgsm_dirmngr_run_command, run_command_status_cb): Pass CTRL to
status callback and handle PROGRESS.


----------------+
 ChangeLog      |    7 +++++++
 call-dirmngr.c |   37 ++++++++++++++++++++++++++++++++++---
 2 files changed, 41 insertions(+), 3 deletions(-)


Index: gnupg/sm/ChangeLog
diff -u gnupg/sm/ChangeLog:1.101.2.80 gnupg/sm/ChangeLog:1.101.2.81
--- gnupg/sm/ChangeLog:1.101.2.80	Wed Dec 15 15:15:54 2004
+++ gnupg/sm/ChangeLog	Wed Dec 15 15:38:37 2004
@@ -1,5 +1,12 @@
 2004-12-15  Werner Koch  <wk at g10code.com>
 
+	* call-dirmngr.c (lookup_status_cb): Send progress messages
+	upstream.
+	(isvalid_status_cb): Ditto.
+	(gpgsm_dirmngr_isvalid): Put CTRL into status CB parameters.
+	(gpgsm_dirmngr_run_command, run_command_status_cb): Pass CTRL to
+	status callback and handle PROGRESS.
+
 	* misc.c (setup_pinentry_env) [W32]: Don't use it.
 
 	* gpgsm.c (main) [W32]: Init Pth because we need it for the socket
Index: gnupg/sm/call-dirmngr.c
diff -u gnupg/sm/call-dirmngr.c:1.16.2.9 gnupg/sm/call-dirmngr.c:1.16.2.10
--- gnupg/sm/call-dirmngr.c:1.16.2.9	Tue Nov 23 18:09:51 2004
+++ gnupg/sm/call-dirmngr.c	Wed Dec 15 15:38:37 2004
@@ -57,6 +57,7 @@
 };
 
 struct isvalid_status_parm_s {
+  CTRL ctrl;
   int seen;
   unsigned char fpr[20];
 };
@@ -348,7 +349,16 @@
 {
   struct isvalid_status_parm_s *parm = opaque;
 
-  if (!strncmp (line, "ONLY_VALID_IF_CERT_VALID", 24)
+  if (!strncmp (line, "PROGRESS", 8) && (line[8]==' ' || !line[8]))
+    {
+      if (parm->ctrl)
+        {
+          for (line += 8; *line == ' '; line++)
+            ;
+          gpgsm_status (parm->ctrl, STATUS_PROGRESS, line);
+        }
+    }
+  else if (!strncmp (line, "ONLY_VALID_IF_CERT_VALID", 24)
       && (line[24]==' ' || !line[24]))
     {
       parm->seen++;
@@ -413,6 +423,7 @@
   parm.cert = cert;
   parm.issuer_cert = issuer_cert;
 
+  stparm.ctrl = ctrl;
   stparm.seen = 0;
   memset (stparm.fpr, 0, 20);
 
@@ -608,7 +619,16 @@
 {
   struct lookup_parm_s *parm = opaque;
 
-  if (!strncmp (line, "TRUNCATED", 9) && (line[9]==' ' || !line[9]))
+  if (!strncmp (line, "PROGRESS", 8) && (line[8]==' ' || !line[8]))
+    {
+      if (parm->ctrl)
+        {
+          for (line += 8; *line == ' '; line++)
+            ;
+          gpgsm_status (parm->ctrl, STATUS_PROGRESS, line);
+        }
+    }
+  else if (!strncmp (line, "TRUNCATED", 9) && (line[9]==' ' || !line[9]))
     {
       if (parm->ctrl)
         {
@@ -728,10 +748,21 @@
 static AssuanError
 run_command_status_cb (void *opaque, const char *line)
 {
+  ctrl_t ctrl = opaque;
+
   if (opt.verbose)
     {
       log_info ("dirmngr status: %s\n", line);
     }
+  if (!strncmp (line, "PROGRESS", 8) && (line[8]==' ' || !line[8]))
+    {
+      if (ctrl)
+        {
+          for (line += 8; *line == ' '; line++)
+            ;
+          gpgsm_status (ctrl, STATUS_PROGRESS, line);
+        }
+    }
   return 0;
 }
 
@@ -790,7 +821,7 @@
   rc = assuan_transact (dirmngr_ctx, line,
                         run_command_cb, NULL,
                         run_command_inq_cb, &parm,
-                        run_command_status_cb, NULL);
+                        run_command_status_cb, ctrl);
   xfree (line);
   log_info ("response of dirmngr: %s\n", rc? assuan_strerror (rc): "okay");
   return map_assuan_err (rc);




More information about the Gnupg-commits mailing list