From b438abf18f1882d234cbe042e141cdb8c23b4e26 Mon Sep 17 00:00:00 2001 From: GraceSolutions Date: Thu, 4 Jun 2026 22:40:20 -0400 Subject: [PATCH 1/2] fix(tests): eliminate UtcNow race in GetChainCertificateTargetStore_NonSelfSigned test The non-self-signed chain-routing test called DateTimeOffset.UtcNow.AddDays(1) twice -- once for the root cert and once for the intermediate cert -- so when the wall clock ticked a second between the two calls the intermediate's notAfter ended up later than the root's notAfter, and CertificateRequest.Create rejected it: System.ArgumentException : The requested notAfter value (...:11) is later than issuerCertificate.NotAfter (...:10). (Parameter 'notAfter') Capture notBefore/notAfter once at the top of the test and reuse the same DateTimeOffset for both certificates so the intermediate's validity window is guaranteed equal to (not later than) the issuer's. TESTS - 216/216 passing locally; this was reliably reproducible under CI load (latest failure on commit ceea76255bad). --- src/PSInfisicalAPI.Tests/CsrAndRequestCmdletTests.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/PSInfisicalAPI.Tests/CsrAndRequestCmdletTests.cs b/src/PSInfisicalAPI.Tests/CsrAndRequestCmdletTests.cs index 48f32ab..0684050 100644 --- a/src/PSInfisicalAPI.Tests/CsrAndRequestCmdletTests.cs +++ b/src/PSInfisicalAPI.Tests/CsrAndRequestCmdletTests.cs @@ -409,6 +409,9 @@ namespace PSInfisicalAPI.Tests using (System.Security.Cryptography.RSA rootRsa = System.Security.Cryptography.RSA.Create(2048)) using (System.Security.Cryptography.RSA intermediateRsa = System.Security.Cryptography.RSA.Create(2048)) { + DateTimeOffset notBefore = DateTimeOffset.UtcNow.AddMinutes(-5); + DateTimeOffset notAfter = DateTimeOffset.UtcNow.AddDays(1); + System.Security.Cryptography.X509Certificates.CertificateRequest rootRequest = new System.Security.Cryptography.X509Certificates.CertificateRequest( "CN=ChainRouting.Root", rootRsa, @@ -416,7 +419,7 @@ namespace PSInfisicalAPI.Tests System.Security.Cryptography.RSASignaturePadding.Pkcs1); rootRequest.CertificateExtensions.Add(new System.Security.Cryptography.X509Certificates.X509BasicConstraintsExtension(true, false, 0, true)); - using (System.Security.Cryptography.X509Certificates.X509Certificate2 rootCert = rootRequest.CreateSelfSigned(DateTimeOffset.UtcNow.AddMinutes(-5), DateTimeOffset.UtcNow.AddDays(1))) + using (System.Security.Cryptography.X509Certificates.X509Certificate2 rootCert = rootRequest.CreateSelfSigned(notBefore, notAfter)) { System.Security.Cryptography.X509Certificates.CertificateRequest intermediateRequest = new System.Security.Cryptography.X509Certificates.CertificateRequest( "CN=ChainRouting.Intermediate", @@ -426,7 +429,7 @@ namespace PSInfisicalAPI.Tests intermediateRequest.CertificateExtensions.Add(new System.Security.Cryptography.X509Certificates.X509BasicConstraintsExtension(true, false, 0, true)); byte[] serial = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 }; - using (System.Security.Cryptography.X509Certificates.X509Certificate2 intermediate = intermediateRequest.Create(rootCert, DateTimeOffset.UtcNow.AddMinutes(-5), DateTimeOffset.UtcNow.AddDays(1), serial)) + using (System.Security.Cryptography.X509Certificates.X509Certificate2 intermediate = intermediateRequest.Create(rootCert, notBefore, notAfter, serial)) { Assert.NotEqual(intermediate.Subject, intermediate.Issuer); From bf641d662da3990c229aa3bead5198cc9e180a7b Mon Sep 17 00:00:00 2001 From: GraceSolutions Date: Thu, 4 Jun 2026 22:40:31 -0400 Subject: [PATCH 2/2] Build artifacts for b438abf18f18 Auto-generated by build.ps1 -CommitArtifacts. Build 2026.06.05.0240. Module DLL and manifest embed BuildCommitHash=b438abf18f18, matching the source commit they were produced from. --- CHANGELOG.md | 6 ++++++ Module/PSInfisicalAPI/PSInfisicalAPI.psd1 | 4 ++-- Module/PSInfisicalAPI/bin/PSInfisicalAPI.dll | Bin 369152 -> 369152 bytes 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 246134c..6ec4b6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) loos ## Unreleased +## 2026.06.05.0240 + +- Build produced from commit b438abf18f18. + +## Unreleased (carried forward) + ## 2026.06.05.0215 - Build produced from commit 82f99ea7d4a4. diff --git a/Module/PSInfisicalAPI/PSInfisicalAPI.psd1 b/Module/PSInfisicalAPI/PSInfisicalAPI.psd1 index 7b58e4f..d26aabf 100644 --- a/Module/PSInfisicalAPI/PSInfisicalAPI.psd1 +++ b/Module/PSInfisicalAPI/PSInfisicalAPI.psd1 @@ -1,6 +1,6 @@ @{ RootModule = 'PSInfisicalAPI.psm1' - ModuleVersion = '2026.06.05.0215' + ModuleVersion = '2026.06.05.0240' GUID = 'b8a2f3d4-7c51-4d2f-9e6a-1f0c8b3d4e51' Author = 'Grace Solutions' CompanyName = 'Grace Solutions' @@ -62,7 +62,7 @@ LicenseUri = 'https://www.gnu.org/licenses/agpl-3.0.html' ProjectUri = 'https://prod.git.gracesolution.info/gsadmin/PSInfisicalAPI' ReleaseNotes = 'See CHANGELOG.md in the project repository for release history.' - CommitHash = '82f99ea7d4a4' + CommitHash = 'b438abf18f18' } } } \ No newline at end of file diff --git a/Module/PSInfisicalAPI/bin/PSInfisicalAPI.dll b/Module/PSInfisicalAPI/bin/PSInfisicalAPI.dll index 2b78ce74c9b6578890934c67dab569ecfa29c871..6d6b7aa683deef5539741c4e8c61dac465c84f21 100644 GIT binary patch delta 356 zcmZoTBGzz3Y(fXir&Wdz8+%%N7+ZUow)QYDn$P&5U4H@dcKrn`vT*{ON({@RBrbY3 zZ*8uRniwXhBv~XI87G;f8kueXY{xn=n&p7?mMPOaX0Zkc zoSHjd#s2bXhbf7F-6xhg-kSbm7HgRTR8&9&DhgCDvbS#%!Ga+X$Vy`{1hOEc1%nYo z3J@Cu<&%MOsX)~xKz=GvjR_DZ17(wds*}NLK&GSuS!UDw=d(JpgN)W=Fqo{!q_v%K I0qcK809Fxg&j0`b delta 356 zcmZoTBGzz3Y(fW%Z=^v>V^3=jV`~r7)*j|X^BJ$V>n~v5uD^gqHcmi(jgzj-9wW!L zzSDe1W?a3vJ?0;axC4)cQJSS?YNC0HNutU0dOKDlCqq*`0|o|LMg|Kb10yp%10Vv5 z7#W&sBdawuHnOlVPcus~GBQa{v`jQJF;6p1H8(d&GfLk6*^YH$G|NJH+27MUX0Zkc zWGir<{k3zS^9;tV&lgn$%$)vW7HgRTR8$xy3Q|8~+2Y;hL5ZT=cTT?DUN@UnfRX(= z0~^CD_UqfH&S8yaWHw|l-Trwlt2<*Tkj0?QV8LL-kj7vMgsBXP4CV|e3?@L@gu#%( z7${=_gyukbGoZK;5SlO~17$6N*bK-9$(RE5nFFB-kZr_}JiUKDt0OzeXgvml$%;%` L+Zh+I{$~ULI>~Eg