6.0.0-beta1
7/6/25

[#8751] Fatal error: Cannot use string offset as an array in lib/Horde/Crypt/smime.php on line 770
Summary Fatal error: Cannot use string offset as an array in lib/Horde/Crypt/smime.php on line 770
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners
Requester medawson (at) boston22 (dot) com
Created 12/04/2009 (5693 days ago)
Due
Updated 04/09/2012 (4836 days ago)
Assigned 12/04/2009 (5693 days ago)
Resolved 12/14/2009 (5683 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
04/09/2012 06:25:16 AM 2863586877 (at) qq (dot) com Comment #15 Reply to this comment
Fatal error: Cannot use string offset as an array in 
/data/www/my/library/autoChooseServer.php on line 19
12/14/2009 07:41:26 PM Michael Slusarz Comment #14
Version ⇒ Git master
Queue ⇒ Horde Framework Packages
State ⇒ Resolved
Reply to this comment
Fixed in Horde 3.3.6.
12/14/2009 07:40:36 PM CVS Commit Comment #12 Reply to this comment
Changes have been made in CVS for this ticket:

Bug: 8751
Merge from git:horde 0fdcebdbb7db59cd901735b7fd71afcaf05c0583
http://cvs.horde.org/diff.php/framework/Crypt/Crypt/Attic/smime.php?rt=horde&r1=1.49.2.22&r2=1.49.2.23&ty=u
12/09/2009 06:58:38 PM medawson (at) boston22 (dot) com Comment #11 Reply to this comment
Presuming that you return a reasonable error message indicating that, 
I think that it's fine.  It would certainly have steered me more 
quickly toward regenerating my certificate.
12/09/2009 06:52:16 PM Michael Slusarz Comment #10 Reply to this comment
For lack of a better way to solve this - what about aborting 
certificate parsing once we figure out the x.509 cert is not version 3?
12/09/2009 04:48:29 PM medawson (at) boston22 (dot) com Comment #9 Reply to this comment
I see the problem with the certificate.  Sorry about that.  I've fixed 
my cert creation steps and am having better luck now.
12/09/2009 08:27:34 AM Michael Slusarz Comment #8 Reply to this comment
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.
12/07/2009 01:58:55 PM medawson (at) boston22 (dot) com Comment #7
New Attachment: smime_keypair.pk12 Download
Reply to this comment
Okay, let's ignore the message with an invalid signature.  (Sorry 
about that - quite possibly a copy/paste error on my end.)

When I attempt to view the "Details" link for the public half of my 
own (self-signed) keypair (attached for your reference with no private 
key or export passphrases - feel free to use both as I've revoked the 
certificate) in the "Your S/MIME Public/Private Certificates " section 
of the S/MIME options page I get the error that I reported in the 
title of this ticket.
12/07/2009 03:59:45 AM Michael Slusarz Comment #6
Priority ⇒ 1. Low
Reply to this comment
I'm really confused.  There is no errors viewing that message with 
either the lastest CVS of FRAMEWORK_3 or the latest git code (although 
the message has an invalid signature).  But there is talk about 
viewing a public key?  So I don't know where this problem is supposed 
to be triggered.
12/06/2009 03:14:52 PM medawson (at) boston22 (dot) com Comment #5
New Attachment: smime_signed_message.txt Download
Reply to this comment
Message source uploaded.
12/04/2009 10:21:07 PM Jan Schneider Comment #4
State ⇒ Feedback
Summary ⇒ Fatal error: Cannot use string offset as an array in lib/Horde/Crypt/smime.php on line 770
Reply to this comment
Please upload the message source as an attachment.
12/04/2009 09:58:08 PM medawson (at) boston22 (dot) com Comment #3 Reply to this comment
One further correction - I see the error when attempting to view the 
details link on my own keypair's public key, not the key itself.
12/04/2009 09:49:26 PM medawson (at) boston22 (dot) com Comment #2 Reply to this comment
Apologies for my copy-and-paste error.  That's the submitter's public 
certificate in the description.

Below is a sample message signed with that certificate.

From myaiser@mac.com  Fri Dec  4 16:41:38 2009
Return-Path: <myaiser@mac.com>
X-Spam-Checker-Version: SpamAssassin 3.2.1-gr1 (2007-05-02) on
         omicron.boston22.com
X-Spam-Level:
X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham
         version=3.2.1-gr1
X-Original-To: medawson@boston22.com
Delivered-To: medawson@boston22.com
Received: by omicron.boston22.com (Postfix, from userid 65534)
         id C0A1832582C7; Fri,  4 Dec 2009 16:41:38 -0500 (EST)
Received: from asmtpout024.mac.com (asmtpout024.mac.com [17.148.16.99])
         by omicron.boston22.com (Postfix) with ESMTP id 9ED0632580B4
         for <medawson@boston22.com>; Fri,  4 Dec 2009 16:41:35 -0500 (EST)
MIME-version: 1.0
Received: from [172.16.1.6]
  (pool-151-203-48-185.bos.east.verizon.net [151.203.48.185])
  by asmtp024.mac.com
  (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit))
  with ESMTPA id <0KU500EW7DL2VN90@asmtp024.mac.com> for medawson@boston22.com;
  Fri, 04 Dec 2009 13:41:27 -0800 (PST)
From: "Michelle L. Yaiser" <myaiser@mac.com>
Content-type: multipart/signed; boundary=Apple-Mail-13-335327992;
  protocol="application/pkcs7-signature"; micalg=sha1
Subject: signed email
Date: Fri, 04 Dec 2009 16:41:25 -0500
Message-id: <8512D0AA-2D16-4E6F-AA9E-B553EDBAE4FA@mac.com>
To: Matthew Dawson <medawson@boston22.com>
X-Mailer: Apple Mail (2.1077)
Status: RO
X-Status:
X-Keywords:
X-UID: 160933


--Apple-Mail-13-335327992
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
         charset=us-ascii

This email message has been signed.



--Apple-Mail-13-335327992
Content-Disposition: attachment;
         filename=smime.p7s
Content-Type: application/pkcs7-signature;
         name=smime.p7s
Content-Transfer-Encoding: base64

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIDmjCCA5Yw
ggJ+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iygE8KBCmZauWh3nNHiob
nEM5qBj6kaiatyL7Wz9BzFXTn5pW46N2v7gGt9IdVhyFLXp12eNQrkkTU9kIGi7sqMw21egzIu+E
7SszoWnPPGvrttVOPgQthO5EAC2Qn/JZViXAAu15IeTihzykERqlaflCYEGS/bCVFCdcR8yp9Lbw
LAdhOP5uA9+6daGTk4Rr8AIQC6t4OV35zQQr85yTXtTUPL/5Vo2EQ21mAf6E6TL6BVSzV7jZjlsL
kCcw6Ad6q7cF9ttCjtA567wuAtt1mpdjUO7EUfBq6DbfWGIYiXdqc0EdDkFLaxIKQ0wIAAAAAAAA

--Apple-Mail-13-335327992--

12/04/2009 09:47:20 PM medawson (at) boston22 (dot) com Comment #1
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ Fatal error: Cannot use string offset as an array in /var/www/localhost/htdocs/horde-webmail/lib/Horde/Crypt/smime.php on line 770
Type ⇒ Bug
Queue ⇒ IMP
Reply to this comment
When trying to read S/MIME-encrypted or signed messages I cannot read 
them at all in single message mode - I get only a blank screen.  When 
I select the message for multiple message view mode I get the above 
error.  It happens regardless of whether I've got the sender's public 
certificate imported.

I get a similar error when attempting to view my own public key.

Here's a sample message that demonstrates the issue:

Certificate:
     Data:
         Version: 1 (0x0)
         Serial Number:
             82:21:04:c2:9d:04:1d:1a
         Signature Algorithm: sha1WithRSAEncryption
         Issuer: C=US, ST=Massachusetts, L=Brighton, O=Michelle 
Yaiser, CN=Michelle Yaiser/emailAddress=myaiser@mac.com
         Validity
             Not Before: Dec  4 20:29:06 2009 GMT
             Not After : Jan  3 20:29:06 2010 GMT
         Subject: C=US, ST=Massachusetts, L=Brighton, O=Michelle 
