mirror of
git://git.gnupg.org/gnupg.git
synced 2024-06-26 01:52:45 +02:00
* call-dirmngr.c (isvalid_status_cb, lookup_status_cb)
(run_command_status_cb): Return cancel status if gpgsm_status returned an error. * server.c (gpgsm_status, gpgsm_status2) (gpgsm_status_with_err_code): Return an error code. (gpgsm_status2): Always call va_end().
This commit is contained in:
parent
4350c58757
commit
0ccb120f68
10
sm/ChangeLog
10
sm/ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2004-12-17 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* call-dirmngr.c (isvalid_status_cb, lookup_status_cb)
|
||||||
|
(run_command_status_cb): Return cancel status if gpgsm_status
|
||||||
|
returned an error.
|
||||||
|
|
||||||
|
* server.c (gpgsm_status, gpgsm_status2)
|
||||||
|
(gpgsm_status_with_err_code): Return an error code.
|
||||||
|
(gpgsm_status2): Always call va_end().
|
||||||
|
|
||||||
2004-12-15 Werner Koch <wk@g10code.com>
|
2004-12-15 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* call-dirmngr.c (lookup_status_cb): Send progress messages
|
* call-dirmngr.c (lookup_status_cb): Send progress messages
|
||||||
|
|
|
@ -355,7 +355,8 @@ isvalid_status_cb (void *opaque, const char *line)
|
||||||
{
|
{
|
||||||
for (line += 8; *line == ' '; line++)
|
for (line += 8; *line == ' '; line++)
|
||||||
;
|
;
|
||||||
gpgsm_status (parm->ctrl, STATUS_PROGRESS, line);
|
if (gpgsm_status (parm->ctrl, STATUS_PROGRESS, line))
|
||||||
|
return ASSUAN_Canceled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!strncmp (line, "ONLY_VALID_IF_CERT_VALID", 24)
|
else if (!strncmp (line, "ONLY_VALID_IF_CERT_VALID", 24)
|
||||||
|
@ -625,7 +626,8 @@ lookup_status_cb (void *opaque, const char *line)
|
||||||
{
|
{
|
||||||
for (line += 8; *line == ' '; line++)
|
for (line += 8; *line == ' '; line++)
|
||||||
;
|
;
|
||||||
gpgsm_status (parm->ctrl, STATUS_PROGRESS, line);
|
if (gpgsm_status (parm->ctrl, STATUS_PROGRESS, line))
|
||||||
|
return ASSUAN_Canceled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!strncmp (line, "TRUNCATED", 9) && (line[9]==' ' || !line[9]))
|
else if (!strncmp (line, "TRUNCATED", 9) && (line[9]==' ' || !line[9]))
|
||||||
|
@ -760,7 +762,8 @@ run_command_status_cb (void *opaque, const char *line)
|
||||||
{
|
{
|
||||||
for (line += 8; *line == ' '; line++)
|
for (line += 8; *line == ' '; line++)
|
||||||
;
|
;
|
||||||
gpgsm_status (ctrl, STATUS_PROGRESS, line);
|
if (gpgsm_status (ctrl, STATUS_PROGRESS, line))
|
||||||
|
return ASSUAN_Canceled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -171,10 +171,10 @@ void gpgsm_init_default_ctrl (struct server_control_s *ctrl);
|
||||||
|
|
||||||
/*-- server.c --*/
|
/*-- server.c --*/
|
||||||
void gpgsm_server (certlist_t default_recplist);
|
void gpgsm_server (certlist_t default_recplist);
|
||||||
void gpgsm_status (ctrl_t ctrl, int no, const char *text);
|
gpg_error_t gpgsm_status (ctrl_t ctrl, int no, const char *text);
|
||||||
void gpgsm_status2 (ctrl_t ctrl, int no, ...);
|
gpg_error_t gpgsm_status2 (ctrl_t ctrl, int no, ...);
|
||||||
void gpgsm_status_with_err_code (ctrl_t ctrl, int no, const char *text,
|
gpg_error_t gpgsm_status_with_err_code (ctrl_t ctrl, int no, const char *text,
|
||||||
gpg_err_code_t ec);
|
gpg_err_code_t ec);
|
||||||
|
|
||||||
/*-- fingerprint --*/
|
/*-- fingerprint --*/
|
||||||
char *gpgsm_get_fingerprint (ksba_cert_t cert, int algo,
|
char *gpgsm_get_fingerprint (ksba_cert_t cert, int algo,
|
||||||
|
|
23
sm/server.c
23
sm/server.c
|
@ -964,18 +964,19 @@ get_status_string ( int no )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
gpg_error_t
|
||||||
gpgsm_status2 (CTRL ctrl, int no, ...)
|
gpgsm_status2 (CTRL ctrl, int no, ...)
|
||||||
{
|
{
|
||||||
|
gpg_error_t err = 0;
|
||||||
va_list arg_ptr;
|
va_list arg_ptr;
|
||||||
const char *text;
|
const char *text;
|
||||||
|
|
||||||
va_start (arg_ptr, no);
|
va_start (arg_ptr, no);
|
||||||
|
|
||||||
if (ctrl->no_server)
|
if (ctrl->no_server && ctrl->status_fd == -1)
|
||||||
|
; /* No status wanted. */
|
||||||
|
else if (ctrl->no_server)
|
||||||
{
|
{
|
||||||
if (ctrl->status_fd == -1)
|
|
||||||
return; /* no status wanted */
|
|
||||||
if (!statusfp)
|
if (!statusfp)
|
||||||
{
|
{
|
||||||
if (ctrl->status_fd == 1)
|
if (ctrl->status_fd == 1)
|
||||||
|
@ -1030,19 +1031,21 @@ gpgsm_status2 (CTRL ctrl, int no, ...)
|
||||||
*p++ = *text++;
|
*p++ = *text++;
|
||||||
}
|
}
|
||||||
*p = 0;
|
*p = 0;
|
||||||
assuan_write_status (ctx, get_status_string (no), buf);
|
err = map_assuan_err (assuan_write_status (ctx,
|
||||||
|
get_status_string (no), buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
va_end (arg_ptr);
|
va_end (arg_ptr);
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
gpg_error_t
|
||||||
gpgsm_status (CTRL ctrl, int no, const char *text)
|
gpgsm_status (CTRL ctrl, int no, const char *text)
|
||||||
{
|
{
|
||||||
gpgsm_status2 (ctrl, no, text, NULL);
|
return gpgsm_status2 (ctrl, no, text, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
gpg_error_t
|
||||||
gpgsm_status_with_err_code (CTRL ctrl, int no, const char *text,
|
gpgsm_status_with_err_code (CTRL ctrl, int no, const char *text,
|
||||||
gpg_err_code_t ec)
|
gpg_err_code_t ec)
|
||||||
{
|
{
|
||||||
|
@ -1050,9 +1053,9 @@ gpgsm_status_with_err_code (CTRL ctrl, int no, const char *text,
|
||||||
|
|
||||||
sprintf (buf, "%u", (unsigned int)ec);
|
sprintf (buf, "%u", (unsigned int)ec);
|
||||||
if (text)
|
if (text)
|
||||||
gpgsm_status2 (ctrl, no, text, buf, NULL);
|
return gpgsm_status2 (ctrl, no, text, buf, NULL);
|
||||||
else
|
else
|
||||||
gpgsm_status2 (ctrl, no, buf, NULL);
|
return gpgsm_status2 (ctrl, no, buf, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user