Skip to content

PrintVect 0.5.9: host key before every job, 8-character PINs, one-time proofs - #24

Merged
rahulranjan-dev-py merged 1 commit into
mainfrom
ccr-5c5bb225-3h4f6u
Oct 30, 2026
Merged

rahulranjan-dev-py merged 1 commit into
mainfrom
ccr-5c5bb225-3h4f6u

Conversation

@rahulranjan-dev-py

Copy link
Copy Markdown
Owner

These are the owner's three follow-ups to the 0.5.8 security review, plus a fix for a PIN-window bug introduced in 0.5.8.

Changes

  1. Host key checked before every job.
    • TcpJobSender makes the PC at the printer's saved address sign a challenge with the remembered host key (MovedHostCheck) before a job goes there. A check that passed is trusted for 5 minutes.
    • A failed check raises HostUnreachableException with the reason. The job then searches for the host and otherwise waits for Retry, saying "Nothing was sent there".
    • A printer without a key learns it at this point; the HostKeyLearned event makes the app save config.json.
  2. New PINs need 8 to 12 characters. This applies to the PIN window and the "Turn on sharing" window.
    • A shorter PIN that is already saved keeps working.
    • Settings shows a "Short" pill and a note next to it, and Diagnostics shows "Sharing PIN is short".
  3. One-time proofs.
    • NonceMemory: the host remembers every nonce it accepted until its proof expires (the proof's time plus 24 h). It holds at most 100,000, dropping the soonest-to-expire first when full.
    • A nonce that comes again is refused and counted as a wrong try. The list is in memory only.
  4. Fix (0.5.8 regression): the PIN window now sizes itself to its content, with room for the longest error message. Its four-line explanation had left the message row no room, so a refused PIN showed nothing.

Version 0.5.9. Also updated: protocol.md, SECURITY.md, README.md, CLAUDE.md, CHANGELOG.md and docs/testing.md (new 0.5.9 section).

Checked

  • 187 tests pass on Mono. New tests cover the saved-address check against a real host on loopback (passes, is cached, is refused once the cache time is zero, and an unpinned printer learns the key), the nonce memory, and an exact copy of an accepted request being refused while Retry still works.
  • The Windows CI build passed on the branch commit.
  • The Settings note and the PIN window error were rendered and checked under Xvfb.

Generated by Claude Code

…e proofs

The owner's three follow-ups to the 0.5.8 security review:

- TcpJobSender checks the PC at the printer's saved address before a job
  goes there: it must sign a challenge with the remembered host key
  (MovedHostCheck). A passed check is trusted for 5 minutes; a failed one
  is HostUnreachableException with the reason, so the job searches for the
  host and then waits for Retry, saying "Nothing was sent there". A printer
  without a key learns it here (HostKeyLearned: the app saves config.json).
- New sharing PINs need 8 to 12 characters (PinDialog.MinLength, also the
  Turn on sharing window). A shorter saved PIN keeps working; Settings
  shows "Short" and a note, and Diagnostics "Sharing PIN is short".
- NonceMemory: the host remembers every nonce it accepted until its proof
  expires (time + 24 h, capped at 100,000, soonest-to-expire dropped
  first) and refuses one that comes again, counting it as a wrong try.
  Memory only; a replayed job still cannot print twice after a restart.
- Fix (0.5.8 regression): the PIN window is as tall as its content with
  room for the longest message; its four-line explanation had left the
  message row no room, so a refused PIN showed nothing.
- Tests: the saved-address check (passes, cached, refused, learns), nonce
  memory rules, an exact copy of an accepted request refused while Retry
  still works.
- Version 0.5.9; protocol.md, SECURITY.md, README, CLAUDE.md, CHANGELOG,
  testing.md steps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JFV1W7wPfiMU9itafQutsk
@rahulranjan-dev-py
rahulranjan-dev-py merged commit 70bb840 into main Oct 30, 2026
2 checks passed
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