[Tickets #8751] Re: Fatal error: Cannot use string offset as an array in lib/Horde/Crypt/smime.php on line 770

bugs at horde.org bugs at horde.org
Wed Dec 9 08:27:35 UTC 2009


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/8751
------------------------------------------------------------------------------
  Ticket             | 8751
  Updated By         | Michael Slusarz <slusarz at horde.org>
  Summary            | Fatal error: Cannot use string offset as an array in
                     | lib/Horde/Crypt/smime.php on line 770
  Queue              | IMP
  Version            | 4.3.5
  Type               | Bug
  State              | Feedback
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


Michael Slusarz <slusarz at horde.org> (2009-12-09 03:27) wrote:

There is a problem with your certificate.  First, why are you using  
version 1 of X.509?  Version 1 was obsoleted long ago (version 3 is  
the up-to-date version).

Regardless, there seems to be an issue parsing the version/serial  
number of that cert.  According to the ASN.1 data, the integer value  
for the version is 9 bytes long, instead of 1 byte long.  
(Additionally, without bcmath, this integer won't be parsed correctly  
anyway).  For whatever reason, the serial number information is being  
ignored.  This results in 1 fewer array entry than expected, which  
screws up the parsing.

Trying another ASN.1 PHP parser I found on the web, it fails at the  
same location.

openssl_x509_parse() *does* seem to parse the data correctly, but 1.)  
the documentation is listed as "The structure of the returned data is  
(deliberately) not yet documented, as it is still subject to change."  
(WTF?) and 2.) it did not support ASN.1 decoding extensions data until  
PHP 5.2.4.






More information about the bugs mailing list