X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pgpkey.c;h=b31676a5ec5985c42f911f36f4929670c25c2f19;hp=2411ee90a2d4889766c9cf08c6e0b33ca372cbe8;hb=2891636277fb96f992eaf08b4e6acc11ca9ea57c;hpb=c98480f8568e6c1bc927c6c5f2b5e80b4aa6548c diff --git a/pgpkey.c b/pgpkey.c index 2411ee9..b31676a 100644 --- a/pgpkey.c +++ b/pgpkey.c @@ -18,12 +18,13 @@ #include #include +#include + #include "mutt.h" #include "enter.h" #include "recvattach.h" #include "mutt_curses.h" #include "mutt_menu.h" -#include "mime.h" #include "pgp.h" #include "pager.h" #include "sort.h" @@ -39,8 +40,6 @@ #include -#ifdef CRYPT_BACKEND_CLASSIC_PGP - struct pgp_cache { char *what; char *dflt; @@ -400,7 +399,7 @@ static int pgp_id_is_valid (pgp_uid_t * uid) #define PGP_KV_MATCH (PGP_KV_ADDR|PGP_KV_STRING) -static int pgp_id_matches_addr (ADDRESS * addr, ADDRESS * u_addr, +static int pgp_id_matches_addr (address_t * addr, address_t * u_addr, pgp_uid_t * uid) { int rv = 0; @@ -422,7 +421,7 @@ static int pgp_id_matches_addr (ADDRESS * addr, ADDRESS * u_addr, return rv; } -static pgp_key_t pgp_select_key (pgp_key_t keys, ADDRESS * p, const char *s) +static pgp_key_t pgp_select_key (pgp_key_t keys, address_t * p, const char *s) { int keymax; pgp_uid_t **KeyTable; @@ -648,7 +647,7 @@ pgp_key_t pgp_ask_for_key (char *tag, char *whatfor, for (l = id_defaults; l; l = l->next) if (!m_strcasecmp(whatfor, l->what)) { - strfcpy (resp, NONULL (l->dflt), sizeof (resp)); + m_strcpy(resp, sizeof(resp), NONULL(l->dflt)); break; } } @@ -661,7 +660,7 @@ pgp_key_t pgp_ask_for_key (char *tag, char *whatfor, if (whatfor) { if (l) - str_replace (&l->dflt, resp); + m_strreplace(&l->dflt, resp); else { l = p_new(struct pgp_cache, 1); l->next = id_defaults; @@ -785,9 +784,9 @@ static pgp_key_t *pgp_get_lastp (pgp_key_t p) return NULL; } -pgp_key_t pgp_getkeybyaddr (ADDRESS * a, short abilities, pgp_ring_t keyring) +pgp_key_t pgp_getkeybyaddr (address_t * a, short abilities, pgp_ring_t keyring) { - ADDRESS *r, *p; + address_t *r, *p; LIST *hints = NULL; int weak = 0; @@ -860,7 +859,7 @@ pgp_key_t pgp_getkeybyaddr (ADDRESS * a, short abilities, pgp_ring_t keyring) this_key_has_weak = 1; } - rfc822_free_address (&r); + address_delete (&r); } if (match && !this_key_has_strong && this_key_has_invalid) @@ -938,7 +937,7 @@ pgp_key_t pgp_getkeybystr (char *p, short abilities, pgp_ring_t keyring) && !m_strcasecmp(p + 2, pgp_keyid (k))) || (option (OPTPGPLONGIDS) && !m_strncasecmp(p, "0x", 2) && !m_strcasecmp(p + 2, k->keyid + 8)) - || str_isstr (a->addr, p)) { + || m_stristr(a->addr, p)) { debug_print (5, ("match.\n")); match = 1; break; @@ -965,6 +964,3 @@ pgp_key_t pgp_getkeybystr (char *p, short abilities, pgp_ring_t keyring) return NULL; } - - -#endif /* CRYPT_BACKEND_CLASSIC_PGP */