Skip to content

Guard Intermediates[0] and keep nulls out of the duplicate-PEM check - #71

Open
Pichatorn-A4K wants to merge 1 commit into
Keyfactor:mainfrom
Pichatorn-A4K:fix/chain-index-and-null-pem
Open

Guard Intermediates[0] and keep nulls out of the duplicate-PEM check#71
Pichatorn-A4K wants to merge 1 commit into
Keyfactor:mainfrom
Pichatorn-A4K:fix/chain-index-and-null-pem

Conversation

@Pichatorn-A4K

Copy link
Copy Markdown

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.0 assembly; 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

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'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant