X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-crypt%2Fcrypt-gpgme.c;h=5be0147054917dc18500ca2e9b88fabf42a39baf;hp=809cec0590b10252b58df8335b4fcc4b95ba26a0;hb=10e80e482eff3762b0b8d41b0c7795b76704479c;hpb=9c29247938d64f721db448824a1121ef47ad2869 diff --git a/lib-crypt/crypt-gpgme.c b/lib-crypt/crypt-gpgme.c index 809cec0..5be0147 100644 --- a/lib-crypt/crypt-gpgme.c +++ b/lib-crypt/crypt-gpgme.c @@ -23,22 +23,22 @@ #include #include #include +#include #include #include #include +#include #include "mutt.h" #include -#include "mutt_menu.h" #include "handler.h" #include "copy.h" #include "pager.h" #include "recvattach.h" #include "sort.h" -#include "lib/debug.h" #include #include @@ -3018,12 +3018,12 @@ leave: */ -/* Convert LIST into a pattern string suitable to be passed to GPGME. +/* Convert string_list_t into a pattern string suitable to be passed to GPGME. We need to convert spaces in an item into a '+' and '%' into "%25". */ -static char *list_to_pattern (LIST * list) +static char *list_to_pattern (string_list_t * list) { - LIST *l; + string_list_t *l; char *pattern, *p; const char *s; size_t n; @@ -3068,7 +3068,7 @@ static char *list_to_pattern (LIST * list) /* Return a list of keys which are candidates for the selection. Select by looking at the HINTS list. */ -static crypt_key_t *get_candidates (LIST * hints, unsigned int app, +static crypt_key_t *get_candidates (string_list_t * hints, unsigned int app, int secret) { crypt_key_t *db, *k, **kend; @@ -3098,7 +3098,7 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app, depending on the protocol. For gpg we don' t need percent escaped pappert but simple strings passed in an array to the keylist_ext_start function. */ - LIST *l; + string_list_t *l; size_t n; char **patarr; @@ -3212,7 +3212,7 @@ static crypt_key_t *get_candidates (LIST * hints, unsigned int app, /* Add the string STR to the list HINTS. This list is later used to match addresses. */ -static LIST *crypt_add_string_to_hints (LIST * hints, const char *str) +static string_list_t *crypt_add_string_to_hints (string_list_t * hints, const char *str) { char *scratch; char *t; @@ -3429,7 +3429,7 @@ static crypt_key_t *crypt_getkeybyaddr (address_t * a, short abilities, unsigned int app, int *forced_valid) { address_t *r, *p; - LIST *hints = NULL; + string_list_t *hints = NULL; int weak = 0; int invalid = 0; @@ -3454,7 +3454,7 @@ static crypt_key_t *crypt_getkeybyaddr (address_t * a, short abilities, mutt_message (_("Looking for keys matching \"%s\"..."), a->mailbox); keys = get_candidates (hints, app, (abilities & KEYFLAG_CANSIGN)); - mutt_free_list (&hints); + string_list_wipe(&hints); if (!keys) return NULL; @@ -3498,7 +3498,7 @@ static crypt_key_t *crypt_getkeybyaddr (address_t * a, short abilities, || !(validity & CRYPT_KV_ADDR))) this_key_has_weak = 1; } - address_delete (&r); + address_list_wipe(&r); if (match) { crypt_key_t *tmp; @@ -3546,7 +3546,7 @@ static crypt_key_t *crypt_getkeybyaddr (address_t * a, short abilities, static crypt_key_t *crypt_getkeybystr (char *p, short abilities, unsigned int app, int *forced_valid) { - LIST *hints = NULL; + string_list_t *hints = NULL; crypt_key_t *keys; crypt_key_t *matches = NULL; crypt_key_t **matches_endp = &matches; @@ -3559,7 +3559,7 @@ static crypt_key_t *crypt_getkeybystr (char *p, short abilities, hints = crypt_add_string_to_hints (hints, p); keys = get_candidates (hints, app, (abilities & KEYFLAG_CANSIGN)); - mutt_free_list (&hints); + string_list_wipe(&hints); if (!keys) return NULL; @@ -3731,8 +3731,8 @@ static char *find_keys (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; } } @@ -3750,8 +3750,8 @@ static char *find_keys (address_t * to, address_t * cc, address_t * bcc, #endif &forced_valid)) == NULL) { p_delete(&keylist); - address_delete (&tmp); - address_delete (&addr); + address_list_wipe(&tmp); + address_list_wipe(&addr); return NULL; } } @@ -3776,9 +3776,9 @@ static char *find_keys (address_t * to, address_t * cc, address_t * bcc, keylist_used = m_strlen(keylist); crypt_free_key (&key); - address_delete (&addr); + address_list_wipe(&addr); } - address_delete (&tmp); + address_list_wipe(&tmp); return (keylist); }