Yaiser, CN=Michelle Yaiser/emailAddress=myaiser@mac.com
         Subject Public Key Info:
             Public Key Algorithm: rsaEncryption
             RSA Public Key: (2048 bit)
                 Modulus (2048 bit):
                     00:c0:6e:59:64:84:f9:3a:2a:d2:c9:78:bc:01:73:
                     d3:c7:6b:85:7f:9a:88:17:38:dd:19:a8:13:79:58:
                     8d:e4:f0:ce:10:cc:79:ab:f5:0a:97:3f:78:f7:ad:
                     2d:3d:39:79:4f:6b:5d:26:21:2e:cc:77:c5:04:da:
                     a2:c2:79:40:97:0a:2f:e3:17:e9:27:22:4d:a2:16:
                     b7:93:00:e5:16:81:9a:c6:e8:d3:3d:9d:1a:36:21:
                     dd:bc:f5:c3:c2:fd:83:21:ed:19:ff:46:ac:e5:e7:
                     e9:79:94:10:aa:50:fc:9a:23:93:78:fa:b0:c3:e7:
                     43:4e:8b:3d:6c:0b:9f:60:dd:77:29:09:f8:f0:94:
                     96:bd:59:f9:5c:0a:f3:74:a4:29:2b:93:61:d8:ab:
                     94:e5:be:43:41:b9:2a:fc:37:70:d2:4d:c3:f5:53:
                     a5:e5:85:04:ed:07:75:01:5a:56:ba:38:0c:24:06:
                     f6:1b:04:01:df:71:53:32:f7:b6:d3:51:21:b2:f8:
                     7d:14:13:43:a2:07:69:ef:88:d3:c3:54:15:28:f8:
                     40:81:ff:65:24:be:3d:ab:91:97:d9:81:e9:07:b5:
                     45:22:60:29:09:c4:7c:21:f1:bf:e7:b5:bf:c5:5e:
                     6b:95:9d:8a:f2:74:62:2f:ba:7c:e8:60:92:3c:c7:
                     dc:b7
                 Exponent: 65537 (0x10001)
     Signature Algorithm: sha1WithRSAEncryption
         b6:1e:8f:03:aa:ee:b9:b5:f2:47:fc:0b:4e:65:14:46:27:c8:
         53:bc:52:02:29:a0:8d:65:2c:16:c8:3f:a8:64:e5:1f:7e:65:
         05:2b:20:10:e2:cf:2e:cc:ad:5f:09:7e:8c:e2:d9:b0:bf:de:
         8f:1f:06:b5:d7:f5:d1:e9:3f:9c:44:c6:c4:f9:73:f4:8a:d9:
         d0:d3:5a:0c:0c:bf:50:76:bf:ff:5c:54:70:0d:a1:3e:9a:b4:
         fc:8d:79:6e:00:a0:f2:59:6b:ef:f5:33:8a:33:f0:47:f9:f3:
         98:81:83:99:d8:00:7e:00:47:8e:dc:51:cd:70:d5:55:40:50:
         c2:ab:ce:2f:66:07:3d:a5:37:bb:6b:91:bb:59:50:e7:59:de:
         29:61:bf:fb:1d:6f:84:df:9d:b9:b9:db:11:dc:01:dd:79:0c:
         2c:4e:86:f6:6f:ea:f4:c1:97:b2:7a:43:32:86:e8:d8:06:73:
         5f:cf:61:f8:98:63:69:e6:b2:af:94:8f:b7:c5:65:e7:3f:22:
         6f:02:03:0b:2d:a5:78:d6:4c:ff:61:89:e9:37:e5:f4:da:64:
         d6:51:f2:f2:b5:8b:5a:a6:6e:5d:f6:03:a5:a9:c3:62:fe:d8:
         17:cd:c7:97:8d:e7:24:a0:d6:9f:38:60:1f:be:4f:38:ee:4a:
         24:c2:a3:ae
-----BEGIN CERTIFICATE-----
MIIDljCCAn4CCQCCIQTCnQQdGjANBgkqhkiG9w0BAQUFADCBjDELMAkGA1UEBhMC
VVMxFjAUBgNVBAgTDU1hc3NhY2h1c2V0dHMxETAPBgNVBAcTCEJyaWdodG9uMRgw
FgYDVQQKEw9NaWNoZWxsZSBZYWlzZXIxGDAWBgNVBAMTD01pY2hlbGxlIFlhaXNl
cjEeMBwGCSqGSIb3DQEJARYPbXlhaXNlckBtYWMuY29tMB4XDTA5MTIwNDIwMjkw
NloXDTEwMDEwMzIwMjkwNlowgYwxCzAJBgNVBAYTAlVTMRYwFAYDVQQIEw1NYXNz
YWNodXNldHRzMREwDwYDVQQHEwhCcmlnaHRvbjEYMBYGA1UEChMPTWljaGVsbGUg
WWFpc2VyMRgwFgYDVQQDEw9NaWNoZWxsZSBZYWlzZXIxHjAcBgkqhkiG9w0BCQEW
D215YWlzZXJAbWFjLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
AMBuWWSE+Toq0sl4vAFz08drhX+aiBc43RmoE3lYjeTwzhDMeav1Cpc/ePetLT05
eU9rXSYhLsx3xQTaosJ5QJcKL+MX6SciTaIWt5MA5RaBmsbo0z2dGjYh3bz1w8L9
gyHt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