-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement FIPS commands for ROM and invoke SELF-TEST from Runtime. (#693
) * Decouple dependency of Kat execution from Rom * Decouple verification environment from ROM dependency * Move fips-self-test test to test crate * Use conditional compilation to build caliptra-runtime as ROM image * Postpone self test execution * Fix 1600 byte ROM size regression in #684 When callers from separate crates call a large generic function like verify_lms_signature_cfi(), rustc 1.70 may build multiple versions (depending on optimizer heuristics), even when all the generic parameters are identical. This is bad, as it can bloat the binary and the second copy violates the FIPS requirements that the same machine code be used for the KAT as the actual implementation. To defend against it, we provide a non-generic function that production firmware should call instead. * Rename goto_idle to enter_idle * Fix typo * Renamed SELF_TEST * START/GET_PROGRESS commands * kats executes before image verification * Remove persistent_data from venv * Implement FIPS commands in ROM VERSION SELF_TEST SHUTDOWN * Fix unassigned error codes * Address feedback - Remove mut from fips create_slice - Use copy_bytes_to_mbox in write_response - Restore idevid tests mistakenly removed - Add bounds checking on fmc and rt sizes * Rom itegrity test call from Runtime. * Fixes for gate --------- Co-authored-by: Anthony Rocha <[email protected]> Co-authored-by: Kor Nielsen <[email protected]>
- Loading branch information
1 parent
28e8146
commit ab9a518
Showing
32 changed files
with
774 additions
and
171 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Licensed under the Apache-2.0 license | ||
|
||
use crate::cprintln; | ||
use crate::mailbox_api::{FipsVersionResp, MailboxResp, MailboxRespHeader}; | ||
use caliptra_drivers::CaliptraResult; | ||
use caliptra_drivers::SocIfc; | ||
|
||
pub struct FipsVersionCmd; | ||
impl FipsVersionCmd { | ||
pub const NAME: [u8; 12] = *b"Caliptra RTM"; | ||
pub const MODE: u32 = 0x46495053; | ||
|
||
pub fn execute(soc_ifc: &SocIfc) -> CaliptraResult<MailboxResp> { | ||
cprintln!("[rt] FIPS Version"); | ||
|
||
let resp = FipsVersionResp { | ||
hdr: MailboxRespHeader::default(), | ||
mode: Self::MODE, | ||
fips_rev: soc_ifc.get_version(), | ||
name: Self::NAME, | ||
}; | ||
|
||
Ok(MailboxResp::FipsVersion(resp)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.