Skip to content

Deprecate Mbed Crypto #395

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

Conversation

gilles-peskine-arm
Copy link
Collaborator

Mbed Crypto is no longer being updated, but this is not visible on https://github.com/ARMmbed/mbed-crypto. In this pull request, I update the readme to let people know to use Mbed TLS instead.

To ease the transition, I propose to have a short transition period during which we fix the security issues in Mbed Crypto, and building the library is still possible but shows a warning. After this transition period, we'll make a last patch to cause the library to fail to build.

To verify what security fixes needed to be backported:

git log --decorate --name-status upstream-public/pr/3085..mbedtls-2.22.0 -- library ':!library/ssl_*' ':!library/x509*'

I saw only one relevant commit.

@gilles-peskine-arm gilles-peskine-arm added the needs: review The pull request is ready for review. This generally means that it has no known issues. label Apr 22, 2020
@yanesca
Copy link
Collaborator

yanesca commented Apr 23, 2020

I have confirmed that all currently available security fixes have been backported, checked spelling and I am happy with the transition period and how it is implemented and documented.

I have only one minor question: In README.md we are asking for feedback on the API to be mailed to [email protected]. Is this address still live and being monitored? We also mention that opening an issue on this repository is an other way to give feedback. Will these issues continue to be monitored in the future?

Copy link
Collaborator

@danh-arm danh-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor comments. The intent of the change looks good to me.

scripts/config.py set MBEDTLS_DEPRECATED_REMOVED
# Build with -O -Wextra to catch a maximum of issues.
make CC=clang CFLAGS='-O -Werror -Wall -Wextra' lib programs
make CC=clang CFLAGS='-O -Werror -Wall -Wextra -Wno-unused-function' tests
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, the rationale for doing this is not clear to me. Is it to avoid CI issues? Can you elaborate in the commit message?

README.md Outdated
We gratefully accept bug reports and contributions from the community. Please see the [contributing guidelines](CONTRIBUTING.md) for details on how to do this.

## Feedback welcome

Arm welcomes feedback on the design of the API. If you think something could be improved, please open an issue on our Github repository. Alternatively, if you prefer to provide your feedback privately, please email us at [`[email protected]`](mailto:[email protected]). All feedback received by email is treated confidentially.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @yanesca said, we should not say "open an issue on our Github repository". We should refer to the psa-crypto mailing list. Actually, we have the same issue on development.

The reference [email protected] is fine though (that's still active)

mpg and others added 3 commits April 23, 2020 17:56
Fix side channel in ECC code that allowed an adversary with access to
precise enough timing and memory access information (typically an
untrusted operating system attacking a secure enclave) to fully recover
an ECDSA private key. Found and reported by Alejandro Cabrera Aldaya,
Billy Brumley and Cesar Pereida Garcia. CVE-2020-10932

See the comments in the code for how an attack would go.

For ECDSA, leaking a few bits of the scalar over several signatures
translates to full private key recovery using a lattice attack.

Signed-off-by: Manuel Pégourié-Gonnard <[email protected]>
State this prominently in README.md and provide a little migration
guidance.

Signed-off-by: Gilles Peskine <[email protected]>
At this point in time, Mbed Crypto has no known security issues. But
in the future, it will not be updated if security issues are discovered.
So add warnings about the migration to Mbed TLS, but don't break the build yet.

Signed-off-by: Gilles Peskine <[email protected]>
@gilles-peskine-arm gilles-peskine-arm force-pushed the crypto-backport-2.22.0-and-deprecate branch from 4491000 to 42b7d35 Compare April 23, 2020 16:03
danh-arm
danh-arm previously approved these changes Apr 23, 2020
Copy link
Collaborator

@danh-arm danh-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM though a couple of missing Signed-off-by lines

Mbed Crypto is no longer being updated, so using it is deprecated.

Don't test with MBEDTLS_DEPRECATED_REMOVED anymore since the library
deliberately no longer builds when it's enabled.

Signed-off-by: Gilles Peskine <[email protected]>
@gilles-peskine-arm gilles-peskine-arm force-pushed the crypto-backport-2.22.0-and-deprecate branch from 83a819e to 5694d9f Compare April 23, 2020 16:59
@gilles-peskine-arm gilles-peskine-arm added the needs: ci Needs a passing full CI run label Apr 23, 2020
danh-arm
danh-arm previously approved these changes Apr 23, 2020
MBEDTLS_DEPRECATED_WARNING now always emits a #warning since this
branch as a whole is deprecated. So disable it from most builds.

Signed-off-by: Gilles Peskine <[email protected]>
Signed-off-by: Gilles Peskine <[email protected]>
@gilles-peskine-arm gilles-peskine-arm force-pushed the crypto-backport-2.22.0-and-deprecate branch from 5694d9f to cd2efd6 Compare April 23, 2020 18:05
@gilles-peskine-arm gilles-peskine-arm removed the needs: ci Needs a passing full CI run label Apr 23, 2020
@gilles-peskine-arm
Copy link
Collaborator Author

CI is passing except for the known breakage in Mbed OS.

Copy link
Collaborator

@yanesca yanesca left a 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.

@danh-arm danh-arm added ready for merge Design and code approved, CI passed, and likewise for backports. Label added by gatekeepers only. and removed needs: review The pull request is ready for review. This generally means that it has no known issues. labels Apr 27, 2020
@danh-arm danh-arm merged commit 8cc246c into ARMmbed:development Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for merge Design and code approved, CI passed, and likewise for backports. Label added by gatekeepers only.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants