Page MenuHomePhabricator

sha1: use the real SHA-1 algorithm
ClosedPublic

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

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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

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.