#include <lib-lib/macros.h>
#include <lib-lib/file.h>
+#include <lib-mime/mime.h>
+
#include "mutt.h"
#include "mutt_crypt.h"
#include "mutt_menu.h"
#include "mutt_curses.h"
#include "handler.h"
#include "enter.h"
-#include "mime.h"
#include "copy.h"
#include "pager.h"
#include "recvattach.h"
/* Return a bit vector describing how well the addresses ADDR and
U_ADDR match and whether KEY is valid. */
-static int crypt_id_matches_addr (ADDRESS * addr, ADDRESS * u_addr,
+static int crypt_id_matches_addr (address_t * addr, address_t * u_addr,
crypt_key_t * key)
{
int rv = 0;
will be set to true on return if the user did override the the
key's validity. */
static crypt_key_t *crypt_select_key (crypt_key_t * keys,
- ADDRESS * p, const char *s,
+ address_t * p, const char *s,
unsigned int app, int *forced_valid)
{
int keymax;
return k;
}
-static crypt_key_t *crypt_getkeybyaddr (ADDRESS * a, short abilities,
+static crypt_key_t *crypt_getkeybyaddr (address_t * a, short abilities,
unsigned int app, int *forced_valid)
{
- ADDRESS *r, *p;
+ address_t *r, *p;
LIST *hints = NULL;
int weak = 0;
|| !(validity & CRYPT_KV_ADDR)))
this_key_has_weak = 1;
}
- rfc822_free_address (&r);
+ address_delete (&r);
if (match) {
crypt_key_t *tmp;
if (whatfor) {
if (l)
- str_replace (&l->dflt, resp);
+ m_strreplace(&l->dflt, resp);
else {
l = p_new(struct crypt_cache, 1);
l->next = id_defaults;
/* 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. */
-static char *find_keys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc,
+static char *find_keys (address_t * to, address_t * cc, address_t * bcc,
unsigned int app)
{
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;
crypt_key_t *k_info, *key;
const char *fqdn = mutt_fqdn (1);
abort ();
}
- *last = rfc822_cpy_adr (p);
+ *last = address_list_dup (p);
while (*last)
last = &((*last)->next);
}
}
else if (r == -1) {
p_delete(&keylist);
- rfc822_free_address (&tmp);
- rfc822_free_address (&addr);
+ address_delete (&tmp);
+ address_delete (&addr);
return NULL;
}
}
#endif
&forced_valid)) == NULL) {
p_delete(&keylist);
- rfc822_free_address (&tmp);
- rfc822_free_address (&addr);
+ address_delete (&tmp);
+ address_delete (&addr);
return NULL;
}
}
keylist_used = m_strlen(keylist);
crypt_free_key (&key);
- rfc822_free_address (&addr);
+ address_delete (&addr);
}
- rfc822_free_address (&tmp);
+ address_delete (&tmp);
return (keylist);
}
-char *pgp_gpgme_findkeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc)
+char *pgp_gpgme_findkeys (address_t * to, address_t * cc, address_t * bcc)
{
return find_keys (to, cc, bcc, APPLICATION_PGP);
}
-char *smime_gpgme_findkeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc)
+char *smime_gpgme_findkeys (address_t * to, address_t * cc, address_t * bcc)
{
return find_keys (to, cc, bcc, APPLICATION_SMIME);
}
is_smime ? APPLICATION_SMIME :
APPLICATION_PGP, NULL))) {
snprintf (input_signas, sizeof (input_signas), "0x%s", crypt_keyid (p));
- str_replace (is_smime ? &SmimeDefaultKey : &PgpSignAs,
+ m_strreplace(is_smime ? &SmimeDefaultKey : &PgpSignAs,
input_signas);
crypt_free_key (&p);
static int verify_sender (HEADER * h, gpgme_protocol_t protocol)
{
- ADDRESS *sender = NULL;
+ address_t *sender = NULL;
unsigned int ret = 1;
if (h->env->from) {