From: Kevin McCarthy Date: Fri, 26 Jul 2019 02:12:32 +0000 (-0700) Subject: Slightly improve the gossip header key update X-Git-Tag: 2019-10-25~97^2~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bf72171b5810d0a51daf4fe7267b2d2a3df97b00;p=neomutt Slightly improve the gossip header key update Don't set an empty peer.gossip_keydata with a value that matches the current peer.keydata. This just wastes space. Co-authored-by: Richard Russon --- diff --git a/autocrypt/autocrypt.c b/autocrypt/autocrypt.c index 500bb706a..276e53e64 100644 --- a/autocrypt/autocrypt.c +++ b/autocrypt/autocrypt.c @@ -390,7 +390,11 @@ int mutt_autocrypt_process_gossip_header(struct Email *hdr, struct Envelope *pro update_db = 1; peer->gossip_timestamp = hdr->date_sent; - if (mutt_str_strcmp(peer->gossip_keydata, ac_hdr->keydata)) + /* This is slightly different from the autocrypt 1.1 spec. + * Avoid setting an empty peer.gossip_keydata with a value that matches + * the current peer.keydata. */ + if ((peer->gossip_keydata && mutt_str_strcmp(peer->gossip_keydata, ac_hdr->keydata)) || + (!peer->gossip_keydata && mutt_str_strcmp(peer->keydata, ac_hdr->keydata))) { import_gpg = 1; insert_db_history = 1;