From 7fbebd98be355d18455aabac40b127ecff4cd7ab Mon Sep 17 00:00:00 2001 From: Daisuke Nojiri Date: Fri, 6 May 2016 12:32:38 -0700 Subject: bdb: Add secrets library 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 Reviewed-on: https://chromium-review.googlesource.com/349252 Reviewed-by: Randall Spangler --- firmware/bdb/secrets.h | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'firmware/bdb/secrets.h') diff --git a/firmware/bdb/secrets.h b/firmware/bdb/secrets.h index e26e97cf..ed8973f2 100644 --- a/firmware/bdb/secrets.h +++ b/firmware/bdb/secrets.h @@ -7,6 +7,63 @@ #define VBOOT_REFERENCE_FIRMWARE_BDB_SECRETS_H_ #define BDB_SECRET_SIZE 32 +#define BDB_CONSTANT_BLOCK_SIZE 64 + +const uint8_t secret_constant_c[] = { + 0x46, 0xda, 0x52, 0x8d, 0x08, 0x56, 0x14, 0xde, 0x75, 0x9c, + 0x9a, 0xeb, 0x08, 0x93, 0x3d, 0xd6, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0x0b}; + +const uint8_t secret_constant_kv1[] = { + 0x0a, 0x9e, 0xc9, 0x20, 0x29, 0xa3, 0x5d, 0xd7, 0x27, 0x55, + 0xb6, 0xa6, 0xb4, 0x80, 0x7c, 0x73, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0x08}; + +const uint8_t secret_constant_kv0[] = { + 0x46, 0x6d, 0xef, 0x2c, 0x05, 0xc9, 0xbf, 0xa9, 0x6b, 0xee, + 0xaa, 0x6c, 0xb9, 0xb4, 0x6d, 0x37, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0x07}; + +const uint8_t secret_constant_l[] = { + /* + * Digest of kernel data key struct fills first 32 bytes + */ + 0x9b, 0xc0, 0x29, 0xd3, 0xc3, 0x90, 0x7f, 0x82, + 0x56, 0xe2, 0x67, 0x79, 0x11, 0x74, 0xbe, 0xd0, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0x04}; + +const uint8_t secret_constant_q[] = { + /* + * Digest of KDB key struct fills first 32 bytes + */ + 0xc7, 0x60, 0x83, 0x0f, 0x20, 0x44, 0x5d, 0x9c, + 0x70, 0x96, 0x05, 0x2d, 0x51, 0x4b, 0x15, 0x99, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0x0d}; + +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. */ +}; /* * Secrets passed to SP-RW by SP-RO. How it's passed depends on chips. -- cgit v1.2.1