Skip to content

Commit

Permalink
Switch order of label and format in CertifyKey Req to match spec
Browse files Browse the repository at this point in the history
  • Loading branch information
sree-revoori1 committed Feb 14, 2024
1 parent f048f4a commit daee090
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions dpe/src/commands/certify_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ bitflags! {
pub struct CertifyKeyCmd {
pub handle: ContextHandle,
pub flags: CertifyKeyFlags,
pub label: [u8; DPE_PROFILE.get_hash_size()],
pub format: u32,
pub label: [u8; DPE_PROFILE.get_hash_size()],
}

impl CertifyKeyCmd {
Expand Down Expand Up @@ -280,8 +280,8 @@ mod tests {
const TEST_CERTIFY_KEY_CMD: CertifyKeyCmd = CertifyKeyCmd {
handle: SIMULATION_HANDLE,
flags: CertifyKeyFlags(0x1234_5678),
label: [0xaa; DPE_PROFILE.get_hash_size()],
format: CertifyKeyCmd::FORMAT_X509,
label: [0xaa; DPE_PROFILE.get_hash_size()],
};

#[test]
Expand Down Expand Up @@ -316,8 +316,8 @@ mod tests {
let certify_cmd = CertifyKeyCmd {
handle: init_resp.handle,
flags: CertifyKeyFlags::empty(),
label: [0; DPE_PROFILE.get_hash_size()],
format: CertifyKeyCmd::FORMAT_X509,
label: [0; DPE_PROFILE.get_hash_size()],
};

let certify_resp = match certify_cmd
Expand Down Expand Up @@ -357,8 +357,8 @@ mod tests {
let certify_cmd_ca = CertifyKeyCmd {
handle: init_resp.handle,
flags: CertifyKeyFlags::IS_CA,
label: [0; DPE_PROFILE.get_hash_size()],
format: CertifyKeyCmd::FORMAT_X509,
label: [0; DPE_PROFILE.get_hash_size()],
};

let certify_resp_ca = match certify_cmd_ca
Expand All @@ -384,8 +384,8 @@ mod tests {
let certify_cmd_non_ca = CertifyKeyCmd {
handle: init_resp.handle,
flags: CertifyKeyFlags::empty(),
label: [0; DPE_PROFILE.get_hash_size()],
format: CertifyKeyCmd::FORMAT_X509,
label: [0; DPE_PROFILE.get_hash_size()],
};

let certify_resp_non_ca = match certify_cmd_non_ca
Expand Down Expand Up @@ -429,8 +429,8 @@ mod tests {
let certify_cmd = CertifyKeyCmd {
handle: init_resp.handle,
flags: CertifyKeyFlags::empty(),
label: [0; DPE_PROFILE.get_hash_size()],
format: CertifyKeyCmd::FORMAT_CSR,
label: [0; DPE_PROFILE.get_hash_size()],
};

let certify_resp = match certify_cmd
Expand Down
2 changes: 1 addition & 1 deletion dpe/src/commands/derive_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -684,8 +684,8 @@ mod tests {
let cmd = CertifyKeyCmd {
handle: parent_handle,
flags: CertifyKeyFlags::empty(),
label: TEST_LABEL,
format: CertifyKeyCmd::FORMAT_X509,
label: TEST_LABEL,
};
let certify_resp = match cmd.execute(&mut dpe, &mut env, TEST_LOCALITIES[0]).unwrap() {
Response::CertifyKey(resp) => resp,
Expand Down
2 changes: 1 addition & 1 deletion dpe/src/commands/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ mod tests {
let cmd = CertifyKeyCmd {
handle: ContextHandle::default(),
flags: CertifyKeyFlags::empty(),
label: TEST_LABEL,
format: CertifyKeyCmd::FORMAT_X509,
label: TEST_LABEL,
};
let certify_resp = match cmd.execute(&mut dpe, &mut env, TEST_LOCALITIES[0]).unwrap() {
Response::CertifyKey(resp) => resp,
Expand Down
2 changes: 1 addition & 1 deletion tools/src/sample_dpe_cert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ fn certify_key(dpe: &mut DpeInstance, env: &mut DpeEnv<TestTypes>, format: u32)
let certify_key_cmd: CertifyKeyCmd = commands::CertifyKeyCmd {
handle: ContextHandle::default(),
flags: CertifyKeyFlags::empty(),
label: [0; DPE_PROFILE.get_hash_size()],
format,
label: [0; DPE_PROFILE.get_hash_size()],
};
let cmd_body = certify_key_cmd.as_bytes().to_vec();
let cmd_hdr = CommandHdr::new_for_test(dpe::commands::Command::CERTIFY_KEY)
Expand Down

0 comments on commit daee090

Please sign in to comment.