diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index fa52bbb4..af46790f 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -1491,6 +1491,9 @@ class X509 it seems like perhaps the ASN.1 description ought not say the parameters field is OPTIONAL, but whatever. */ $cert['tbsCertificate']['subjectPublicKeyInfo']['algorithm']['parameters'] = null; + // https://tools.ietf.org/html/rfc3279#section-2.2.1 + $cert['signatureAlgorithm']['parameters'] = null; + $cert['tbsCertificate']['signature']['parameters'] = null; } } diff --git a/tests/Unit/File/X509/X509Test.php b/tests/Unit/File/X509/X509Test.php index 88ae279d..06c8efb3 100644 --- a/tests/Unit/File/X509/X509Test.php +++ b/tests/Unit/File/X509/X509Test.php @@ -140,6 +140,8 @@ aBtsWpliLSex/HHhtRW9AkBGcq67zKmEpJ9kXcYLEjJii3flFS+Ct/rNm+Hhm1l7 $cert = $x509->loadX509($cert); $this->assertArrayHasKey('parameters', $cert['tbsCertificate']['subjectPublicKeyInfo']['algorithm']); + $this->assertArrayHasKey('parameters', $cert['signatureAlgorithm']); + $this->assertArrayHasKey('parameters', $cert['tbsCertificate']['signature']); } private function _encodeOID($oid)