6.0.0-beta1
8/14/25

[#6628] PHP Fatal error: Cannot use string offset as an array in ./lib/Horde/Crypt/smime.php on line 830
Summary PHP Fatal error: Cannot use string offset as an array in ./lib/Horde/Crypt/smime.php on line 830
Queue Horde Framework Packages
Queue Version HEAD
Type Bug
State Resolved
Priority 1. Low
Owners Horde Developers (at) , slusarz (at) horde (dot) org
Requester horde (at) iiegn (dot) de
Created 04/19/2008 (6326 days ago)
Due
Updated 11/06/2008 (6125 days ago)
Assigned 07/16/2008 (6238 days ago)
Resolved 11/06/2008 (6125 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
11/06/2008 02:24:44 AM Chuck Hagenbuch Comment #9
State ⇒ Resolved
Reply to this comment
No feedback + patch = resolved.
07/16/2008 05:42:25 AM CVS Commit Comment #8 Reply to this comment
07/16/2008 05:39:49 AM Michael Slusarz Comment #7
State ⇒ Feedback
Reply to this comment
I didn't write any of this code (sorry) - but mucking through the 
attached data, looks like this is the difference between the two 
pertinent data objects is as follows:



Bad data:

[9] => Array

                                 (

                                     [0] => bit string

                                     [1] => 10+

                                 )



Good data:

                             [9] => Array

                                 (

                                     [0] => sequence

                                     [1] => Array

                                         (

                                             [0] => Array

                                                 (

                                                     [0] => oid

                                                     [1] => 
id-ce-basicConstraints

                                                 )



                                             [1] => Array

                                                 (

                                                     [0] => boolean

                                                     [1] => 1

                                                 )



                                             [2] => Array

                                                 (

                                                     [0] => octet string

                                                     [1] => 0�

                                                 )



                                         )



                                 )



The code has something to do with determining certificate extensions I 
guess, so I just ignored data formatted as the former to fix the 
error.  Others who know more about S/MIME can feel free to fix 
properly, as necessary.
07/16/2008 05:36:32 AM CVS Commit Comment #6 Reply to this comment
07/06/2008 04:17:43 PM Jan Schneider Assigned to Horde DevelopersHorde Developers
 
05/01/2008 09:10:52 PM Chuck Hagenbuch State ⇒ Assigned
 
04/22/2008 04:25:43 AM Chuck Hagenbuch Comment #5
Assigned to Michael Slusarz
Reply to this comment
Michael, is this something you could take a look at?
04/21/2008 12:10:49 PM horde (at) iiegn (dot) de Comment #4
New Attachment: horde.zip Download
Reply to this comment
versions and the like are:



Horde Version

Horde: 3.2-RC3



Horde Applications

Dimp: H3 (1.0-RC3)

Horde: 3.2-RC3

Imp: H3 (4.2-RC3)

Ingo: H3 (1.2-cvs))

Kronolith: H3 (2.2-RC2)

Mimp: H3 (1.0-cvs)

Nag: H3 (2.2-cvs)

Turba: H3 (2.2-cvs)



PHP Version

PHP Version: 5.2.0-8+etch10



in particular, smime.php:

* $Horde: framework/Crypt/Crypt/smime.php,v 1.49.2.17 2008/01/02 
11:30:26 jan Exp $





the exact error message is simply this (when trying to *view* a 
message in IMP):

Apr 21 13:44:27 ### apache2: PHP Fatal error:  Cannot use string 
offset as an array in /###/horde.org/lib/Horde/Crypt/smime.php on line 
827





however, it seems that the error only occurs with one of my 
certificates, i.e. (and that's probably what makes it hard to 
reproduce) messages signed with one of my certificates just display 
fine and messages signed with another one fail - sorry, hadn't 
realized this before...



so: i attached the two certificates (der format) and two message 
sources (names should be rather obvious) where one displays fine and 
the other fails with the mentioned error message.




04/21/2008 03:58:43 AM Chuck Hagenbuch Comment #3
State ⇒ Feedback
Reply to this comment
Can you please provide a full source message that we can use to 
reproduce the problem?
04/19/2008 08:04:33 PM horde (at) iiegn (dot) de Comment #2 Reply to this comment
(OOPS - sorry) a possible solution:



*** smime.php.org

--- smime.php

***************

*** 825,830 ****

--- 825,831 ----

           }



           $i = 9;

+                   $cert_data[1][0][1] = array();

           while (isset($cert_data[1][0][1][$i])) {

               $oid = $cert_data[1][0][1][$i][1][0][1];

               $cert_details['certificate']['extensions'][$oid] = 
$cert_data[1][0][1][$i][1][1];




04/19/2008 08:00:06 PM horde (at) iiegn (dot) de Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ PHP Fatal error: Cannot use string offset as an array in ./lib/Horde/Crypt/smime.php on line 830
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
when trying to view a s/mime signed message in imp (at least this 
holds for my own signed messages - however, signed with a different 
application) i get the mentioned php fatal error:



a possible solution:



         $i = 9;

         $cert_data[1][0][1] = array();

         while (isset($cert_data[1][0][1][$i])) {

             $oid = $cert_data[1][0][1][$i][1][0][1];

             $cert_details['certificate']['extensions'][$oid] = 
$cert_data[1][0][1][$i][1][1];

             $i++;

         }




Saved Queries