Skip to content

Commit

Permalink
Remove tagging from DPE
Browse files Browse the repository at this point in the history
This will be added to caliptra-sw runtime in a separate PR.
  • Loading branch information
sree-revoori1 committed Nov 17, 2023
1 parent 8e3623d commit e05063e
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 488 deletions.
2 changes: 0 additions & 2 deletions dpe/fuzz/src/fuzz_target_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ fn harness(data: &[u8]) {
Response::Sign(ref res) => res.resp_hdr.status,
Response::DestroyCtx(ref resp_hdr) => resp_hdr.status,
Response::ExtendTci(ref res) => res.resp_hdr.status,
Response::TagTci(ref res) => res.resp_hdr.status,
Response::GetTaggedTci(ref res) => res.resp_hdr.status,
Response::GetCertificateChain(ref res) => res.resp_hdr.status,
Response::Error(ref resp_hdr) => resp_hdr.status,
};
Expand Down
41 changes: 0 additions & 41 deletions dpe/src/commands/get_tagged_tci.rs

This file was deleted.

10 changes: 0 additions & 10 deletions dpe/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ pub use self::initialize_context::InitCtxCmd;
pub use self::certify_key::{CertifyKeyCmd, CertifyKeyFlags};

use self::extend_tci::ExtendTciCmd;
use self::get_tagged_tci::GetTaggedTciCmd;
pub use self::rotate_context::{RotateCtxCmd, RotateCtxFlags};
pub use self::sign::{SignCmd, SignFlags};
use self::tag_tci::TagTciCmd;

use crate::{
dpe_instance::{DpeEnv, DpeInstance, DpeTypes},
Expand All @@ -30,11 +28,9 @@ mod derive_child;
mod destroy_context;
mod extend_tci;
mod get_certificate_chain;
mod get_tagged_tci;
mod initialize_context;
mod rotate_context;
mod sign;
mod tag_tci;

#[derive(Debug, PartialEq, Eq)]
pub enum Command {
Expand All @@ -46,8 +42,6 @@ pub enum Command {
RotateCtx(RotateCtxCmd),
DestroyCtx(DestroyCtxCmd),
ExtendTci(ExtendTciCmd),
TagTci(TagTciCmd),
GetTaggedTci(GetTaggedTciCmd),
GetCertificateChain(GetCertificateChainCmd),
}

Expand Down Expand Up @@ -85,8 +79,6 @@ impl Command {
Self::parse_command(Command::GetCertificateChain, bytes)
}
Command::EXTEND_TCI => Self::parse_command(Command::ExtendTci, bytes),
Command::TAG_TCI => Self::parse_command(Command::TagTci, bytes),
Command::GET_TAGGED_TCI => Self::parse_command(Command::GetTaggedTci, bytes),
_ => Err(DpeErrorCode::InvalidCommand),
}
}
Expand All @@ -112,8 +104,6 @@ impl From<Command> for u32 {
Command::RotateCtx(_) => Command::ROTATE_CONTEXT_HANDLE,
Command::DestroyCtx(_) => Command::DESTROY_CONTEXT,
Command::ExtendTci(_) => Command::EXTEND_TCI,
Command::TagTci(_) => Command::TAG_TCI,
Command::GetTaggedTci(_) => Command::GET_TAGGED_TCI,
Command::GetCertificateChain(_) => Command::GET_CERTIFICATE_CHAIN,
}
}
Expand Down
197 changes: 0 additions & 197 deletions dpe/src/commands/tag_tci.rs

This file was deleted.

2 changes: 0 additions & 2 deletions dpe/src/dpe_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ impl DpeInstance {
Command::RotateCtx(cmd) => cmd.execute(self, env, locality),
Command::DestroyCtx(cmd) => cmd.execute(self, env, locality),
Command::ExtendTci(cmd) => cmd.execute(self, env, locality),
Command::TagTci(cmd) => cmd.execute(self, env, locality),
Command::GetTaggedTci(cmd) => cmd.execute(self, env, locality),
Command::GetCertificateChain(cmd) => cmd.execute(self, env, locality),
};

Expand Down
17 changes: 2 additions & 15 deletions dpe/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Abstract:
DPE reponses and serialization.
--*/
use crate::{
context::ContextHandle, tci::TciMeasurement, CURRENT_PROFILE_MAJOR_VERSION,
CURRENT_PROFILE_MINOR_VERSION, DPE_PROFILE, MAX_CERT_SIZE, MAX_HANDLES,
context::ContextHandle, CURRENT_PROFILE_MAJOR_VERSION, CURRENT_PROFILE_MINOR_VERSION,
DPE_PROFILE, MAX_CERT_SIZE, MAX_HANDLES,
};
use crypto::CryptoError;
use platform::PlatformError;
Expand All @@ -23,8 +23,6 @@ pub enum Response {
Sign(SignResp),
DestroyCtx(ResponseHdr),
ExtendTci(NewHandleResp),
TagTci(NewHandleResp),
GetTaggedTci(GetTaggedTciResp),
GetCertificateChain(GetCertificateChainResp),
Error(ResponseHdr),
}
Expand All @@ -40,8 +38,6 @@ impl Response {
Response::Sign(res) => res.as_bytes(),
Response::DestroyCtx(res) => res.as_bytes(),
Response::ExtendTci(res) => res.as_bytes(),
Response::TagTci(res) => res.as_bytes(),
Response::GetTaggedTci(res) => res.as_bytes(),
Response::GetCertificateChain(res) => res.as_bytes(),
Response::Error(res) => res.as_bytes(),
}
Expand Down Expand Up @@ -135,15 +131,6 @@ pub struct SignResp {
pub sig_s: [u8; DPE_PROFILE.get_ecc_int_size()],
}

#[repr(C)]
#[derive(Debug, zerocopy::AsBytes)]
#[cfg_attr(test, derive(PartialEq, Eq))]
pub struct GetTaggedTciResp {
pub resp_hdr: ResponseHdr,
pub tci_cumulative: TciMeasurement,
pub tci_current: TciMeasurement,
}

#[repr(C)]
#[derive(Debug, PartialEq, Eq, zerocopy::AsBytes, zerocopy::FromBytes)]
pub struct GetCertificateChainResp {
Expand Down
Loading

0 comments on commit e05063e

Please sign in to comment.