aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagendra modadugu <ngm@google.com>2016-12-15 23:37:57 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-12-15 23:37:57 +0000
commit6c856e63621bddc00c1c8587b2e70b3c2da78e7c (patch)
tree4431e784f37e9022cfad72010e5d39d5728d8be6
parent03d6eae3212b12ce596f98d166fd78e9780275f0 (diff)
parent12242f389d4b29cac7b244ed54e09854ef74b187 (diff)
downloadtpm2-6c856e63621bddc00c1c8587b2e70b3c2da78e7c.tar.gz
Add a build-time assert for sizeof(OBJECT) am: 1d3ac31070 am: 458b6689d7 am: 09170b3a3c
am: 12242f389d Change-Id: I8f2fc3d7789e065c9a7d5b9db324276eb212dc01
-rw-r--r--Global.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Global.h b/Global.h
index 057fa89..5b868ad 100644
--- a/Global.h
+++ b/Global.h
@@ -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