Skip to content

Commit

Permalink
Bug fix: Hashes were incorrectly dumped as a list. Updated packages.
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
  • Loading branch information
prabhu committed Mar 19, 2024
1 parent 2bcaacb commit b7986fd
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 115 deletions.
4 changes: 2 additions & 2 deletions blint/sbom.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ def process_dotnet_dependencies(dotnet_deps: dict[str, dict], dependencies_dict:
],
)
if hash_content:
comp.hashes = [Hash(alg=HashAlg.SHA_512, content=hash_content)],

This comment has been minimized.

Copy link
@prabhu

prabhu Apr 8, 2024

Author Member

It turned out that blint was actually correct to generate hashes as array. Possible the bug is with cdxgen. Investigating.

This comment has been minimized.

Copy link
@prabhu

prabhu Apr 8, 2024

Author Member

The extra comma at the end of line 520 results in the creation of nested lists. Fixed here 5119e3c

comp.hashes = Hash(alg=HashAlg.SHA_512, content=hash_content),
comp.bom_ref = RefType(purl)
components.append(comp)
targets: dict[str, dict[str, dict]] = dotnet_deps.get("targets", {})
Expand Down Expand Up @@ -567,7 +567,7 @@ def process_go_dependencies(go_deps: dict[str, str]) -> list[Component]:
except binascii.Error:
hash_content = str(v.get("hash").removeprefix("h1:"))
if hash_content:
comp.hashes = [Hash(alg=HashAlg.SHA_256, content=hash_content)]
comp.hashes = Hash(alg=HashAlg.SHA_256, content=hash_content)
comp.bom_ref = RefType(f"""pkg:golang/{k}@{v.get("version")}""")
components.append(comp)
return components
Expand Down
Loading

0 comments on commit b7986fd

Please sign in to comment.