+8
−2
+6
−2
Loading
Independent review (Befund B): findExtensionValue() returned false both
when an extension's OID wasn't found at all and when it was found but
its extnValue failed to parse, so keyUsageAllowsCertSign() treated both
the same way -- "no restriction stated" (true). A present-but-malformed
keyUsage (wrong ASN.1 type, or extnValue too short to even be a TLV)
should fail closed instead.
findExtensionValue() gained an optional outPresent parameter, set as soon
as the OID is matched regardless of whether extnValue then parses.
keyUsageAllowsCertSign() uses it to return false (not true) when the
extension is present but unreadable.
Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com>