Skip to content
Closed
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
3.0.2
* Fixed a null object reference bug when resolving SANs via the Entry Parameter.

3.0.1
* Fixed an issues when renewing ECC Certificates

Expand Down
2 changes: 1 addition & 1 deletion IISU/ClientPSCertStoreReEnrollment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public string ResolveSANString(ReenrollmentJobConfiguration config)
}
else if (config.JobProperties != null &&
config.JobProperties.TryGetValue("SAN", out object legacySanValue) &&
!string.IsNullOrWhiteSpace(legacySanValue.ToString()))
(legacySanValue is not null && !string.IsNullOrWhiteSpace(legacySanValue.ToString())))
{
sanValue = legacySanValue.ToString().Trim();
sourceUsed = "config.JobProperties[\"SAN\"] (legacy)";
Expand Down
9 changes: 6 additions & 3 deletions WindowsCertStore.UnitTests/SANsUnitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,18 @@ public void ResolveSanString_PrefersConfigSANs_WhenBothSourcesExist()
Assert.DoesNotContain("legacy.example.com", result); // ensure legacy ignored
}

[Fact]
public void ResolveSanString_UsesLegacySAN_WhenConfigSANsMissing()
[Theory]
[InlineData("dns=legacy.example.com&dns=old.example.com")]
[InlineData("")]
[InlineData(null)]
public void ResolveSanString_UsesLegacySAN_WhenConfigSANsMissing(string legacySan)
{
// Arrange
var config = new ReenrollmentJobConfiguration
{
JobProperties = new Dictionary<string, object>
{
{ "SAN", "dns=legacy.example.com&dns=old.example.com" }
{ "SAN", legacySan }
},
SANs = new Dictionary<string, string[]>()
};
Expand Down
Loading