From 7c894b2b99f57c0dddb54c0f1af87a1cd9383e5b Mon Sep 17 00:00:00 2001 From: Ulugbek Miniyarov Date: Fri, 8 Mar 2019 11:33:02 +0300 Subject: [PATCH] Fix x509 OpenSSL format when multiple OU's are present When formatting DN in OpenSSL format Multiple Organizational Unit Names (OU) in certificates throw `PHP Notice: Undefined index: id-at-organizationalUnitName` and returned array only contains the last OU. --- phpseclib/File/X509.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index 1a180253..3d4b1fcf 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -2977,7 +2977,7 @@ class File_X509 } $output.= $desc . '=' . $value; $result[$desc] = isset($result[$desc]) ? - array_merge((array) $dn[$prop], array($value)) : + array_merge((array) $result[$desc], array($value)) : $value; $start = false; }