<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>GPG signature verification broken</title> 
  <pubDate>Fri, 10 Apr 2026 13:36:24 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/12142</link> 
  <atom:link rel="self" type="application/rss+xml" title="GPG signature verification broken" href="https://bugs.horde.org/ticket/12142/rss" /> 
  <description>GPG signature verification broken</description> 
 
   
   
  <item> 
   <title>I sign an email with enigmail using PGP/mime
-&gt; Horde state</title> 
   <description>I sign an email with enigmail using PGP/mime
-&gt; Horde states: 
gpg: Signature made Tue 26 Mar 2013 07:27:20 PM CET using RSA key ID xxx
gpg: Good signature from xxx
(the key being on a keyserver)

When i sign+encrypt an email with enigmail using PGP/mime (exactly the same account and key)
-&gt; After decryption Horde states: 
gpg: Signature made Tue 26 Mar 2013 07:27:20 PM CET using RSA key ID xxx
gpg: Can&#039;t check signature: No public key</description> 
   <pubDate>Tue, 26 Mar 2013 18:55:33 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12142#t77376</link> 
  </item> 
   
  <item> 
   <title>Duplicate of Bug #12100?</title> 
   <description>Duplicate of Bug #12100?</description> 
   <pubDate>Tue, 26 Mar 2013 20:02:45 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12142#t77381</link> 
  </item> 
   
  <item> 
   <title>i traced the problem down quite a bit already:

in ./www/i</title> 
   <description>i traced the problem down quite a bit already:

in ./www/imp/lib/Mime/Viewer/Pgp.php:427

$this-&gt;getConfigParam(&#039;imp_contents&#039;)-&gt;getBodyPart($signed_id, array(&#039;mimeheaders&#039; =&gt; true))
returns an empty string

because:

in ./www/imp/lib/Contents.php:245

$part-&gt;getContents();

returns an empty string, therefore Horde_Mime_Part::getRawPartText(...) three lines below fails, since there are no mime parts in the string. (the string contains only the mime headers of the base_id container)

why this happens is unclear to me</description> 
   <pubDate>Wed, 27 Mar 2013 02:06:13 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12142#t77386</link> 
  </item> 
   
  <item> 
   <title>&gt; in ./www/imp/lib/Mime/Viewer/Pgp.php:427

And that&#039;s exa</title> 
   <description>&gt; in ./www/imp/lib/Mime/Viewer/Pgp.php:427

And that&#039;s exactly the code that was changed/fixed in Bug #12100.</description> 
   <pubDate>Wed, 27 Mar 2013 03:03:52 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12142#t77387</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; in ./www/imp/lib/Mime/Viewer/Pgp.php:427
&gt;
&gt; And that&#039;s</title> 
   <description>&gt;&gt; in ./www/imp/lib/Mime/Viewer/Pgp.php:427
&gt;
&gt; And that&#039;s exactly the code that was changed/fixed in Bug #12100.

gee, i really missed your comment. thanks for saving my time :)

the fix introduced there indeed fixes verification for signed and encrypted mails, but breaks verification of signed only.

the problem seems to be with the change introduced on line 443, as
&#039;mimeheaders&#039; =&gt; true and &#039;stream&#039; =&gt; true cannot be set both as can be seen in 

./imp/lib/Contents.php:292</description> 
   <pubDate>Wed, 27 Mar 2013 10:05:18 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12142#t77393</link> 
  </item> 
   
  <item> 
   <title>(line numbers as in origin master)

&gt; &#039;mimeheaders&#039; =&gt; tru</title> 
   <description>(line numbers as in origin master)

&gt; &#039;mimeheaders&#039; =&gt; true and &#039;stream&#039; =&gt; true cannot be set both as can 
&gt; be seen in
&gt;
&gt; ./imp/lib/Contents.php:292

actually i&#039;m totally unsure about the code there, maybe it should be able to provide this, but then its broken.

this piece of code from line 287 to 299 looks really wrong to me, since there should be 4 possible cases (mime: yes/no, stream: yes/no) but the code has only 3 different execution paths.</description> 
   <pubDate>Wed, 27 Mar 2013 10:39:17 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12142#t77395</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in Git (master):

commit f1c84583504f</title> 
   <description>Changes have been made in Git (master):

commit f1c84583504f142ca37eae1b9dcda3b99dab801c
Author: Michael M Slusarz &lt;slusarz@horde.org&gt;
Date:   Wed Mar 27 22:18:44 2013 -0600

    Fix returning stream if requested (Bug #12142)

 imp/lib/Contents.php |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

http://git.horde.org/horde-git/-/commit/f1c84583504f142ca37eae1b9dcda3b99dab801c</description> 
   <pubDate>Thu, 28 Mar 2013 04:19:41 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12142#t77405</link> 
  </item> 
   
  <item> 
   <title>I can&#039;t reproduce.  Signature verification works fine for me</title> 
   <description>I can&#039;t reproduce.  Signature verification works fine for me.

&gt; this piece of code from line 287 to 299 looks really wrong to me, 
&gt; since there should be 4 possible cases (mime: yes/no, stream: yes/no) 
&gt; but the code has only 3 different execution paths.

So?  The one missing case is not used in the PGP code.  So not sure what that has to do with this ticket.</description> 
   <pubDate>Thu, 28 Mar 2013 04:19:50 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12142#t77406</link> 
  </item> 
   
  <item> 
   <title>&gt; I can&#039;t reproduce.  Signature verification works fine for </title> 
   <description>&gt; I can&#039;t reproduce.  Signature verification works fine for me.

now i&#039;m embarassed. i can&#039;t either. sorry if i wasted your time!

&gt;&gt; this piece of code from line 287 to 299 looks really wrong to me,
&gt;&gt; since there should be 4 possible cases (mime: yes/no, stream: yes/no)
&gt;&gt; but the code has only 3 different execution paths.
&gt;
&gt; So?  The one missing case is not used in the PGP code.  So not sure 
&gt; what that has to do with this ticket.

ehm nothing, i was just guessing, since i didn&#039;t really understand the code...

so now there is only one special case, that is somewhat missing: 

mails created with enigmail don&#039;t have a detached signature. so the signature verification is done in Horde_Crypt_Pgp::_decryptMessage. since in this method the pubkeyring consists only my own pubkey, this will always yield &quot;Can&#039;t check signature: No public key&quot; (opposed to the detached signatures which are verified in IMP_Crypt_Pgp::verifySignature which automatically tries to fetch the correct key....)

(see Mime/Viewer/Pgp.php under  /* Check for combined encryption/signature data. */ for the beginning of this call path)

but i don&#039;t yet see an easy solution to this problem. because all the signature logic is in the mime viewer, the key fetching logic is in IMP_Crypt_Pgp and the decryption in Horde_Crypt_Pgp. the signature keyid is in the encrypted container, so somehow you would need to first decrypt it, then fetch the key, then decrypt it again, with the fetched key in the keyring...
</description> 
   <pubDate>Thu, 28 Mar 2013 23:09:28 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12142#t77411</link> 
  </item> 
   
  <item> 
   <title>&gt; mails created with enigmail don&#039;t have a detached signatur</title> 
   <description>&gt; mails created with enigmail don&#039;t have a detached signature. so the 
&gt; signature verification is done in Horde_Crypt_Pgp::_decryptMessage. 
&gt; since in this method the pubkeyring consists only my own pubkey, this 
&gt; will always yield &quot;Can&#039;t check signature: No public key&quot; (opposed to 
&gt; the detached signatures which are verified in 
&gt; IMP_Crypt_Pgp::verifySignature which automatically tries to fetch the 
&gt; correct key....)

I am not following.  Signed messages can be sent in one of three ways:

1) As PGP armored text (handled in Plain viewer).
2) multpart/signed w/ application/pgp-signature (handled in PGP viewer).
3) Encrypted + signed message -- multipart/encrypted (handled in PGP viewer).  There are acutally 2 types here (encrypted with embedded signed part AND encrypted+signed).  Both are handled by the PGP viewer.

Not sure which one is not being handled properly for you.</description> 
   <pubDate>Thu, 04 Apr 2013 05:22:42 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12142#t77470</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; mails created with enigmail don&#039;t have a detached signatu</title> 
   <description>&gt;&gt; mails created with enigmail don&#039;t have a detached signature. so the
