Recursion in OpenPGP password code, RNP callback
Categories
(MailNews Core :: Security: OpenPGP, defect)
Tracking
(thunderbird_esr91 wontfix)
Tracking | Status | |
---|---|---|
thunderbird_esr91 | --- | wontfix |
People
(Reporter: KaiE, Assigned: KaiE)
Details
Attachments
(1 file, 2 obsolete files)
While running automated tests, I noticed the following JS error on the console:
0:38.39 GECKO(28623) JavaScript error: chrome://openpgp/content/modules/RNPLib.jsm, line 578: Error: Got null OpenPGP password
0:38.39 GECKO(28623) [init_encrypted_src() /home/user/moz/commcent/mozilla/comm/third_party/rnp/src/librepgp/stream-parse.cpp:2080] failed to obtain decrypting key or password
0:38.39 GECKO(28623) console.debug: "rnp_op_verify_execute returned unexpected: 301989892"
0:38.40 INFO Console message: [JavaScript Error: "Error: Got null OpenPGP password" {file: "chrome://openpgp/content/modules/RNPLib.jsm" line: 578}]
password_cb@chrome://openpgp/content/modules/RNPLib.jsm:578:15
decrypt@chrome://openpgp/content/modules/RNP.jsm:953:30
decrypt@chrome://openpgp/content/modules/cryptoAPI/RNPCryptoAPI.jsm:245:16
decryptMessage@chrome://openpgp/content/modules/decryption.jsm:310:33
messageParseCallback@chrome://openpgp/content/ui/enigmailMessengerOverlay.js:1396:36
messageParse@chrome://openpgp/content/ui/enigmailMessengerOverlay.js:1240:24
messageDecryptCb@chrome://openpgp/content/ui/enigmailMessengerOverlay.js:875:20
messageDecrypt/</<@chrome://openpgp/content/ui/enigmailMessengerOverlay.js:581:28
onData@chrome://openpgp/content/modules/mime.jsm:460:19
onStopRequest@chrome://openpgp/content/modules/streams.jsm:60:23
sync@chrome://openpgp/content/modules/cryptoAPI/interface.js:56:15
password_cb@chrome://openpgp/content/modules/RNPLib.jsm:576:23
decrypt@chrome://openpgp/content/modules/RNP.jsm:953:30
decrypt@chrome://openpgp/content/modules/cryptoAPI/RNPCryptoAPI.jsm:245:16
decryptMessage@chrome://openpgp/content/modules/decryption.jsm:310:33
messageParseCallback@chrome://openpgp/content/ui/enigmailMessengerOverlay.js:1396:36
messageParse@chrome://openpgp/content/ui/enigmailMessengerOverlay.js:1240:24
messageDecryptCb@chrome://openpgp/content/ui/enigmailMessengerOverlay.js:875:20
messageDecrypt/</<@chrome://openpgp/content/ui/enigmailMessengerOverlay.js:581:28
onData@chrome://openpgp/content/modules/mime.jsm:460:19
onStopRequest@chrome://openpgp/content/modules/streams.jsm:60:23
sleep@resource://testing-common/mozmill/utils.jsm:62:12
wait_for_message_display_completion@resource://testing-common/mozmill/FolderDisplayHelpers.jsm:1951:15
open_message_from_file@resource://testing-common/mozmill/FolderDisplayHelpers.jsm:727:38
Assignee | ||
Comment 1•3 years ago
|
||
In RNPLib we provide password_cb which is called by the external RNP C library.
While processing this callback, we make a fake-sync call cApi.sync(OpenPGPMasterpass.retrieveOpenPGPPassword())
When executing this function for the first time, if the underlying data file does not yet exist, and while executing async IOUtils functions to test/create that new file, a scheduler apparently causes us to retry data processing, triggering another decryption attempt, causing us to arrive in the same function again.
I cannot yet say if this can happen in production execution, or if this scenario is limited to automated testing with FolderDisplayHelpers.
Assignee | ||
Comment 2•3 years ago
|
||
I suggest to test for the recursion in our RNP password callback, and throw an error if it happens. This can allow us to discover the failure in error console more clearly.
Assignee | ||
Comment 3•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/63b8aed694a6
Throw if we discover an unexpected RNP password_cb recursion. r=mkmelin
Assignee | ||
Comment 5•3 years ago
|
||
This change breaks test mail/test/browser/openpgp/browser_viewMessage.js - testDecryptHtmlWithNBSP
Assignee | ||
Comment 6•3 years ago
|
||
I suggest to backout.
Comment 7•3 years ago
|
||
Assignee | ||
Comment 8•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 9•3 years ago
|
||
Comment 10•3 years ago
|
||
Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/a8d48c8d1033
Fix a recursion in OpenPGP password callback (v3). r=mkmelin
Description
•