From: Kevin McCarthy Date: Fri, 26 Jul 2019 02:12:32 +0000 (-0700) Subject: Slightly improve the gossip header key update. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d0a56a1499d8fb376457334cbf85e3db9b7686aa;p=mutt 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. --- diff --git a/autocrypt/autocrypt.c b/autocrypt/autocrypt.c index d56d70ea..f53f8748 100644 --- a/autocrypt/autocrypt.c +++ b/autocrypt/autocrypt.c @@ -377,7 +377,11 @@ int mutt_autocrypt_process_gossip_header (HEADER *hdr, ENVELOPE *prot_headers) update_db = 1; peer->gossip_timestamp = hdr->date_sent; - if (mutt_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_strcmp (peer->gossip_keydata, ac_hdr->keydata)) || + (!peer->gossip_keydata && mutt_strcmp (peer->keydata, ac_hdr->keydata))) { import_gpg = 1; insert_db_history = 1;