blob: 2d61746869fd66bb1dabf530c268a8e67e1c03c0 [file] [log] [blame]
/*
* Copyright (c) 2019 The Fuchsia Authors
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <common.h>
#include <libavb/libavb.h>
#include <libavb_atx/libavb_atx.h>
#include <tee/ta_vx_helper.h>
#include <asm/arch-g12b/efuse.h>
#include <u-boot/sha256.h>
static int read_permanent_attr_hash(uint8_t *hash, size_t size)
{
}
AvbIOResult
avb_read_permanent_attributes(AvbAtxOps *atx_ops,
AvbAtxPermanentAttributes *attributes)
{
size_t size;
int rc = ta_vx_read_perm_attr(attributes, sizeof(AvbAtxPermanentAttributes),
&size);
if (rc || size != sizeof(AvbAtxPermanentAttributes)) {
return AVB_IO_RESULT_ERROR_IO;
}
return AVB_IO_RESULT_OK;
}
AvbIOResult
avb_read_permanent_attributes_hash(AvbAtxOps *atx_ops,
uint8_t hash[AVB_SHA256_DIGEST_SIZE])
{
if (hash == NULL) {
return AVB_IO_RESULT_ERROR_IO;
}
int rc = ta_vx_read_perm_attr_hash(hash, AVB_SHA256_DIGEST_SIZE);
if (rc) {
return AVB_IO_RESULT_ERROR_IO;
}
return AVB_IO_RESULT_OK;
}