Verify artifacts against explicit SHA-2 lengths and digests #6

Open
opened 2026-10-24 17:09:13 +02:00 by erikinkinen · 0 comments
Owner

Problem and motivation

Callers need a direct way to compare an artifact with its expected length and digest, including inherited input on EriX.

Proposed behavior and scope

Add verify-sha256 and verify-sha512 with explicit LENGTH HEX SOURCE triples. Preserve raw paths, repeated inputs, stdin once, -- and --zero. Parse before I/O and print a verdict only after checking the actual input and retiring it. Keep existing hash commands compatible. This checks caller-provided expectations, not publisher identity.

Authority, security and reliability

Bind complete original argv to admitted startup. Narrow each actual file or recipient-stream READ endpoint before data access, with monotonic alias-wide limits, a genuine data-free EOF probe and once-only retirement. A surviving output alias must not retain usable input authority. Preserve fixed terminals, lenders, original errors and separate cleanup evidence. No checkfile discovery, new pathname authority, widening fallback or arbitrary input cap. Coordinate protocol, provider, measured-profile and counted storage changes.

Acceptance criteria

  • Both algorithms check exact length, digest and genuine EOF for files and stdin, with documented raw-path/record/status behavior.
  • Full original argv binding and same-owner READ limits cover aliases, repeated narrowing, lost replies, Status and exhaustion without unrestricted fallback.
  • Recipient views retire READ before verdicts without closing surviving lenders or fixed terminals; uncertainty retains original owners and errors.
  • Parser, host, native, denial, mismatch, partial-I/O, output and lifecycle tests cover the complete feature.
  • Maintained real image scenarios exercise file, redirection and pipeline verification with exact byte/status oracles and unchanged authority scope.
  • Manuals, APIs, measured profiles, exact manifests and capacity accounting match delivered behavior; ordinary hashing remains compatible.

Alternatives and tradeoffs

A local byte counter does not narrow native authority. Provider-enforced limits and recipient-only views require coordinated work but avoid an unrestricted verifier or duplicate file runtime. Checkfiles and publisher authentication are separate features.

Tracking and rollout

Implement the shared protocol and providers, then the command, measured profiles and image scenarios. Tracked by Phase 6 completion and the compatibility changes. Boot assembly's expected-length adoption remains a separate requirement.

## Problem and motivation Callers need a direct way to compare an artifact with its expected length and digest, including inherited input on EriX. ## Proposed behavior and scope Add verify-sha256 and verify-sha512 with explicit LENGTH HEX SOURCE triples. Preserve raw paths, repeated inputs, stdin once, -- and --zero. Parse before I/O and print a verdict only after checking the actual input and retiring it. Keep existing hash commands compatible. This checks caller-provided expectations, not publisher identity. ## Authority, security and reliability Bind complete original argv to admitted startup. Narrow each actual file or recipient-stream READ endpoint before data access, with monotonic alias-wide limits, a genuine data-free EOF probe and once-only retirement. A surviving output alias must not retain usable input authority. Preserve fixed terminals, lenders, original errors and separate cleanup evidence. No checkfile discovery, new pathname authority, widening fallback or arbitrary input cap. Coordinate protocol, provider, measured-profile and counted storage changes. ## Acceptance criteria - [ ] Both algorithms check exact length, digest and genuine EOF for files and stdin, with documented raw-path/record/status behavior. - [ ] Full original argv binding and same-owner READ limits cover aliases, repeated narrowing, lost replies, Status and exhaustion without unrestricted fallback. - [ ] Recipient views retire READ before verdicts without closing surviving lenders or fixed terminals; uncertainty retains original owners and errors. - [ ] Parser, host, native, denial, mismatch, partial-I/O, output and lifecycle tests cover the complete feature. - [ ] Maintained real image scenarios exercise file, redirection and pipeline verification with exact byte/status oracles and unchanged authority scope. - [ ] Manuals, APIs, measured profiles, exact manifests and capacity accounting match delivered behavior; ordinary hashing remains compatible. ## Alternatives and tradeoffs A local byte counter does not narrow native authority. Provider-enforced limits and recipient-only views require coordinated work but avoid an unrestricted verifier or duplicate file runtime. Checkfiles and publisher authentication are separate features. ## Tracking and rollout Implement the shared protocol and providers, then the command, measured profiles and image scenarios. Tracked by [Phase 6 completion](https://git.erikinkinen.fi/erix/integration/issues/65) and the [compatibility changes](https://git.erikinkinen.fi/erix/sha2-tool/pulls/2). Boot assembly's expected-length adoption remains a separate requirement.
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:35:14 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/sha2-tool#6
No description provided.