Skip to content

Deserialize plain DI certs as raw DER - #553

Open
puiterwijk wants to merge 1 commit into
fdo-rs:mainfrom
puiterwijk:fix_plain_di_key_loading
Open

Deserialize plain DI certs as raw DER#553
puiterwijk wants to merge 1 commit into
fdo-rs:mainfrom
puiterwijk:fix_plain_di_key_loading

Conversation

@puiterwijk

Copy link
Copy Markdown
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

7flying commented Sep 8, 2023

Copy link
Copy Markdown
Contributor

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