Verified Commit 73e0bf8a authored by intrigeri's avatar intrigeri
Browse files
parent 2ce30476
# HG changeset patch
# User Kai Engert <kaie@kuix.de>
# Date 1604501649 -3600
# Node ID 264083e4186898410df5b1454668df2054a7290a
# Parent 9484591b8ae3db9665d3f0e8db6e9b528a7b2cf6
Bug 1675285 - OpenPGP: Composer key status should list undecided/rejected keys. r=PatrickBrunschwig a=wsmwk
Differential Revision: https://phabricator.services.mozilla.com/D95859
diff --git a/comm/mail/extensions/openpgp/content/modules/keyRing.jsm b/comm/mail/extensions/openpgp/content/modules/keyRing.jsm
--- a/comm/mail/extensions/openpgp/content/modules/keyRing.jsm
+++ b/comm/mail/extensions/openpgp/content/modules/keyRing.jsm
@@ -997,35 +997,16 @@ var EnigmailKeyRing = {
if (!uidMatch) {
return -2;
}
// key valid for encryption?
if (!keyObj.keyUseFor.includes("E")) {
return -2;
}
- let acceptanceLevel;
- if (keyObj.secretAvailable) {
- let isPersonal = await PgpSqliteDb2.isAcceptedAsPersonalKey(keyObj.fpr);
- if (isPersonal) {
- acceptanceLevel = 3;
- } else {
- acceptanceLevel = -1; // rejected
- }
- } else {
- acceptanceLevel = await this.getKeyAcceptanceLevelForEmail(
- keyObj,
- emailAddr
- );
- }
-
- if (acceptanceLevel < 1) {
- return acceptanceLevel;
- }
-
// Ensure we have at least one key usable for encryption
// that is not expired/revoked.
// We already checked above, the primary key is not revoked/expired
let foundGoodEnc = keyObj.keyUseFor.match(/e/);
if (!foundGoodEnc) {
for (let aSub of keyObj.subKeys) {
switch (aSub.keyTrust) {
@@ -1039,16 +1020,31 @@ var EnigmailKeyRing = {
}
}
}
if (!foundGoodEnc) {
return -2;
}
+ let acceptanceLevel;
+ if (keyObj.secretAvailable) {
+ let isPersonal = await PgpSqliteDb2.isAcceptedAsPersonalKey(keyObj.fpr);
+ if (isPersonal) {
+ acceptanceLevel = 3;
+ } else {
+ acceptanceLevel = -1; // rejected
+ }
+ } else {
+ acceptanceLevel = await this.getKeyAcceptanceLevelForEmail(
+ keyObj,
+ emailAddr
+ );
+ }
+
return acceptanceLevel;
},
/**
* try to find valid key for encryption to passed email address
*
* @param details if not null returns error in details.msg
*
@@ -1276,17 +1272,17 @@ var EnigmailKeyRing = {
let k = this.getAllKeys(null, null);
let keyList = k.keyList;
for (let keyObj of keyList) {
let acceptanceLevel = await this.isValidKeyForRecipient(
keyObj,
emailAddr
);
- if (acceptanceLevel < 1) {
+ if (acceptanceLevel < -1) {
continue;
}
if (!keyObj.secretAvailable) {
keyObj.acceptance = this.getAcceptanceStringFromAcceptanceLevel(
acceptanceLevel
);
}
found.push(keyObj);
......@@ -2,5 +2,4 @@ Prefer-fetched-configurations-using-SSL-over-plainte.patch
Add-pref-for-whether-we-accept-OAuth2-during-autocon.patch
Fix-buggy-pref-for-disabling-MS-Exchange-autoconfig-.patch
Don-t-reset-encryption-choice-when-disabling-encrypt.patch
OpenPGP_Composer_key_status_should_list_undecided_re.patch
If_a_signed_OpenPGP_message_automatically_includes_t.patch
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment