-
Notifications
You must be signed in to change notification settings - Fork 747
boards: apollo3: Support loading signed applications #4232
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
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.
Generally looks good, but two of the under the radar changes warrant explanation or potentially better solution
kernel::static_buf!( | ||
capsules_system::storage_permissions::tbf_header::TbfHeaderStoragePermissions< | ||
$C, | ||
$D, |
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 just fixing a missing parameter that wasn't working before this PR, yes?
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.
Yeah, the current code doesn't compile, this just fixes it so it does compile when we go to use it
@@ -1016,7 +1016,7 @@ impl<'a> I2CClient for Atecc508a<'a> { | |||
Operation::ShaEnd(run) => { | |||
if status == Err(i2c::Error::DataNak) || status == Err(i2c::Error::AddressNak) { | |||
// The device isn't ready yet, try again | |||
if run == 50 { | |||
if run == 500 { |
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.
Why? Why was it working before but not now? Is this just a magic number that happens to sort of work? The datasheet seems to indicate a specific amount of time to wait until the device is ready (~600us it looks like)
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.
It worked before, but only for small amounts of data (which is all the test cases do). When I tried to SHA an entire application it would timeout.
It's just a magic number that works
See the commit: 6aa39e0 for details
Increase the SHA timeout to ensure that if we are processing a lot of data (like an entire application) the operation finishes within the timeout. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
If the "atecc508a" feature is enabled we can do signature verification. The application is signed like this ```shell elf2tab -n sensor-receive --stack 2048 --app-heap 1024 --kernel-heap 1024 \ --kernel-major 2 --kernel-minor 0 --minimum-footer-size 3000 \ -o build/sensor-receive.tab \ build/cortex-m0/cortex-m0.elf \ build/cortex-m3/cortex-m3.elf \ build/cortex-m4/cortex-m4.elf \ build/cortex-m7/cortex-m7.elf \ build/rv32imac/rv32imac.0x20040080.0x80002800.elf \ build/rv32imac/rv32imac.0x403B0080.0x3FCC0000.elf \ build/rv32imc/rv32imc.0x41000080.0x42008000.elf \ build/rv32imc/rv32imc.0x00080080.0x40008000.elf \ build/rv32imc/rv32imc.0x20030080.0x10005000.elf \ build/rv32imc/rv32imc.0x20030880.0x10008000.elf \ build/rv32imc/rv32imc.0x20032080.0x10008000.elf \ build/rv32imc/rv32imc.0x20034080.0x10008000.elf \ build/rv32imac/rv32imac.0x40430080.0x80004000.elf \ build/rv32imac/rv32imac.0x40440080.0x80007000.elf \ --ecdsa-nist-p256-private p256-private-key.p8 \ --verbose ``` Which then generates the following log with debug prints enabled ``` Initialization complete. Entering main loop Looking for process binary in flash=0x00040000-0x000D5FFF Checking: Checking Some("sensor-receive") footer 0 Checking: Integrity region is 40000-50798; footers at 50798-60000 Checking: Current footer slice 50798-60000 ProcessCheck: @50798 found a len 68 footer: EcdsaNistP256 Checking: Found 0, checking Checking: Check status for process sensor-receive, footer 0: Checking Checking: check_done gave result Ok(Accept(None)) Loading: Check succeeded for process sensor-receive Looking for process binary in flash=0x00060000-0x000D5FFF Loading: process flash=0x00040000-0x0005FFFF ram=0x100082B8-0x1005FFFF Loading: sensor-receive [0] flash=0x00040000-0x00060000 ram=0x1000A000-0x1000DFFF Loading: Loaded process sensor-receive ``` Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
acf968d
to
ed69bb0
Compare
Pull Request Overview
If the "atecc508a" feature is enabled we can do application signature verification.
The application is signed like this
Which then generates the following log with debug prints enabled
Testing Strategy
Loading a signed application, with this diff
TODO or Help Wanted
N/A
Documentation Updated
/docs
, or no updates are required.Formatting
make prepush
.