Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public static function initialize(PathValidationConfig $config,
$state->_workingPublicKey = $tbsCert->subjectPublicKeyInfo();
$state->_workingPublicKeyParameters = self::getAlgorithmParameters(
$state->_workingPublicKey->algorithmIdentifier());
$state->_workingIssuerName = $tbsCert->issuer();
$state->_workingIssuerName = $tbsCert->subject();
$state->_maxPathLength = $config->maxLength();
return $state;
}
Expand Down
10 changes: 10 additions & 0 deletions test/unit/certification-path/CertificationPathValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ public function testExplicitTrustAnchor()
$validator->validate());
}

public function testExplicitTrustAnchorWithIntermediateCertificate()
{
$config = PathValidationConfig::defaultConfig()->withTrustAnchor(
self::$_path->certificates()[1]);
$validator = new PathValidator(Crypto::getDefault(), $config,
...[self::$_path->certificates()[2]]);
$this->assertInstanceOf(PathValidationResult::class,
$validator->validate());
}

public function testValidateFailNoCerts()
{
$validator = new PathValidator(Crypto::getDefault(),
Expand Down