Topic: Problem decrypting OWA email in Firefox

Please review the following message with FireGPG's "Check for PGP blocks in page" option OFF as FireGPG will otherwise catch all the PGP message parts and tend to obscure the discussion.

I have the following problem:

I am using Firefox on Ubuntu accessing a Outlook Web Access site.  Using FireGPG I can generally encrypt and decrypt emails OK.  However, for any emails received by users using IE through the same site, I get in-line failures to decrypt:

Decryption failed. Unknown error.
yyyyy...yyyy\n
gpg: invalid armor header: 
gpg: CRC error; 0F5926 - 2D90E0
gpg: [don't know]: invalid packet (ctb=4b)

The reason seems to be that FireGPG is failing to in-line interpret/render the message HTML properly.  For example, without FireGPG ([OFF] Check for PGP blocks in page), a message of this type renders as follows (Example 1):

-----BEGIN PGP MESSAGE-----
Version: PGP Desktop 9.10.0 (Build 500)
Charset: utf-8
xxxxx...xxxxx
yyyyy...yyyyy
blah more lines of encryption...
-----END PGP MESSAGE-----

With FireGPG ([ON] Check for PGP blocks in page), when I "display original", the message renders (Example 2):

-----BEGIN PGP MESSAGE-----
Version: PGP Desktop 9.10.0 (Build 500)
Charset: utf-8xxxxx...xxxxx
yyyyy...yyyyy
blah more lines of encryption...
-----END PGP MESSAGE-----

As you can see, then first line of the encryption is merged with the previous comment line.

If I select the text of Example 1 and use FireGPG's text editor to decrypt the message, all is well.  However, Example 2 will not decrypt in-line or with the text editor and gives the above error.  If I use the text editor, I can edit Example 2 by adding the proper line feed before the first encrypted character and all is well.

This tends to defeat the very excellent in-line decryption that work well with other messages.

Looking at the HTML code, I see that it seems to be a <div> rendering problem:

<div dir="ltr"><font color="#000000" size="2" face="Tahoma">-----BEGIN PGP MESSAGE-----<br>
Version: PGP Desktop 9.10.0 (Build 500)<br>
Charset: utf-8</font></div>
<div dir="ltr"><font color="#000000" size="2" face="Tahoma"><font color="#000000" size="2" face="Tahoma">xxxxx...</font>...xxxxx<br>
yyyyy...yyyyy<br>
blah more lines of encryption...<br>
-----END PGP MESSAGE-----<br>
</font></div>

While IE/OWA "may" be constructing the email wrong, Firefox does display the message correctly without FireGPG.

Please fix.

Re: Problem decrypting OWA email in Firefox

Seen to be a carridgne return issue. This bug has already been reported on bugs.getfiregpg.org I think... (As he is down for the moment..)

I don't have any outlook accessto fix the problem anyways so...

Re: Problem decrypting OWA email in Firefox

Thanks the_glu!

Not having OWA access shouldn't pose a problem.  You can grab any web page with a encryption and modify the html to use a <div></div> starting after the last comment line in the encryption, ending after the encryption, and removing any <br> for the comment line.

Here's a sample HTML file that shows the problem:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
</head>
<body>
<div dir="ltr"><font color="#000000" size="2" face="Tahoma">-----BEGIN PGP MESSAGE-----<br>
Version: PGP Desktop 9.10.0 (Build 500)<br>
Charset: utf-8</font></div>
<div dir="ltr"><font color="#000000" size="2" face="Tahoma"><font color="#000000" size="2" face="Tahoma">xxxxx...</font>...xxxxx<br>
yyyyy...yyyyy<br>
blah more lines of encryption...<br>
-----END PGP MESSAGE-----</font></div>
</body>
</html>

Save the above as an html file and test by loading it in Firefox.  You'll need FireGPG inline off to copy it (or do some creative copy and pasting with it on).  This should demonstrate the display problem nicely with the FireGPG inline option turned on and off.  So...have fun with it!

Re: Problem decrypting OWA email in Firefox

I've downloaded the code, found the problem, and created a fix:

In cselect.js:
  in wash: function(text)
change:
        var reg=new RegExp("<style>[^<]*</style>", "gi"); //Élimination des styles
        str = str.replace(reg,"\n");

        reg=new RegExp("<[^>]+>", "g"); // Élimination des balises HTML
        str = str.replace(reg, "");

to
        var reg=new RegExp("<style>[^<]*</style>", "gi"); //Élimination des styles
        str = str.replace(reg,"\n");

        reg=new RegExp("</div>", "gi"); // Force end of <div>s to a newline
        str = str.replace(reg, "\n");

        reg=new RegExp("<[^>]+>", "g"); // Élimination des balises HTML
        str = str.replace(reg, "");

This properly places a newline at the end of any <div>s since they tag a contained area anyway.  For that matter, other HTML tags might also cause this problem, but this is the only one I've seen generated by the latest PGP Desktop software (www.pgp.com).  Since the next line removes all tags anyway, I see no current problems.

Re: Problem decrypting OWA email in Firefox

Thanks, I will apply your patch wink

Re: Problem decrypting OWA email in Firefox

Applied wink

Re: Problem decrypting OWA email in Firefox

Thanks! smile  When will the new version be out?

Re: Problem decrypting OWA email in Firefox

I don't know yet