From 844d7ab539866ff2a7898c376feff24cf5a72941 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Tue, 2 Jun 2020 08:51:04 -0500 Subject: [PATCH] X509: getPublicKey() didn't work for SPKAC --- phpseclib/File/X509.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index 8803fd7e..1f1f9f52 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -2101,7 +2101,12 @@ class X509 } if (isset($this->currentCert) && is_array($this->currentCert)) { - foreach (['tbsCertificate/subjectPublicKeyInfo', 'certificationRequestInfo/subjectPKInfo'] as $path) { + $paths = [ + 'tbsCertificate/subjectPublicKeyInfo', + 'certificationRequestInfo/subjectPKInfo', + 'publicKeyAndChallenge/spki' + ]; + foreach ($paths as $path) { $keyinfo = $this->subArray($this->currentCert, $path); if (!empty($keyinfo)) { break;