Skip to content

[Rust] Chain verification in fd5 crate #170

@gerchowl

Description

@gerchowl

Parent: #161

Goal

Extend verify.rs to validate audit chain integrity.

Spec

  • ChainStatus enum: Valid(usize) (entry count), NoLog, BrokenChain { index, expected, actual }, Error(String)
  • verify_chain(file: &File) -> Fd5Result<ChainStatus>
  • Integrate into Fd5Status or return separately
  • Validation:
    1. Walk entries in order
    2. Each entry\u2019s parent_hash must form a valid chain
    3. No gaps or tampered entries

TDD

  • Test valid chain → Valid(N)
  • Test tampered middle entry → BrokenChain
  • Test no log → NoLog
  • Test single entry chain
  • Test content_hash mismatch with chain (Merkle tree catches audit log tampering)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corefd5 core libraryaudit-trailAudit trail / provenance chain featureeffort:medium1-4 hoursfeatureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions