Skip to content

Commit

Permalink
Adjusting FMC logging to fix size issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nquarton committed Feb 4, 2025
1 parent f3e7f01 commit db03b08
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions fmc/src/flow/rt_alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@ impl RtAliasLayer {
return Err(CaliptraError::FMC_ALIAS_KV_COLLISION);
}

cprintln!("[aliasrt] Derive CDI");
cprintln!("[aliasrt] Store in in slot 0x{:x}", KEY_ID_RT_CDI as u8);
cprintln!("[art] Derive CDI");
cprintln!("[art] Store in in slot 0x{:x}", KEY_ID_RT_CDI as u8);

// Derive CDI
Self::derive_cdi(env, input.cdi, KEY_ID_RT_CDI)?;
report_boot_status(FmcBootStatus::RtAliasDeriveCdiComplete as u32);
cprintln!("[aliasrt] Derive Key Pair");
cprintln!("[art] Derive Key Pair");
cprintln!(
"[aliasrt] Store priv key in slot 0x{:x}",
"[art] Store priv key in slot 0x{:x}",
KEY_ID_RT_PRIV_KEY as u8
);

// Derive DICE Key Pair from CDI
let key_pair = Self::derive_key_pair(env, KEY_ID_RT_CDI, KEY_ID_RT_PRIV_KEY)?;
cprintln!("[aliasrt] Derive Key Pair - Done");
cprintln!("[art] Derive Key Pair - Done");
report_boot_status(FmcBootStatus::RtAliasKeyPairDerivationComplete as u32);

// Generate the Subject Serial Number and Subject Key Identifier.
Expand Down Expand Up @@ -101,16 +101,16 @@ impl RtAliasLayer {
#[inline(never)]
pub fn run(env: &mut FmcEnv) -> CaliptraResult<()> {
Self::extend_pcrs(env)?;
cprintln!("[aliasrt] Extend RT PCRs Done");
cprintln!("[art] Extend RT PCRs Done");

env.pcr_bank
.set_pcr_lock(caliptra_common::RT_FW_CURRENT_PCR);
env.pcr_bank
.set_pcr_lock(caliptra_common::RT_FW_JOURNEY_PCR);
cprintln!("[aliasrt] Lock RT PCRs Done");
cprintln!("[art] Lock RT PCRs Done");

Self::populate_dv(env)?;
cprintln!("[aliasrt] Populate DV Done");
cprintln!("[art] Populate DV Done");
report_boot_status(crate::FmcBootStatus::RtMeasurementComplete as u32);

// Retrieve Dice Input Layer from Hand Off and Derive Key
Expand Down Expand Up @@ -326,7 +326,7 @@ impl RtAliasLayer {

// Sign the `To Be Signed` portion
cprintln!(
"[aliasrt] Signing Cert with AUTHO
"[art] Signing Cert with AUTHO
RITY.KEYID = {}",
auth_priv_key as u8
);
Expand All @@ -338,7 +338,7 @@ impl RtAliasLayer {
let sig = okref(&sig)?;
// Clear the authority private key
cprintln!(
"[aliasrt] Erasing AUTHORITY.KEYID = {}",
"[art] Erasing AUTHORITY.KEYID = {}",
auth_priv_key as u8
);
// FMC ensures that CDIFMC and PrivateKeyFMC are locked to block further usage until the next boot.
Expand All @@ -347,13 +347,13 @@ impl RtAliasLayer {

let _pub_x: [u8; 48] = (&pub_key.x).into();
let _pub_y: [u8; 48] = (&pub_key.y).into();
cprintln!("[aliasrt] PUB.X = {}", HexBytes(&_pub_x));
cprintln!("[aliasrt] PUB.Y = {}", HexBytes(&_pub_y));
cprintln!("[art] PUB.X = {}", HexBytes(&_pub_x));
cprintln!("[art] PUB.Y = {}", HexBytes(&_pub_y));

let _sig_r: [u8; 48] = (&sig.r).into();
let _sig_s: [u8; 48] = (&sig.s).into();
cprintln!("[aliasrt] SIG.R = {}", HexBytes(&_sig_r));
cprintln!("[aliasrt] SIG.S = {}", HexBytes(&_sig_s));
cprintln!("[art] SIG.R = {}", HexBytes(&_sig_r));
cprintln!("[art] SIG.S = {}", HexBytes(&_sig_s));

// Verify the signature of the `To Be Signed` portion
if Crypto::ecdsa384_verify(env, auth_pub_key, tbs.tbs(), sig)? != Ecc384Result::Success {
Expand Down

0 comments on commit db03b08

Please sign in to comment.