Page MenuHome GnuPG

GnuPG fails to verify a signature with two empty lines after the "-----BEGIN PGP SIGNED MESSAGE-----" header.
Closed, ResolvedPublic

Description

Release: 1.4.2.2

Environment

Windows XP Pro SP2
GnuPG version: 1.4.2.2
Enigmail version: 0.94.0.0 (20060110)
Thunderbird/Mozilla version: 1.5 (20051201)

Description

GnuPG fails to verify a signed email when there are _two_ empty lines beneath the Signed email header. Like this:

THIS FAILS:

  1. -----BEGIN PGP SIGNED MESSAGE-----
  2. Hash: SHA1
  3. <-- empty line 1
  4. <-- empty line 2
  5. *Begin email text*

    THIS WORKS:
  6. -----BEGIN PGP SIGNED MESSAGE-----
  7. Hash: SHA1
  8. <-- empty line 1
  9. *Begin email text*

    I have verified this behaviour on multiple systems running the aforementioned software versions on Windows XP SP2, using different emails.
  10. gpg command line and output:
  11. C:\\GnuPG\\gpg.exe --charset utf8 --batch --no-tty --status-fd 2 -d
  12. gpg: Signature made 04/12/06 10:45:57 using DSA key ID D795E02C
  13. gpg: BAD signature from "GOVCERT.NL 2006 <cert@govcert.nl>"

    This happens when for example PGP Desktop signs a "current" window; if there's an empty line at the top of the window which holds the text that's being signed, PGP Desktop will (correctly) honor this empty line and sign as-is, this giving two empty lines in total due to the adding of the PGP Signed header. Making sure that there is no empty line at the top of a text, and then signing, will make the verification succeed.

    I've come upon this error through the use of Enigmail, the Thunderbird PGP extension. I initially reported the issue in the mozdev.org bugtracker:

    http://mozdev.org/bugs/show_bug.cgi?id=13746

    But the comment there suggests this might be an issue with GnuPG.

How To Repeat

  1. Try to verify an email with the aforementioned two empty lines after the "PGP Signed Message" header
  2. See GnuPG fail to verify the message
  3. Cry

Fix

Make the whitespace/number of empty lines beneath the "PGP Signed Message" header not bork the verifier?

Event Timeline

Should we do something about it or claim that this is as per OpenPGP specs.
I am in favor of sticking to the one-empty-line rule. We simply can't
workaround all bugs in all MUAs.

This is not a bug. If we would skip additional empty lines we won't be able to
sign message with leading empty lines. The specs say that thre shall be exactly
one empty line.