aboutcode-org / aboutcode-org/scancode-toolkit

SPDX output sets invalid empty checksums

オープン
#3,453 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
2.6k
フォーク
791
平均マージ
1日 12時間
マージ済み PR(30日)
5

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。