DPE: Restructure derive_context_request code
Since the function code is already too long and to
facilitate futher update, split it into
sub-functions.
Signed-off-by: Maulik Patel <maulik.patel@arm.com>
Change-Id: Id3801cc81f03d8860e78e467406c083e87c12e8b
diff --git a/partitions/dice_protection_environment/dpe_log.c b/partitions/dice_protection_environment/dpe_log.c
index 8dcc909..bb78f6b 100644
--- a/partitions/dice_protection_environment/dpe_log.c
+++ b/partitions/dice_protection_environment/dpe_log.c
@@ -192,4 +192,26 @@
LOG_BOOL_VAL(ctx_ptr->is_cdi_to_be_exported));
}
+void log_derive_context_output(int *new_context_handle,
+ int *new_parent_context_handle,
+ struct component_context_t *derived_ctx,
+ int free_component_idx,
+ struct cert_context_t *cert_ctx,
+ uint8_t *new_certificate_buf,
+ size_t new_certificate_actual_size)
+{
+ log_derive_context_output_handles(*new_parent_context_handle,
+ *new_context_handle);
+
+ /* Log component context, certificate context & certificate if no error */
+ log_dpe_component_ctx_metadata(derived_ctx, free_component_idx);
+ if (cert_ctx != NULL) {
+ log_dpe_cert_ctx_metadata(cert_ctx);
+ }
+ if (new_certificate_actual_size > 0) {
+ log_intermediate_certificate(new_certificate_buf,
+ new_certificate_actual_size);
+ }
+}
+
#endif /* TFM_PARTITION_LOG_LEVEL */