Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deserialize plain DI certs as raw DER #553

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

puiterwijk
Copy link
Contributor

Because of the deserialize implementation that's automatically generated, at this moment the expected value for the public_key_store in the manufacturing server is a CBOR array of the DER certificate. This commit adds a new type PlainBytes which (de)serializes transparently, and makes the manufacturing server use it for the public key store.

NOTE: this means that with this patch, the store format on disk changes. This store is a ReadOnly (the server will never write to it), but if anyone would've put a CBOR file in place, that will now fail to open. Raw DER was always the intention (and documented) format, but it still is a risk.

Fixes: #477

Because of the deserialize implementation that's automatically
generated, at this moment the expected value for the public_key_store
in the manufacturing server is a CBOR array of the DER certificate.
This commit adds a new type PlainBytes which (de)serializes
transparently, and makes the manufacturing server use it for the public
key store.

NOTE: this means that with this patch, the store format on disk changes.
This store is a ReadOnly (the server will never write to it), but if
anyone would've put a CBOR file in place, that will now fail to open.
Raw DER was always the intention (and documented) format, but it still
is a risk.

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
Fixes: fdo-rs#477
@7flying 7flying self-requested a review September 7, 2023 14:50
@nullr0ute nullr0ute added jira manufacturing Anything to do with the manufacturing client/service/APIs/protocol labels Sep 7, 2023
@7flying
Copy link
Contributor

7flying commented Sep 8, 2023

tested, works as expected, @puiterwijk you've got a commit lint warning, can you rename your commit to something like "fix: deserialize plain DI certs as raw DER", thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira manufacturing Anything to do with the manufacturing client/service/APIs/protocol
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fdo-manufacturing-client plain-di does work
3 participants