DPE: Use pointers instead of indices
Currently, indices are used to track the relationship between
components & certificates. Use pointers instead.
Signed-off-by: Maulik Patel <maulik.patel@arm.com>
Change-Id: I8a50f619254ebce025d349a61b61186991f627d0
diff --git a/partitions/dice_protection_environment/dpe_log.c b/partitions/dice_protection_environment/dpe_log.c
index 51011f9..8dcc909 100644
--- a/partitions/dice_protection_environment/dpe_log.c
+++ b/partitions/dice_protection_environment/dpe_log.c
@@ -121,12 +121,10 @@
LOG_DBGFMT(" - cert_chain_buf_size = %d\r\n", cert_chain_buf_size);
}
-void log_intermediate_certificate(uint16_t cert_ctx_idx,
- const uint8_t *cert_buf,
+void log_intermediate_certificate(const uint8_t *cert_buf,
size_t cert_size)
{
LOG_DBGFMT("DPE Intermediate Certificate:\r\n");
- LOG_DBGFMT(" - certificate context index = %d\r\n", cert_ctx_idx);
LOG_DBGFMT(" - size = %d\r\n", cert_size);
LOG_DBGFMT(" - certificate =");
print_byte_array(cert_buf, cert_size);
@@ -174,18 +172,19 @@
LOG_DBGFMT(" - is_export_cdi_allowed = %s\r\n",
LOG_BOOL_VAL(ctx_ptr->is_export_cdi_allowed));
LOG_DBGFMT(" - nonce = 0x%x\r\n", ctx_ptr->nonce);
- LOG_DBGFMT(" - parent_idx = %d\r\n", ctx_ptr->parent_idx);
- LOG_DBGFMT(" - linked_cert_ctx_idx = %d\r\n", ctx_ptr->linked_cert_ctx_idx);
LOG_DBGFMT(" - target_locality = %d\r\n", ctx_ptr->target_locality);
LOG_DBGFMT(" - expected_mhu_id = %u\r\n", ctx_ptr->expected_mhu_id);
+ LOG_DBGFMT(" - parent_comp_ctx->nonce = %d\r\n", ctx_ptr->parent_comp_ctx->nonce);
+ if (ctx_ptr->linked_cert_ctx != NULL) {
+ LOG_DBGFMT(" - linked_cert_ctx->cert_id = %d\r\n",
+ ctx_ptr->linked_cert_ctx->cert_id);
+ }
}
-void log_dpe_cert_ctx_metadata(const struct cert_context_t *ctx_ptr,
- uint16_t cert_ctx_idx)
+void log_dpe_cert_ctx_metadata(const struct cert_context_t *ctx_ptr)
{
- LOG_DBGFMT(" DPE cert_ctx_array[%d]: \r\n", cert_ctx_idx);
+ LOG_DBGFMT(" DPE cert_ctx_array[]: \r\n");
LOG_DBGFMT(" - cert_id = 0x%x\r\n", ctx_ptr->cert_id);
- LOG_DBGFMT(" - parent_cert_ctx_idx = %d\r\n", ctx_ptr->parent_cert_ctx_idx);
LOG_DBGFMT(" - state = %d\r\n", ctx_ptr->state);
LOG_DBGFMT(" - is_external_pub_key_provided = %s\r\n",
LOG_BOOL_VAL(ctx_ptr->is_external_pub_key_provided));