-
Notifications
You must be signed in to change notification settings - Fork 3k
crypto: Remove PSA Crypto API from targets without entropy #9710
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
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
An entropy source is required in order to use the PSA Crypto API. The only devices Mbed OS knows are guaranteed by default to have an entropy source are those devices with a TRNG. Don't enable the PSA Crypto API by default for devices that Mbed OS can't know have an entropy source. This avoids run-time errors when an entropy source is not present on these targets. Applications can add their own entropy source by place entropy into their systems, implementing their own NV Seed read and write callbacks, and then enabling the MBEDTLS_ENTROPY_NV_SEED configuration option to notify the PSA Crypto implementation that an entropy source is present and how to use it. See https://os.mbed.com/docs/mbed-os/v5.11/porting/entropy-sources.html for the background on why entropy is fundamental to system security and how to inject entropy into systems that lack an on-board source of entropy.
gilles-peskine-arm
approved these changes
Feb 13, 2019
orenc17
approved these changes
Feb 13, 2019
We might want to consider additionally removing "PSA" from extra_labels_add for this target, depending on if other PSA requirements are met or not (e.g. ITS with such small flash space available). |
orenc17
approved these changes
Feb 13, 2019
cmonr
approved these changes
Feb 13, 2019
0xc0170
approved these changes
Feb 14, 2019
@teetak01 Will this fix it , please confirm |
CI started |
Test run: SUCCESSSummary: 12 of 12 test jobs passed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
An entropy source is required in order to use the PSA Crypto API. The
only devices Mbed OS knows are guaranteed by default to have an entropy
source are those devices with a TRNG. Don't enable the PSA Crypto API by
default for devices that Mbed OS can't know have an entropy source. This
avoids run-time errors when an entropy source is not present on these
targets.
Applications can add their own entropy source by place entropy into
their systems, implementing their own NV Seed read and write callbacks,
and then enabling the MBEDTLS_ENTROPY_NV_SEED configuration option to
notify the PSA Crypto implementation that an entropy source is present
and how to use it.
See https://os.mbed.com/docs/mbed-os/v5.11/porting/entropy-sources.html
for the background on why entropy is fundamental to system security and
how to inject entropy into systems that lack an on-board source of
entropy.
This is a follow up PR to #9605 which inadvertently turned on the PSA Crypto API by default. The NUCLEO_F411RE board requires a source of entropy that isn't available by default. Not all Mbed OS applications our users have written for the F411RE require the PSA Crypto API nor are guaranteed to have injected the necessary entropy in order to use the PSA Crypto API. #9605 broke compatibility with existing applications on the F411RE. This PR is a fix to restore functionality to existing applications.
Pull request type
Reviewers
@teetak01 @orenc17