From 29b9642965b4170a9c90f9d4c3df118183c77ce2 Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Thu, 27 Sep 2012 14:38:37 +0200 Subject: [PATCH] X509: Fix 'OU' attribute mapping, add 'SN' (surname) short name, add 'role', 'title', 'description', 'x500UniqueIdentifier' DN attributes. --- phpseclib/File/X509.php | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index aea67ce0..b5d787fc 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -1041,12 +1041,15 @@ class File_X509 { '2.5.4.10' => 'id-at-organizationName', '2.5.4.11' => 'id-at-organizationalUnitName', '2.5.4.12' => 'id-at-title', + '2.5.4.13' => 'id-at-description', '2.5.4.46' => 'id-at-dnQualifier', '2.5.4.6' => 'id-at-countryName', '2.5.4.5' => 'id-at-serialNumber', '2.5.4.65' => 'id-at-pseudonym', '2.5.4.17' => 'id-at-postalCode', '2.5.4.9' => 'id-at-streetAddress', + '2.5.4.45' => 'id-at-uniqueIdentifier', + '2.5.4.72' => 'id-at-role', '0.9.2342.19200300.100.1.25' => 'id-domainComponent', '1.2.840.113549.1.9' => 'pkcs-9', @@ -1749,7 +1752,6 @@ class File_X509 { return 'id-at-organizationName'; case 'id-at-dnqualifier': case 'dnqualifier': - case 'ou': return 'id-at-dnQualifier'; case 'id-at-commonname': case 'commonname': @@ -1786,6 +1788,7 @@ class File_X509 { return 'id-at-givenName'; case 'id-at-surname': case 'surname': + case 'sn': return 'id-at-surname'; case 'id-at-initials': case 'initials': @@ -1795,10 +1798,24 @@ class File_X509 { return 'id-at-generationQualifier'; case 'id-at-organizationalunitname': case 'organizationalunitname': + case 'ou': return 'id-at-organizationalUnitName'; case 'id-at-pseudonym': case 'pseudonym': return 'id-at-pseudonym'; + case 'id-at-title': + case 'title': + return 'id-at-title'; + case 'id-at-description': + case 'description': + return 'id-at-description'; + case 'id-at-role': + case 'role': + return 'id-at-role'; + case 'id-at-uniqueidentifier': + case 'uniqueidentifier': + case 'x509uniqueidentifier': + return 'id-at-uniqueIdentifier'; default: return false; } @@ -1961,7 +1978,7 @@ class File_X509 { case 'id-at-organizationName': $desc = 'O='; break; - case 'id-at-dnQualifier': + case 'id-at-organizationalUnitName': $desc = 'OU='; break; case 'id-at-commonName': @@ -2640,4 +2657,4 @@ class File_X509 { $this->removeDNProp('id-at-commonName'); $this->setDNProp('id-at-commonName', $this->domains[0]); } -} \ No newline at end of file +}