Skip to content

Commit 6a7d5d2

Browse files
committed
sha: support Win32 for SHA256
Adding SHA256 support prompted an overdue refactoring of some of the unnecessary complexity around the CNG/CryptoAPI abstraction.
1 parent 6b4a6fa commit 6a7d5d2

File tree

5 files changed

+317
-192
lines changed

5 files changed

+317
-192
lines changed

cmake/SelectHashes.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ elseif(USE_SHA256 STREQUAL "CommonCrypto")
6262
set(GIT_SHA256_COMMON_CRYPTO 1)
6363
elseif(USE_SHA256 STREQUAL "mbedTLS")
6464
set(GIT_SHA256_MBEDTLS 1)
65+
elseif(USE_SHA256 STREQUAL "Win32")
66+
set(GIT_SHA256_WIN32 1)
6567
else()
6668
message(FATAL_ERROR "Asked for unknown SHA256 backend: ${USE_SHA256}")
6769
endif()

src/features.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#cmakedefine GIT_SHA1_MBEDTLS 1
5050

5151
#cmakedefine GIT_SHA256_BUILTIN 1
52+
#cmakedefine GIT_SHA256_WIN32 1
5253
#cmakedefine GIT_SHA256_COMMON_CRYPTO 1
5354
#cmakedefine GIT_SHA256_OPENSSL 1
5455
#cmakedefine GIT_SHA256_MBEDTLS 1

src/util/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ elseif(USE_SHA256 STREQUAL "CommonCrypto")
5555
file(GLOB UTIL_SRC_SHA256 hash/common_crypto.*)
5656
elseif(USE_SHA256 STREQUAL "mbedTLS")
5757
file(GLOB UTIL_SRC_SHA256 hash/mbedtls.*)
58+
elseif(USE_SHA256 STREQUAL "Win32")
59+
file(GLOB UTIL_SRC_SHA256 hash/win32.*)
5860
else()
5961
message(FATAL_ERROR "Asked for unknown SHA256 backend: ${USE_SHA256}")
6062
endif()

0 commit comments

Comments
 (0)