Skip to content

fix(piv): serve a synthesized Card Capability Container - #124

Merged
TheMaxMur merged 3 commits into
TheMaxMur:mainfrom
IsayIsee:pr/piv-ccc
Oct 19, 2026
Merged

TheMaxMur merged 3 commits into
TheMaxMur:mainfrom
IsayIsee:pr/piv-ccc

Conversation

@IsayIsee

Copy link
Copy Markdown
Contributor

What

The Card Capability Container (5FC107) is a mandatory PIV object
(SP 800-73-4 pt1 §3.1.1). This card only held one if a host had written it, so a
freshly provisioned card answered 6A82 for it — and the Windows inbox PIV
minidriver reads that object while opening a key container, which is where a
certificate login comes back NTE_BAD_KEYSET.

How

The default follows the CHUID path rather than adding a second one: get_data
reads flash first, and when nothing is stored it serves the object the
specification describes — Table 8's mandatory elements in table order, F0/F1/
F2 zero-length (§3.1.1 defines no PIV values for them) and F5 carrying the
PIV data model number 0x10 (Appendix A). A host PUT DATA still overrides it,
and an empty PUT DATA falls back to the default again.

  • crates/rsk-piv/src/ccc.rs holds the nine wire bytes beside their Table 8
    provenance, with unit tests pinning both the literal and the TLV walk.
  • docs/protocol.md documents the synthesized default; docs/guides/piv.md and
    docs/windows.md cover the host side; tests/interop/divergences.py records
    the divergence (Yubico's SDK documents a factory CCC as present-but-empty).
  • The applet is shared, so every board's image gains the object: bcdDevice
    moves to 0x09DB. If the display-keys PR (feat: touchless display build for screen+button boards (display-keys) #123) lands first, this one needs
    the neighbouring bump — its bcdDevice is the same value today.

@github-actions

Copy link
Copy Markdown

Development firmware for this pull request: https://rskey.fob.wtf/preview?pr=124

The link always opens the latest successful preview build.

@TheMaxMur

Copy link
Copy Markdown
Owner

Please sign your commits

`5FC107` is a mandatory PIV object (SP 800-73-4 pt1 §3.1.1) that this card only
held if a host had written one, so a freshly provisioned card answered 6A82 for
it — and the Windows inbox PIV minidriver reads that object while opening a key
container.

The default follows the CHUID path rather than adding a second one: `get_data`
reads flash first, and with nothing stored it serves the object the
specification describes — Table 8's mandatory elements in table order, `F0`/`F1`/
`F2` zero-length (§3.1.1 defines no PIV values for them) and `F5` carrying the
PIV data model number `0x10`. A host `PUT DATA` still overrides it, and an empty
one falls back to the default again.

`ccc.rs` holds the nine wire bytes beside their Table 8 provenance, with unit
tests pinning the literal and the TLV walk; `docs/protocol.md` records the wire
behaviour, and `docs/guides/piv.md` / `docs/windows.md` the host side. The applet
is shared, so every board's image gains the object: bcdDevice -> 0x09DB.
The synthesized Card Capability Container arms add nine lines to
`crates/rsk-piv/src/lib.rs`, which moves the five `Fs` delete-family call
sites disposal is recorded against (858/1172/1207/1208/1210 -> +9). The
dispositions themselves are unchanged; `scripts/deleter_gate.py` is green
again.
`docs/platform-assumptions.md` is written from the spans in
`assurance/platform.toml`, and the CCC work moves the code two of its rows
cite: `crates/rsk-piv/src/lib.rs` 1328 -> 1337, `firmware/src/main.rs`
1022/960/968 -> 1025/963/971.

The registry already held the new spans, so only the region generated from
it was stale: this is `scripts/platform_gate.py --write`, two lines, and no
change to the argument either row states.
@IsayIsee

Copy link
Copy Markdown
Contributor Author

All three commits are now signed (SSH, FIDO key) — GitHub shows them as Verified. The new CI runs on cc5f287 are marked "action required" and need your approval to start. Nothing else has changed: the rebase was patch-identical to the previous tip (range-diff shows = for all three). Thanks!

@TheMaxMur
TheMaxMur merged commit 960b20a into TheMaxMur:main Oct 19, 2026
40 checks passed
@IsayIsee
IsayIsee deleted the pr/piv-ccc branch October 20, 2026 05:10
IsayIsee added a commit to IsayIsee/RS-Key that referenced this pull request Oct 20, 2026
The 2" board ships in all three postures, so the six published flavors are two
boards x three postures: the GEEK and the 2" in default, `strong-pin` and
`always-uv`. `bcdDevice` is 0x09DB, unchanged by this release: on this line it
follows upstream.

The tree is upstream 0.4.11 plus PR TheMaxMur#124 (the synthesized PIV Card Capability
Container) and the dependabot bumps. The release notes are extracted from this
section at tag time.
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