summaryrefslogtreecommitdiffstats
path: root/autocrypt
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2019-07-24 18:59:07 -0700
committerKevin McCarthy <kevin@8t8.us>2019-08-03 14:08:09 -0700
commit78d028d78112463c522b3447008fecb9bc1242fe (patch)
tree9ad003808fb8a277a6a8f9f646ead91716bf811f /autocrypt
parent963fc1ba4795ec65083741adf7b649d997fd58b7 (diff)
Fix process_gossip_headers() to look at the right envelope.
Diffstat (limited to 'autocrypt')
-rw-r--r--autocrypt/autocrypt.c9
-rw-r--r--autocrypt/autocrypt.h2
2 files changed, 7 insertions, 4 deletions
diff --git a/autocrypt/autocrypt.c b/autocrypt/autocrypt.c
index 7ac2bd5f..d56d70ea 100644
--- a/autocrypt/autocrypt.c
+++ b/autocrypt/autocrypt.c
@@ -305,8 +305,9 @@ cleanup:
return rv;
}
-int mutt_autocrypt_process_gossip_header (HEADER *hdr, ENVELOPE *env)
+int mutt_autocrypt_process_gossip_header (HEADER *hdr, ENVELOPE *prot_headers)
{
+ ENVELOPE *env;
AUTOCRYPTHDR *ac_hdr;
struct timeval now;
AUTOCRYPT_PEER *peer = NULL;
@@ -322,9 +323,11 @@ int mutt_autocrypt_process_gossip_header (HEADER *hdr, ENVELOPE *env)
if (mutt_autocrypt_init (0))
return -1;
- if (!hdr || !hdr->content || !env)
+ if (!hdr || !hdr->env || !prot_headers)
return 0;
+ env = hdr->env;
+
if (!env->from)
return 0;
@@ -342,7 +345,7 @@ int mutt_autocrypt_process_gossip_header (HEADER *hdr, ENVELOPE *env)
rfc822_append (last ? &last : &recips, env->reply_to, 0);
mutt_autocrypt_db_normalize_addrlist (recips);
- for (ac_hdr = env->autocrypt_gossip; ac_hdr; ac_hdr = ac_hdr->next)
+ for (ac_hdr = prot_headers->autocrypt_gossip; ac_hdr; ac_hdr = ac_hdr->next)
{
if (ac_hdr->invalid)
continue;
diff --git a/autocrypt/autocrypt.h b/autocrypt/autocrypt.h
index 83c5f7c8..78779777 100644
--- a/autocrypt/autocrypt.h
+++ b/autocrypt/autocrypt.h
@@ -74,7 +74,7 @@ typedef enum
int mutt_autocrypt_init (int);
void mutt_autocrypt_cleanup (void);
int mutt_autocrypt_process_autocrypt_header (HEADER *hdr, ENVELOPE *env);
-int mutt_autocrypt_process_gossip_header (HEADER *hdr, ENVELOPE *env);
+int mutt_autocrypt_process_gossip_header (HEADER *hdr, ENVELOPE *prot_headers);
autocrypt_rec_t mutt_autocrypt_ui_recommendation (HEADER *hdr, char **keylist);
int mutt_autocrypt_set_sign_as_default_key (HEADER *hdr);
int mutt_autocrypt_write_autocrypt_header (ENVELOPE *env, FILE *fp);