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 |
State ⇒ Resolved
http://cvs.horde.org/diff.php/framework/Crypt/Crypt/smime.php?r1=1.49.2.18&r2=1.49.2.19&ty=u
State ⇒ Feedback
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.
http://cvs.horde.org/diff.php/framework/Crypt/Crypt/smime.php?r1=1.71&r2=1.72&ty=u
Assigned to Michael Slusarz
New Attachment: horde.zip
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.
State ⇒ Feedback
reproduce the problem?
*** 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];
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
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++;
}