1185{
1186 char *certfile = NULL;
1187 struct Buffer *buf = NULL;
1188
1190 if (!fp_err)
1191 {
1193 goto done;
1194 }
1195
1197 if (!fp_out)
1198 {
1200 goto done;
1201 }
1202
1205 if (c_smime_ask_cert_label)
1206 {
1210 {
1211 goto done;
1212 }
1213 }
1214
1217 if (certfile)
1218 {
1220
1222 FILE *fp_smime_in = NULL;
1223 pid_t pid =
smime_invoke(&fp_smime_in, NULL, NULL, -1, fileno(fp_out),
1224 fileno(fp_err), certfile, NULL, NULL, NULL, NULL,
1225 NULL, NULL, c_smime_import_cert_command);
1226 if (pid == -1)
1227 {
1228 mutt_message(
_(
"Error: unable to create OpenSSL subprocess"));
1229 goto done;
1230 }
1232 fputc('\n', fp_smime_in);
1234
1236
1239 }
1240
1241 fflush(fp_out);
1242 rewind(fp_out);
1243 fflush(fp_err);
1244 rewind(fp_err);
1245
1248
1249done:
1253}
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
void mutt_endwin(void)
Shutdown curses.
int mutt_file_copy_stream(FILE *fp_in, FILE *fp_out)
Copy the contents of one file into another.
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
void mutt_file_unlink(const char *s)
Delete a file, carefully.
int filter_wait(pid_t pid)
Wait for the exit of a process and return its status.
int mw_get_field(const char *prompt, struct Buffer *buf, CompletionFlags complete, enum HistoryClass hclass, const struct CompleteOps *comp_api, void *cdata)
Ask the user for a string -.
#define mutt_message(...)
@ HC_OTHER
Miscellaneous strings.
#define MUTT_COMP_NO_FLAGS
No flags are set.
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.
static char * smime_extract_certificate(const char *infile)
Extract an SMIME certificate from a file.
static pid_t smime_invoke(FILE **fp_smime_in, FILE **fp_smime_out, FILE **fp_smime_err, int fp_smime_infd, int fp_smime_outfd, int fp_smime_errfd, const char *fname, const char *sig_fname, const char *cryptalg, const char *digestalg, const char *key, const char *certificates, const char *intermediates, const char *format)
Run an SMIME command.
String manipulation buffer.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
#define mutt_file_mkstemp()