Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Protect against hash conflicts #85

Open
zkat opened this issue Apr 20, 2017 · 1 comment
Open

Protect against hash conflicts #85

zkat opened this issue Apr 20, 2017 · 1 comment

Comments

@zkat
Copy link
Owner

zkat commented Apr 20, 2017

I'm starting to think that cacache should start storing secondary integrity hashes in the index. Direct content address reads can still potentially yield bad data, but if you provide a key, cacache will interpret checksum conflicts as regular checksum failures (by using the stronger algorithm for data verification), and then it's up to the user to figure out what to do with it.

In the case of, say, pacote, what would happen on a tarball conflict is simply treating the conflict as corruption and then it would re-fetch the data.

idk if this is worth the effort -- if you're using cacache with weak checksums (it defaults to sha512!), then you're basically asking for trouble, but the reality is the npm registry still relies on sha1, and alternative registries will continue to do so further into the future.

@zkat zkat changed the title Mitigate against hash conflicts Protect against hash conflicts Apr 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants
@zkat and others