X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=crypt-gpgme.c;h=e3dd337d672b56a1abcc9cd8d0a4ba3172151069;hp=84bc377cc270d856a0009c8b595a1dc16a3e5b27;hb=decc5c3abbd9004ced0d36059818aa9688491872;hpb=0f44dc85fc1280372ffab911d701e703d803fb4b diff --git a/crypt-gpgme.c b/crypt-gpgme.c index 84bc377..e3dd337 100644 --- a/crypt-gpgme.c +++ b/crypt-gpgme.c @@ -30,6 +30,7 @@ #include "lib/mem.h" #include "lib/intl.h" #include "lib/str.h" +#include "lib/debug.h" #include #include @@ -112,10 +113,10 @@ static gpgme_key_t signature_key = NULL; * General helper functions. */ -/* return true when S pints to a didgit or letter. */ +/* return true when S points to a didgit or letter. */ static int digit_or_letter (const unsigned char *s) { - return ((*s >= '0' && *s < '9') + return ((*s >= '0' && *s <= '9') || (*s >= 'A' && *s <= 'Z') || (*s >= 'a' && *s <= 'z')); } @@ -1311,7 +1312,7 @@ static int verify_one (BODY * sigbdy, STATE * s, gpgme_release (ctx); state_attach_puts (_("[-- End signature information --]\n\n"), s); - dprint (1, (debugfile, "verify_one: returning %d.\n", badsig)); + debug_print (1, ("returning %d.\n", badsig)); return badsig ? 1 : anywarn ? 2 : 0; } @@ -1778,7 +1779,7 @@ void pgp_gpgme_application_handler (BODY * m, STATE * s) char body_charset[STRING]; /* Only used for clearsigned messages. */ - dprint (2, (debugfile, "Entering pgp_application_pgp handler\n")); + debug_print (2, ("Entering pgp_application_pgp handler\n")); /* For clearsigned messages we won't be able to get a character set but we know that this may only be text thus we assume Latin-1 @@ -1983,7 +1984,7 @@ void pgp_gpgme_application_handler (BODY * m, STATE * s) " of PGP message! --]\n\n"), s); return; } - dprint (2, (debugfile, "Leaving pgp_application_pgp handler\n")); + debug_print (2, ("Leaving pgp_application_pgp handler\n")); } /* @@ -1999,7 +2000,7 @@ void pgp_gpgme_encrypted_handler (BODY * a, STATE * s) BODY *orig_body = a; int is_signed; - dprint (2, (debugfile, "Entering pgp_encrypted handler\n")); + debug_print (2, ("Entering pgp_encrypted handler\n")); a = a->parts; if (!a || a->type != TYPEAPPLICATION || !a->subtype || ascii_strcasecmp ("pgp-encrypted", a->subtype) @@ -2064,7 +2065,7 @@ void pgp_gpgme_encrypted_handler (BODY * a, STATE * s) fclose (fpout); mutt_unlink (tempfile); - dprint (2, (debugfile, "Leaving pgp_encrypted handler\n")); + debug_print (2, ("Leaving pgp_encrypted handler\n")); } /* Support for application/smime */ @@ -2076,7 +2077,7 @@ void smime_gpgme_application_handler (BODY * a, STATE * s) int is_signed; - dprint (2, (debugfile, "Entering smime_encrypted handler\n")); + debug_print (2, ("Entering smime_encrypted handler\n")); a->warnsig = 0; mutt_mktemp (tempfile); @@ -2133,7 +2134,7 @@ void smime_gpgme_application_handler (BODY * a, STATE * s) fclose (fpout); mutt_unlink (tempfile); - dprint (2, (debugfile, "Leaving smime_encrypted handler\n")); + debug_print (2, ("Leaving smime_encrypted handler\n")); } @@ -2960,7 +2961,7 @@ static void verify_key (crypt_key_t * key) mutt_mktemp (tempfile); if (!(fp = safe_fopen (tempfile, "w"))) { - mutt_perror _("Can't create temporary file"); + mutt_perror (_("Can't create temporary file")); return; } @@ -3455,16 +3456,13 @@ static crypt_key_t *crypt_getkeybyaddr (ADDRESS * a, short abilities, if (!keys) return NULL; - dprint (5, (debugfile, "crypt_getkeybyaddr: looking for %s <%s>.", - a->personal, a->mailbox)); + debug_print (5, ("looking for %s <%s>.\n", a->personal, a->mailbox)); for (k = keys; k; k = k->next) { - dprint (5, (debugfile, " looking at key: %s `%.15s'\n", - crypt_keyid (k), k->uid)); + debug_print (5, (" looking at key: %s `%.15s'\n", crypt_keyid (k), k->uid)); if (abilities && !(k->flags & abilities)) { - dprint (5, (debugfile, " insufficient abilities: Has %x, want %x\n", - k->flags, abilities)); + debug_print (5, (" insufficient abilities: Has %x, want %x\n", k->flags, abilities)); continue; } @@ -3568,8 +3566,7 @@ static crypt_key_t *crypt_getkeybystr (char *p, short abilities, continue; match = 0; - dprint (5, (debugfile, "crypt_getkeybystr: matching \"%s\" against " - "key %s, \"%s\": ", p, crypt_keyid (k), k->uid)); + debug_print (5, ("matching \"%s\" against " "key %s, \"%s\":\n", p, crypt_keyid (k), k->uid)); if (!*p || !safe_strcasecmp (p, crypt_keyid (k)) || (!safe_strncasecmp (p, "0x", 2) @@ -3580,7 +3577,7 @@ static crypt_key_t *crypt_getkeybystr (char *p, short abilities, || str_isstr (k->uid, p)) { crypt_key_t *tmp; - dprint (5, (debugfile, "match.\n")); + debug_print (5, ("match.\n")); *matches_endp = tmp = crypt_copy_key (k); matches_endp = &tmp->next;