Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ Newest first. Each version is a [release](https://github.com/rahulranjan-dev-py/
program; PCs that run PrintVect offer the newest one by themselves (Settings, Updates). **Tested** says how far the
version was tried on the office's PCs (Windows 10 and 11).

## 0.5.10

When the PC with a printer was set up again (PrintVect or Windows installed again), it proves a new identity key and
jobs are refused until the person decides: the waiting job now says exactly that, instead of the "did not answer" of the
PC-name try that came after it, and Printers on other PCs shows **Trust it again** next to that printer. It checks the PC
once more and, after the person confirms, takes its new key. Hellos (the "PCs that use this PC" list) are now sent only
to a PC that passed the same identity check as jobs. Settings warns when the sharing PIN is digits only. **Tested:**
awaiting test.

## 0.5.9

Three more security fixes. Before a job leaves, the PC at the printer's saved address must prove it is the PC the
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ polling, re-checks within 0.5 s; taken when exclusively openable and size stable
(XpsFormatSniffer looks inside: namespace openxps.org = oxps; it also reads the docProps title; the v4 writer stores
none, so the document name comes from EnumJobs on the virtual printer while the port writes) -> ClientService sends
(3 tries, each IP then PC name; after the first failure one 3 s discovery search follows a host that moved (0.5.0); a new address or the name's
address is used only once it signs a challenge with the host key remembered for the printer (0.5.8, HostIdentity, MovedHostCheck; 0.5.9: the saved address too, before each job, passed checks kept 5 min in TcpJobSender); then pending\
address is used only once it signs a challenge with the host key remembered for the printer (0.5.8, HostIdentity, MovedHostCheck; 0.5.9: the saved address too, before each job, passed checks kept 5 min in TcpJobSender; 0.5.10: hellos too, HostIdentityException keeps the reason, Trust it again takes a re-proven new key after confirmation); then pending\
and Retry resends under the same job id; sent\ kept 1 h, failed\ last 20) and polls status.
Host: receive into spool\incoming\ -> verify size, sniff the real format -> HostPrintEngine -> reply JSON -> watch the
job (up to 60 s before replying). One job at a time per printer, arrival order, on that printer's worker thread (never
Expand All @@ -75,7 +75,7 @@ unit-tested with fakes over loopback TCP (tests never load System.Printing, whic
- One milestone at a time (M0..M6 in the brief, section 9). Finish, build, hand over test steps,
then wait for the owner's result before starting the next one. M4 (Windows 7 pass) is skipped:
the office has no Windows 7 PC (owner, 2026-10-06); keep Windows 7 paths only where they cost nothing. M6: M6a
updates, M6b-1 new look, M6b-2 hardening; then 0.4.1 (jobs menu), 0.5.0 (redesign, colours, hotspot), 0.5.1-0.5.3 (look fixes), 0.5.4, 0.5.5 (no office words: homes too), 0.5.6 (menu fits), 0.5.7 (copies window), 0.5.8 (security review: PIN proof, host identity, Elevate link guard, host flood limits, strict updates, test releases), 0.5.9 (host key before each job, 8-character PINs, nonce memory).
updates, M6b-1 new look, M6b-2 hardening; then 0.4.1 (jobs menu), 0.5.0 (redesign, colours, hotspot), 0.5.1-0.5.3 (look fixes), 0.5.4, 0.5.5 (no office words: homes too), 0.5.6 (menu fits), 0.5.7 (copies window), 0.5.8 (security review: PIN proof, host identity, Elevate link guard, host flood limits, strict updates, test releases), 0.5.9 (host key before each job, 8-character PINs, nonce memory), 0.5.10 (changed key kept as reason, Trust it again, hello check, digits-only PIN warning).
- Build: `msbuild PrintVect.sln /p:Configuration=Release` (VS 2022 Build Tools + .NET Framework 4.8 targeting pack); `dotnet build PrintVect.sln -c Release` (.NET 8 SDK) too.
- Tests: `dotnet test tests/PrintVect.Tests/PrintVect.Tests.csproj -c Release`. CI: .github/workflows/build.yml (windows-latest) builds, tests, makes the setup program;
release.yml publishes a TEST version (pre-release, never "latest", so PCs skip it; text = CHANGELOG section via tools/release_notes.py); promote.yml makes it the latest release for every PC (0.5.8).
Expand Down
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>

<!-- Raise all three together before publishing a release (README, "Publishing a new version"). -->
<Version>0.5.9</Version>
<AssemblyVersion>0.5.9.0</AssemblyVersion>
<FileVersion>0.5.9.0</FileVersion>
<Version>0.5.10</Version>
<AssemblyVersion>0.5.10.0</AssemblyVersion>
<FileVersion>0.5.10.0</FileVersion>
<Product>PrintVect</Product>
<Company>PrintVect</Company>
<Authors>PrintVect contributors</Authors>
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ pvct-send status 192.168.1.5 <job id>
`192.168.1.5` is the host PC's address (shown on its Share my printers page, and under Network in Settings, Diagnostics); a PC
name works too. `PrintVect-test-page.xps` is a ready-made one-page test file. Any other
`.xps` file works: print a document to "Microsoft XPS Document Writer" to make one. Options:
`/pin 1234` when the host has a PIN, `/doc "title"`, `/port 9151`, `/nowait`.
`/pin <the sharing PIN>` when the host has a PIN, `/doc "title"`, `/port 9151`, `/nowait`.

If another PC cannot reach the host, the Windows Firewall on the host is blocking port 9151 (on a phone
hotspot: see Troubleshooting). Without the installer, run this once on the host as administrator:
Expand Down Expand Up @@ -263,7 +263,7 @@ netsh advfirewall firewall add rule name="PrintVect Discovery (UDP-In)" dir=in a
| After an update PrintVect did not come back | Start it from the Start menu; the update itself is complete. Tell the person who supports PrintVect which version the window shows. |
| A job waits with "asks for the sharing PIN" | The two PCs have different sharing PINs (or one has none). Set the same PIN in Settings on both, then press **Retry waiting** (Printers on other PCs) on the PC that printed. |
| A job waits with "Too many wrong sharing PINs" | That PC sent 5 wrong PINs, so the PC with the printer ignores it for the minutes the message names (longer each time). Set the same PIN on both PCs, wait, then press **Retry waiting**. |
| A job waits with "it is not ..., the PC this printer was added from" | A PC answered with the name of the PC that has the printer but could not prove it is that PC, so nothing was sent to it. If the PC with the printer was set up again (new Windows, or PrintVect removed and installed again), remove its printer on this PC and add it again (Printers on other PCs). |
| A job waits with "proved a different identity key" or "it is not ..., the PC this printer was added from" | The PC at the printer's address could not prove it is the PC the printer was added from, so nothing was sent to it. If that PC was set up again (new Windows, or PrintVect removed and installed again), press **Trust it again** next to the printer on Printers on other PCs and confirm, or remove the printer and add it again; then press **Retry waiting**. If it was not set up again, find out which PC now has that address before trusting it. |
| A job waits with "runs a PrintVect older than 0.5.8" | The PC with the printer has a sharing PIN and the PC that printed has an old PrintVect. Update it (Settings, Updates, Check now), then press **Retry waiting**. |
| A job waits with "already holds ... of documents waiting to print" or "is nearly full" | The PC with the printer has 1 GB of documents waiting (a paused printer?) or little disk space left. Resume the printer or free some space on that PC, then press **Retry waiting**. |
| A job waits with "is paused there" | Someone pressed **Pause** on the PC that has the printer. Press **Resume** there (Share my printers). |
Expand Down
3 changes: 2 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ These are known limits of the design, not vulnerabilities:
- A PC name and printer ids can be claimed by any PC on the network. Since 0.5.8 a printer follows its host to a new
address only when the PC there proves, by signing a random challenge with the host's identity key, that it is the
PC the printer was added from. Since 0.5.9 the PC at the saved address must prove it too before a job goes there
(checked again every 5 minutes), in case another PC was given the host's old address. Someone who can intercept the network traffic itself (not just answer on it) is
(checked again every 5 minutes; hellos too since 0.5.10), in case another PC was given the host's old address. A PC
that proves a new key there (set up again) is trusted only after the person confirms it (Trust it again, 0.5.10). Someone who can intercept the network traffic itself (not just answer on it) is
outside what PrintVect can stop.
- Every user may write in `C:\ProgramData\PrintVect`. The administrator helper (`PrintVect.Elevate.exe`) checks that no
folder it creates, gives rights on, deletes or writes its log and result in is a junction or symbolic link, and
Expand Down
9 changes: 6 additions & 3 deletions docs/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ address with the remembered key; one that claims the host's name or printers wit
says why. A printer with no key yet remembers the first one proven to it; a host before 0.5.8 (no key) is followed
as before. The signed address stops a PC from passing on the real host's answer from elsewhere.

Since 0.5.9 the client also checks the PC at the printer's saved address before it sends a job there: the same list
request with a challenge, trusted for 5 minutes once passed. When it fails, nothing is sent; the client treats the
host as not reachable at that address (it searches for it, then keeps the job for Retry with the reason).
Since 0.5.9 the client also checks the PC at the printer's saved address before it sends a job there (0.5.10: before
a hello too): the same list request with a challenge, trusted for 5 minutes once passed. When the PC there does not
answer, the client treats the host as not reachable at that address. When it answers but does not prove the key,
nothing is sent; the client searches for the host once and otherwise keeps the job for Retry with that reason as its
message (0.5.10). When it proves a different key with a valid signature for that address (set up again), the person
can take that key with **Trust it again** on Printers on other PCs, after a fresh check and a confirmation.

## Job header

Expand Down
18 changes: 17 additions & 1 deletion docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -746,11 +746,27 @@ on 0.5.9.
|---|---------|-------------|
| 0 | Install the 0.5.9 test version on HOST and CLIENT (docs/releasing.md: download the setup from the release page). | "Version 0.5.9" under the menu. |
| 1 | Print a page from CLIENT, and another within 5 minutes. | Both print. CLIENT's log, first job only: "The PC at 192.168.… proved it is HOST (identity key checked; checked again after 5 minutes)." |
| 2 | (Optional, needs a spare PC) switch HOST off, give the spare PC HOST's old address (on the router, or as a fixed address), share a printer on it, wait 5 minutes and print from CLIENT. | Nothing prints on the spare PC. The job waits: "… is not HOST, the PC this printer was added from … Nothing was sent there." |
| 2 | (Optional, needs a spare PC) switch HOST off, give the spare PC HOST's old address (on the router, or as a fixed address), share a printer on it, wait 5 minutes and print from CLIENT. | Nothing prints on the spare PC. In 0.5.9 the job waits with the result of the PC-name try that comes after the refusal: "HOST did not answer (3 tries). HOST did not answer at 192.168.…, and its name leads nowhere (…)" (or "… leads to no other address."). The spare PC's own refusal is only in CLIENT's log: "Not sending to 192.168.…: A PC calling itself … but it is not HOST …". From 0.5.10 the job keeps that reason as its message (section 0.5.10, step 2). |
| 3 | On a PC whose PIN has fewer than 8 characters: Settings. | Sharing PIN shows an orange "Short" and the note "This PIN has 4 characters; new PINs need at least 8 …". Printing still works. Diagnostics: "Sharing PIN is short". |
| 4 | Change PIN…, type 1234 twice. | "The PIN needs 8 to 12 characters." Type an 8-character PIN: saved, "Short" gone. Set the same PIN on the other PCs. |
| 5 | Nothing to do for the one-time proofs: printing and Retry work as before. (A copied request would be refused with "its one-time PIN proof was already used"; the unit tests check that.) | |

## 0.5.10: a changed host key says so, Trust it again, hellos checked, digits-only PINs

From the owner (2026-11-01). In 0.5.9 a PC that proved a different identity key at the saved address (PrintVect or
Windows installed again there) refused the job, but the PC-name try after it replaced that reason with "did not
answer". Now the reason stays, and Printers on other PCs offers **Trust it again**. Hellos get the same check as jobs.
Use HOST (shares the printer) and CLIENT (prints), both on 0.5.10.

| # | Do this | Expect this |
|---|---------|-------------|
| 0 | Install the 0.5.10 test version on HOST and CLIENT (docs/releasing.md). | "Version 0.5.10" under the menu. Printing works as before. |
| 1 | On HOST: uninstall PrintVect (Windows Settings, Apps) and install 0.5.10 again; share the printer again and set the same sharing PIN. On CLIENT: print a page. | Nothing prints. The job waits: "The PC HOST at 192.168.… proved a different identity key than HOST had when this printer was added: PrintVect or Windows was installed again there, or it is another PC. Nothing was sent there. If HOST was set up again, press Trust it again …". Not "did not answer". |
| 2 | On CLIENT: Printers on other PCs. | HOST's printer shows an orange "Identity changed" and a **Trust it again** button in place of Test page. CLIENT's log: "… proved a different identity key than HOST had …; nothing is sent there until it is trusted again". Within 5 minutes also "Presence: HOST did not take the hello (…)": no hello went there. |
| 3 | Press **Trust it again**. | A question: "The PC at 192.168.…, which calls itself HOST, now proves a different identity key … Trust this PC as HOST from now on?" (No is the default). Press **No**: "Nothing changed …". Press Trust it again once more and **Yes**: "HOST is trusted again with its new identity key." The pill shows the printer status again. |
| 4 | Press **Retry waiting**. | The page prints. CLIENT's log: "Trust it again: the person confirmed the new identity key …", then "The PC at … proved it is HOST". |
| 5 | Settings on a PC whose PIN is 8 digits (for example 12345678). | Sharing PIN shows an orange "Digits only" and the note "This PIN has only digits, which anyone guessing tries first …". Diagnostics: "Sharing PIN is digits only". A PIN with letters and digits: "Set", no note. |

## Later

Phase 2 items (brief section 9): raw port-9100 relay, Hindi UI, optional service host, job counter per user.
4 changes: 2 additions & 2 deletions installer/PrintVect.iss
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
; PrintVect installer (Inno Setup 6, milestone M5; silent in-app updates since M6a).
; CI builds it with: ISCC.exe /DAppVersion=0.5.9 /DSourceDir=<folder with the built program files> installer\PrintVect.iss
; CI builds it with: ISCC.exe /DAppVersion=0.5.10 /DSourceDir=<folder with the built program files> installer\PrintVect.iss
; The source folder is what the build workflow collects: PrintVect.App.exe, PrintVect.Core.dll,
; Newtonsoft.Json.dll, PrintVect.Elevate.exe, pvct-send.exe, Fonts\, the sample .xps files, README.md, LICENSE.
; An update from inside PrintVect runs this same program as PrintVect-Setup-<version>.exe /SILENT /NORESTART /LOG=...
; started by the app like a double-click: Setup asks Windows for administrator rights itself, ends the running
; PrintVect (PrepareToInstall below), installs over the old files and starts PrintVect again as the signed-in user.

#ifndef AppVersion
#define AppVersion "0.5.9"
#define AppVersion "0.5.10"
#endif
#ifndef SourceDir
#define SourceDir "..\artifacts\PrintVect"
Expand Down
Loading
Loading