Skip to content

Commit

Permalink
Working on the ability to terminate trust at a chosen Trust Anchor.
Browse files Browse the repository at this point in the history
This should pass the tests.
It used to be that we did not fail when chainBuilder.Build(certificate) returned false.  That is not longer the case and I think it is a better way to validate.  In the past we would examine the problem flags to determine if it was a failure.

This means many tests need to run with X509RevocationMode set to NoCheck and that is fine for these tests.
  • Loading branch information
JoeShook committed Nov 5, 2024
1 parent f42c279 commit b431104
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
7 changes: 0 additions & 7 deletions Udap.Common/Certificates/TrustChainValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,6 @@ public bool IsTrustedCertificate(string clientName,
{
bool isAnchor = roots?.FindByThumbprint(chainElement.Certificate.Thumbprint) != null;

if (this.ChainElementHasProblems(chainElement))
{
this.NotifyProblem(chainElement);
this.NotifyUntrusted(chainElement.Certificate);
return false;
}

if (isAnchor)
{
// Found a valid anchor!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public UdapControllerCommunityTest(ApiForCommunityTestFixture fixture, ITestOutp
{
DisableCertificateDownloads = true,
UrlRetrievalTimeout = TimeSpan.FromMilliseconds(1),
RevocationMode = X509RevocationMode.NoCheck
},
problemFlags,
_testOutputHelper.ToLogger<TrustChainValidator>()));
Expand Down Expand Up @@ -567,7 +568,8 @@ public async Task ValidateChainWithMyAnchorAndIntermediateTest()
{
DisableCertificateDownloads = true,
UrlRetrievalTimeout = TimeSpan.FromMilliseconds(1),
},
RevocationMode = X509RevocationMode.NoCheck
},
problemFlags,
_testOutputHelper.ToLogger<TrustChainValidator>()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public UdapControllerTests(ApiTestFixture fixture, ITestOutputHelper testOutputH
{
DisableCertificateDownloads = true,
UrlRetrievalTimeout = TimeSpan.FromMilliseconds(1),
RevocationMode = X509RevocationMode.NoCheck
},
problemFlags,
testOutputHelper.ToLogger<TrustChainValidator>()));
Expand Down
2 changes: 2 additions & 0 deletions _tests/UdapServer.Tests/IntegrationRegistrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ public async Task GoodIUdapClientRegistrationStore()
{
DisableCertificateDownloads = true,
UrlRetrievalTimeout = TimeSpan.FromMicroseconds(1),
RevocationMode = X509RevocationMode.NoCheck
},
problemFlags,
_testOutputHelper.ToLogger<TrustChainValidator>()));
Expand Down Expand Up @@ -415,6 +416,7 @@ public async Task GoodCertificationsRegistrationStore()
{
DisableCertificateDownloads = true,
UrlRetrievalTimeout = TimeSpan.FromMicroseconds(1),
RevocationMode = X509RevocationMode.NoCheck
},
problemFlags,
_testOutputHelper.ToLogger<TrustChainValidator>()));
Expand Down

0 comments on commit b431104

Please sign in to comment.