summaryrefslogtreecommitdiff
path: root/board/cr50/dcrypto/fips.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/cr50/dcrypto/fips.c')
-rw-r--r--board/cr50/dcrypto/fips.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/board/cr50/dcrypto/fips.c b/board/cr50/dcrypto/fips.c
index 5e9422d2c3..2ea98187c4 100644
--- a/board/cr50/dcrypto/fips.c
+++ b/board/cr50/dcrypto/fips.c
@@ -642,18 +642,22 @@ static bool call_on_stack(void *new_stack, bool (*func)(void))
const struct sha256_digest fips_integrity
__attribute__((section(".rodata.fips.checksum")));
+#ifndef SELF_INTEGRITY_TEST
+#define SELF_INTEGRITY_TEST 0
+#endif
+
static enum dcrypto_result fips_self_integrity(void)
{
struct sha256_digest digest;
size_t module_length = &__fips_module_end - &__fips_module_start;
-#ifdef CR50_DEV
+#if SELF_INTEGRITY_TEST
CPRINTS("FIPS self-integrity start %x, length %u",
(uintptr_t)&__fips_module_start, module_length);
#endif
SHA256_hw_hash(&__fips_module_start, module_length, &digest);
-#ifdef CR50_DEV
+#if SELF_INTEGRITY_TEST
CPRINTS("Stored: %ph",
HEX_BUF(fips_integrity.b8, SHA256_DIGEST_SIZE));
CPRINTS("Computed: %ph",