#include <lib-mime/mime.h>
+#include <lib-ui/curses.h>
+#include <lib-ui/enter.h>
+#include <lib-ui/menu.h>
+
#include "mutt.h"
-#include "enter.h"
#include "handler.h"
-#include "mutt_curses.h"
#include "pgp.h"
#include "copy.h"
#include "attach.h"
-#include "lib/debug.h"
#include <sys/wait.h>
#include <string.h>
#endif
#include "crypt.h"
-#include "mutt_menu.h"
char PgpPass[LONG_STRING];
void pgp_void_passphrase (void)
{
- p_clear(PgpPass, sizeof(PgpPass));
+ p_clear(PgpPass, countof(PgpPass));
PgpExptime = 0;
}
if (PgpGoodSign.pattern) {
char *line = NULL;
int lineno = 0;
- size_t linelen;
+ ssize_t linelen;
while ((line = mutt_read_line (line, &linelen, fpin, &lineno)) != NULL) {
if (regexec (PgpGoodSign.rx, line, 0, NULL, 0) == 0) {
- debug_print (2, ("\"%s\" matches regexp.\n", line));
rv = 0;
}
- else
- debug_print (2, ("\"%s\" doesn't match regexp.\n", line));
if (strncmp (line, "[GNUPG:] ", 9) == 0)
continue;
p_delete(&line);
}
else {
- debug_print (2, ("No pattern.\n"));
mutt_copy_stream (fpin, fpout);
rv = 1;
}
char buf[HUGE_STRING];
short complete, armor_header;
- FGETCONV *fc;
+ fgetconv_t *fc;
rewind (fpin);
pgp_copy_clearsigned (tmpfp, s, body_charset);
}
else if (pgpout) {
- FGETCONV *fc;
- int c;
+ fgetconv_t *fc;
rewind (pgpout);
state_set_prefix (s);
/* fix the content type */
- mutt_set_parameter ("format", "fixed", &b->parameter);
+ parameter_setval(&b->parameter, "format", "fixed");
if (enc)
- mutt_set_parameter ("x-action", "pgp-encrypted", &b->parameter);
+ parameter_setval(&b->parameter, "x-action", "pgp-encrypted");
else if (sgn)
- mutt_set_parameter ("x-action", "pgp-signed", &b->parameter);
+ parameter_setval(&b->parameter, "x-action", "pgp-signed");
else if (key)
- mutt_set_parameter ("x-action", "pgp-keys", &b->parameter);
+ parameter_setval(&b->parameter, "x-action", "pgp-keys");
return 1;
}
if ((rv = mutt_wait_filter (thepid)))
badsig = -1;
-
- debug_print (1, ("mutt_wait_filter returned %d.\n", rv));
}
safe_fclose (&pgperr);
mutt_unlink (sigfile);
mutt_unlink (pgperrfile);
- debug_print (1, ("returning %d.\n", badsig));
-
return badsig;
}
t->use_disp = 0;
t->disposition = DISPINLINE;
- mutt_generate_boundary (&t->parameter);
- mutt_set_parameter ("protocol", "application/pgp-signature", &t->parameter);
- mutt_set_parameter ("micalg", pgp_micalg (sigfile), &t->parameter);
+ parameter_set_boundary(&t->parameter);
+ parameter_setval(&t->parameter, "protocol", "application/pgp-signature");
+ parameter_setval(&t->parameter, "micalg", pgp_micalg (sigfile));
t->parts = a;
a = t;
}
else if (r == -1) {
p_delete(&keylist);
- address_delete (&tmp);
- address_delete (&addr);
+ address_list_wipe(&tmp);
+ address_list_wipe(&addr);
return NULL;
}
}
if ((key = pgp_ask_for_key (buf, q->mailbox,
KEYFLAG_CANENCRYPT, PGP_PUBRING)) == NULL) {
p_delete(&keylist);
- address_delete (&tmp);
- address_delete (&addr);
+ address_list_wipe(&tmp);
+ address_list_wipe(&addr);
return NULL;
}
}
keylist_used = m_strlen(keylist);
pgp_free_key (&key);
- address_delete (&addr);
+ address_list_wipe(&addr);
}
- address_delete (&tmp);
+ address_list_wipe(&tmp);
return (keylist);
}
t->use_disp = 0;
t->disposition = DISPINLINE;
- mutt_generate_boundary (&t->parameter);
- mutt_set_parameter ("protocol", "application/pgp-encrypted", &t->parameter);
+ parameter_set_boundary(&t->parameter);
+ parameter_setval(&t->parameter, "protocol", "application/pgp-encrypted");
t->parts = mutt_new_body ();
t->parts->type = TYPEAPPLICATION;
else
from_charset = Charset;
- if (!mutt_is_us_ascii (body_charset)) {
+ if (!charset_is_us_ascii (body_charset)) {
int c;
- FGETCONV *fc;
+ fgetconv_t *fc;
if (flags & ENCRYPT)
send_charset = "us-ascii";
b->type = TYPETEXT;
b->subtype = m_strdup("plain");
- mutt_set_parameter ("x-action",
- flags & ENCRYPT ? "pgp-encrypted" : "pgp-signed",
- &b->parameter);
- mutt_set_parameter ("charset", send_charset, &b->parameter);
+ parameter_setval(&b->parameter, "x-action",
+ flags & ENCRYPT ? "pgp-encrypted" : "pgp-signed");
+ parameter_setval(&b->parameter, "charset", send_charset);
b->filename = m_strdup(pgpoutfile);
-#if 0
- /* The following is intended to give a clue to some completely brain-dead
- * "mail environments" which are typically used by large corporations.
- */
-
- b->d_filename = m_strdup("msg.pgp");
- b->use_disp = 1;
-
-#endif
-
b->disposition = DISPINLINE;
b->unlink = 1;