Skip to content

Show saved credential state and add optional password reveal - #22

Merged
gh-slee merged 2 commits into
mainfrom
claude/wifi-password-retention-316ffd
Nov 21, 2026
Merged

gh-slee merged 2 commits into
mainfrom
claude/wifi-password-retention-316ffd

Conversation

@gh-slee

@gh-slee gh-slee commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Change Summary

Saved Wi-Fi, OPDS and reading-sync passwords were invisible in the app, so a blank password field looked as if applying would erase the saved password. Credential fields now show a masked "saved" state, and an optional action can reveal passwords on request.

  • Password fields show •••••••• (saved, kept unless you change it) when the card already holds a password, and "No saved password" otherwise. Blank input still keeps the stored password; only a typed value or Clear changes it.
  • The helper returns only a true/false per credential field (saved_passwords), never the secret.
  • A new explicit config.reveal action returns plaintext-fallback passwords as stored and decodes obfuscated password_obf values with a reader MAC address the user types in (Base64, then cyclic XOR with the six MAC bytes, matching CrossPoint's ObfuscationUtils).
  • The MAC address is not stored or guessed; revealed passwords stay in memory until the next snapshot load.

Files Changed

  • inkkit_config.py: adds saved_passwords to settings snapshots, parse_mac, _deobfuscate and reveal_passwords.
  • inkkit_helper.py: allowlists config.reveal with optional store and mac fields.
  • macos/InkKitApp.swift: masked placeholder in secret fields, "Show saved passwords" and Hide buttons, a MAC field and reveal state that clears on snapshot reload.
  • tests/test_config_stores.py: covers saved-password flags, plaintext reveal, MAC decode, wrong MAC and invalid MAC input.
  • docs/config-architecture.md: updates the credentials section to describe the explicit reveal path.

Testing & Evidence

Local Verification

  • PASS: xcrun swiftc -swift-version 5 -parse-as-library -typecheck on macos/InkKitApp.swift, and python3 -m compileall on the changed Python files.
  • PASS: direct check of the MAC parser and deobfuscation round trip, including a wrong-MAC result.
  • NOT RUN: the full unit suite and the new reveal test could not complete in the author's sandbox because it blocks the macOS user temp directory that synthetic demo cards need (49 errors and 1 failure, all demo-card creation). Run XTEINK_TESTING=1 python3 -m unittest discover -s tests -v -b outside the sandbox before merging.
  • PASS: the maintainer built the local preview app, whose synthetic apply/restore self-test passed, and reported that the masked placeholder looked correct. This was a manual check, not recorded hardware acceptance.

CI Verification

  • PENDING: the first push (6f24403) failed unit (3.9) and unit (3.12) on one assertion in the new reveal test, which expected three credential slots instead of all eight (run). Commit c0fce5b fixes the assertion; its run has not completed yet.

Independent QA / Architecture Review

  • NOT RUN: no independent review has been performed.

Required Pre-PR Validation

  • PASS: python3 scripts/check_configuration_docs.py and python3 scripts/check_publication.py for worktree, staged and all-history scopes, at commit 6f24403.

Behavior & Compatibility

  • Saving behavior is unchanged: existing password and password_obf values are preserved unless a new password or Clear is requested.
  • Snapshots gain an additive saved_passwords field; the Swift decoder treats it as optional.
  • Revealing passwords reverses the earlier rule that secrets never appear in the UI, but only after an explicit button press for the current category.

Risks, Limitations & Rollback

  • Decoding assumes CrossPoint's current obfuscation (key = base MAC, six bytes, cyclic XOR). It was checked against upstream source, not against a real reader's wifi.json, so decoding is unverified on hardware.
  • The reader MAC cannot be read from the SD card; the user must supply it. A wrong MAC is reported rather than shown as garbage.
  • Revealed passwords are on screen until hidden or the card state reloads.
  • Rollback is a plain revert; it changes no files on cards.

Reviewer Focus

  • reveal_passwords in inkkit_config.py: confirm secrets are returned only from this action and never reach routine snapshots, diffs or logs.
  • The config.reveal allowlist entry in inkkit_helper.py.

Credential fields now show a masked placeholder when a password is already
saved, so a blank field no longer looks like it will erase it. Blank input
still keeps the stored password.

An explicit Show saved passwords action returns plaintext fallback values
and decodes obfuscated ones with a reader MAC address entered by the user
(Base64, then cyclic XOR with the six MAC bytes). The MAC is not stored.
@gh-slee
gh-slee merged commit 0c78243 into main Nov 21, 2026
6 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.

1 participant