-
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
New mbedtls_x509_crt_parse_der_with_ext_cb() routine #3243
Conversation
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]>
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]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution! I think the overall design is fine, it's simple and quite flexible. I left some individual comments on the interface, the documentation and the code.
We will need test cases for the new feature and a changelog entry in ChangeLog.d
.
As suggested in Mbed-TLS#3243 (comment) Co-authored-by: Gilles Peskine <[email protected]> Signed-off-by: Nicola Di Lieto <[email protected]>
added make_copy parameter as suggested in Mbed-TLS#3243 (comment) Co-authored-by: Gilles Peskine <[email protected]> Signed-off-by: Nicola Di Lieto <[email protected]>
Can you please edit the commits to have a signed-off-by line? Unfortunately applying GitHub suggestions doesn't do this. Also please give them a meaningful subject line. It would be better to squash the related ones together, too (e.g. “Minor documentation improvements”). |
Co-authored-by: Gilles Peskine <[email protected]> Signed-off-by: Nicola Di Lieto <[email protected]>
new name: mbedtls_x509_crt_parse_der_with_ext_cb Co-authored-by: Gilles Peskine <[email protected]> Signed-off-by: Nicola Di Lieto <[email protected]>
As suggested in Mbed-TLS#3243 (comment) Co-authored-by: Gilles Peskine <[email protected]> Signed-off-by: Nicola Di Lieto <[email protected]>
added make_copy parameter as suggested in Mbed-TLS#3243 (comment) Co-authored-by: Gilles Peskine <[email protected]> Signed-off-by: Nicola Di Lieto <[email protected]>
Done, and also squashed/rebased the trivial ones. Please. let me know what else you expect me to do to get this merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Regarding the make_copy
parameter, I understand and share Gilles's hesitations, but I don't have anything better to suggest, and I think we'll get an opportunity to clean things up when preparing 3.0, so I don't think those hesitation should prevent us from approving this.
Hi, many thanks for merging this. One last question, in which future mbedTLS release will this be included? I ask so that I can include this in uacme - see ndilieto/uacme#23 |
You're welcome, and thank you for contributing in the first place! This will be included in Mbed TLS 2.23.0, which should be released at the beginning of July. |
This deprecated option is no longer needed following the merge of Mbed-TLS#3243 The removed option also affected the handling of critical unsupported certificate policies. Therefore also pass the certificate policies extension to the callback supplied to mbedtls_x509_crt_parse_der_with_ext_cb() if it contains unsupported policies, which allows the callback to fully replicate the behaviour of the removed option.
This deprecated option is no longer needed following the merge of Mbed-TLS#3243 The removed option also affected the handling of critical unsupported certificate policies. Therefore also pass the certificate policies extension to the callback supplied to mbedtls_x509_crt_parse_der_with_ext_cb() if it contains unsupported policies, which allows the callback to fully replicate the behaviour of the removed option. Signed-off-by: Nicola Di Lieto <[email protected]>
The mbedtls_x509_crt_parse_der_with_ext_cb function (available in mbedTLS 2.23.0 and later) allows parsing the "id-pe-acmeIdentifier" certificate extension without having to configure the deprecated MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION. Fixes #23 See also Mbed-TLS/mbedtls#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]> (cherry picked from commit 96c3b52) Signed-off-by: Peter Korsgaard <[email protected]>
This can be replaced with a version check, as the new function was merged upstream: Mbed-TLS/mbedtls#3243 (comment)
Following the update to mbedTLS 2.28.0 in commit 0f8aab0, ualpn can work with mbedTLS without restrictions. References https://git.buildroot.net/buildroot/commit?id=96c3b52132b41716ca445b4c73a1a8886c26e5ee ndilieto/uacme#23 (comment) ndilieto/uacme@bbee626 Mbed-TLS/mbedtls#3243 Signed-off-by: Nicola Di Lieto <[email protected]> Signed-off-by: Peter Korsgaard <[email protected]>
Following the update to mbedTLS 2.28.0 in commit 0f8aab0, ualpn can work with mbedTLS without restrictions. References https://git.buildroot.net/buildroot/commit?id=96c3b52132b41716ca445b4c73a1a8886c26e5ee ndilieto/uacme#23 (comment) ndilieto/uacme@bbee626 Mbed-TLS/mbedtls#3243 Signed-off-by: Nicola Di Lieto <[email protected]> Signed-off-by: Peter Korsgaard <[email protected]>
Following the update to mbedTLS 2.28.0 in commit 0f8aab0, ualpn can work with mbedTLS without restrictions. References https://git.buildroot.net/buildroot/commit?id=96c3b52132b41716ca445b4c73a1a8886c26e5ee ndilieto/uacme#23 (comment) ndilieto/uacme@bbee626 Mbed-TLS/mbedtls#3243 Signed-off-by: Nicola Di Lieto <[email protected]> Signed-off-by: Peter Korsgaard <[email protected]> (cherry picked from commit 6c7b469) Signed-off-by: Peter Korsgaard <[email protected]>
Following the update to mbedTLS 2.28.0 in commit 0f8aab0, ualpn can work with mbedTLS without restrictions. References https://git.buildroot.net/buildroot/commit?id=96c3b52132b41716ca445b4c73a1a8886c26e5ee ndilieto/uacme#23 (comment) ndilieto/uacme@bbee626 Mbed-TLS/mbedtls#3243 Signed-off-by: Nicola Di Lieto <[email protected]> Signed-off-by: Peter Korsgaard <[email protected]> (cherry picked from commit 6c7b469) Signed-off-by: Peter Korsgaard <[email protected]>
Description
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 #3241
Signed-off-by: Nicola Di Lieto [email protected]
Status
READY
Requires Backporting
NO
Migrations
NO