X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-crypt%2Fcrypt-gpgme.c;h=c5c698688c4b6aeed8a1330d68ee1bda32fa462b;hp=8cb83411e709b77bee4f8ae6bd6c7257c0212c48;hb=676b896e26b7aeef16d95aba7a5ea9322d2dc6e1;hpb=0dbe922d4298aed78dcba64b7c770f315a64505e diff --git a/lib-crypt/crypt-gpgme.c b/lib-crypt/crypt-gpgme.c index 8cb8341..c5c6986 100644 --- a/lib-crypt/crypt-gpgme.c +++ b/lib-crypt/crypt-gpgme.c @@ -12,48 +12,28 @@ * please see the file GPL in the top level source directory. */ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include #ifdef CRYPT_BACKEND_GPGME -#include -#include -#include -#include -#include -#include -#include - #ifdef HAVE_LOCALE_H # include #endif #ifdef HAVE_LANGINFO_D_T_FMT # include #endif -#ifdef HAVE_SYS_TIME_H -# include -#endif #ifdef HAVE_SYS_RESOURCE_H # include #endif #include -#include -#include -#include -#include -#include - #include #include #include #include -#include "mutt.h" #include "lib.h" #include "alias.h" #include @@ -62,6 +42,7 @@ #include "pager.h" #include "recvattach.h" #include "sort.h" +#include "crypt-gpgme.h" /* * Helper macros. @@ -3522,7 +3503,7 @@ static crypt_key_t *crypt_getkeybyaddr (address_t * a, short abilities, } -static crypt_key_t *crypt_getkeybystr (char *p, short abilities, +static crypt_key_t *crypt_getkeybystr (const char *p, short abilities, unsigned int app, int *forced_valid) { string_list_t *hints = NULL; @@ -3636,7 +3617,8 @@ static crypt_key_t *crypt_ask_for_key (char *tag, static char *find_keys (address_t * to, address_t * cc, address_t * bcc, unsigned int app) { - char *keyID, *keylist = NULL, *t; + char *keylist = NULL, *t; + const char *keyID; ssize_t keylist_size = 0; ssize_t keylist_used = 0; address_t *tmp = NULL, *addr = NULL; @@ -3673,7 +3655,7 @@ static char *find_keys (address_t * to, address_t * cc, address_t * bcc, if (fqdn) rfc822_qualify (tmp, fqdn); - tmp = mutt_remove_duplicates (tmp); + address_list_uniq(tmp); for (p = tmp; p; p = p->next) { char buf[LONG_STRING]; @@ -3696,13 +3678,8 @@ static char *find_keys (address_t * to, address_t * cc, address_t * bcc, q = addr; } else { -#if 0 - k_info = crypt_getkeybystr (keyID, KEYFLAG_CANENCRYPT, - *r_application, &forced_valid); -#else k_info = crypt_getkeybystr (keyID, KEYFLAG_CANENCRYPT, app, &forced_valid); -#endif } } else if (r == -1) { @@ -3719,11 +3696,7 @@ static char *find_keys (address_t * to, address_t * cc, address_t * bcc, snprintf (buf, sizeof (buf), _("Enter keyID for %s: "), q->mailbox); if ((key = crypt_ask_for_key (buf, q->mailbox, KEYFLAG_CANENCRYPT, -#if 0 - *r_application, -#else app, -#endif &forced_valid)) == NULL) { p_delete(&keylist); address_list_wipe(&tmp); @@ -3737,13 +3710,6 @@ static char *find_keys (address_t * to, address_t * cc, address_t * bcc, { const char *s = crypt_fpr (key); -#if 0 - if (key->flags & KEYFLAG_ISX509) - *r_application &= ~APPLICATION_PGP; - if (!(key->flags & KEYFLAG_ISX509)) - *r_application &= ~APPLICATION_SMIME; -#endif - keylist_size += m_strlen(s) + 4 + 1; p_realloc(&keylist, keylist_size); sprintf (keylist + keylist_used, "%s0x%s%s", /* __SPRINTF_CHECKED__ */ @@ -3837,11 +3803,6 @@ static int gpgme_send_menu (HEADER * msg, int *redraw, int is_smime) msg->security |= (is_smime ? SMIMESIGN : PGPSIGN); } -#if 0 - else { - msg->security &= (is_smime ? ~SMIMESIGN : ~PGPSIGN); - } -#endif *redraw = REDRAW_FULL; break;