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

[wicketd] Don't check RoT CMPA/CFPA until we've decided to update it #4459

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

jgallagher
Copy link
Contributor

@jgallagher jgallagher commented Nov 7, 2023

Fixes #4420, which is a bit of an edge case: if the TUF repo contains RoT images with the same version as the target sled, but does not contain an RoT image signed with a correct key for the target sled, we would previously fail to mupdate the sled even if the user chose not to update the RoT (since its version number already matched), due to missing a correctly-signed image.

With this PR, we postpone the key check (implemented as fetching the CMPA/CFPA pages to verify against each archive) until after we've decided whether or not to try updating the RoT at all.

An additional check added with this PR that is always true today with TUF repos built in CI is that for each class of Hubris archive where we accept multiple options (e.g., "gimlet SP" where we accept multiple board revisions, "gimlet RoT", "sidecar RoT", etc.), we require all the archives of that class to have the same version. We will still allow SP images to have different versions than RoT images, and even allow "gimlet RoT" images to have different versions of "sidecar RoT" images, but we do not allow something like "gimlet RoT version 1.0.1 signed with a dev key and gimlet RoT version 1.0.2 signed with a production key".

Todo before merging:

  • Test on madrid Edit: Test completed. I uploaded a TUF repo containing only 1.0.2 prod RoT images to madrid and attempted to update a sled with a 1.0.2 staging-dev RoT image on main with force update RoT unchecked, and it failed in the way described in Mupdate fails on locked Rev E gimlet #4420. After updating wicketd to this branch, the update succeeded: the RoT update was skipped as expected, and the rest of the update proceeded normally.

Fixes #4420, which is a bit of an edge case: if the TUF repo contains
RoT images with the same version as the target sled, but does not
contain an RoT image signed with a correct key for the target sled, we
would previously fail to mupdate the sled even if the user chose _not_
to update the RoT (since its version number already matched), due to
missing a correctly-signed image.

With this PR, we postpone the key check (implemented as fetching the
CMPA/CFPA pages to verify against each archive) until _after_ we've
decided whether or not to try updating the RoT at all.

An additional check added with this PR that is always true today with
TUF repos built in CI is that for each class of Hubris archive where we
accept multiple options (e.g., "gimlet SP" where we accept multiple
board revisions, "gimlet RoT", "sidecar RoT", etc.), we require all the
archives of that class to have the same version. We will still allow
SP images to have different versions than RoT images, and even allow
"gimlet RoT" images to have different versions of "sidecar RoT" images,
but we do not allow something like "gimlet RoT version 1.0.1 signed with
a dev key and gimlet RoT version 1.0.2 signed with a production key".
Copy link
Contributor

@andrewjstone andrewjstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@jgallagher jgallagher merged commit 5b4ae0b into main Nov 9, 2023
20 checks passed
@jgallagher jgallagher deleted the wicketd-postpone-rot-cmpa-check branch November 9, 2023 15:31
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.

Mupdate fails on locked Rev E gimlet
2 participants