You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support allowing specific unknown critical extensions (#2377)
As of today, AWS-LC returns an error as part of verification if there
are any critical extensions present in the certificate being validated.
There have been asks to set a custom OID on the issued certificates to
ensure that additional validation is performed by customers after or
during the handshake. The intention is to prevent accidental mis-use of
these certificates without that extra validation.
To support this, we've decided to add two new APIs for this use case.
1. `X509_STORE_CTX_add_custom_crit_oid` adds an oid as an `ASN1_OBJECT`
to the list of "known" critical extension OIDs in `ctx`. Typical
OpenSSL/AWS-LC behavior returns an error if there are any unknown
critical extensions present within the certificates being validated.
This function lets users specify custom OIDs of any critical extensions
that are within the certificates being validated, that they wish to
allow. The callback mechanism enabled with
`X509_STORE_CTX_set_verify_crit_oids` must be set for this feature to
enabled.
2. `X509_STORE_CTX_set_verify_crit_oids` enables the
`X509_STORE_CTX_verify_crit_oids_cb` with `X509_STORE_CTX`. Consumers
should be performing additional validation against the custom extension
oids after or during the handshake. This callback forces users to
validate their custom OIDs when processing unknown custom critical
extensions. The `X509_STORE_CTX_verify_crit_oids_cb` callback function
gives the user the current certificate being validated as `x509` and a
stack of `ASN1_OBJECT`s representing unknown critical extension OIDs
that were found in `x509` and match those previously registered
via`|X509_STORE_CTX_add_custom_crit_oid` as `oids`.
This should not effect any existing consumers of `X509_verify_cert`. Any
existence of an unknown critical extension will still cause the entire
verification to be aborted. Only consumers that have enabled the
callback and set specific OIDs with `ASN1_OBJECT` can circumvent the
check and trigger the verification to pass.
### Testing:
Test certs were generated by the team asking for this feature.
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.
0 commit comments