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

Refactor to make it clearer that we return the validated TOC value #1887

Merged
merged 3 commits into from
Apr 16, 2024

Commits on Apr 13, 2024

  1. Only obtain the estargz TOC digest once

    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č <mitr@redhat.com>
    mtrmac committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    3beea1e View commit details
    Browse the repository at this point in the history
  2. Only obtain the zstd:chunked TOC digest once

    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č <mitr@redhat.com>
    mtrmac committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    1f47b38 View commit details
    Browse the repository at this point in the history
  3. Remove ChecksumAnntation from ZstdChunkedFooterData

    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č <mitr@redhat.com>
    mtrmac committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    053ac61 View commit details
    Browse the repository at this point in the history