-
Notifications
You must be signed in to change notification settings - Fork 3k
DRAFT: Enable MBEDTLS_FS_IO when this feature can be used #3955
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
retest uvisor |
@andresag01 Shall we close this? is this still relevant and we keep it open? |
ARM Internal Ref: IOTSSL-1723 |
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.
I approve this, but is this still a draft?
@RonEld: Thanks for the review! I have marked it as DRAFT because I would like the changes to be reviewed by at least two mbed TLS developers before removing the label. |
bump, is this still active, and targeting master? |
@mazimkhan @hanno-arm I think this falls to you two now |
"\n" \ | ||
"\/*\n" \ | ||
" * Only use features that do not require an entropy source when\n" \ | ||
" * DEVICE_ENTROPY_SOURCE is not defined in mbed OS.\n" \ |
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.
@andresag01 Where is DEVICE_ENTROPY_SOURCE
defined? It doesn't occur in the mbed-OS repository (I only found DEVICE_TRNG
in relation to entropy). Depending on its definition, it might need to be updated to incorporate the new potential source of entropy from the NV seed.
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.
This is simply an out-of-date comment from PR #2716. I think my original idea was to create a simple macro that would make it easy to tell if an entropy source is available. However, I think this idea was scraped at some point (due to some complications with config/implementation) and unfortunately the comment was not updated.
Note that I did not change this line in the PR other than to align the \ character. I will update the comment before removing the DRAFT label. However, could you please look at the actual code changes for the time being? Thanks!
@@ -21,6 +21,10 @@ | |||
#define MBEDTLS_ENTROPY_HARDWARE_ALT | |||
#endif | |||
|
|||
#if defined(MBED_CONF_FILESYSTEM_PRESENT) |
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.
Where is it documented what this option entails? Does it ensure the presence of FS IO functions that Mbed TLS is using, with the same (standard) signatures?
Will the use of the NV seed be configured by manually setting |
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.
The documentation is outdated and should be adapted. Overall the change looks good, but I'd like to have more confidence that MBED_CONF_FILESYSTEM_PRESENT
and MBEDTLS_FS_IO
are compatible.
@hanno-arm: I do not think that you have been reviewing this PR by taking into account all the background information. Please refer to the internal ticket IOTSSL-1283 that contains information on how this can be used for NV Seed and some security considerations. |
@andresag01 I'll look at that. Please add the reference to the PR description. |
@hanno-arm: Regarding the correspondence between MBED_CONF_FILESYSTEM_PRESENT and wha. I am not aware of any documentation from mbed OS that describes what MBED_CONF_FILESYSTEM_PRESENT does. I looked into the code in mbed_retarget.h which I believe is the place where some of the libc functions end up being implemented and observed:
If you continue looking into that file you will see that for example the file opening code has:
So I thought that MBED_CONF_FILESYSTEM_PRESENT is probably a superset of whats needed for MBEDTLS_FS_IO. But we could certainly ask for more information... |
We enable MBEDTLS_FS_IO whenever MBED_CONF_FILESYSTEM_PRESENT is defined in mbed OS. It is assumed that MBED_CONF_FILESYSTEM_PRESENT defines at least the filesystem functionality required by MBEDTLS_FS_IO
27bb879
to
9c9543e
Compare
The config.h now takes into consideration whether the mbed TLS NV Seed feature is present to decide which configuration is actually going to be used.
9c9543e
to
f922586
Compare
@hanno-arm Could you please re-review ? |
@hanno-arm @andresag01, any progress? |
@hanno-arm @RonEld @yanesca @sbutcher-arm Thoughts? This PR has been sitting for a while. I've also added @mazimkhan since this is a TLS-related PR. |
@hanno-arm @RonEld @yanesca @sbutcher-arm @mazimkhan |
@k-stachowiak is looking into this PR, and confirming it's current status. Based on new requirements we know are coming, we may close this PR and start again, or alternatively build on @andresag01 's existing work. |
Please reopen with an update if needed, I'll close this one now. |
Description
This patch is the first step towards integrating the mbed TLS NV Seed feature with mbed OS. The change enables the macro
MBEDTLS_FS_IO
when filesystem support is present in mbed OS. To use NV Seed, users will need to define the macrosMBEDTLS_ENTROPY_NV_SEED
andMBEDTLS_PLATFORM_STD_NV_SEED_FILE
either through the user config file or thembed_app.json
.NOTE: The entropy seed file will be stored unencrypted in the non-volatile storage.
@RonEld @sbutcher-arm @yanesca: Please review.
Status
IN DEVELOPMENT
Migrations
NO
Related PRs
List related PRs against other branches:
Todos