Skip to content

Commit 8bc998f

Browse files
committed
sha1: remove generic implementation
Remove the "generic" implementation; it should never be used; it only existed for a no-dependencies configuration, and our bundled sha1dc satisfies that requirement _and_ is correct.
1 parent fb6d018 commit 8bc998f

File tree

6 files changed

+4
-327
lines changed

6 files changed

+4
-327
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ option(USE_NSEC "Support nanosecond precision file mtimes and cti
2929
# Backend selection
3030
option(USE_SSH "Link with libssh2 to enable SSH support" OFF)
3131
option(USE_HTTPS "Enable HTTPS support. Can be set to a specific backend" ON)
32-
option(USE_SHA1 "Enable SHA1. Can be set to CollisionDetection(ON)/HTTPS/Generic" ON)
32+
option(USE_SHA1 "Enable SHA1. Can be set to CollisionDetection(ON)/HTTPS" ON)
3333
option(USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF)
3434
set(USE_HTTP_PARSER "" CACHE STRING "Specifies the HTTP Parser implementation; either system or builtin.")
3535
set(REGEX_BACKEND "" CACHE STRING "Regular expression implementation. One of regcomp_l, pcre2, pcre, regcomp, or builtin.")

cmake/SelectHashes.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ elseif(USE_SHA1 STREQUAL "mbedTLS")
4242
list(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES})
4343
elseif(USE_SHA1 STREQUAL "Win32")
4444
set(GIT_SHA1_WIN32 1)
45-
elseif(NOT (USE_SHA1 STREQUAL "Generic"))
45+
else()
4646
message(FATAL_ERROR "Asked for unknown SHA1 backend: ${USE_SHA1}")
4747
endif()
4848

src/util/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ elseif(USE_SHA1 STREQUAL "mbedTLS")
4141
file(GLOB UTIL_SRC_HASH hash/sha1/mbedtls.*)
4242
elseif(USE_SHA1 STREQUAL "Win32")
4343
file(GLOB UTIL_SRC_HASH hash/sha1/win32.*)
44-
elseif(USE_SHA1 STREQUAL "Generic")
45-
file(GLOB UTIL_SRC_HASH hash/sha1/generic.*)
4644
else()
4745
message(FATAL_ERROR "Asked for unknown SHA1 backend: ${USE_SHA1}")
4846
endif()

src/util/hash/sha1.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212

1313
typedef struct git_hash_sha1_ctx git_hash_sha1_ctx;
1414

15-
#if defined(GIT_SHA1_COLLISIONDETECT)
16-
# include "sha1/collisiondetect.h"
17-
#elif defined(GIT_SHA1_COMMON_CRYPTO)
15+
#if defined(GIT_SHA1_COMMON_CRYPTO)
1816
# include "sha1/common_crypto.h"
1917
#elif defined(GIT_SHA1_OPENSSL)
2018
# include "sha1/openssl.h"
@@ -23,7 +21,7 @@ typedef struct git_hash_sha1_ctx git_hash_sha1_ctx;
2321
#elif defined(GIT_SHA1_MBEDTLS)
2422
# include "sha1/mbedtls.h"
2523
#else
26-
# include "sha1/generic.h"
24+
# include "sha1/collisiondetect.h"
2725
#endif
2826

2927
#define GIT_HASH_SHA1_SIZE 20

src/util/hash/sha1/generic.c

Lines changed: 0 additions & 300 deletions
This file was deleted.

src/util/hash/sha1/generic.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)