aboutcode-org / aboutcode-org/scancode-toolkit

SPDX output sets invalid empty checksums

Aberta
#3,453 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
2.6k
Forks
791
Merge médio
1d 12h
PRs com merge (30d)
5

Descrição

The following line sets the SHA1 checksum of a file to an empty string in SPDX if not present:
https://github.com/nexB/scancode-toolkit/blob/a15174f31efaf8816e8c9a65c9f85c4beffc0227/src/formattedcode/output_spdx.py#L294

This is not valid in SPDX, see [here](https://spdx.github.io/spdx-spec/v2.3/file-information/#84-file-checksum-field).
The 0.7 version of `spdx-tools` erroneously supports empty checksum strings in the package verification code calculation, which will be fixed in the upcoming 0.8 release. This means that the current state of empty checksum strings in SPDX output will actually lead to an error.

There are at least two options to fix this:
- Set `filesAnalyzed=False` for the package and leave out any file information and the verification code of that package.
- Raise an error indicating that the determination of the checksum failed for the file and thus no SPDX can be produced.

As a workaround, one might set the unknown file checksum to be the empty file hash, but that wouldn't give the correct verification code, either.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.