Skip to content
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

Generate DeviceKey RoT for all non-internal storage type #67

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ void kv_store_global_api_example()
res = kv_reset("/kv/");
printf("kv_reset -> %d\n", err_code(res));

if (strcmp(STR(MBED_CONF_STORAGE_STORAGE_TYPE), "TDB_EXTERNAL") == 0) {
if (strcmp(STR(MBED_CONF_STORAGE_STORAGE_TYPE), "TDB_INTERNAL") != 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Was the intention the same originally but with an incorrect condition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The original condition was incomplete. The condition should be "anything except TDB_INTERNAL", which includes both TDB_EXTERNAL and FILESYSTEM.

Copy link
Contributor

@hugueskamba hugueskamba Mar 31, 2021

Choose a reason for hiding this comment

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

So the intention was the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

Copy link
Contributor

Choose a reason for hiding this comment

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

The original condition was incomplete.

How did you complete the condition? It [the condition] is now the opposite of what it was before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not the opposite. Notice TDB_EXTERNAL, == before, and TDB_INTERNAL, != now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I didnt notice INTERNAL...

// Generate DeviceKey Root of Trust for non-internal storage types
// as SecureStore requires
res = DeviceKey::get_instance().generate_root_of_trust();
printf("DeviceKey::get_instance().generate_root_of_trust() -> %d\n", res);
}
Expand Down