Skip to content

Delete a data object on PUT DATA with an empty object - #55

Open
FlorianFranzen wants to merge 1 commit into
trussed-dev:mainfrom
FlorianFranzen:feat/empty-put-data-deletes
Open

FlorianFranzen wants to merge 1 commit into
trussed-dev:mainfrom
FlorianFranzen:feat/empty-put-data-deletes

Conversation

@FlorianFranzen

Copy link
Copy Markdown
Contributor

PUT DATA with an empty object stored a zero-length file, and the following GET DATA answered 9000 with an empty object. On a YubiKey the empty PUT DATA is the delete primitive: yubikit's delete_certificate is put_object(id) with no data, and ykman then expects the object to be absent. An empty object now removes the stored file, and for a PIN-protected object its sealed key file as well, so GET DATA answers NotFound afterwards and a deleted retired certificate no longer counts in the key history object. Objects with a built-in default (CCC, printed information, discovery object) serve that default again; the CHUID, which is written at initialization, answers NotFound once deleted instead of hitting the panic! that guarded its default.

Tested in command_response.ron: delete of a certificate object, of a retired certificate as seen through the key history, of a PIN-protected object, and of the CHUID.

@FlorianFranzen

Copy link
Copy Markdown
Contributor Author

Heads-up for whichever of #52 and #55 lands second: #55's test deletes a retired certificate and then expects the key history object to come back as the synthesised empty one (53 08 C1 01 00 ...); with #52 merged that object is absent and the expectation becomes NotFound. One-line change in command_response.ron, I will push it to the one still open at that point.

FlorianFranzen added a commit to FlorianFranzen/piv-authenticator that referenced this pull request Oct 16, 2026
- 42fdab7 Delete a data object on PUT DATA with an empty object
FlorianFranzen added a commit to FlorianFranzen/piv-authenticator that referenced this pull request Oct 16, 2026

This branch has not been deployed

No deployments
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