Skip to content

Commit

Permalink
[ownership] Test an INFO page configuration
Browse files Browse the repository at this point in the history
Add an INFO page to the various `with-flash` configurations in the
ownership transfer tests.

Signed-off-by: Chris Frantz <[email protected]>
  • Loading branch information
cfrantz committed Nov 22, 2024
1 parent f793a4e commit e6c2bfe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sw/host/tests/ownership/flash_permission_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ fn flash_info_check(info: &[FlashRegion<'_>], unlocked: bool) -> Result<()> {
FlashRegion("info", 1, 0, 3, "RD-xx-xx-SC-EC-xx", "LK") // owner config 1
},
FlashRegion("info", 1, 0, 4, "uu-uu-uu-uu-uu-uu", "LK"), // creator reserved
FlashRegion("info", 1, 0, 5, "xx-xx-xx-xx-xx-xx", "UN"), // owner reserved
FlashRegion("info", 1, 0, 5, "RD-WR-ER-xx-xx-HE", "UN"), // owner reserved
FlashRegion("info", 1, 0, 6, "xx-xx-xx-xx-xx-xx", "UN"), // owner reserved
FlashRegion("info", 1, 0, 7, "xx-xx-xx-xx-xx-xx", "UN"), // owner reserved
FlashRegion("info", 1, 0, 8, "xx-xx-xx-xx-xx-xx", "UN"), // owner reserved
Expand Down
12 changes: 11 additions & 1 deletion sw/host/tests/ownership/transfer_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ use opentitanlib::chip::helper::{OwnershipActivateParams, OwnershipUnlockParams}
use opentitanlib::crypto::ecdsa::{EcdsaPrivateKey, EcdsaPublicKey};
use opentitanlib::ownership::{
ApplicationKeyDomain, CommandTag, FlashFlags, KeyMaterial, OwnerApplicationKey, OwnerBlock,
OwnerConfigItem, OwnerFlashConfig, OwnerFlashRegion, OwnerRescueConfig, OwnershipKeyAlg,
OwnerConfigItem, OwnerFlashConfig, OwnerFlashInfoConfig, OwnerFlashRegion, OwnerInfoPage,
OwnerRescueConfig, OwnershipKeyAlg,
};
use opentitanlib::rescue::serial::RescueSerial;

Expand Down Expand Up @@ -241,6 +242,15 @@ where
],
..Default::default()
}));
owner
.data
.push(OwnerConfigItem::FlashInfoConfig(OwnerFlashInfoConfig {
config: vec![
// Bank 1, page 5, filesystem-like configuration.
OwnerInfoPage::new(1, 5, config.filesystem()),
],
..Default::default()
}));
}
if cfg & CFG_RESCUE1 != 0 {
let mut rescue = OwnerRescueConfig::all();
Expand Down

0 comments on commit e6c2bfe

Please sign in to comment.