Skip to content

Commit 84fcb4b

Browse files
jltoblergitster
authored andcommitted
help: include unsafe SHA-1 build info in version
In 06c92da (Makefile: allow specifying a SHA-1 for non-cryptographic uses, 2024-09-26), support for unsafe SHA-1 is added. Add the unsafe SHA-1 build info to `git version --build-info` and update corresponding documentation. Signed-off-by: Justin Tobler <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cb6f9e4 commit 84fcb4b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Documentation/git-version.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ OPTIONS
2222
--build-options::
2323
Include additional information about how git was built for diagnostic
2424
purposes.
25+
+
26+
If built to use a faster SHA-1 implementation for non-cryptographic purposes,
27+
the implmentation used is denoted as "unsafe-SHA-1".
2528

2629
GIT
2730
---

help.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,14 @@ static void get_sha_impl(struct strbuf *buf)
784784
strbuf_addstr(buf, "SHA-1: Collision Detection\n");
785785
#endif
786786

787+
#if defined(SHA1_OPENSSL_UNSAFE)
788+
strbuf_addstr(buf, "unsafe-SHA-1: OpenSSL\n");
789+
#elif defined(SHA1_BLK_UNSAFE)
790+
strbuf_addstr(buf, "unsafe-SHA-1: blk\n");
791+
#elif defined(SHA1_APPLE_UNSAFE)
792+
strbuf_addstr(buf, "unsafe-SHA-1: Apple CommonCrypto\n");
793+
#endif
794+
787795
#if defined(SHA256_OPENSSL)
788796
strbuf_addstr(buf, "SHA-256: OpenSSL\n");
789797
#elif defined(SHA256_NETTLE)

0 commit comments

Comments
 (0)