1
0
Fork 0
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:
Werner Koch 2001-11-24 14:26:27 +00:00
parent 757c13a171
commit 8e58435312
6 changed files with 148 additions and 19 deletions

View file

@ -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;
}