aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sm/ChangeLog7
-rw-r--r--sm/call-dirmngr.c37
2 files changed, 41 insertions, 3 deletions
diff --git a/sm/ChangeLog b/sm/ChangeLog
index 096c4ca8e..b33ed5409 100644
--- a/sm/ChangeLog
+++ b/sm/ChangeLog
@@ -1,5 +1,12 @@
2004-12-15 Werner Koch <[email protected]>
+ * 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
diff --git a/sm/call-dirmngr.c b/sm/call-dirmngr.c
index c70f56580..44246daa6 100644
--- a/sm/call-dirmngr.c
+++ b/sm/call-dirmngr.c
@@ -57,6 +57,7 @@ struct inq_certificate_parm_s {
};
struct isvalid_status_parm_s {
+ CTRL ctrl;
int seen;
unsigned char fpr[20];
};
@@ -348,7 +349,16 @@ isvalid_status_cb (void *opaque, const char *line)
{
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 @@ gpgsm_dirmngr_isvalid (ctrl_t ctrl,
parm.cert = cert;
parm.issuer_cert = issuer_cert;
+ stparm.ctrl = ctrl;
stparm.seen = 0;
memset (stparm.fpr, 0, 20);
@@ -608,7 +619,16 @@ lookup_status_cb (void *opaque, const char *line)
{
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 @@ run_command_inq_cb (void *opaque, const char *line)
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 @@ gpgsm_dirmngr_run_command (CTRL ctrl, const char *command,
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);