-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix premature fopen() call in mbedtls_entropy_write_seed_file #3616
Fix premature fopen() call in mbedtls_entropy_write_seed_file #3616
Conversation
…S#3175 Signed-off-by: Victor Krasnoshchok <ct3da21164@protonmail.ch>
@militant-daos Thank you very much for contributing to Mbed TLS! Could you please add an entry to |
Sure, will update the suite. |
Signed-off-by: Victor Krasnoshchok <ct3da21164@protonmail.ch>
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.
Looks good to me!
The failure in the CI is only a glitch in the infrastructure. |
@militant-daos Could you please add a signed-by line to the last commit message? |
Signed-off-by: Victor Krasnoshchok <ct3da21164@protonmail.ch>
4b59685
to
a0c2d19
Compare
Sorry, I forgot to do that yesterday (I will create a pre-commit hook for this), thanks for pointing out. Added. |
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.
Thank you, looks good to me!
@militant-daos Now that the main PR is approved, could you please create the backports as well? Also, we normally credit contributors in our ChangeLog. Please feel free to add a file with your entry in |
@yanesca sure, will do. But first I need to reinstall my dev. environment, so this may take a while (I'll push the corresponding changes tomorrow) |
5fa3dac
Signed-off-by: Victor Krasnoshchok <ct3da21164@protonmail.ch>
5fa3dac
to
6361ad9
Compare
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.
LGTM.
The 2.16 backport looks good to me too, we can merge them as soon as the 2.7 backport is ready too. |
Since the only missing thing was an approved 2.7 backport, this pull request is ready for merge. I just want to re-run the pr-merge CI first. |
Fix premature fopen() call in mbedtls_entropy_write_seed_file
Signed-off-by: Victor Krasnoshchok ct3da21164@protonmail.ch
Description
The PR fixes potential seed file corruption in case if
path
param ofmbedtls_entropy_write_seed_file
is equal toMBEDTLS_PLATFORM_STD_NV_SEED_FILE
(or vice versa; i.e. the same file is used to read from and to write to).Status
READY
Requires Backporting
Yes
Migrations
NO
Steps to test
MBEDTLS_ENTROPY_NV_SEED
in the active config (config.h
);test_suite_entropy.data
in such a way to makeentropy_seed_file
define the same name asMBEDTLS_PLATFORM_STD_NV_SEED_FILE
(seedfile
by default);test_suite_entropy
target - NV-file related tests should pass.