X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pgp.c;h=e198331061d5882bc3391825ab1401fcb5cbdb26;hp=6bd70f296cdd038f7c345f18517aa9a0ac443811;hb=c88f8ebd5e7542e4ee2ac2c24dfd5f358dbb4235;hpb=9274cbe8e6410ddb95ddc667faa678a29da85420 diff --git a/pgp.c b/pgp.c index 6bd70f2..e198331 100644 --- a/pgp.c +++ b/pgp.c @@ -25,13 +25,15 @@ #include #include #include +#include + +#include #include "mutt.h" #include "enter.h" #include "handler.h" #include "mutt_curses.h" #include "pgp.h" -#include "mime.h" #include "copy.h" #include "attach.h" @@ -206,11 +208,11 @@ static void pgp_copy_clearsigned (FILE * fpin, STATE * s, char *charset) continue; } - if (str_cmp (buf, "-----BEGIN PGP SIGNATURE-----\n") == 0) + if (m_strcmp(buf, "-----BEGIN PGP SIGNATURE-----\n") == 0) break; if (armor_header) { - char *p = str_skip_initws (buf); + char *p = vskipspaces(buf); if (*p == '\0') armor_header = 0; @@ -268,18 +270,18 @@ int pgp_application_pgp_handler (BODY * m, STATE * s) bytes -= (offset - last_pos); /* don't rely on m_strlen(buf) */ last_pos = offset; - if (str_ncmp ("-----BEGIN PGP ", buf, 15) == 0) { + if (m_strncmp("-----BEGIN PGP ", buf, 15) == 0) { clearsign = 0; start_pos = last_pos; - if (str_cmp ("MESSAGE-----\n", buf + 15) == 0) + if (m_strcmp("MESSAGE-----\n", buf + 15) == 0) needpass = 1; - else if (str_cmp ("SIGNED MESSAGE-----\n", buf + 15) == 0) { + else if (m_strcmp("SIGNED MESSAGE-----\n", buf + 15) == 0) { clearsign = 1; needpass = 0; } else if (!option (OPTDONTHANDLEPGPKEYS) && - str_cmp ("PUBLIC KEY BLOCK-----\n", buf + 15) == 0) { + m_strcmp("PUBLIC KEY BLOCK-----\n", buf + 15) == 0) { needpass = 0; pgp_keyblock = 1; } @@ -309,10 +311,10 @@ int pgp_application_pgp_handler (BODY * m, STATE * s) fputs (buf, tmpfp); if ((needpass - && str_cmp ("-----END PGP MESSAGE-----\n", buf) == 0) + && m_strcmp("-----END PGP MESSAGE-----\n", buf) == 0) || (!needpass - && (str_cmp ("-----END PGP SIGNATURE-----\n", buf) == 0 - || str_cmp ("-----END PGP PUBLIC KEY BLOCK-----\n", + && (m_strcmp("-----END PGP SIGNATURE-----\n", buf) == 0 + || m_strcmp("-----END PGP PUBLIC KEY BLOCK-----\n", buf) == 0))) break; } @@ -506,12 +508,12 @@ static int pgp_check_traditional_one_body (FILE * fp, BODY * b, } while (fgets (buf, sizeof (buf), tfp)) { - if (str_ncmp ("-----BEGIN PGP ", buf, 15) == 0) { - if (str_cmp ("MESSAGE-----\n", buf + 15) == 0) + if (m_strncmp("-----BEGIN PGP ", buf, 15) == 0) { + if (m_strcmp("MESSAGE-----\n", buf + 15) == 0) enc = 1; - else if (str_cmp ("SIGNED MESSAGE-----\n", buf + 15) == 0) + else if (m_strcmp("SIGNED MESSAGE-----\n", buf + 15) == 0) sgn = 1; - else if (str_cmp ("PUBLIC KEY BLOCK-----\n", buf + 15) == 0) + else if (m_strcmp("PUBLIC KEY BLOCK-----\n", buf + 15) == 0) key = 1; } } @@ -993,9 +995,9 @@ BODY *pgp_sign_message (BODY * a) * recommended for future releases of PGP. */ while (fgets (buffer, sizeof (buffer) - 1, pgpout) != NULL) { - if (str_cmp ("-----BEGIN PGP MESSAGE-----\n", buffer) == 0) + if (m_strcmp("-----BEGIN PGP MESSAGE-----\n", buffer) == 0) fputs ("-----BEGIN PGP SIGNATURE-----\n", fp); - else if (str_cmp ("-----END PGP MESSAGE-----\n", buffer) == 0) + else if (m_strcmp("-----END PGP MESSAGE-----\n", buffer) == 0) fputs ("-----END PGP SIGNATURE-----\n", fp); else fputs (buffer, fp); @@ -1076,14 +1078,14 @@ static short is_numerical_keyid (const char *s) /* This routine attempts to find the keyids of the recipients of a message. * It returns NULL if any of the keys can not be found. */ -char *pgp_findKeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc) +char *pgp_findKeys (address_t * to, address_t * cc, address_t * bcc) { char *keyID, *keylist = NULL, *t; size_t keylist_size = 0; size_t keylist_used = 0; - ADDRESS *tmp = NULL, *addr = NULL; - ADDRESS **last = &tmp; - ADDRESS *p, *q; + address_t *tmp = NULL, *addr = NULL; + address_t **last = &tmp; + address_t *p, *q; int i; pgp_key_t k_info = NULL, key = NULL;