fix(cloud): tolerate unsupported key sizes/curves in CIT policy parse - #217
Open
TomaszSwierszczCA wants to merge 1 commit into
Open
fix(cloud): tolerate unsupported key sizes/curves in CIT policy parse#217TomaszSwierszczCA wants to merge 1 commit into
TomaszSwierszczCA wants to merge 1 commit into
Conversation
NGTS zones backed by third-party CAs advertise key lengths the client cannot represent (e.g. DigiCert/ZTPKI CITs advertise RSA 1024). _parse_policy_response_to_object built KeyType() for every advertised size/curve with no guard, so KeyType.__init__ raised BadData and crashed read_zone_conf / get_policy / request_cert for the entire zone - making such CITs unusable via the SDK. Skip entries KeyType cannot represent (log + continue) in both the keyTypes loop and the recommended-settings key, matching the Go SDK which tolerates unknown key lengths (cloud.go passes them through unchecked). Request-side validation stays strict. Live-verified against an NGTS DigiCert CIT: read_zone_conf and enrollment now succeed (RSA 1024 dropped, RSA 2048/3072/4096 + EC p256/p384/p521/ed25519 retained). Adds an offline regression test; offline suite: 56 passed.
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.
NGTS zones backed by third-party CAs advertise key lengths the client cannot represent (e.g. DigiCert/ZTPKI CITs advertise RSA 1024). _parse_policy_response_to_object built KeyType() for every advertised size/curve with no guard, so KeyType.init raised BadData and crashed read_zone_conf / get_policy / request_cert for the entire zone - making such CITs unusable via the SDK.
Skip entries KeyType cannot represent (log + continue) in both the keyTypes loop and the recommended-settings key, matching the Go SDK which tolerates unknown key lengths (cloud.go passes them through unchecked). Request-side validation stays strict.
Live-verified against an NGTS DigiCert CIT: read_zone_conf and enrollment now succeed (RSA 1024 dropped, RSA 2048/3072/4096 + EC p256/p384/p521/ed25519 retained). Adds an offline regression test; offline suite: 56 passed.