1593{
1594 char buf[1024] = { 0 };
1595 FILE *fp_pgp_in = NULL, *fp_tmp = NULL;
1596 struct Body *t = NULL;
1597 int err = 0;
1598 bool empty = false;
1599 pid_t pid;
1602
1605 if (!fp_out)
1606 {
1608 goto cleanup;
1609 }
1610
1612 if (!fp_pgp_err)
1613 {
1617 goto cleanup;
1618 }
1619
1622 if (!fp_tmp)
1623 {
1628 goto cleanup;
1629 }
1630
1631 if (sign)
1633
1635 fputc('\n', fp_tmp);
1638
1640 fileno(fp_pgp_err),
buf_string(pgpinfile), keylist, sign);
1641 if (pid == -1)
1642 {
1646 goto cleanup;
1647 }
1648
1649 if (sign)
1650 {
1653 fputc('\n', fp_pgp_in);
1654 }
1656
1659 empty = true;
1660
1662
1663 fflush(fp_out);
1664 rewind(fp_out);
1665 if (!empty)
1666 empty = (fgetc(fp_out) == EOF);
1668
1669 fflush(fp_pgp_err);
1670 rewind(fp_pgp_err);
1671 while (fgets(buf, sizeof(buf) - 1, fp_pgp_err))
1672 {
1673 err = 1;
1674 fputs(buf, stdout);
1675 }
1677
1678
1679 if (err)
1681
1682 if (empty)
1683 {
1684
1685 if (sign)
1688 goto cleanup;
1689 }
1690
1697
1700
1705
1715
1716cleanup:
1719 return t;
1720}
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's string.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
int mutt_any_key_to_continue(const char *s)
Prompt the user to 'press any key' and wait.
FILE * mutt_file_fopen(const char *path, const char *mode)
Call fopen() safely.
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
int filter_wait(pid_t pid)
Wait for the exit of a process and return its status.
void pgp_class_void_passphrase(void)
Implements CryptModuleSpecs::void_passphrase() -.
static char PgpPass[1024]
Cached PGP Passphrase.
bool pgp_use_gpg_agent(void)
Does the user want to use the gpg agent?
pid_t pgp_invoke_encrypt(FILE **fp_pgp_in, FILE **fp_pgp_out, FILE **fp_pgp_err, int fd_pgp_in, int fd_pgp_out, int fd_pgp_err, const char *fname, const char *uids, bool sign)
Use PGP to encrypt a file.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
int mutt_write_mime_body(struct Body *a, FILE *fp, struct ConfigSubset *sub)
Write a MIME part.
String manipulation buffer.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
#define mutt_file_mkstemp()