X509: adjust comments

This commit is contained in:
Patrick Monnerat 2012-11-05 12:08:20 +01:00
parent 916dcff8a8
commit 0afed5b65b

View File

@ -64,9 +64,9 @@ define('FILE_X509_VALIDATE_SIGNATURE_BY_CA', 1);
*/ */
define('FILE_X509_DN_ARRAY', 0); // Internal array representation. define('FILE_X509_DN_ARRAY', 0); // Internal array representation.
define('FILE_X509_DN_STRING', 1); // String. define('FILE_X509_DN_STRING', 1); // String.
define('FILE_X509_DN_ASN1', 2); // ASN.1 element. define('FILE_X509_DN_ASN1', 2); // ASN.1 Name string.
define('FILE_X509_DN_OPENSSL', 3); // OpenSSL compatible array. define('FILE_X509_DN_OPENSSL', 3); // OpenSSL compatible array.
define('FILE_X509_DN_CANON', 4); // Canonical ASN.1 element. define('FILE_X509_DN_CANON', 4); // Canonical ASN.1 RDNs string.
define('FILE_X509_DN_HASH', 5); // Name hash for file indexing. define('FILE_X509_DN_HASH', 5); // Name hash for file indexing.
/** /**
@ -113,6 +113,7 @@ class File_X509 {
var $netscape_ca_policy_url; var $netscape_ca_policy_url;
var $Name; var $Name;
var $RelativeDistinguishedName;
var $CRLNumber; var $CRLNumber;
var $CRLReason; var $CRLReason;
var $IssuingDistributionPoint; var $IssuingDistributionPoint;
@ -282,7 +283,7 @@ class File_X509 {
- https://www.opends.org/wiki/page/DefinitionRelativeDistinguishedName - https://www.opends.org/wiki/page/DefinitionRelativeDistinguishedName
*/ */
$RelativeDistinguishedName = array( $this->RelativeDistinguishedName = array(
'type' => FILE_ASN1_TYPE_SET, 'type' => FILE_ASN1_TYPE_SET,
'min' => 1, 'min' => 1,
'max' => -1, 'max' => -1,
@ -295,7 +296,7 @@ class File_X509 {
// RDNSequence does not define a min or a max, which means it doesn't have one // RDNSequence does not define a min or a max, which means it doesn't have one
'min' => 0, 'min' => 0,
'max' => -1, 'max' => -1,
'children' => $RelativeDistinguishedName 'children' => $this->RelativeDistinguishedName
); );
$this->Name = array( $this->Name = array(
@ -752,7 +753,7 @@ class File_X509 {
'constant' => 1, 'constant' => 1,
'optional' => true, 'optional' => true,
'implicit' => true 'implicit' => true
) + $RelativeDistinguishedName ) + $this->RelativeDistinguishedName
) )
); );
@ -2248,7 +2249,6 @@ class File_X509 {
$filters = array(); $filters = array();
$filters['value'] = array('type' => FILE_ASN1_TYPE_UTF8_STRING); $filters['value'] = array('type' => FILE_ASN1_TYPE_UTF8_STRING);
$asn1->loadFilters($filters); $asn1->loadFilters($filters);
$RelDN = $this->Name['children']['rdnSequence']['children'];
$result = ''; $result = '';
foreach ($dn['rdnSequence'] as $rdn) { foreach ($dn['rdnSequence'] as $rdn) {
foreach ($rdn as &$attr) { foreach ($rdn as &$attr) {
@ -2266,7 +2266,7 @@ class File_X509 {
} }
} }
} }
$result .= $asn1->encodeDER($rdn, $RelDN); $result .= $asn1->encodeDER($rdn, $this->RelativeDistinguishedName);
} }
return $result; return $result;
case FILE_X509_DN_HASH: case FILE_X509_DN_HASH: