diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2016-05-06 12:32:38 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-06-23 15:15:12 -0700 |
commit | 7fbebd98be355d18455aabac40b127ecff4cd7ab (patch) | |
tree | d04f28d0d6def9ed6507380871db93d249e4da06 /firmware/bdb/bdb_api.h | |
parent | 7931177cc35f5dcd2505e1efa448511ba8a0b3b1 (diff) | |
download | vboot-7fbebd98be355d18455aabac40b127ecff4cd7ab.tar.gz |
bdb: Add secrets librarystabilize-8530.Bstabilize-8530.96.Bstabilize-8530.93.Bstabilize-8530.89.Bstabilize-8530.80.Bstabilize-8530.77.Bstabilize-8530.71.Bstabilize-8530.35.Bstabilize-8516.Brelease-R53-8530.B
The secrets library clears, extends, and derives secrets which are used
by vboot SoC.
BUG=chrome-os-partner:51907
BRANCH=tot
TEST=make runtests
Change-Id: I38c93fd450364792cebc942694f848e10d0e9502
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/349252
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'firmware/bdb/bdb_api.h')
-rw-r--r-- | firmware/bdb/bdb_api.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/firmware/bdb/bdb_api.h b/firmware/bdb/bdb_api.h index 7ef935c0..6c2e2a46 100644 --- a/firmware/bdb/bdb_api.h +++ b/firmware/bdb/bdb_api.h @@ -10,11 +10,15 @@ #include "vboot_register.h" #include "nvm.h" #include "secrets.h" +#include "bdb_flag.h" struct vba_context { /* Indicate which slot is being tried: 0 - primary, 1 - secondary */ uint8_t slot; + /* Defined by VBA_CONTEXT_FLAG_* in bdb_flag.h */ + uint32_t flags; + /* BDB */ uint8_t *bdb; @@ -77,6 +81,29 @@ int vba_update_kernel_version(struct vba_context *ctx, int vba_update_buc(struct vba_context *ctx, uint8_t *new_buc); /** + * Derive a secret + * + * This derives a new secret from a secret passed from SP-RO. + * + * @param ctx + * @param type Type of secret to derive + * @param buf Buffer containing data to derive secret from + * @param buf_size Size of <buf> + * @return BDB_SUCCESS or BDB_ERROR_* + */ +int vba_derive_secret(struct vba_context *ctx, enum bdb_secret_type type, + const uint8_t *buf, uint32_t buf_size); + +/** + * Clear a secret + * + * @param ctx + * @param type Type of secret to clear + * @return BDB_SUCCESS or BDB_ERROR_* + */ +int vba_clear_secret(struct vba_context *ctx, enum bdb_secret_type type); + +/** * Get vboot register value * * Implemented by each chip |