chore(storage): add error string to static_assert
What changed, and why it matters
This is a trivial build-compatibility change. It adds human-readable error messages to two compile-time size checks so that newer versions of the Clang compiler accept the code without warnings. The actual security logic is unchanged.
No security action needed. Treat as a normal build/maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies two _Static_assert macros in storage/storage.c to include a string literal diagnostic message. This is purely a C23/Clang 21 compatibility fix; the asserted conditions (SHA256_DIGEST_LENGTH == TROPIC_MAC_AND_DESTROY_SIZE and SHA256_DIGEST_LENGTH == OPTIGA_PIN_SECRET_SIZE) and all surrounding code remain identical.
Changed components
storage/storage.cInspect captured patch +4 / −2
diff --git a/storage/storage.c b/storage/storage.c
index 04fb77671..23e36c886 100644
--- a/storage/storage.c
+++ b/storage/storage.c
@@ -715,7 +715,8 @@ static secbool __wur derive_kek_set(const uint8_t *pin, size_t pin_len,
}
#endif
#if USE_TROPIC
- _Static_assert(SHA256_DIGEST_LENGTH == TROPIC_MAC_AND_DESTROY_SIZE);
+ _Static_assert(SHA256_DIGEST_LENGTH == TROPIC_MAC_AND_DESTROY_SIZE,
+ "SHA256_DIGEST_LENGTH != TROPIC_MAC_AND_DESTROY_SIZE");
uint8_t tropic_mac_and_destroy_reset_key[TROPIC_MAC_AND_DESTROY_SIZE] = {0};
if (!tropic_pin_set(ui_progress, stretched_pins,
tropic_mac_and_destroy_reset_key)) {
@@ -728,7 +729,8 @@ static secbool __wur derive_kek_set(const uint8_t *pin, size_t pin_len,
}
#endif
#if USE_OPTIGA
- _Static_assert(SHA256_DIGEST_LENGTH == OPTIGA_PIN_SECRET_SIZE);
+ _Static_assert(SHA256_DIGEST_LENGTH == OPTIGA_PIN_SECRET_SIZE,
+ "SHA256_DIGEST_LENGTH != OPTIGA_PIN_SECRET_SIZE");
uint8_t optiga_hmac_reset_key[SHA256_DIGEST_LENGTH] = {0};
if (!optiga_pin_set(ui_progress, stretched_pins, optiga_hmac_reset_key)) {
goto cleanup;
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.