Skip to content

Commit

Permalink
Adding missing libcaliptra dpe command structs
Browse files Browse the repository at this point in the history
  • Loading branch information
nquarton committed Jul 26, 2024
1 parent 51ff0a8 commit 799bdbd
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions libcaliptra/inc/caliptra_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,7 @@ struct caliptra_capabilities_resp {
uint8_t capabilities[16];
};

// The below fields are placeholders to set up the baseline
// required for communication of DPE commands to Caliptra
// firmware.
// DPE commands

#define DPE_DATA_MAX 512
#define DPE_MAGIC 0x44504543 // "DPEC"
Expand Down Expand Up @@ -254,6 +252,10 @@ struct dpe_resp_hdr {
#endif

// GET_PROFILE
struct dpe_get_profile_cmd {
struct dpe_cmd_hdr cmd_hdr;
};

struct dpe_get_profile_response {
struct dpe_resp_hdr resp_hdr;
uint16_t profile_major_version;
Expand Down Expand Up @@ -344,7 +346,10 @@ struct dpe_rotate_context_handle_response {
struct dpe_destroy_context_cmd {
struct dpe_cmd_hdr cmd_hdr;
uint8_t context_handle[DPE_HANDLE_SIZE];
uint32_t flags;
};

struct dpe_destroy_context_response {
struct dpe_resp_hdr resp_hdr;
};

// GET_CERTIFICATE_CHAIN
Expand All @@ -365,28 +370,32 @@ struct caliptra_invoke_dpe_req {
struct caliptra_req_header hdr;
uint32_t data_size;
union {
struct dpe_cmd_hdr cmd_hdr;
struct dpe_get_profile_cmd get_profile_cmd;
struct dpe_initialize_context_cmd initialize_context_cmd;
struct dpe_derive_context_cmd derive_context_cmd;
struct dpe_certify_key_cmd certify_key_cmd;
struct dpe_sign_cmd sign_cmd;
struct dpe_rotate_context_handle_cmd rotate_context_handle_cmd;
struct dpe_destroy_context_cmd destroy_context_cmd;
struct dpe_get_certificate_chain_cmd get_certificate_chain_cmd;
uint8_t data[DPE_DATA_MAX];
uint8_t data[0];
};
};

struct caliptra_invoke_dpe_resp {
struct caliptra_resp_header cpl;
uint32_t data_size;
union {
struct dpe_resp_hdr resp_hdr;
struct dpe_get_profile_response get_profile_resp;
struct dpe_initialize_context_response initialize_context_resp;
struct dpe_derive_context_response derive_context_resp;
struct dpe_certify_key_response certify_key_resp;
struct dpe_sign_response sign_resp;
struct dpe_rotate_context_handle_response rotate_context_handle_resp;
struct dpe_destroy_context_response destroy_context_resp;
struct dpe_get_certificate_chain_response get_certificate_chain_resp;
uint8_t data[sizeof(struct dpe_certify_key_response)];
uint8_t data[0];
};
};

0 comments on commit 799bdbd

Please sign in to comment.