Update with Mbed TLS development branch as of 2019-06-27 #158
No reviewers
Labels
No labels
api-spec
bug
CLA requested
CLA valid
compliance
DO NOT MERGE
duplicate
enhancement
feature branch
good first issue
HEADER FORMATTING ISSUE
help wanted
Information
invalid
Jira status: AWAITING REVIEW
Jira status: CLOSED
Jira status: DONE
Jira status: IN PROGRESS
Jira status: IN REVIEW
Jira status: OPEN
Jira status: REOPENED
Jira status: RESOLVED
mirrored
mirror internally
needs: backports
needs: ci
needs: design review
needs: preceding PR
needs: review
needs: work
notabug
open for community contribution
Product Backlog
question
ready for merge
security
stale
type: bug
type: enhancement
type: question
web pages
wontfix
writing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-ARMmbed/mbed-crypto!158
Loading…
Reference in a new issue
No description provided.
Delete branch "dev-tls-dev-crypto-20190627"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Merge from Mbed TLS development as of 2019-06-27, plus two commits on top to get tests working.
Tests should pass if the PR job is updated to work with
MBEDTLS_USE_PSA_CRYPTOin the full configuration, which requires seedfiles. Raised PR https://github.com/ARMmbed/mbedtls-test/pull/90 for updating the PR job.Force pushed to remove commits added to help get better CI output.
I did the merge and ended up with the following differences:
config.pl.generate_visualc_files.pland the associated templates altogether. I see advantages both ways: keep the code simple here (we don't need the extra variable) vs keep the code as close as possible in the two projects. Since the code isn't completely identical, I'd rather do it my way, i.e. don't addINCLUDE_DIRECTORIES.tests/data_filesare relevant.We can add
MBEDTLS_USE_PSA_CRYPTOtofull, but this should be done in a separate PR that updatesall.shaccordingly, not as part of a merge.We should not
MBEDTLS_ECP_RESTARTABLEfromfull. Especially not since there's no specific test for it inall.sh, but I don't see why we'd start excluding it fromfull.@ -51,2 +51,3 @@$(MBEDTLS_CERT_WRITE) is_ca=1 serial=3 request_file=test-ca.req.sha256 selfsign=1 issuer_name="C=NL,O=PolarSSL,CN=PolarSSL Test CA" issuer_key=$(test_ca_key_file_rsa) issuer_pwd=$(test_ca_pwd_rsa) not_before=20110212144400 not_after=20210212144400 md=SHA1 version=3 output_file=$@test-ca.der: test-ca.crtall_final += test-ca.crtNone of the changes in the directory
tests/data_filesare relevant. They're all changes to certificates or to keys that are only used to run tests with certificates.This wasn't introduced in a merge commit, but came from upstream mbedtls where it was done in a separate PR. https://github.com/ARMmbed/mbedtls/pull/2403/commits/971dea37453c9c45a64f32d91bf4e6da73d0c047
See upstream source commit for why: https://github.com/ARMmbed/mbedtls/pull/2403/commits/03c35a5744ffddea35ce050439ab5580ea760dbf
@ -51,2 +51,3 @@$(MBEDTLS_CERT_WRITE) is_ca=1 serial=3 request_file=test-ca.req.sha256 selfsign=1 issuer_name="C=NL,O=PolarSSL,CN=PolarSSL Test CA" issuer_key=$(test_ca_key_file_rsa) issuer_pwd=$(test_ca_pwd_rsa) not_before=20110212144400 not_after=20210212144400 md=SHA1 version=3 output_file=$@test-ca.der: test-ca.crtall_final += test-ca.crtThis was a particularly hairy bit of the merge. For the sake of future merges, it's good to have this match more closely with what's in Mbed TLS.
The changes came along with upstream changes that allow testing even with PEM is disabled, which is still relevant to Mbed Crypto. See upstream PR https://github.com/ARMmbed/mbedtls/pull/2260
Note that
library/certs.cis part of libmbedcrypto.[so|a] until we do an Mbed TLS 3.0.Yes, but mbedtls and mbed-crypto have diverged here. We must not import the
config.plchange without also adaptingall.shaccordingly. As it stands, this PR completely removes testing of ECP_RESTARTABLE.This is being introduced as part of the merge of mbedtls, and we should not do it as part of a merge, especially since it would cause us to stop testing ECP_RESTARTABLE.
I had initially gone down the route of no changes to
generate_visualc_files, but decided it'd be nicer to include some changes given that I'd like to eventually use the same generation script in both repos. I chose to keep the templates aligned, even if the code isn't 100% aligned (it is closer to aligned now, though). We may be able to share generators and templates in the future if they are the same, and it's also easier for future merges to have 1 file need resolution than all the visualc files, plus the resolution in that one file isn't as tricky any more now that the code is more similar.@ -51,2 +51,3 @@$(MBEDTLS_CERT_WRITE) is_ca=1 serial=3 request_file=test-ca.req.sha256 selfsign=1 issuer_name="C=NL,O=PolarSSL,CN=PolarSSL Test CA" issuer_key=$(test_ca_key_file_rsa) issuer_pwd=$(test_ca_pwd_rsa) not_before=20110212144400 not_after=20210212144400 md=SHA1 version=3 output_file=$@test-ca.der: test-ca.crtall_final += test-ca.crtUgh, right. Even before Mbed TLS 3.0, we could move
certs.cto mbedtls, and link it intolibmbedcryptowhen building that in mbedtls, but I guess we won't get around to doing it that way. So ok, let's keep these changes.Upstream doesn't test with
MBEDTLS_ECP_RESTARTABLEright now either. The merge would bring us parity there. I've raised https://github.com/ARMmbed/mbedtls/pull/2738 to fix this.The goal of a merge is to bring two branches together, aligning them, with the destination branch gaining all the applicable advantages and disadvantages of the source branch.
We should align on all.sh where applicable (and a test with USE_PSA_CRYPTO off would make sense for Mbed Crypto at this point in time), but it's too bad Mbed TLS currently has this disadvantage.
mbed-crypto and mbedtls are close, but they are not identical in all points. In particular, we do have a different default configuration. I would have opposed dropping the testing of
MBEDTLS_ECP_RESTARTABLEin mbedtls, and I oppose dropping it here. Let's keep this difference until the testing is in place.Closing this PR. Will do merge again from an Mbed TLS development branch that does have testing of MBEDTLS_ECP_RESTARTABLE
Pull request closed