&gt;&gt; signature verification is done in Horde_Crypt_Pgp::_decryptMessage.
&gt;&gt; since in this method the pubkeyring consists only my own pubkey, this
&gt;&gt; will always yield &quot;Can&#039;t check signature: No public key&quot; (opposed to
&gt;&gt; the detached signatures which are verified in
&gt;&gt; IMP_Crypt_Pgp::verifySignature which automatically tries to fetch the
&gt;&gt; correct key....)
&gt;
&gt; I am not following.  Signed messages can be sent in one of three ways:
&gt;
&gt; 1) As PGP armored text (handled in Plain viewer).
&gt; 2) multpart/signed w/ application/pgp-signature (handled in PGP viewer).
&gt; 3) Encrypted + signed message -- multipart/encrypted (handled in PGP 
&gt; viewer).  There are acutally 2 types here (encrypted with embedded 
&gt; signed part AND encrypted+signed).  Both are handled by the PGP 
&gt; viewer.
&gt;
&gt; Not sure which one is not being handled properly for you.

its about case 3:
* when there is a pgp-encrypted part which contains both an encrypted packet and a signature packet, the signature is only verified in Horde_Crypt_Pgp::_decryptMessage, which does not fetch the key from a keyserver.
* whereas when the encrypted part contains a message with a detached signature, it is verified in the viewer, and the key is properly fetched.

for the two cases see http://www.ietf.org/rfc/rfc2015.txt  section 6.2 vs. 6.1</description> 
   <pubDate>Thu, 04 Apr 2013 12:17:37 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12142#t77472</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in Git (FRAMEWORK_5_0):

commit 2f4b7</title> 
   <description>Changes have been made in Git (FRAMEWORK_5_0):

commit 2f4b732a481e1c948221f5e04ef0038904c0fd16
Author: Michael M Slusarz &lt;slusarz@horde.org&gt;
Date:   Tue Apr 9 15:28:09 2013 -0600

    [mms] Fix signature verification for PGP combined signed &amp; encrypted messages (Bug #12142).

 imp/docs/CHANGES            |    2 +
 imp/lib/Crypt/Pgp.php       |   44 ++++++++++++++++++++++++++++++++++--------
 imp/lib/Mime/Viewer/Pgp.php |   37 +++++++++++++++++++++++++----------
 imp/package.xml             |    2 +
 4 files changed, 65 insertions(+), 20 deletions(-)

http://git.horde.org/horde-git/-/commit/2f4b732a481e1c948221f5e04ef0038904c0fd16</description> 
   <pubDate>Tue, 09 Apr 2013 21:28:46 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12142#t77552</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in Git (master):

commit 9281a2cda2ec</title> 
   <description>Changes have been made in Git (master):

commit 9281a2cda2ec8ed9ae4b25fdee59460b822581b4
Author: Michael M Slusarz &lt;slusarz@horde.org&gt;
Date:   Tue Apr 9 15:28:09 2013 -0600

    [mms] Fix signature verification for PGP combined signed &amp; encrypted messages (Bug #12142).
    
    Conflicts:
    	imp/lib/Mime/Viewer/Pgp.php
    	imp/package.xml

 imp/docs/CHANGES            |    2 +
 imp/lib/Crypt/Pgp.php       |   44 ++++++++++++++++++++++++++++++++++--------
 imp/lib/Mime/Viewer/Pgp.php |   39 ++++++++++++++++++++++++++-----------
 imp/package.xml             |    1 +
 4 files changed, 65 insertions(+), 21 deletions(-)

http://git.horde.org/horde-git/-/commit/9281a2cda2ec8ed9ae4b25fdee59460b822581b4</description> 
   <pubDate>Tue, 09 Apr 2013 21:30:45 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12142#t77554</link> 
  </item> 
   
  <item> 
   <title>Does this fix?</title> 
   <description>Does this fix?</description> 
   <pubDate>Tue, 09 Apr 2013 21:30:55 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12142#t77555</link> 
  </item> 
   
  <item> 
   <title>Marking as resolved since this fixes the issue reported in t</title> 
   <description>Marking as resolved since this fixes the issue reported in this ticket for me.</description> 
   <pubDate>Mon, 15 Apr 2013 19:39:06 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/12142#t77638</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
