Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1835)

Unified Diff: firmware/lib/include/vboot_struct.h

Issue 2865014: Assorted integration fixes. (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Add struct size tests Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « firmware/lib/cgptlib/include/gpt.h ('k') | firmware/lib/vboot_firmware.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/lib/include/vboot_struct.h
diff --git a/firmware/lib/include/vboot_struct.h b/firmware/lib/include/vboot_struct.h
index a60615c201440ffc1c1d2fd64d9482005fdbc07c..b33e46d568585b8d5e327de80270ca8c28d87dbe 100644
--- a/firmware/lib/include/vboot_struct.h
+++ b/firmware/lib/include/vboot_struct.h
@@ -11,6 +11,7 @@
#include "sysincludes.h"
+PACK_START /* Support packing for MSVC */
/* Public key data */
typedef struct VbPublicKey {
@@ -21,6 +22,8 @@ typedef struct VbPublicKey {
uint64_t key_version; /* Key version */
} __attribute__((packed)) VbPublicKey;
+#define EXPECTED_VBPUBLICKEY_SIZE 32
+
/* Signature data (a secure hash, possibly signed) */
typedef struct VbSignature {
@@ -30,6 +33,8 @@ typedef struct VbSignature {
uint64_t data_size; /* Size of the data block which was signed in bytes */
} __attribute__((packed)) VbSignature;
+#define EXPECTED_VBSIGNATURE_SIZE 24
+
#define KEY_BLOCK_MAGIC "CHROMEOS"
#define KEY_BLOCK_MAGIC_SIZE 8
@@ -69,6 +74,8 @@ typedef struct VbKeyBlockHeader {
* 3) The signature data for (VBKeyBlockHeader + data_key data), pointed to
* by key_block_signature.sig_offset. */
+#define EXPECTED_VBKEYBLOCKHEADER_SIZE 112
+
#define FIRMWARE_PREAMBLE_HEADER_VERSION_MAJOR 2
#define FIRMWARE_PREAMBLE_HEADER_VERSION_MINOR 0
@@ -95,6 +102,7 @@ typedef struct VbFirmwarePreambleHeader {
* + body signature data), pointed to by
* preamble_signature.sig_offset. */
+#define EXPECTED_VBFIRMWAREPREAMBLEHEADER_SIZE 104
#define KERNEL_PREAMBLE_HEADER_VERSION_MAJOR 2
#define KERNEL_PREAMBLE_HEADER_VERSION_MINOR 0
@@ -121,4 +129,9 @@ typedef struct VbKernelPreambleHeader {
* 3) The signature data for (VBFirmwarePreambleHeader + body signature
* data), pointed to by preamble_signature.sig_offset. */
+#define EXPECTED_VBKERNELPREAMBLEHEADER_SIZE 96
+
+
+PACK_STOP /* Support packing for MSVC */
+
#endif /* VBOOT_REFERENCE_VBOOT_STRUCT_H_ */
« no previous file with comments | « firmware/lib/cgptlib/include/gpt.h ('k') | firmware/lib/vboot_firmware.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698