Skip to content

Commit

Permalink
Add ability to supply a toml file for ImageOptions in image-builder.
Browse files Browse the repository at this point in the history
A new parameter is added in this change to allow supplying a toml file
with the desired options to image-builder. This allows settings values
like the firmware versions, SVNs, or key sets.
  • Loading branch information
zhalvorsen committed Jan 28, 2025
1 parent 3b76999 commit 7e6fd7b
Show file tree
Hide file tree
Showing 11 changed files with 445 additions and 20 deletions.
9 changes: 9 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ hex.workspace = true
memoffset.workspace = true
nix.workspace = true
once_cell.workspace = true
serde.workspace = true
serde_derive.workspace = true
serde_json.workspace = true
sha2.workspace = true
toml.workspace = true
zerocopy.workspace = true

[features]
Expand Down
80 changes: 72 additions & 8 deletions builder/bin/image_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ fn main() {
.arg(arg!(--"zeros" "Build an image bundle with zero'd FMC and RT. This will NMI immediately."))
.arg(arg!(--"owner-sig-override" [FILE] "Manually overwrite the owner_sigs of the FW bundle image with the contents of binary [FILE]. The signature should be an ECC signature concatenated with an LMS signature").value_parser(value_parser!(PathBuf)))
.arg(arg!(--"vendor-sig-override" [FILE] "Manually overwrite the vendor_sigs of the FW bundle image with the contents of binary [FILE]. The signature should be an ECC signature concatenated with an LMS signature").value_parser(value_parser!(PathBuf)))
.arg(arg!(--"image-options" [FILE] "Override the `ImageOptions` struct for the image bundle with the given toml file").value_parser(value_parser!(PathBuf)))
.get_matches();

if let Some(path) = args.get_one::<PathBuf>("rom-no-log") {
Expand Down Expand Up @@ -76,25 +77,32 @@ fn main() {
};

if let Some(path) = args.get_one::<PathBuf>("fw") {
let image_options = if let Some(path) = args.get_one::<PathBuf>("image-options") {
toml::from_str(&std::fs::read_to_string(path).unwrap()).unwrap()
} else if args.contains_id("zeros") {
ImageOptions::default()
} else {
ImageOptions {
fmc_version: version::get_fmc_version(),
app_version: version::get_runtime_version(),
fmc_svn,
app_svn,
..Default::default()
}
};
// Generate Image Bundle
let image = if args.contains_id("zeros") {
caliptra_builder::build_and_sign_image(
&firmware::FMC_ZEROS,
&firmware::APP_ZEROS,
ImageOptions::default(),
image_options,
)
.unwrap()
} else {
let mut image = caliptra_builder::build_and_sign_image(
&firmware::FMC_WITH_UART,
&firmware::APP_WITH_UART,
ImageOptions {
fmc_version: version::get_fmc_version(),
app_version: version::get_runtime_version(),
fmc_svn,
app_svn,
..Default::default()
},
image_options,
)
.unwrap();

Expand Down Expand Up @@ -180,3 +188,59 @@ fn test_binaries_are_identical() {
);
}
}

#[test]
fn test_image_options_imports_correctly() {
// Toml options
let t: ImageOptions =
toml::from_str(&std::fs::read_to_string("default_image_options.toml").unwrap()).unwrap();

// Default options
let d = ImageOptions {
fmc_version: version::get_fmc_version(),
app_version: version::get_runtime_version(),
..Default::default()
};

// Check top level fields
assert_eq!(t.fmc_version, d.fmc_version);
assert_eq!(t.fmc_svn, d.fmc_svn);
assert_eq!(t.app_version, d.app_version);
assert_eq!(t.app_svn, d.app_svn);

// Check vendor config fields. Only the first key is populated in the toml file.
let t_v = &t.vendor_config;
let d_v = &d.vendor_config;
assert_eq!(t_v.ecc_key_idx, d_v.ecc_key_idx);
assert_eq!(t_v.lms_key_idx, d_v.lms_key_idx);
assert_eq!(t_v.not_before, d_v.not_before);
assert_eq!(t_v.not_after, d_v.not_after);
assert_eq!(t_v.pl0_pauser, d_v.pl0_pauser);
assert_eq!(t_v.pub_keys.ecc_pub_keys[0], d_v.pub_keys.ecc_pub_keys[0]);
assert_eq!(t_v.pub_keys.lms_pub_keys[0], d_v.pub_keys.lms_pub_keys[0]);
assert_eq!(
t_v.priv_keys.unwrap().ecc_priv_keys[0],
d_v.priv_keys.unwrap().ecc_priv_keys[0]
);
assert_eq!(
t_v.priv_keys.unwrap().lms_priv_keys[0],
d_v.priv_keys.unwrap().lms_priv_keys[0]
);

// Check owner config fields
let t_o = &t.owner_config.unwrap();
let d_o = &d.owner_config.unwrap();
assert_eq!(t_o.not_before, d_o.not_before);
assert_eq!(t_o.not_after, d_o.not_after);
assert_eq!(t_o.epoch, d_o.epoch);
assert_eq!(t_o.pub_keys.ecc_pub_key, d_o.pub_keys.ecc_pub_key);
assert_eq!(t_o.pub_keys.lms_pub_key, d_o.pub_keys.lms_pub_key);
assert_eq!(
t_o.priv_keys.unwrap().ecc_priv_key,
d_o.priv_keys.unwrap().ecc_priv_key
);
assert_eq!(
t_o.priv_keys.unwrap().lms_priv_key,
d_o.priv_keys.unwrap().lms_priv_key
);
}
121 changes: 121 additions & 0 deletions builder/default_image_options.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Copied data from the default FW ImageOptions.

# NOTE: Only the first keys in the vendor config are populated. The keys are
# copied from image/fake-keys/src/lib.rs.

# FMC Version - 16 bits
# Major - 5 bits [15:11]
# Minor - 5 bits [10:6]
# Patch - 6 bits [5:0]
fmc_version = 0x840
fmc_svn = 0x0
# Runtime Version - 32 bits
# Major - 8 bits [31:24]
# Minor - 8 bits [23:16]
# Patch - 16 bits [15:0]
app_version = 0x1010000
app_svn = 0x0

[vendor_config]
ecc_key_idx = 0
lms_key_idx = 0
not_before = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
not_after = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
pl0_pauser = 1

[vendor_config.pub_keys]
ecc_pub_keys = [
{x = [0xc69fe67f, 0x97ea3e42, 0x21a7a603, 0x6c2e070d, 0x1657327b, 0xc3f1e7c1, 0x8dccb9e4, 0xffda5c3f, 0x4db0a1c0, 0x567e0973, 0x17bf4484, 0x39696a07], y = [0xc126b913, 0x5fc82572, 0x8f1cd403, 0x19109430, 0x994fe3e8, 0x74a8b026, 0xbe14794d, 0x27789964, 0x7735fde8, 0x328afd84, 0xcd4d4aa8, 0x72d40b42]},
{x = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], y = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{x = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], y = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{x = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], y = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
]
lms_pub_keys = [
{tree_type = 12, otstype = 7, id = [0x49, 0x08, 0xa1, 0x7b, 0xca, 0xdb, 0x18, 0x29, 0x1e, 0x28, 0x90, 0x58, 0xd5, 0xa8, 0xe3, 0xe8], digest = [0x64, 0xad, 0x3e, 0xb8, 0xbe, 0x68, 0x64, 0xf1, 0x7c, 0xcd, 0xa3, 0x8b, 0xde, 0x35, 0xed, 0xaa, 0x6c, 0x0d, 0xa5, 0x27, 0x64, 0x54, 0x07, 0xc6]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], digest = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
]

[vendor_config.priv_keys]
ecc_priv_keys = [
[0x29F939EA, 0x41746499, 0xD550C6FA, 0x6368B0D7, 0x61E09B4C, 0x75B21922, 0x86F96240, 0xEA1D99, 0xACE94BA6, 0x7AE89B0E, 0x3F210CF1, 0x9A45B6B5,],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
]
lms_priv_keys = [
{tree_type = 12, otstype = 7, id = [0x49, 0x08, 0xa1, 0x7b, 0xca, 0xdb, 0x18, 0x29, 0x1e, 0x28, 0x90, 0x58, 0xd5, 0xa8, 0xe3, 0xe8], seed = [0x4d, 0xce, 0x1e, 0x1e, 0x77, 0x52, 0x53, 0xec, 0x07, 0xbc, 0x07, 0x90, 0xcb, 0x59, 0xb2, 0x73, 0x45, 0x86, 0xb0, 0x32, 0x86, 0xc7, 0x69, 0x74]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
{tree_type = 0, otstype = 0, id = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]},
]

[owner_config]
not_before = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
not_after = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
epoch = [0, 0]

[owner_config.pub_keys]
ecc_pub_key = {x = [0xC6F82E2B, 0xDCF3E157, 0xA162E7F3, 0x3ECA35C4, 0x55EA08A9, 0x13811779, 0xB6F2646D, 0x92C817CD, 0x4094BD1A, 0xDB215F62, 0xCF36F017, 0x12D5AEB], y = [0xA4674593, 0x6CB5A379, 0x99B08264, 0x862B2C1C, 0x517F12C6, 0x573E1F94, 0x7142291A, 0xF9624BD7, 0x2733DCDD, 0xCE24EC5E, 0x961C00E3, 0x4372BA17]}
lms_pub_key = {tree_type = 12, otstype = 7, id = [0xE5, 0x6D, 0x3E, 0x53, 0xA5, 0xC2, 0x5B, 0xEA, 0xF3, 0x3A, 0x90, 0x15, 0x5B, 0x27, 0x3A, 0xE3], digest = [0x47, 0xb2, 0x15, 0x6c, 0xa3, 0x64, 0x1c, 0xc4, 0x02, 0xc0, 0xfd, 0x95, 0x79, 0x72, 0xba, 0x56, 0x08, 0x6f, 0x8f, 0x8c, 0xfa, 0x05, 0xb5, 0xbb]}

[owner_config.priv_keys]
ecc_priv_key = [0x59FDF849, 0xE39F4256, 0x19342ED2, 0x81D28D3D, 0x45AB3219, 0x5174582C, 0xECB4E9DF, 0x9CC2E991, 0xB75F88FD, 0xFA4BC6A4, 0x6B88340F, 0x5DD8890]
lms_priv_key = {tree_type = 12, otstype = 7, id = [0xE5, 0x6D, 0x3E, 0x53, 0xA5, 0xC2, 0x5B, 0xEA, 0xF3, 0x3A, 0x90, 0x15, 0x5B, 0x27, 0x3A, 0xE3], seed = [0x65, 0xc4, 0xfb, 0xac, 0xd3, 0xab, 0xa2, 0x8f, 0x77, 0xe7, 0xc5, 0x1c, 0x7f, 0x39, 0xba, 0x4d, 0x59, 0xd0, 0xb0, 0x83, 0x79, 0xa9, 0xf7, 0x5d]}
3 changes: 2 additions & 1 deletion builder/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Licensed under the Apache-2.0 license

use serde_derive::Deserialize;
use std::borrow::Cow;
use std::collections::hash_map::Entry;
use std::collections::{HashMap, HashSet};
Expand Down Expand Up @@ -500,7 +501,7 @@ pub fn elf_size(elf_bytes: &[u8]) -> io::Result<u64> {
})
}

#[derive(Clone)]
#[derive(Clone, Deserialize)]
pub struct ImageOptions {
pub fmc_version: u16,
pub fmc_svn: u32,
Expand Down
2 changes: 2 additions & 0 deletions image/gen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ bitflags.workspace = true
caliptra-image-types = { workspace = true, features = ["std"] }
caliptra-lms-types.workspace = true
memoffset.workspace = true
serde.workspace = true
serde_derive.workspace = true
zerocopy.workspace = true
Loading

0 comments on commit 7e6fd7b

Please sign in to comment.