Tb-native OpenPGP implementation does not use newer subkeys
Categories
(MailNews Core :: Security: OpenPGP, defect)
Tracking
(thunderbird_esr78 fixed, thunderbird82 fixed)
People
(Reporter: cai.0407, Assigned: KaiE)
References
Details
Attachments
(2 files)
47 bytes,
text/x-phabricator-request
|
wsmwk
:
approval-comm-beta+
wsmwk
:
approval-comm-esr78+
|
Details | Review |
47 bytes,
text/x-phabricator-request
|
wsmwk
:
approval-comm-beta+
wsmwk
:
approval-comm-esr78+
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0
Steps to reproduce:
I have a keypair with multiple subkeys shown below (RSA keypair is created in 2009, and ECC subkeys are added in 2020).
sec rsa4096/523DD5D34E8E48D9, created: 2009-10-26, usage: SC
ssb rsa4096/0C94EE97CC4A2E9C, created: 2009-10-26, usage: E
ssb ed25519/1CFC0F1D2839684B, created: 2020-07-01, usage: S
ssb cv25519/A1236D2F9431B88C, created: 2020-07-01, usage: E
I have upgraded Tb 68.12.0 to 78.2.2 via autoupdate, and migrated from Enigmail 2.1.8 to Tb-native OpenPGP implementation.
Keys and configurations are migrated successfully.
Testing signing/encryption with Tb-native OpenPGP.
Actual results:
- A message via 4E8E48D9 is signed with 4E8E48D9 (primary key, RSA)
- A message for 4E8E48D9 is encrypted with CC4A2E9C (older encryption key, RSA)
Expected results:
- A message via 4E8E48D9 is signed with 2839684B (newer signing subkey, EdDSA)
- A message for 4E8E48D9 is encrypted with 9431B88C (newer encryption key, ECDH)
Classic Tb (68 and below) + Enigmail + GnuPG uses the newer subkeys for signing/encryption.
Users of Tb + Enigmail + GnuPG expect the same behavior.
GnuPG itself and other GnuPG-based front-end applications also use the newer subkeys for signing/encryption.
(Maybe other OpenPGP implementations, too)
Comment 1•4 years ago
|
||
From support documentation:
not or not yet supported...
- Keys that use a different password for a sub key
Reporter | ||
Comment 2•4 years ago
|
||
This is a kind of a decline of security level.
ex.
sec dsa1024/XXXXXXXXXXXXXXXX, created: 2009-10-26, usage: SC
ssb dsa1024/XXXXXXXXXXXXXXXX, created: 2009-10-26, usage: E
ssb ed25519/XXXXXXXXXXXXXXXX, created: 2020-07-01, usage: S
ssb cv25519/XXXXXXXXXXXXXXXX, created: 2020-07-01, usage: E
Once ago, user created DSA keypair, and recently added new EdDSA subkeys.
(Long-time OpenPGP users often have this kind of keys, old primary key + new subkeys.)
With classic Tb + Enigmail + GnuPG or most other environments, user can get 128-bit security level with EdDSA key.
However, Tb-native OpenPGP implementation forces user to get only 80-bit security level with old, weak DSA key.
(In reply to Thomas D. (:thomas8) from comment #1)
From support documentation:
not or not yet supported...
- Keys that use a different password for a sub key
I cannot understand the situation "Keys that use a different password for a sub key".
Usually, OpenPGP keypair has only one passphrase even if it includes multiple subkeys, and all subkeys will be unlocked with this common passphrase.
Reporter | ||
Comment 3•4 years ago
|
||
Also posted on Thunderbird e2ee.
https://thunderbird.topicbox.com/groups/e2ee/T12a8f43ab17206ec/tb-native-openpgp-implementation-does-not-use-newer-subkeys
Assignee | ||
Comment 4•4 years ago
|
||
We need to update code in Thunderbird's RNP.jsm to have a smarter lookup of the appropriate key. Currently, it's happy as soon as it finds key that's usable and is not expired/revoked. Your scenario has not yet been configured.
Is it always the correct decision to use the newer subkey?
Comment 5•4 years ago
|
||
I also filed an issue at https://github.com/rnpgp/rnp/issues/1313
However I still think that this should be controllable by enduser (with appropriate default, of course).
Assignee | ||
Comment 7•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 8•4 years ago
|
||
(In reply to Nickolay Olshevsky from comment #5)
However I still think that this should be controllable by enduser (with appropriate default, of course).
Let's consider that later, I've filed bug 1667232 to track that.
I suggest that for now we implement the simple compatibility fix (encrypt to single key, use newest).
Assignee | ||
Updated•4 years ago
|
Reporter | ||
Comment 9•4 years ago
|
||
Thank you for providing a patch.
Is this patch effective for both encryption and signing (in my case; sign with 0x2839684B, newer signing subkey, EdDSA)? or only for encryption?
Assignee | ||
Comment 10•4 years ago
|
||
(In reply to Kosuke Kaizuka from comment #9)
Is this patch effective for both encryption and signing ... ?
yes, it should
I'd appreciate your feedback that it works as expected.
Comment 11•4 years ago
|
||
Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/8fc4a078751c
Encrypt to most recently created OpenPGP encryption subkey. r=PatrickBrunschwig DONTBUILD
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 12•4 years ago
|
||
Comment on attachment 9177744 [details]
Bug 1665281 - Encrypt to most recently created OpenPGP encryption subkey. r=PatrickBrunschwig
[Approval Request Comment]
Regression caused by (bug #): none
User impact if declined: some correspondents cannot decrypt email sent by Thunderbird
Testing completed (on c-c, etc.): manually
Risk to taking this patch (and alternatives if risky): low risk
Assignee | ||
Comment 13•4 years ago
|
||
(In reply to Kai Engert (:KaiE:) from comment #10)
(In reply to Kosuke Kaizuka from comment #9)
Is this patch effective for both encryption and signing ... ?
yes, it should
I realize I was wrong. I've only modified function getSuitableSubkey(). But if the primary is already found to be usable, then we don't call getSuitableSubkey().
Usually the primary key isn't allowed to be used with encryption. That means this patch helps in the common scenario.
In the unusual scenario that the primary key is allowed to be used for encryption, this patch doesn't change anything, we'd still use the primary key.
For signing, because the usual scenario is that the primary key may be used for signing, this patch doesn't help yet.
A more complete patch needs to check for newer subkeys, regardless of the allowance settings of the primary key.
Assignee | ||
Comment 14•4 years ago
|
||
Comment on attachment 9177744 [details]
Bug 1665281 - Encrypt to most recently created OpenPGP encryption subkey. r=PatrickBrunschwig
removing approval requests, I'd like to work on a better patch.
Assignee | ||
Comment 15•4 years ago
|
||
Note that in the following scenario we'd have to ignore the suggested "use newer subkey" rule:
- primary key created in 2015 and expires in 2021 (or never)
- subkey created in 2018 and expired in 2019
then in the year 2020, we'd ignore the newer subkey, and use the primary key.
Reporter | ||
Comment 16•4 years ago
|
||
(In reply to Kai Engert (:KaiE:) from comment #15)
Note that in the following scenario we'd have to ignore the suggested "use newer subkey" rule:
- primary key created in 2015 and expires in 2021 (or never)
- subkey created in 2018 and expired in 2019
then in the year 2020, we'd ignore the newer subkey, and use the primary key.
That's the case, of course.
To be accurate, "use the newest usable (neither revoked nor expired) subkey".
Assignee | ||
Comment 17•4 years ago
|
||
Comment 18•4 years ago
|
||
Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/48906d492bc5
Follow-up, always check subkeys, even if primary key is usable. r=PatrickBrunschwig DONTBUILD
Assignee | ||
Comment 19•4 years ago
|
||
Comment on attachment 9177744 [details]
Bug 1665281 - Encrypt to most recently created OpenPGP encryption subkey. r=PatrickBrunschwig
[Approval Request Comment]
Regression caused by (bug #): none
User impact if declined: some correspondents cannot decrypt email sent by Thunderbird
Testing completed (on c-c, etc.): manually
Risk to taking this patch (and alternatives if risky): low risk
Assignee | ||
Updated•4 years ago
|
Comment 20•4 years ago
|
||
Comment on attachment 9177744 [details]
Bug 1665281 - Encrypt to most recently created OpenPGP encryption subkey. r=PatrickBrunschwig
[Triage Comment]
Approved for esr78
Approved for beta
Comment 21•4 years ago
|
||
Comment on attachment 9178201 [details]
Bug 1665281 - Follow-up, always check subkeys, even if primary key is usable. r=PatrickBrunschwig
[Triage Comment]
Approved for esr78
Approved for beta
Assignee | ||
Comment 22•4 years ago
|
||
Assignee | ||
Comment 23•4 years ago
|
||
Reporter | ||
Comment 24•4 years ago
|
||
Confirmed with 78.3.2 (auto-updated today), both signing and encryption with the newest subkey work fine.
Description
•