-
Notifications
You must be signed in to change notification settings - Fork 108
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
Added support for custom TLVs in manifest header #412
Conversation
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.
Very nice work! Just a couple minor items.
tools/keytools/sign.c
Outdated
tag = (uint16_t)arg2num(argv[i + 1], 2); | ||
len = (uint16_t)arg2num(argv[i + 2], 2); | ||
|
||
if ((tag < 0x0030) || (tag > 0xFEFE)) { |
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.
NIT: This still allows a tag of 0xFF which is not valid (HDR_PADDING).
This example adds a custom field when the signing tool is used to sign the firmware image: | ||
|
||
```bash | ||
./tools/keytools/sign --ed25519 --custom-tlv 0x34 4 0xAABBCCDD test-app/image.bin wolfboot_signing_private_key.der 4 |
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.
Could we add this test to one of the GitHub action tests?
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.
done!
b677f55
to
0996e0f
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.
Thank you so much for adding this feature! Excellent work.
Added support in
sign.c
for custom TLVs in the manifest header. Numeric values are supported (valid len: 1, 2, 4 or 8).[edit: custom length buffers are also supported via
--custom-tlv-buffer
]The numbers are stored in little-endian format (according to the current format of the other fields). The TLVs are part of the signed image, so their value is secured against modifications.
The custom fields stored in the TLV can be retrieved at runtime in wolfboot by using
wolfBoot_find_header()
.Documentation is updated accordingly.