Closed Bug 1664370 Opened 4 years ago Closed 3 years ago

OpenPGP signed e-mail - signature PNG not displayed sometimes

Categories

(Thunderbird :: Message Reader UI, defect)

defect

Tracking

(thunderbird_esr78? affected, thunderbird82- affected)

RESOLVED WORKSFORME
Tracking Status
thunderbird_esr78 ? affected
thunderbird82 - affected

People

(Reporter: marcoagpinto, Assigned: u671950)

Details

Attachments

(4 files)

Hello!

I have sent a signed e-mail to myself with my OpenPGP signature attached and my message has a bottom signature in a PNG.

Sometimes (most of the time) the PNG doesn't appear both in the sent folder and inbox.

See attached image.

Component: Untriaged → Message Reader UI

Please explain how you configure the signature that contains an image.
In particular, please explain how the image is attached/included in the signature.

The signature of my e-mails.

@Kai:

Please check if the two attached images help you identify the problem.

Thanks!

I also see this bug and I'm trying to help.

Calling console.trace() in RNPCryptoAPI.verifyMime() shows a recursion that isn't expressed in the code (onStopRequest doesn't call onStopRequest):

console.trace() RNPCryptoAPI.jsm:270:9
    verifyMime chrome://openpgp/content/modules/cryptoAPI/RNPCryptoAPI.jsm:270
    onStopRequest chrome://openpgp/content/modules/mimeVerify.jsm:564
    sync chrome://openpgp/content/modules/cryptoAPI/interface.js:53
    onStopRequest chrome://openpgp/content/modules/mimeVerify.jsm:566

The code in CryptoAPI.sync() reaches promise.then() with a good result object, but nevertheless sync() returns null.

Might the code in CryptoAPI.sync(), which uses nsIJSInspector, not work as expected?

This warning is seen, could it change the expectations of the CryptoAPI.sync() code?

Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. contentAreaClick.js:82:6
Attached patch bugfix.patchSplinter Review

Are async and await acceptable to fix this problem? It works for me.

Comment on attachment 9181423 [details] [diff] [review]
bugfix.patch

Thanks for submitting the patch, I'm pinging Magnus for a review.

Attachment #9181423 - Flags: review?(mkmelin+mozilla)

Thank you for your help Alessandro!

I want to add, I see this error in the Thunderbird error console when the problem occurs:

TypeError: this.returnStatus is null mimeVerify.jsm:565:7
    onStopRequest chrome://openpgp/content/modules/mimeVerify.jsm:565
    onStopRequest self-hosted:844
    sync chrome://openpgp/content/modules/cryptoAPI/interface.js:51
    onStopRequest chrome://openpgp/content/modules/mimeVerify.jsm:564
    onStopRequest self-hosted:844

I have another problem.

I send a signed email with two image attachments to myself.
Then I look at the email in my sent folder.

The problem is that only one image is shown. With the fix both images are shown.

Comment on attachment 9181423 [details] [diff] [review]
bugfix.patch

Review of attachment 9181423 [details] [diff] [review]:
-----------------------------------------------------------------

This is good, but it doesn't seem to fix the bug.
I was able to create a test case and it's quite reproducible - but I get the same results with and without the patch.
Attachment #9181423 - Flags: review?(mkmelin+mozilla) → feedback+
Status: UNCONFIRMED → NEW
Ever confirmed: true

The bugfix works for me on the Thunderbird 78 branch. Are you testing on a different branch? Do you get error messages on the console with the bugfix applied?

I was testing on trunk. No error message... just the broken image icon.
Seems like a timing issue, because if I open one of the large attached pictures I got, then the next reload of the message can show another one of the attached pictures broken (I had 4). Likely you patch changes the timing slightly which makes it works for your case but not necessarily for all. Can you test with a few messages where multiple large pictures are attached?

(In reply to Magnus Melin [:mkmelin] from comment #12)

I was testing on trunk. No error message... just the broken image icon.
Seems like a timing issue, because if I open one of the large attached pictures I got, then the next reload of the message can show another one of the attached pictures broken (I had 4). Likely you patch changes the timing slightly which makes it works for your case but not necessarily for all. Can you test with a few messages where multiple large pictures are attached?

Hello Magnus,

The timing issue was the answer from the developers of Enigmail a year or so ago.

But my PNG signature only has a few kB.

Also, I now (since January) have an i7 with 6 cores, so it is impossible that it may be slow.

How fast the machine is doesn't really matter. It's an async operation and if it doesn't wait enough it obviously doesn't work.
So this was an issue in Enigmail as well?

(In reply to Magnus Melin [:mkmelin] from comment #14)

How fast the machine is doesn't really matter. It's an async operation and if it doesn't wait enough it obviously doesn't work.
So this was an issue in Enigmail as well?

In Enigmail it only happened with attachments (large JPEGs) but not with my PNG signature.

Any news on this?

We've reporters in german support forums confirming this bug (and me too) in 78.4.

Report from error console:

TypeError: this.returnStatus is nullmimeVerify.jsm:565:7
    onStopRequest chrome://openpgp/content/modules/mimeVerify.jsm:565
    onStopRequest self-hosted:844
    sync chrome://openpgp/content/modules/cryptoAPI/interface.js:51
    onStopRequest chrome://openpgp/content/modules/mimeVerify.jsm:564
    onStopRequest self-hosted:844
CryptoAPI.sync() failed result:  Error: invalid data parameter
    getKeyListFromKeyBlockImpl chrome://openpgp/content/modules/RNP.jsm:1624
    getKeyListFromKeyBlockAPI chrome://openpgp/content/modules/cryptoAPI/RNPCryptoAPI.jsm:283
    getKeyListFromKeyBlock chrome://openpgp/content/modules/key.jsm:155
    commonProcessAttachedKey chrome://openpgp/content/ui/enigmailMessengerOverlay.js:3212
    autoProcessPgpKeyCallback chrome://openpgp/content/ui/enigmailMessengerOverlay.js:3426
    bufferListener chrome://openpgp/content/ui/enigmailMessengerOverlay.js:3459
    onStopRequest chrome://openpgp/content/modules/streams.jsm:78
    callbackWrapper chrome://openpgp/content/modules/timer.jsm:30
    notify resource://gre/modules/Timer.jsm:62
    sync chrome://openpgp/content/modules/cryptoAPI/interface.js:51
    onStopRequest chrome://openpgp/content/modules/mimeVerify.jsm:564

It seems the issue is fixed on 78.4.3.

Can more people confirm?

(In reply to Marco A.G.Pinto [:marcoagpinto] from comment #18)

It seems the issue is fixed on 78.4.3.

Can more people confirm?

Flags: needinfo?(kaie)
Flags: needinfo?(bugzilla)

Works for me in 78.11.0, but also in 78.4.0.

Flags: needinfo?(bugzilla)

It seems to work here too.

Sounds like another change might have had the side effect of fixing this bug.

Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(kaie)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: