Jamie Fox | e7f8b4e | 2023-05-30 18:03:20 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2023, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #ifndef __DPE_LOG_H__ |
| 9 | #define __DPE_LOG_H__ |
| 10 | |
| 11 | #include "dice_protection_environment.h" |
| 12 | #include "tfm_sp_log.h" |
| 13 | |
| 14 | #ifdef __cplusplus |
| 15 | extern "C" { |
| 16 | #endif |
| 17 | |
| 18 | #if (TFM_PARTITION_LOG_LEVEL >= TFM_PARTITION_LOG_LEVEL_DEBUG) |
| 19 | |
| 20 | /** |
Maulik Patel | ad2f3db | 2023-05-17 15:41:36 +0100 | [diff] [blame] | 21 | * \brief Log the derive rot context command parameters. |
| 22 | */ |
| 23 | void log_derive_rot_context(const DiceInputValues *dice_inputs); |
| 24 | |
| 25 | /** |
Jamie Fox | e7f8b4e | 2023-05-30 18:03:20 +0100 | [diff] [blame] | 26 | * \brief Log the derive child command parameters. |
| 27 | */ |
| 28 | void log_derive_child(int context_handle, |
| 29 | bool retain_parent_context, |
| 30 | bool allow_child_to_derive, |
| 31 | bool create_certificate, |
Maulik Patel | ad2f3db | 2023-05-17 15:41:36 +0100 | [diff] [blame] | 32 | const DiceInputValues *dice_inputs, |
| 33 | int32_t client_id); |
Jamie Fox | e7f8b4e | 2023-05-30 18:03:20 +0100 | [diff] [blame] | 34 | |
| 35 | /** |
Maulik Patel | 54d65f7 | 2023-06-28 13:04:36 +0100 | [diff] [blame] | 36 | * \brief Log the destroy context command parameters. |
| 37 | */ |
| 38 | void log_destroy_context(int context_handle, |
| 39 | bool destroy_recursively); |
| 40 | |
| 41 | /** |
Jamie Fox | e7f8b4e | 2023-05-30 18:03:20 +0100 | [diff] [blame] | 42 | * \brief Log the certify key command parameters. |
| 43 | */ |
| 44 | void log_certify_key(int context_handle, |
| 45 | bool retain_context, |
| 46 | const uint8_t *public_key, |
| 47 | size_t public_key_size, |
| 48 | const uint8_t *label, |
| 49 | size_t label_size); |
| 50 | |
Maulik Patel | 2358bbb | 2023-07-21 10:56:56 +0100 | [diff] [blame] | 51 | /** |
| 52 | * \brief Log intermediate layer certificate contents. |
| 53 | */ |
| 54 | void log_intermediate_certificate(uint16_t layer_idx, |
| 55 | const uint8_t *cert_buf, |
| 56 | size_t cert_buf_size); |
| 57 | |
Maulik Patel | e6adc11 | 2023-08-18 14:21:51 +0100 | [diff] [blame] | 58 | /** |
| 59 | * \brief Log Certificate chain contents. |
| 60 | */ |
| 61 | void log_certificate_chain(const uint8_t *certificate_chain_buf, |
| 62 | size_t certificate_chain_size); |
| 63 | |
Jamie Fox | e7f8b4e | 2023-05-30 18:03:20 +0100 | [diff] [blame] | 64 | #else /* TFM_PARTITION_LOG_LEVEL */ |
| 65 | |
Maulik Patel | ad2f3db | 2023-05-17 15:41:36 +0100 | [diff] [blame] | 66 | #define log_derive_rot_context(...) |
Jamie Fox | e7f8b4e | 2023-05-30 18:03:20 +0100 | [diff] [blame] | 67 | #define log_derive_child(...) |
Maulik Patel | 54d65f7 | 2023-06-28 13:04:36 +0100 | [diff] [blame] | 68 | #define log_destroy_context(...) |
Jamie Fox | e7f8b4e | 2023-05-30 18:03:20 +0100 | [diff] [blame] | 69 | #define log_certify_key(...) |
Maulik Patel | 2358bbb | 2023-07-21 10:56:56 +0100 | [diff] [blame] | 70 | #define log_intermediate_certificate(...) |
Maulik Patel | e6adc11 | 2023-08-18 14:21:51 +0100 | [diff] [blame] | 71 | #define log_certificate_chain(...) |
Jamie Fox | e7f8b4e | 2023-05-30 18:03:20 +0100 | [diff] [blame] | 72 | |
| 73 | #endif /* TFM_PARTITION_LOG_LEVEL */ |
| 74 | |
| 75 | #ifdef __cplusplus |
| 76 | } |
| 77 | #endif |
| 78 | |
| 79 | #endif /* __DPE_LOG_H__ */ |