mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-14 09:24:07 +00:00
X509: make it so ip addresses and domain names can be used together
This commit is contained in:
parent
9b53c45f04
commit
a577a09a4f
@ -3228,9 +3228,10 @@ class File_X509 {
|
|||||||
$this->setExtension('id-ce-subjectKeyIdentifier', $subject->currentKeyIdentifier);
|
$this->setExtension('id-ce-subjectKeyIdentifier', $subject->currentKeyIdentifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$altName = array();
|
||||||
|
|
||||||
if (isset($subject->domains) && count($subject->domains) > 1) {
|
if (isset($subject->domains) && count($subject->domains) > 1) {
|
||||||
$this->setExtension('id-ce-subjectAltName',
|
$altName = array_map(array('File_X509', '_dnsName'), $subject->domains);
|
||||||
array_map(array('File_X509', '_dnsName'), $subject->domains));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($subject->ipAddresses) && count($subject->ipAddresses)) {
|
if (isset($subject->ipAddresses) && count($subject->ipAddresses)) {
|
||||||
@ -3244,10 +3245,14 @@ class File_X509 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count($ipAddresses)) {
|
if (count($ipAddresses)) {
|
||||||
$this->setExtension('id-ce-subjectAltName', $ipAddresses);
|
$altName = array_merge($altName, $ipAddresses);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($altName)) {
|
||||||
|
$this->setExtension('id-ce-subjectAltName', $altName);
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->caFlag) {
|
if ($this->caFlag) {
|
||||||
$keyUsage = $this->getExtension('id-ce-keyUsage');
|
$keyUsage = $this->getExtension('id-ce-keyUsage');
|
||||||
if (!$keyUsage) {
|
if (!$keyUsage) {
|
||||||
|
Loading…
Reference in New Issue
Block a user