1 /* 2 * Copyright 2023, Rockchip Electronics Co., Ltd 3 * callen.cai, <callen.cai@rock-chips.com> 4 * 5 * SPDX-License-Identifier: GPL-2.0+ 6 */ 7 8 #ifndef ID_ATTESTATION_H_ 9 #define ID_ATTESTATION_H_ 10 11 #include <common.h> 12 #include "attestation_key.h" 13 #define IDAT_DEBUG 0 14 #if IDAT_DEBUG 15 #define MSG(...) printf(__VA_ARGS__) 16 #else 17 #define MSG(...) do {} while (0) 18 #endif 19 20 #define PROP_LEN 32 21 22 typedef struct AttestationIds_ { 23 u8 brand[PROP_LEN]; 24 u8 device[PROP_LEN]; 25 u8 product[PROP_LEN]; 26 u8 serial[PROP_LEN]; 27 u8 imei[PROP_LEN]; 28 u8 second_imei[PROP_LEN]; 29 u8 meid[PROP_LEN]; 30 u8 manufacturer[PROP_LEN]; 31 u8 model[PROP_LEN]; 32 } AttestationIds; 33 34 void printAttestationIds(const AttestationIds *ids); 35 36 /* 37 * write id attestation to secure storage. 38 * @received_data: received data from usb 39 * @len: the size of received_data 40 * @return ATAP_RESULT_OK if ok, or ATAP_RESULT_ERROR_* on error 41 */ 42 atap_result write_id_attestation_to_secure_storage(u8 *received_data, uint32_t len); 43 #endif //ID_ATTESTATION_H_ 44