Skip to content

32 Byte key derivation may fail with a 16 Byte ROT key #10516

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
merged 1 commit into from
May 2, 2019

Conversation

yossi2le
Copy link
Contributor

@yossi2le yossi2le commented Apr 30, 2019

Description

When trying to derive 32 bytes key with a 16 bytes ROT key the process may fail cause the ROT returned buffer size from kvstore has been ignored.

This bug fix is influencing PR #10493 (STM32F303RE: Activate FLASHIAP) because the device key test is failing on that PR.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@JanneKiiskila, @jeromecoutant

Release Notes

@yossi2le yossi2le force-pushed the yossi_fix_device_key_when_no_trng branch 2 times, most recently from 7bbb082 to bf37b8b Compare April 30, 2019 14:38
@yossi2le yossi2le force-pushed the yossi_fix_device_key_when_no_trng branch from bf37b8b to f74d545 Compare April 30, 2019 14:44
@yossi2le
Copy link
Contributor Author

@jeromecoutant, sorry to bother you but please take a look again cause I thought about it and find out the real correction is a bit different and therefore I have updated the file.

@ciarmcom ciarmcom requested review from JanneKiiskila and a team April 30, 2019 15:00
@ciarmcom
Copy link
Member

@yossi2le, thank you for your changes.
@JanneKiiskila @ARMmbed/mbed-os-storage @ARMmbed/mbed-os-maintainers please review.

Copy link
Contributor

@davidsaada davidsaada left a comment

Choose a reason for hiding this comment

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

LGTM.

@adbridge
Copy link
Contributor

adbridge commented May 1, 2019

ci started

@mbed-ci
Copy link

mbed-ci commented May 1, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@JanneKiiskila
Copy link
Contributor

At least it now matches the function parameter defined in:

int TDBStore::reserved_data_get(void *reserved_data, size_t reserved_data_buf_size, size_t *actual_data_size)

Though I'm still wondering a bit which function it used before? Do we have an overloaded version somewhere, which does not have the last size_t *actual_size as parameter at all?

@yossi2le
Copy link
Contributor Author

yossi2le commented May 2, 2019

The actual_size parameter has a default value of 0 and therefore no overload function is needed.
You can see it at the function declaration in the header file.

@JanneKiiskila
Copy link
Contributor

Found it now, yep makes sense.

@JanneKiiskila
Copy link
Contributor

@adbridge @0xc0170 - target to next patch release, please.

@0xc0170 0xc0170 merged commit d30d772 into ARMmbed:master May 2, 2019
@0xc0170
Copy link
Contributor

0xc0170 commented May 2, 2019

This bug fix is influencing PR #10493 (STM32F303RE: Activate FLASHIAP) because the device key test is failing on that PR.

Also in , both will be in 5.12.3

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

Successfully merging this pull request may close these issues.

8 participants