6.0.0-beta1
9/24/25

[#5986] Problem importing public keys for S/MIME
Summary Problem importing public keys for S/MIME
Queue Horde Framework Packages
Queue Version HEAD
Type Enhancement
State Resolved
Priority 2. Medium
Owners chuck (at) horde (dot) org
Requester holger.richter (at) klst (dot) com
Created 12/13/2007 (6495 days ago)
Due 12/13/2007 (6495 days ago)
Updated 12/28/2007 (6480 days ago)
Assigned
Resolved 12/28/2007 (6480 days ago)
Milestone
Patch No

History
12/28/2007 10:26:51 PM Chuck Hagenbuch Comment #5
Assigned to Chuck Hagenbuch
State ⇒ Resolved
Reply to this comment
I was able to generate a test for this, including a multi-valued 
subjectAltName set of email addresses, and committed a similar patch 
(that also handles multiple values correctly).
12/13/2007 06:52:56 PM Jan Schneider Comment #4 Reply to this comment
Can you also provide an example cert that triggers this behavior?
12/13/2007 06:25:10 PM holger (dot) richter (at) klst (dot) com Comment #3 Reply to this comment
the patch for smime.php



*** framework/Crypt/Crypt/smime.php-orig        Wed Aug 22 11:48:04 2007

--- framework/Crypt/Crypt/smime.php        Wed Dec 12 16:00:45 2007

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

*** 1250,1255 ****

--- 1250,1265 ----

               } elseif (isset($key_info['subject']['emailAddress'])) {

                   return $key_info['subject']['emailAddress'];

               }

+         }

+         // Hg: the email address could be moved from the subject to the

+         //     subjectAltName field

+         if (is_array($key_info) && isset($key_info['extensions'])) {

+             if (isset($key_info['extensions']['subjectAltName'])) {

+                 $val = $key_info['extensions']['subjectAltName'];

+                 if (trim(stripos($val, "mail:")) == 1) {

+                         return substr($val, 7);

+                 }

+             }

           }



           return null;


12/13/2007 06:19:56 PM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
There was no patch attached.
12/13/2007 10:03:34 AM holger (dot) richter (at) klst (dot) com Comment #1
Priority ⇒ 2. Medium
Type ⇒ Enhancement
Summary ⇒ Problem importing public keys for S/MIME
Due ⇒ 12/13/2007
Queue ⇒ Horde Framework Packages
State ⇒ New
Reply to this comment
X.509 certificates may contain email addresses in the subject. But it 
is also possible to move the email address from the subject to the 
subject alternative name.



Horde looks for the mail address only in the subject of the 
certificate during the import of the public key. If the address was 
moved from the subject to the subject alternative name horde is unable 
to import the public key.



I hope this small patch for smime.php is suitable.

Saved Queries