-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC8737 and MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION #3241
Comments
Hi Nicola, I agree that the library should have something better than This has come up before, at least, in OpenVPN. Lev Stipakov has proposed a patch, but there are still design issues to resolve. If you have thoughts about the design, please share them here or on the Mbed TLS mailing list. It's unlikely that the Mbed TLS team will have time to work actively on this feature in the near or medium term. However, if Lev, you or someone else is willing to work on it, we'll strive to review designs and code. |
This routine is functionally equivalent to mbedtls_x509_crt_parse_der(), but it accepts an additional callback function which it calls with every unsupported certificate extension. Proposed solution to Mbed-TLS#3241 Signed-off-by: Nicola Di Lieto <[email protected]>
I made a pull request addressing this issue: #3243 |
ualpn requires mbedTLS to be configured and built with MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION which is not the default and can be a security risk. Therefore make BR2_PACKAGE_UACME_UALPN depend on BR2_PACKAGE_OPENSSL || BR2_PACKAGE_GNUTLS. Fixes http://autobuild.buildroot.net/results/d241121f8155bad9b6b25c16234576abb7fc940b See also ndilieto/uacme#23 Mbed-TLS/mbedtls#3241 Mbed-TLS/mbedtls#3243 http://lists.busybox.net/pipermail/buildroot/2020-April/281059.html http://lists.busybox.net/pipermail/buildroot/2020-April/281108.html Signed-off-by: Nicola Di Lieto <[email protected]> Signed-off-by: Thomas Petazzoni <[email protected]>
ualpn requires mbedTLS to be configured and built with MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION which is not the default and can be a security risk. Therefore make BR2_PACKAGE_UACME_UALPN depend on BR2_PACKAGE_OPENSSL || BR2_PACKAGE_GNUTLS. Fixes http://autobuild.buildroot.net/results/d241121f8155bad9b6b25c16234576abb7fc940b See also ndilieto/uacme#23 Mbed-TLS/mbedtls#3241 Mbed-TLS/mbedtls#3243 http://lists.busybox.net/pipermail/buildroot/2020-April/281059.html http://lists.busybox.net/pipermail/buildroot/2020-April/281108.html Signed-off-by: Nicola Di Lieto <[email protected]> Signed-off-by: Thomas Petazzoni <[email protected]> (cherry picked from commit 96c3b52) Signed-off-by: Peter Korsgaard <[email protected]>
As #3243 has been merged for a while now it looks like this issue can be closed. |
Enhancement\Feature Request
Justification
mbedtls_x509_crt_parse_der refuses to parse X509 certificates with unsupported critical extensions unless configured with MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION, which is a security risk. This is very different from the approach of GnuTLS and OpenSSL, which can parse such certificates, and only fail to validate them (OpenSSL for example has a -ignore_critical command line switch to allow ignoring critical extensions).
Also note that it is currently possible to use mbedtls_x509write_crt_set_extension to generate certificates with arbitrary critical extensions regardless of whether MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION is enabled or disabled.
In order to support RFC8737 - ACME TLS ALPN Challenge Extension, the ualpn software currently needs to parse certificates with a new critical extension that mbedTLS does not recognize. So users wishing to use mbedTLS as a backend, must build it with MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION, see ndilieto/uacme#23 and http://lists.busybox.net/pipermail/buildroot/2020-April/281084.html
Suggested enhancement
Allow mbedtls_x509_crt_parse_der to parse X509 certificates with unsupported critical extensions, like GnuTLS and OpenSSL do, and move their rejection at validation stage.
The text was updated successfully, but these errors were encountered: