mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
Signing does now work. There is no secret key management yet, so you
should set GPGSM_FAKE_KEY=1 before you try to verify a signature created by gpgsm --sign or the SIGN server command.
This commit is contained in:
parent
757c13a171
commit
8e58435312
6 changed files with 148 additions and 19 deletions
27
sm/server.c
27
sm/server.c
|
@ -128,15 +128,34 @@ cmd_verify (ASSUAN_CONTEXT ctx, char *line)
|
|||
}
|
||||
|
||||
|
||||
/* SIGN
|
||||
/* SIGN [--detached]
|
||||
|
||||
FIXME */
|
||||
Sign the data set with the INPUT command and write it to the sink
|
||||
set by OUTPUT. with "--detached" specified, a detached signature is
|
||||
created (surprise). */
|
||||
static int
|
||||
cmd_sign (ASSUAN_CONTEXT ctx, char *line)
|
||||
{
|
||||
|
||||
int inp_fd, out_fd;
|
||||
FILE *out_fp;
|
||||
int detached;
|
||||
|
||||
return set_error (Not_Implemented, "fixme");
|
||||
inp_fd = assuan_get_input_fd (ctx);
|
||||
if (inp_fd == -1)
|
||||
return set_error (No_Input, NULL);
|
||||
out_fd = assuan_get_output_fd (ctx);
|
||||
if (out_fd == -1)
|
||||
return set_error (No_Output, NULL);
|
||||
|
||||
detached = !!strstr (line, "--detached"); /* fixme: this is ambiguous */
|
||||
|
||||
out_fp = fdopen ( dup(out_fd), "w");
|
||||
if (!out_fp)
|
||||
return set_error (General_Error, "fdopen() failed");
|
||||
gpgsm_sign (assuan_get_pointer (ctx), inp_fd, detached, out_fp);
|
||||
fclose (out_fp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue