Don't set an empty peer.gossip_keydata with a value that matches the
current peer.keydata. This just wastes space.
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;