mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 02:05:01 +00:00
This patch adds code which dervies secrets from BDS. It's supposed to be done by SP-RO, hence the code is mostly useful for testing (or emulation). vba_extend_secrets_ro takes a function pointer to a hash extend function. It'll be used to try different sha256 extend algorithms. BUG=chromium:649555 BRANCH=none TEST=make runtests Change-Id: I8fef6b851fb84686d8bcdd948b36160016687c51 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/384354 Reviewed-by: Randall Spangler <rspangler@chromium.org>
36 lines
917 B
C
36 lines
917 B
C
/* Copyright 2016 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#ifndef VBOOT_REFERENCE_FIRMWARE_BDB_SECRETS_H_
|
|
#define VBOOT_REFERENCE_FIRMWARE_BDB_SECRETS_H_
|
|
|
|
#define BDB_SECRET_SIZE 32
|
|
#define BDB_CONSTANT_BLOCK_SIZE 64
|
|
|
|
enum bdb_secret_type {
|
|
BDB_SECRET_TYPE_WSR,
|
|
BDB_SECRET_TYPE_NVM_WP,
|
|
BDB_SECRET_TYPE_NVM_RW,
|
|
BDB_SECRET_TYPE_BDB,
|
|
BDB_SECRET_TYPE_BOOT_VERIFIED,
|
|
BDB_SECRET_TYPE_BOOT_PATH,
|
|
BDB_SECRET_TYPE_BUC,
|
|
BDB_SECRET_TYPE_COUNT, /* Last entry. Add new secrets before this. */
|
|
};
|
|
|
|
/*
|
|
* Struct storing BDB secrets passed between SP-RO and SP-RW.
|
|
*/
|
|
struct bdb_secrets {
|
|
uint8_t nvm_rw[BDB_SECRET_SIZE];
|
|
uint8_t bdb[BDB_SECRET_SIZE];
|
|
uint8_t boot_verified[BDB_SECRET_SIZE];
|
|
uint8_t boot_path[BDB_SECRET_SIZE];
|
|
uint8_t nvm_wp[BDB_SECRET_SIZE];
|
|
uint8_t buc[BDB_SECRET_SIZE];
|
|
};
|
|
|
|
#endif
|