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

Amend Artifact Identifiers to use SHA-1DC, SHA-1, and SHA-256, to match Git. #70

Open
Tracked by #73
david-a-wheeler opened this issue Nov 17, 2023 · 2 comments
Labels
c-spec Category: Improvements or additions to the OmniBOR specification

Comments

@david-a-wheeler
Copy link

“SHA1” is not the algorithm used by git. I think OmniBOR should use git's algorithm instead (SHA-1DC) and clearly say so.

Here's the background. The OmniBOR site says it uses SHA-1, but it justifies this by saying that “Git Blobs are identified by the sha1 of the blob object”. The latter statement is not true; git uses SHA-1DC, not SHA-1. Historically it’s true that git used SHA-1, but for security reasons that changed. On 23 February 2017 the SHAttered attack (https://shattered.io/) demonstrated a practical SHA-1 hash collision. Git v2.13.0 and later subsequently moved to a hardened SHA-1 implementation by default, which isn’t vulnerable to the SHAttered attack. Its result is the same as SHA-1 in “normal” cases, but when it detects a “SHAttered attack” it produces a different result. This algorithmic variant is called SHA-1DC. SHA-1 is still weak; many consider this algorithm a transitional measure, so SHA-256 work began. Unfortunately, git was not designed to change hash algorithms, so changing it has been challenging. Indeed, transitioning git to SHA-256 has been challenging and stalled in 2022. So I think it's important to clarify "SHA-1" is really "SHA-1DC" since it's not clear how long this "transitional" state will be "transitional".

@alilleybrinker
Copy link
Member

Thanks @david-a-wheeler!

There are actually two relevant issues here:

Together, these really reinforce that we ought to update the spec and website to be precise about how OmniBOR Artifact Identifiers are constructed.

@alilleybrinker alilleybrinker added the c-spec Category: Improvements or additions to the OmniBOR specification label Dec 7, 2023
@alilleybrinker
Copy link
Member

In last week's WG meeting, there was a proposal of defining three mandatory hashes be used for artifact identifier construction (and thus also for manifests): SHA-1DC, SHA-1, and SHA-256. This is in part in recognition that older Git versions use plain SHA-1, and also that Git can still today fallback to plain SHA-1 if the SHA-1DC implementation is unavailable (though we expect this to be uncommon).

@alilleybrinker alilleybrinker changed the title Git uses SHA-1DC, not SHA-1; OmniBOR should match Amend Artifact Identifiers to use SHA-1DC, SHA-1, and SHA-256, to match Git. Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-spec Category: Improvements or additions to the OmniBOR specification
Projects
None yet
Development

No branches or pull requests

2 participants