Guard Intermediates[0] and keep nulls out of the duplicate-PEM check - #71
Open
Pichatorn-A4K wants to merge 1 commit into
Open
Guard Intermediates[0] and keep nulls out of the duplicate-PEM check#71Pichatorn-A4K wants to merge 1 commit into
Pichatorn-A4K wants to merge 1 commit into
Conversation
Two small problems in GetAllConnectorCertsForOrder that both drop certificates from a synchronization with only a warning. Intermediates[0] is indexed with no bounds check, unlike the equivalent in GetSingleRecord() a few hundred lines up which does check Count > 0. A certificate whose chain comes back empty therefore raised IndexOutOfRangeException, which the per-certificate catch swallowed, so the certificate silently vanished from the sync. Now it fails with a message that names the certificate and order. Separately, 'certificate' is null for any status that is neither issued nor revoked, and that null was added to pemList - so the *second* pending certificate in the same order matched pemList.Contains(null) and was skipped as a 'duplicate PEM'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small problems in GetAllConnectorCertsForOrder that both drop
certificates from a synchronization with only a warning.
Intermediates[0] is indexed with no bounds check, unlike the equivalent in
GetSingleRecord() a few hundred lines up which does check Count > 0. A
certificate whose chain comes back empty therefore raised
IndexOutOfRangeException, which the per-certificate catch swallowed, so the
certificate silently vanished from the sync. Now it fails with a message that
names the certificate and order.
Separately, 'certificate' is null for any status that is neither issued nor
revoked, and that null was added to pemList - so the second pending
certificate in the same order matched pemList.Contains(null) and was skipped
as a 'duplicate PEM'.
Found during a pre-engagement audit of the shipped 2.4.1
net8.0assembly; verified by building and running the change against a fake client offline. Companion PRs from the same audit: #65, #66, #67.🤖 Generated with Claude Code