X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-crypt%2Fpgp.c;h=bb55885116d6b17eb999f3fa0c547cfc7e9b007e;hp=7982dca5fe9171d09e38588ff5b232e1e5c8266c;hb=2293e9bc5a94ef33dc596b064c607d6bed5ad1fd;hpb=dbb9a1e16d03a2d4664d6dc6a30c721b889d4982 diff --git a/lib-crypt/pgp.c b/lib-crypt/pgp.c index 7982dca..bb55885 100644 --- a/lib-crypt/pgp.c +++ b/lib-crypt/pgp.c @@ -30,15 +30,15 @@ #include #include +#include +#include #include "mutt.h" -#include "enter.h" #include "handler.h" #include "pgp.h" #include "copy.h" #include "attach.h" -#include "lib/debug.h" #include #include @@ -61,7 +61,6 @@ #endif #include "crypt.h" -#include "mutt_menu.h" char PgpPass[LONG_STRING]; @@ -69,7 +68,7 @@ time_t PgpExptime = 0; /* when does the cached passphrase expire? */ void pgp_void_passphrase (void) { - p_clear(PgpPass, sizeof(PgpPass)); + p_clear(PgpPass, countof(PgpPass)); PgpExptime = 0; } @@ -148,15 +147,12 @@ static int pgp_copy_checksig (FILE * fpin, FILE * fpout) 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; @@ -166,7 +162,6 @@ static int pgp_copy_checksig (FILE * fpin, FILE * fpout) p_delete(&line); } else { - debug_print (2, ("No pattern.\n")); mutt_copy_stream (fpin, fpout); rv = 1; } @@ -192,7 +187,7 @@ static void pgp_copy_clearsigned (FILE * fpin, STATE * s, char *charset) char buf[HUGE_STRING]; short complete, armor_header; - FGETCONV *fc; + fgetconv_t *fc; rewind (fpin); @@ -419,8 +414,7 @@ int pgp_application_pgp_handler (BODY * m, STATE * s) pgp_copy_clearsigned (tmpfp, s, body_charset); } else if (pgpout) { - FGETCONV *fc; - int c; + fgetconv_t *fc; rewind (pgpout); state_set_prefix (s); @@ -602,8 +596,6 @@ int pgp_verify_one (BODY * sigbdy, STATE * s, const char *tempfile) if ((rv = mutt_wait_filter (thepid))) badsig = -1; - - debug_print (1, ("mutt_wait_filter returned %d.\n", rv)); } safe_fclose (&pgperr); @@ -613,8 +605,6 @@ int pgp_verify_one (BODY * sigbdy, STATE * s, const char *tempfile) mutt_unlink (sigfile); mutt_unlink (pgperrfile); - debug_print (1, ("returning %d.\n", badsig)); - return badsig; } @@ -1145,8 +1135,8 @@ char *pgp_findKeys (address_t * to, address_t * cc, address_t * bcc) } else if (r == -1) { p_delete(&keylist); - address_delete (&tmp); - address_delete (&addr); + address_list_wipe(&tmp); + address_list_wipe(&addr); return NULL; } } @@ -1162,8 +1152,8 @@ char *pgp_findKeys (address_t * to, address_t * cc, address_t * bcc) 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; } } @@ -1180,10 +1170,10 @@ char *pgp_findKeys (address_t * to, address_t * cc, address_t * bcc) 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); } @@ -1358,9 +1348,9 @@ BODY *pgp_traditional_encryptsign (BODY * a, int flags, char *keylist) 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";