aboutsummaryrefslogtreecommitdiffstats
path: root/sm/server.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2002-03-12 13:36:29 +0000
committerWerner Koch <[email protected]>2002-03-12 13:36:29 +0000
commit83374554830904dfc6f2010e3fcdd9a1a864a2e6 (patch)
tree7323408f5ce8764ed3fa1dae665b6f8b23f8c1bb /sm/server.c
parent* server.c (cmd_listkeys, cmd_listsecretkeys): Divert to (diff)
downloadgnupg-83374554830904dfc6f2010e3fcdd9a1a864a2e6.tar.gz
gnupg-83374554830904dfc6f2010e3fcdd9a1a864a2e6.zip
* verify.c (gpgsm_verify): Detect certs-only message.
Diffstat (limited to 'sm/server.c')
-rw-r--r--sm/server.c37
1 files changed, 33 insertions, 4 deletions
diff --git a/sm/server.c b/sm/server.c
index 856eb56be..9ec4834e2 100644
--- a/sm/server.c
+++ b/sm/server.c
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stdarg.h>
#include <ctype.h>
#include <unistd.h>
@@ -176,6 +177,11 @@ cmd_recipient (ASSUAN_CONTEXT ctx, char *line)
int rc;
rc = gpgsm_add_to_certlist (line, &ctrl->server_local->recplist);
+ if (rc)
+ gpgsm_status2 (ctrl, STATUS_INV_RECP,
+ rc == -1? "1":
+ rc == GNUPG_Ambiguous_Name? "2 ": "0 ",
+ line, NULL);
return map_to_assuan_status (rc);
}
@@ -672,10 +678,14 @@ get_status_string ( int no )
}
-
void
-gpgsm_status (CTRL ctrl, int no, const char *text)
+gpgsm_status2 (CTRL ctrl, int no, ...)
{
+ va_list arg_ptr;
+ const char *text;
+
+ va_start (arg_ptr, no);
+
if (ctrl->no_server)
{
if (ctrl->status_fd == -1)
@@ -699,7 +709,7 @@ gpgsm_status (CTRL ctrl, int no, const char *text)
fputs ("[GNUPG:] ", statusfp);
fputs (get_status_string (no), statusfp);
- if (text)
+ while ( (text = va_arg (arg_ptr, const char*) ))
{
putc ( ' ', statusfp );
for (; *text; text++)
@@ -718,11 +728,30 @@ gpgsm_status (CTRL ctrl, int no, const char *text)
else
{
ASSUAN_CONTEXT ctx = ctrl->server_local->assuan_ctx;
+ char buf[950], *p;
+ size_t n;
- assuan_write_status (ctx, get_status_string (no), text);
+ p = buf;
+ n = 0;
+ while ( (text = va_arg (arg_ptr, const char *)) )
+ {
+ for ( ; *text && n < DIM (buf)-1; n++)
+ *p++ = *text++;
+ }
+ *p = 0;
+ assuan_write_status (ctx, get_status_string (no), buf);
}
+
+ va_end (arg_ptr);
}
+void
+gpgsm_status (CTRL ctrl, int no, const char *text)
+{
+ gpgsm_status2 (ctrl, no, text, NULL);
+}
+
+
#if 0
/*