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

fix: ensure hash function is available #314

Merged
merged 2 commits into from
Jul 14, 2023
Merged

Conversation

tri-adam
Copy link
Member

@tri-adam tri-adam commented Jul 14, 2023

Use sha256.New() rather than crypto.SHA256.New() to ensure the SHA256 algorithm is available (avoids "requested hash function is unavailable" panic in #313.) Improve tests for add of OCI index/blob.

Fixes #313

@tri-adam tri-adam self-assigned this Jul 14, 2023
@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Merging #314 (02ad885) into main (a1631da) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #314      +/-   ##
==========================================
+ Coverage   72.94%   73.01%   +0.06%     
==========================================
  Files          35       35              
  Lines        2953     2953              
==========================================
+ Hits         2154     2156       +2     
+ Misses        644      642       -2     
  Partials      155      155              
Impacted Files Coverage Δ
pkg/sif/descriptor.go 75.41% <100.00%> (ø)

... and 1 file with indirect coverage changes

Rather than using crypto.SHA256.New(), use sha256.New() directly to
ensure the SHA256 algorithm is available.
@tri-adam tri-adam marked this pull request as ready for review July 14, 2023 16:27
@tri-adam tri-adam merged commit f1d4f12 into sylabs:main Jul 14, 2023
@tri-adam tri-adam deleted the add-panic branch July 14, 2023 16:37
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.

siftool: Panic adding empty JSON OCI.RootIndex to empty SIF
2 participants