blob: 2f2cba859f07557e88c95815b2e46c0bdecbf6e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
// SPDX-License-Identifier: BSD-2-Clause
/*
* Copyright (c) 2015, Linaro Limited
*/
#include <inttypes.h>
#include <kernel/tee_common_otp.h>
#include <kernel/huk_subkey.h>
/*
* Override these in your platform code to really fetch device-unique
* bits from e-fuses or whatever.
*
* The default implementation just sets it to a constant.
*/
__weak TEE_Result tee_otp_get_hw_unique_key(struct tee_hw_unique_key *hwkey)
{
memset(&hwkey->data[0], 0, sizeof(hwkey->data));
return TEE_SUCCESS;
}
__weak int tee_otp_get_die_id(uint8_t *buffer, size_t len)
{
if (huk_subkey_derive(HUK_SUBKEY_DIE_ID, NULL, 0, buffer, len))
return -1;
return 0;
}
|