cr-marcstevens / sha1collisiondetection

Library and command line tool to detect SHA-1 collision in a file
Other
1.31k stars 185 forks source link

Fixup pull request 34 #37

Closed avar closed 7 years ago

avar commented 7 years ago

This is a rebase & fixup of pull request #34 that has 3 linear history commits on top of master. The end result of the code in #34 is good, but the history is a total mess (one of my WIP commits seems to have been fixup up during a merge conflict for example).

The actual diff between this and the end result of #34 is minimal:

$ git diff  n-soda/fix-little-endian-bsd..avar/fixup-pull-request-34 
diff --git a/lib/sha1.c b/lib/sha1.c
index b1b8514..d594882 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -81,9 +81,9 @@
 #define SHA1DC_BIGENDIAN
 #endif

-/* Not under GCC-alike or glibc or *BSD or newlib or <processor whitelist> */
+/* Not under GCC-alike or glibc or *BSD or newlib */
 #elif (defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || \
-       defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || \
+       defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || \
        defined(__sparc))
 /*
  * Should define Big Endian for a whitelist of known processors. See
@@ -94,7 +94,6 @@

 /* Not under GCC-alike or glibc or *BSD or newlib or <processor whitelist> */
 #elif defined(SHA1DC_ON_INTEL_LIKE_PROCESSOR)
-
 /*
  * As a last resort before we do anything else we're not 100% sure
  * about below, we blacklist specific processors here. We could add

That comment was incorrect given the code, there was some whitespace issues (adding a stray \t), and adding that newline before the comment wasn't in sync with the rest of the if/else formatting.

I think this is ready to merge to master.

shumow commented 7 years ago

Thanks for all the good work @avar @n-soda ! Merged this, closed https://github.com/cr-marcstevens/sha1collisiondetection/pull/34 as per request.