| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
The imported code is not ISO C90 compatible, there's a declaration after code in src/hash/sha1dc/sha1.c:55. Otherwise this looks fine, I guess (even though I obviously didn't skim through the SHA1DC implementation). |
Sorry, something went wrong.
|
Dang, thanks @pks-t , I missed that. (Seriously, you would have thought somebody at Microsoft would have gotten that one right. 😛 ) |
Sorry, something went wrong.
|
AppVeyor's mingw builds are busted. Sigh. 👀 |
Sorry, something went wrong.
|
All fixed up! |
Sorry, something went wrong.
| git_oid __expected; \ | ||
| git_oid_fromstr(&__expected, (idstr)); \ | ||
| cl_assert_equal_oid(&__expected, (oid)); \ | ||
| } |
There was a problem hiding this comment.
This #define is currently unused?
Sorry, something went wrong.
There was a problem hiding this comment.
Yep, good 👁 . I've dropped this.
Sorry, something went wrong.
| ELSEIF (WIN32 AND NOT MINGW AND NOT SHA1_TYPE STREQUAL "builtin") | ||
| ADD_DEFINITIONS(-DGIT_SHA1_WIN32) | ||
| FILE(GLOB SRC_SHA1 src/hash/hash_win32.c) | ||
| ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
There was a problem hiding this comment.
By the way, is it correct that OS X does not check for SHA1_TYPE=="builtin"? Sounds as if it wasn't possible for OS X systems to build with our generic hashing algorithm.
Sorry, something went wrong.
There was a problem hiding this comment.
Good question... digging in a bit deeper, it looks like one can't actually set SHA1_TYPE. So I'm removing these tests for builtin entirely.
Sorry, something went wrong.
There was a problem hiding this comment.
Just some thoughts, feel free to tell me I'm petty.
Sorry, something went wrong.
| OPTION( ENABLE_TRACE "Enables tracing support" OFF ) | ||
| OPTION( LIBGIT2_FILENAME "Name of the produced binary" OFF ) | ||
|
|
||
| OPTION( USE_SHA1DC "Use sha1 with collision detection" OFF ) |
There was a problem hiding this comment.
s/sha1/SHA-1/ ?
Sorry, something went wrong.
There was a problem hiding this comment.
Done
Sorry, something went wrong.
|
|
||
| #ifdef GIT_SHA1_COLLISIONDETECT | ||
| GIT_UNUSED(expected); | ||
| cl_git_fail(sha1_file(&oid, FIXTURE_DIR "/shattered-1.pdf")); |
There was a problem hiding this comment.
Do we want to have a specific error code for this as well, so we can do cl_git_fail_with(GIT_ESHA1ATTACK, ...)? I'm not sure if this adds that much value, just a thought.
Sorry, something went wrong.
There was a problem hiding this comment.
🤔
Sorry, something went wrong.
There was a problem hiding this comment.
So... my thinking here is that this is only useful if it's something that you want to act on. I think that if you were a hosting provider that you would actually not want to bother logging these, because once this becomes reasonably cheap and you can create two git objects that have colliding hashes -- or when a research org decides to extend their corpus of files with colliding hashes to git objects and not just PDFs -- then people are going to go crazy uploading them to poke at you. And if you're a client, then this isn't useful knowledge to have at all.
But it's quite easy to implement, so I'm happy to add it if you're passionate about it.
Sorry, something went wrong.
There was a problem hiding this comment.
I just figured a client might want to throw a particular prompt, but it's so far beyond what we have control over that it's not really worth it.
Sorry, something went wrong.
Include the SHA1 collision attack detection library from https://github.com/cr-marcstevens/sha1collisiondetection
We never set `SHA1_TYPE` to `builtin`. Don't bother testing for it.
|
It looks like the git authors and the authors of this SHA-1 collision detection library are interested in optimizing it; we'll revisit this if/when they settle on something more efficient. |
Sorry, something went wrong.
Introduce (optional) SHA1 collision attack detection
Introduce (optional) SHA1 collision attack detection
Introduce (optional) SHA1 collision attack detection
Introduce (optional) SHA1 collision attack detection
| Back | FazBrowse Home | New Git URL |
Include SHA1 collision attack detection from https://github.com/cr-marcstevens/sha1collisiondetection when configured with -DUSE_SHA1DC=1.
This is the same implementation being proposed for git core; see https://public-inbox.org/git/20170223230536.tdmtsn46e4lnrimx@sigill.intra.peff.net/