Skip to content

[test] add tbor crypto command fuzz targets - #680

Draft
David Zimmermann (zimmy87) wants to merge 3 commits into
user/v-davidz/add_tbor_part_info_fuzzfrom
user/v-davidz/add_tbor_crypto_fuzz
Draft

[test] add tbor crypto command fuzz targets#680
David Zimmermann (zimmy87) wants to merge 3 commits into
user/v-davidz/add_tbor_part_info_fuzzfrom
user/v-davidz/add_tbor_crypto_fuzz

Conversation

@zimmy87

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI lite review requested due to automatic review settings September 1, 2026 23:25
@zimmy87
David Zimmermann (zimmy87) force-pushed the user/v-davidz/add_tbor_crypto_fuzz branch from dbb0af8 to e7574d7 Compare September 1, 2026 23:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are additive fuzz targets and corresponding Cargo registrations, and the implementations follow existing fuzz-target patterns in this repository.

Pull request overview

Adds new libFuzzer fuzz targets for TBOR crypto-related DDI commands in the fuzz/ crate, expanding emulator-backed round-trip coverage of TBOR request handling for cryptographic operations.

Changes:

  • Introduces multiple new TBOR crypto command fuzz targets (AES, ECC, ECDH, HKDF, ConcatKDF, HMAC, RSA mod-exp, unwrap/get-unwrapping-key).
  • Bounds fuzzed variable-length inputs to the corresponding TBOR type limits to avoid trivial oversized frames.
  • Registers the new fuzz targets as [[bin]] entries in fuzz/Cargo.toml.
File summaries
File Description
fuzz/fuzz_targets/ddi/tbor/fuzz_tbor_unwrap_key.rs Fuzzes TborUnwrapKeyReq with bounded wrapped blob input.
fuzz/fuzz_targets/ddi/tbor/fuzz_tbor_rsa_mod_exp.rs Fuzzes TborRsaModExpReq with bounded masked key and input integer.
fuzz/fuzz_targets/ddi/tbor/fuzz_tbor_hmac.rs Fuzzes TborHmacReq, generating a valid masked key via TborHmacGenerateKeyReq.
fuzz/fuzz_targets/ddi/tbor/fuzz_tbor_hmac_generate_key.rs Fuzzes TborHmacGenerateKeyReq parameter space.
fuzz/fuzz_targets/ddi/tbor/fuzz_tbor_hkdf_derive.rs Fuzzes TborHkdfDeriveReq, deriving a valid masked secret via ECC keygen + ECDH.
fuzz/fuzz_targets/ddi/tbor/fuzz_tbor_hash.rs Fuzzes TborHashReq with bounded message input.
fuzz/fuzz_targets/ddi/tbor/fuzz_tbor_get_unwrapping_key.rs Fuzzes TborGetUnwrappingKeyReq round-trips.
fuzz/fuzz_targets/ddi/tbor/fuzz_tbor_ecdh_derive.rs Fuzzes TborEcdhDeriveReq, generating a valid masked key first.
fuzz/fuzz_targets/ddi/tbor/fuzz_tbor_ecc_sign.rs Fuzzes TborEccSignReq, generating a valid masked key first.
fuzz/fuzz_targets/ddi/tbor/fuzz_tbor_ecc_generate_key.rs Fuzzes TborEccGenerateKeyReq parameter space.
fuzz/fuzz_targets/ddi/tbor/fuzz_tbor_concat_kdf_derive.rs Fuzzes TborConcatKdfDeriveReq, deriving a valid masked secret via ECC keygen + ECDH.
fuzz/fuzz_targets/ddi/tbor/fuzz_tbor_aes_generate_key.rs Fuzzes TborAesGenerateKeyReq parameter space.
fuzz/fuzz_targets/ddi/tbor/fuzz_tbor_aes_encrypt_decrypt.rs Fuzzes TborAesEncryptDecryptReq, generating a valid masked key first.
fuzz/Cargo.toml Registers the new fuzz target binaries.
Review details
  • Files reviewed: 14/14 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 1, 2026 23:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

fuzz_tbor_get_unwrapping_key currently ignores its input, making it ineffective as a fuzz target.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

fuzz/fuzz_targets/ddi/tbor/fuzz_tbor_get_unwrapping_key.rs:28

  • This fuzz target ignores its input entirely, so the fuzzer can't mutate anything meaningful and coverage will be effectively constant. Consider consuming the input to vary session_id (e.g., sometimes use the real active session id and sometimes a fuzzed one) so validation and error paths are actually fuzzed.
  • Files reviewed: 14/14 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants