diff options
Diffstat (limited to 'gpg-interface.c')
-rw-r--r-- | gpg-interface.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/gpg-interface.c b/gpg-interface.c index 854c1e56a3..c98035dffa 100644 --- a/gpg-interface.c +++ b/gpg-interface.c @@ -229,29 +229,13 @@ int verify_signed_buffer(const char *payload, size_t payload_size, "--status-fd=1", "--verify", temp.filename.buf, "-", NULL); - gpg.in = -1; - gpg.out = -1; - if (gpg_output) - gpg.err = -1; - if (start_command(&gpg)) { - delete_tempfile(&temp); - return error(_("could not run gpg.")); - } - sigchain_push(SIGPIPE, SIG_IGN); - write_in_full(gpg.in, payload, payload_size); - close(gpg.in); - - if (gpg_output) { - strbuf_read(gpg_output, gpg.err, 0); - close(gpg.err); - } if (!gpg_status) gpg_status = &buf; - strbuf_read(gpg_status, gpg.out, 0); - close(gpg.out); - ret = finish_command(&gpg); + sigchain_push(SIGPIPE, SIG_IGN); + ret = pipe_command(&gpg, payload, payload_size, + gpg_status, 0, gpg_output, 0); sigchain_pop(SIGPIPE); delete_tempfile(&temp); |