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

securechip: make kdf async

Public commit record

What the developer wrote

Authored by Marko Bencun

58/100 · Thin
securechip: make kdf async

Expose the OPTIGA crypt instance to Rust and route the\nKDF through the async command bridge. The higher-level\nsecurechip and application callers now await the operation\ninstead of relying on the synchronous C wrapper.
✓ Descriptive subject✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit rewrites how the BitBox02 hardware wallet performs a key-derivation operation inside its secure chip (OPTIGA). Previously the operation was synchronous and wrapped in C; now it is asynchronous and called from Rust through the existing async command bridge. The change touches many files because every caller of the KDF/keystore functions had to be updated to `await` the result. The diff itself is a large refactoring with no obvious security bug, but it introduces new async machinery around a sensitive cryptographic operation, so it warrants careful review for memory-safety and concurrency issues.

Recommended action

Treat this as a high-priority architectural change requiring focused review of the new async KDF path: verify that the static `INPUT`/`MAC` buffers cannot be re-entered concurrently, that zeroization covers all error and cancellation paths, that the Rust future cannot be dropped while OPTIGA still holds the raw pointers, and that the async command bridge correctly serializes OPTIGA commands. Regression tests should cover KDF failure, cancellation, and concurrent command scenarios.

Security signals we found

01

Sensitive operation (KDF) moved from synchronous C wrapper to async Rust bridge

02

Raw pointers to static buffers passed to OPTIGA library during async operation

03

Static mutable buffers used across await points; zeroization added on error paths

04

Large blast radius: keystore, signing, address derivation, backup/restore all made async

05

No explicit security bug visible in the diff, but async state machine and static buffers are a traditional source of use-after-free or lifetime bugs

06

Old `optiga_kdf_external` removed; new path uses `optiga_crypt_hmac` with OID_HMAC

Risk score

Why this scored 27/100

Our methodology →
Potential impact 5/30
Exploitability 3/25
Stealth signal 4/15
Affected reach 6/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.