--- a/mail/extensions/openpgp/content/ui/enigmailMessengerOverlay.js
+++ b/mail/extensions/openpgp/content/ui/enigmailMessengerOverlay.js
@@ -2830,49 +2830,43 @@ Enigmail.msg = {
}
let errorMsgObj = {};
let preview = await EnigmailKey.getKeyListFromKeyBlock(
keyData,
errorMsgObj,
true,
true,
- false
+ true
);
// If we cannot analyze the keyblock, or if it's empty, or if we
// got an error message, then the key is bad and shouldn't be used.
if (!preview || !preview.length || errorMsgObj.value) {
return;
}
this.fetchParticipants();
for (let newKey of preview) {
- let keyDataOneKey = await RNP.getOnePubKeyFromKeyBlock(
- keyData,
- newKey.fpr,
- false
- );
-
let oldKey = EnigmailKeyRing.getKeyById(newKey.fpr);
if (!oldKey) {
// If the key is unknown, an expired key cannot help us
// for anything new, so don't use it.
if (newKey.keyTrust == "e") {
continue;
}
// Potentially merge the revocation into CollectedKeysDB, it if
// already has that key.
if (newKey.keyTrust == "r") {
let db = await CollectedKeysDB.getInstance();
let existing = await db.findKeyForFingerprint(newKey.fpr);
if (existing) {
- let key = await db.mergeExisting(newKey, keyDataOneKey, {
+ let key = await db.mergeExisting(newKey, newKey.pubKey, {
uri: `mid:${gMessageDisplay.displayedMessage.messageId}`,
type: isBinaryAutocrypt ? "autocrypt" : "attachment",
description,
});
await db.storeKey(key);
Services.obs.notifyObservers(null, "openpgp-key-change");
}
continue;
@@ -2919,17 +2913,17 @@ Enigmail.msg = {
let nextIndex = Enigmail.msg.attachedKeys.length;
let info = {
fpr: "0x" + newKey.fpr,
idx: nextIndex,
keyInfo: newKey,
binary: isBinaryAutocrypt,
};
Enigmail.msg.attachedSenderEmailKeysIndex.push(info);
- Enigmail.msg.attachedKeys.push(keyDataOneKey);
+ Enigmail.msg.attachedKeys.push(newKey.pubKey);
}
// We want to collect keys for potential later use, however,
// we also want to avoid that an attacker can send us a large
// number of keys to poison our cache, so we only collect keys
// that are related to the author or one of the recipients.
// Also, we don't want a public key, if we already have a
// secret key for that email address.
@@ -2960,18 +2954,18 @@ Enigmail.msg = {
this.keyCollectCandidates.set(relatedParticipantEmailAddress, {
skip: true,
});
} else {
let candidate = {};
candidate.skip = false;
candidate.newKeyObj = newKey;
candidate.pubKey = isBinaryAutocrypt
- ? RNP.enArmorString(keyDataOneKey, "public key")
- : keyDataOneKey;
+ ? RNP.enArmorString(newKey.pubKey, "public key")
+ : newKey.pubKey;
candidate.source = {
uri: `mid:${gMessageDisplay.displayedMessage.messageId}`,
type: isBinaryAutocrypt ? "autocrypt" : "attachment",
description,
};
this.keyCollectCandidates.set(
relatedParticipantEmailAddress,
candidate
@@ -2999,17 +2993,17 @@ Enigmail.msg = {
if (!newHasNewValidity) {
continue;
}
if (
!(await EnigmailKeyRing.importKeyDataSilent(
window,
- keyDataOneKey,
+ newKey.pubKey,
isBinaryAutocrypt,
"0x" + newKey.fpr
))
) {
console.debug(
"EnigmailKeyRing.importKeyDataSilent failed 0x" + newKey.fpr
);
}