This is an archive of the discontinued Mercurial Phabricator instance.

sha1: use the real SHA-1 algorithm
ClosedPublic

Authored by simpkins on Aug 8 2017, 4:20 PM.
Tags
None
Subscribers
None

Details

Reviewers
ryanmce
Group Reviewers
Restricted Project
Commits
rFBHGX2122226e17b4: sha1: use the real SHA-1 algorithm
Summary

The sha1collisiondetection library by default performs its own "safe-hash"
algorithm, which is not actually the same as the normal SHA-1 algorithm.
For most inputs the output will be the actual SHA-1 hash, but if the input
happens to contain one of several known SHA-1 disturbance vectors this code
returns an alternate "safe-hash" output instead.

This updates the code to explicitly disable "safe-hash" mode and collision
detection, so that we always get actual SHA-1 hashes.

Test Plan

Ran the unit tests.

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

simpkins created this revision.Aug 8 2017, 4:20 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptAug 8 2017, 4:20 PM
ryanmce accepted this revision.Aug 9 2017, 5:58 AM
This revision is now accepted and ready to land.Aug 9 2017, 5:58 AM
This revision was automatically updated to reflect the committed changes.