x509: allow AnyExtendedKeyUsage for CA#5313
Conversation
reneme
left a comment
There was a problem hiding this comment.
Generally this looks good to me, but I'm wondering if we should consider this new "any usage" in X509_Certificate::allowed_extended_usage() as well:
botan/src/lib/x509/x509cert.cpp
Lines 481 to 492 in f97d7db
... essentially, if ex contains "X509v3.AnyExtendedKeyUsage" we may immediately return true and don't even bother checking the vector.
However, RFC 5280 Section 4.2.1.12 quite vaguely states:
Applications that require the presence of a particular purpose MAY reject certificates that include the anyExtendedKeyUsage OID but not the particular OID expected for the application.
However, in my opinion, if we consider "any usage" good enough for specifying a CA, we might as well consider it for other usages as well.
There was a problem hiding this comment.
Changes look fine to me.
Do you happen to have a certificate handy that we could place in the test suite to exercise those new checks? (Edit: just recalled that you had in fact already posted some, sorry.) Perhaps along those lines. I.e. a CA certificate that doesn't have any specific EKUs but just "any". Just place it in "src/tests/data/x509/misc" and add a test ensuring that it recognized as 1) "a CA" and 2) capable of signing CRLs, OCSPs or similar.
c95029e to
c86208c
Compare
added test. but cert is considered as not capable for OCSP because maybe it's ok to leave it this way (otherwise should to modify testing cert ku/eku: |
I found it surprising that "PKIX.ServerAuth" and "PKIX.ClientAuth" is checked with
I think, |
c86208c to
effda0a
Compare
* add new OID 2.5.29.37.0 = X509v3.AnyExtendedKeyUsage * x509: is_CA_cert: consider X509v3.AnyExtendedKeyUsage as certificate signing compatible purpose * x509: allowed_extended_usage: allow any usage if contains AnyExtendedKeyUsage * x509: has_ex_constraint: return true if contains AnyExtendedKeyUsage
effda0a to
f50701d
Compare
|
changed:
|
Resolves #5308