-
Notifications
You must be signed in to change notification settings - Fork 246
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
Refactor to make it clearer that we return the validated TOC value #1887
Conversation
Make it structually clear that the code is all using the same value, making it less likely for the verifier and other uses to get out of sync. Also avoids some redundant parsing and error paths. Should not change behavior. Signed-off-by: Miloslav Trmač <[email protected]>
(Completely untested, to be transparent.) |
Make it structually clear that the code is all using the same value, making it less likely for the verifier and other uses to get out of sync. Also avoids some redundant parsing and error paths. The conversion path looks longer, but that's just moving the parsing from the called function (which is redundant for other callers). Should not change behavior. Signed-off-by: Miloslav Trmač <[email protected]>
Manage the value directly to simplify. This happens to fix the ReadFooterDataFromBlob code path, which was not setting ChecksumAnntation at all. Signed-off-by: Miloslav Trmač <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested it with some existing images and it works well.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe, mtrmac The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
LGTM |
/lgtm |
Primarily, this ensures that the value in
ApplyDiff
’sDriverWithDifferOutput.TOCDigest
is really exactly the value we used to validate the digest, by only reading it once and passing it around.That’s to simplify auditing and make the relationship clear, but it should not change behavior.
Incidentally, this also should fix #1886 — but I still think the binary footer code path should be removed entirely.
Cc: @giuseppe