diff options
author | nagendra modadugu <ngm@google.com> | 2016-12-15 22:54:02 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-12-15 22:54:02 +0000 |
commit | 458b6689d711589f4a5689efe08fe49711fadeab (patch) | |
tree | 4431e784f37e9022cfad72010e5d39d5728d8be6 | |
parent | be4ffac51ae06d3735cbedb425c5091da0b8ae9c (diff) | |
parent | 1d3ac310707d4c587b275b2683c26eb5cde32123 (diff) | |
download | tpm2-458b6689d711589f4a5689efe08fe49711fadeab.tar.gz |
Add a build-time assert for sizeof(OBJECT)
am: 1d3ac31070
Change-Id: I6fd167b748ac45fdacde2af135b96375aee59896
-rw-r--r-- | Global.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -190,6 +190,12 @@ typedef struct TPM2B_NAME name; // Name of the object name. Kept here // to avoid repeatedly computing it. } OBJECT; +#ifdef EMBEDDED_MODE +// This build time assert serves as a rudimentary check for changes +// to the OBJECT structure (which is serialized to NVmem). Whenever +// the OBJECT struct changes, NV_FORMAT_VERSION ought to be bumped. +struct size_check { char a[sizeof(OBJECT) == 1536 ? 1 : -1]; }; +#endif // // // HASH_OBJECT Structure |