1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

Made decryption work in --server mode, allow output of plain base64,

allow --armor and --base64 arguments for INPUT and OUTPUT, new global
option --base64, cleaned up the help page.
This commit is contained in:
Werner Koch 2001-12-13 09:09:11 +00:00
parent 717bc63ad2
commit 9e241878a6
4 changed files with 76 additions and 35 deletions

View file

@ -203,9 +203,25 @@ cmd_encrypt (ASSUAN_CONTEXT ctx, char *line)
static int
cmd_decrypt (ASSUAN_CONTEXT ctx, char *line)
{
CTRL ctrl = assuan_get_pointer (ctx);
int inp_fd, out_fd;
FILE *out_fp;
int rc;
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);
out_fp = fdopen ( dup(out_fd), "w");
if (!out_fp)
return set_error (General_Error, "fdopen() failed");
rc = gpgsm_decrypt (ctrl, inp_fd, out_fp);
fclose (out_fp);
return rc_to_assuan_status (rc);
}
@ -395,6 +411,7 @@ gpgsm_server (void)
assuan_strerror(rc));
gpgsm_exit (2);
}
assuan_set_hello_line (ctx, "GNU Privacy Guard's S/M server ready");
assuan_register_reset_notify (ctx, reset_notify);
assuan_register_input_notify (ctx, input_notify);