<?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>False positive SMIME verification</title> 
  <pubDate>Fri, 10 Apr 2026 07:03:43 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/6323</link> 
  <atom:link rel="self" type="application/rss+xml" title="False positive SMIME verification" href="https://bugs.horde.org/ticket/6323/rss" /> 
  <description>False positive SMIME verification</description> 
 
   
   
  <item> 
   <title>In file framework/Crypt/Crypt/smime.php,v 1.49.2.14 line 215</title> 
   <description>In file framework/Crypt/Crypt/smime.php,v 1.49.2.14 line 215

212:/* Try again without verfying the signer&#039;s cert */

213:        $result = openssl_pkcs7_verify($input, PKCS7_NOVERIFY, $output);

214:

215:        if (($result === true) || ($result === -1)) {

216:            [Verification OK]

217:        } else {

218:            [Verification KO]

219:        }



Verification is OK if &quot;$result === -1&quot; but &quot;openssl_pkcs7_verify&quot; documentation specify that &quot;[openssl_pkcs7_verify] Returns [...] -1 on error.&quot;

Why do you consider -1 a valid verification ???



In my case, I had malformed smime signature which lead to an encouraging message &quot;valid message verification, but unknown issuer&quot;...</description> 
   <pubDate>Tue, 26 Feb 2008 16:25:34 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6323#t43109</link> 
  </item> 
   
  <item> 
   <title>&gt; Why do you consider -1 a valid verification ???



Because</title> 
   <description>&gt; Why do you consider -1 a valid verification ???



Because, if the signature was really invalid, it would have returned false. The commit message that allowed -1 as a valid return, says: &quot;openssl_pkcs7_verify returns -1 when the signature is ok but there are no certificates to return.&quot;</description> 
   <pubDate>Tue, 26 Feb 2008 21:22:01 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6323#t43144</link> 
  </item> 
   
  <item> 
   <title>Then there is a problem in openssl&#039;s function : 

I wrote th</title> 
   <description>Then there is a problem in openssl&#039;s function : 

I wrote the signature function that caused invalid signature production and I had two problem : Invalid signature syntax AND invalid signature

When facing both problems the function returs -1 as the invalid signature is unparsable ... but still invalid</description> 
   <pubDate>Wed, 27 Feb 2008 12:57:04 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6323#t43192</link> 
  </item> 
   
  <item> 
   <title>I suggest that we return two different error messages in tho</title> 
   <description>I suggest that we return two different error messages in those cases.</description> 
   <pubDate>Thu, 06 Mar 2008 00:32:11 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6323#t43436</link> 
  </item> 
   
  <item> 
   <title>I ran a few tests on my own, there is no way to differenciat</title> 
   <description>I ran a few tests on my own, there is no way to differenciate both cases (output is not filled).

If you want to raise two different messages, we need to contact PHP&#039;s openssl team and ask for a third return code</description> 
   <pubDate>Thu, 06 Mar 2008 10:36:30 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6323#t43485</link> 
  </item> 
   
  <item> 
   <title>With both cases I meant -1 which means an error during verif</title> 
   <description>With both cases I meant -1 which means an error during verification, and false which means an invalid cert.</description> 
   <pubDate>Thu, 06 Mar 2008 10:45:45 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6323#t43492</link> 
  </item> 
   
  <item> 
   <title>Try this patch.  Also, do you have a few sample messages I c</title> 
   <description>Try this patch.  Also, do you have a few sample messages I can use for testing?  How did you break the message to get openssl_pkcs7_verify() to return -1?</description> 
   <pubDate>Thu, 13 Mar 2008 06:00:47 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6323#t43790</link> 
  </item> 
   
  <item> 
   <title>Thomas confirmed this as working.  Fixed in HEAD and RC4.</title> 
   <description>Thomas confirmed this as working.  Fixed in HEAD and RC4.</description> 
   <pubDate>Fri, 14 Mar 2008 13:43:32 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/6323#t43833</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
