Jamie Fox | ab30e71 | 2023-03-30 17:48:36 +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 | #include "dpe_impl.h" |
| 9 | |
| 10 | #include <string.h> |
| 11 | |
| 12 | dpe_error_t dpe_derive_child_impl(int context_handle, |
| 13 | bool retain_parent_context, |
| 14 | bool allow_child_to_derive, |
| 15 | bool create_certificate, |
| 16 | const DiceInputValues *dice_inputs, |
| 17 | int *child_context_handle, |
| 18 | int *new_context_handle) |
| 19 | { |
| 20 | *child_context_handle = 123; |
| 21 | *new_context_handle = 456; |
| 22 | |
| 23 | return DPE_NO_ERROR; |
| 24 | } |
| 25 | |
| 26 | dpe_error_t dpe_certify_key_impl(int context_handle, |
| 27 | bool retain_context, |
| 28 | const uint8_t *public_key, |
| 29 | size_t public_key_size, |
| 30 | const uint8_t *label, |
| 31 | size_t label_size, |
| 32 | uint8_t *certificate_chain_buf, |
| 33 | size_t certificate_chain_buf_size, |
| 34 | size_t *certificate_chain_actual_size, |
| 35 | uint8_t *derived_public_key_buf, |
| 36 | size_t derived_public_key_buf_size, |
| 37 | size_t *derived_public_key_actual_size, |
| 38 | int *new_context_handle) |
| 39 | { |
| 40 | memcpy(certificate_chain_buf, "abc", 4); |
| 41 | *certificate_chain_actual_size = 4; |
| 42 | memcpy(derived_public_key_buf, "def", 4); |
| 43 | *derived_public_key_actual_size = 4; |
| 44 | *new_context_handle = 789; |
| 45 | |
| 46 | return DPE_NO_ERROR; |
| 47 | } |