Skip to content

Avoid overwriting tls headers in submodule mode #344

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

Closed
wants to merge 2 commits into from

Conversation

Ionic
Copy link

@Ionic Ionic commented Jan 16, 2020

Description (required)

Summary of change (What the change is for and why)

When crypto is embedded as a submodule and the cmake build system is used, it would previously overwrite some header files installed by tls.

Most of them are harmless (since they should be identical), but config.h is a special case.

tls's and crypto's config.h files differ widely in scope and overwriting the more general, bigger config.h file from tls with crypto's smaller one will make a lot of features unavailable in programs using tls.

Let's just avoid overwriting any tls header in submodule mode.

Note that this will not fix the potential issue that crypto might be using a different configuration than tls in the submodule case.

Documentation (Details of any document updates required)

N/A


Pull request type (required)

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[ ] Feature update (New feature / Functionality change / New API)
[ ] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results (required)

[ ] No Tests required for this change (E.g docs only update)
[ ] Covered by existing mbed-os tests (Greentea or Unittest)
[X] Tests / results supplied as part of this PR

Reviewers (optional)

TBD


Release Notes (required for feature/major PRs)

Summary of changes

N/A

Impact of changes

N/A

Migration actions required

N/A

When crypto is embedded as a submodule and the cmake build system is
used, it would previously overwrite some header files installed by tls.
Most of them are harmless (since they should be identical), but config.h
is a special case.

tls's and crypto's config.h files differ widely in scope and overwriting
the more general, bigger config.h file from tls with crypto's smaller
one will make a lot of features unavailable in programs using tls.

Let's just avoid overwriting any tls header in submodule mode.

Note that this will not fix the potential issue that crypto might be
using a different configuration than tls in the submodule case.

Fixes Mbed-TLS/mbedtls#2965
@Ionic
Copy link
Author

Ionic commented Jan 16, 2020

Needs test case.

This makes sure that common headers that are also found in tls are not
getting overwritten for cmake builds.
@Ionic Ionic marked this pull request as ready for review January 16, 2020 09:40
@Ionic
Copy link
Author

Ionic commented Jan 16, 2020

Let's see if that works. I'm a bit unsure about the test case and whether it'll do what we need, or whether this stuff should better be part of tls instead of crypto, but oh well.

@gilles-peskine-arm
Copy link
Collaborator

Mbed Crypto has been merged back into Mbed TLS, therefore this pull request is no longer relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants