Title GPGOL creates broken attachments in Outlook 2007
Priority critical Status resolved
Category gpgol Due Date
Version 1.1.1 ExtLink  (go)
Superseder Nosy List Christoph, bernhard, emanuel, werner
Assigned To Topics  (help)

Created on 2010-07-13.19:20:57 by [P] Christoph, last changed 2013-06-24.12:44:59 by bernhard.

msg4648 (view) Author: bernhard Date: 2013-06-24.12:44:51
For completeness, this fix has been published as part of the regular Gpg4win
releases since 2.1.1-beta1. It is also included in 2.1.1. There is no need to
download the dll directly, just move to the recent Gpg4win version.
msg4213 (view) Author: werner Date: 2011-12-27.14:49:51
A new release has been made.

The new gpgol DLL is available at
and a signature for that file at

Please download them, check with gpg that the signature is correct and
replace the gpgol.dll in the GNU/GnuPG installation directory with the
new DLL.  You need to rename the new DLL to gpgol.dll .

Source tarballs are available as well; the GIT repo is at .
msg4212 (view) Author: werner Date: 2011-12-23.19:21:06
commit 9373fd75 fixes this data corruption during encryption and signing.

That extra write was plainly wrong.  I have no idea, how it slipped
in.  The error comes up with attachments of certain lengths.  For
example with a file length of 13859 bytes.

* src/mimemaker.c (write_b64): Remove a stupid buffer write of 4
msg4211 (view) Author: werner Date: 2011-12-23.15:51:34
issue1110 is now used to track the second problems (Outlook crashes).
msg3765 (view) Author: bernhard Date: 2010-07-26.07:50:38
I believe we have two seperate issues
here, though of course they might be caused by the same defect.

However issue1110 even crashes on correct attachements created by Kmail
and issue1251 leads to attachments that even mutt cannot decrypt.
msg3743 (view) Author: Christoph Date: 2010-07-13.19:20:57
[This might be a duplicate of Issue1110 but I found no way to add a comment]

I'm using the latest Gpg4win featuring GPGOL 1.1.1. Outlook is from Office 2007 
Professional, Operatingsystem is Windows XP.

Attachments encrypted using GPGOL 1.1.1 are broken.

Steps to reproduce:

1. Create a file test.txt, add line "testcontent", use 7zip to create a file.
2. Use Outlook to send this file to yourself using GPGOL.
3. Decrypt and save attachment
4. The original file and the received attachment are different.

Additional Details:

Original file dump:

Decrypted file dump:

Additional characters are added to the first line. In another test using a 3 MB 
file other characters had been added close to the end of the file (at byte 
position -780).

In both cases 3 bytes. Looks like it just repeated these bytes:

Example from above:
  Original : PK^C    ^D
  Decrypted: PK^CPK^C^D
  "PK^C" is repeated

Other test with 3 MB zip-file:
  Original : PK^A^B^T^@^T      ^@^@^@^H
  Decrypted: PK^A^B^T^@^T^T^@^T^@^@^@^H
  "^T^@^T" is repeated

More observations:

- Attachments decrypted using Linux/mutt/gnupg are broken too (this is the 
reason why I believe the encryption is broken, rather than the decryption!).
- Outlook 2007 Prof on Windows 7 crashes on receiving these attachments (at 
least once), on XP it doesn't.
- The attachment from the email in my sent folder is broken, too.
- Non-binary files don't seem to be affected (10k ascii public key file)
- Sending multiple attachments using the same file affects each the same way
- Other files (1 MB Word-file, 600k zip-file) weren't affected (I see no 
pattern in what is and what is not affected).

Date User Action Args
2013-06-24 12:44:59bernhardsetstatus: chatting -> resolved
2013-06-24 12:44:52bernhardsetstatus: resolved -> chatting
messages: + msg4648
2011-12-27 14:49:51wernersetstatus: in-progress -> resolved
messages: + msg4213
2011-12-23 19:21:24wernersetstatus: chatting -> in-progress
2011-12-23 19:21:06wernersetmessages: + msg4212
2011-12-23 15:51:34wernersetmessages: + msg4211
2010-08-02 08:47:18wernersetassignedto: werner ->
2010-07-26 07:50:38bernhardsetstatus: unread -> chatting
nosy: + werner, bernhard, emanuel
messages: + msg3765
assignedto: werner
2010-07-13 19:20:57Christophcreate