[wicketd] Don't check RoT CMPA/CFPA until we've decided to update it #4459
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
madrid
Edit: Test completed. I uploaded a TUF repo containing only 1.0.2 prod RoT images tomadrid
and attempted to update a sled with a 1.0.2 staging-dev RoT image onmain
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.