Skip to content

fix(cloud): tolerate unsupported key sizes/curves in CIT policy parse - #217

Open
TomaszSwierszczCA wants to merge 1 commit into
Venafi:masterfrom
TomaszSwierszczCA:ngts-cit-parse-resilience
Open

fix(cloud): tolerate unsupported key sizes/curves in CIT policy parse#217
TomaszSwierszczCA wants to merge 1 commit into
Venafi:masterfrom
TomaszSwierszczCA:ngts-cit-parse-resilience

Conversation

@TomaszSwierszczCA

Copy link
Copy Markdown
Contributor

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.

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.
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