Skip to content

Commit

Permalink
Add encoding options struct to modify behavior of the x509 encoder. D…
Browse files Browse the repository at this point in the history
…eriveContext will disable ueid encoding
  • Loading branch information
clundin25 committed Jan 25, 2025
1 parent b39178f commit 6fd8e40
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 33 deletions.
1 change: 1 addition & 0 deletions dpe/src/commands/certify_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ impl CommandExecution for CertifyKeyCmd {
cdi_label: b"DPE",
key_label: &self.label,
context: b"ECC",
encoding_override: None,
};
let mut cert = [0; MAX_CERT_SIZE];

Expand Down
3 changes: 2 additions & 1 deletion dpe/src/commands/derive_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
DeriveContextExportedCdiResp, DeriveContextResp, DpeErrorCode, Response, ResponseHdr,
},
tci::TciMeasurement,
x509::{create_exported_dpe_cert, CreateDpeCertArgs, CreateDpeCertResult},
x509::{create_exported_dpe_cert, CreateDpeCertArgs, CreateDpeCertResult, EncodingOptions},
DPE_PROFILE, MAX_CERT_SIZE, MAX_EXPORTED_CDI_SIZE,
};
use bitflags::bitflags;
Expand Down Expand Up @@ -310,6 +310,7 @@ impl CommandExecution for DeriveContextCmd {
cdi_label: b"Exported CDI",
key_label: b"Exported ECC",
context: &exported_cdi_handle,
encoding_override: Some(EncodingOptions{ encode_ueid: false, ..Default::default()}),
};
let mut cert = [0; MAX_CERT_SIZE];
let CreateDpeCertResult { cert_size, .. } = create_exported_dpe_cert(
Expand Down
Loading

0 comments on commit 6fd8e40

Please sign in to comment.