diff options
author | Kevin McCarthy <kevin@8t8.us> | 2019-07-25 19:12:32 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2019-08-03 14:08:09 -0700 |
commit | d0a56a1499d8fb376457334cbf85e3db9b7686aa (patch) | |
tree | 512c4a9c2becae67197b366430bde0743971dc98 /autocrypt | |
parent | 78d028d78112463c522b3447008fecb9bc1242fe (diff) |
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.
Diffstat (limited to 'autocrypt')
-rw-r--r-- | autocrypt/autocrypt.c | 6 |
1 files changed, 5 insertions, 1 deletions
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; |