AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 34 Bitcoin

refactor(core): split secret, make it optional, add compile flags based on presence

Public commit record

What the developer wrote

Authored by tychovrahe

62/100 · Adequate
refactor(core): split secret, make it optional, add compile flags based on presence

[no changelog]
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope! No meaningful explanatory body
The short version

What changed, and why it matters

This commit reorganizes how Trezor firmware handles secret keys and the 'secret' subsystem. It splits key-handling code into a new optional component (secret_keys), adds compile-time flags (USE_SECRET and USE_SECRET_KEYS) so different device models can include or exclude these features, and updates the build configuration for every supported model. The change is a structural refactor, not a direct security fix, but it touches sensitive code paths that protect device secrets and storage encryption.

Recommended action

Treat this as a high-risk refactor requiring careful review and regression testing. Verify that every model configuration still enables USE_SECRET and USE_SECRET_KEYS where the previous common code unconditionally included them, ensuring no production device loses secret-handling functionality. Specifically confirm that the boardloader's erase_storage(NULL) fallback correctly and securely wipes storage when USE_SECRET is absent, and that removing secret_safety_erase() does not weaken anti-exfiltration behavior. Run full build and test matrix across all models, and review downstream callers of secret_key APIs for missing guards.

Security signals we found

01

Refactor of secret and secret_keys subsystems with new compile-time feature flags

02

Conditional compilation of secret_init(), secret_safety_erase(), secret_prepare_fw(), and secret_key_delegated_identity__verified()

03

Direct storage erase fallback in boardloader when USE_SECRET is disabled

04

Build-system changes affecting all supported hardware models and emulators

05

No changelog entry and no explicit security disclosure in commit message

Risk score

Why this scored 34/100

Our methodology →
Potential impact 5/30
Exploitability 5/25
Stealth signal 5/15
Affected reach 10/15
Confidence 6/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.