build: add options to disable SHA-512/256 hash algo

Existing C macro lacked build-level counterparts.
Add them in this patch.

- cmake: `-DCURL_DISABLE_SHA512_256=ON`
- autotools: `--disable-sha512-256`

Also drop the checker exception from `test1165.pl`.

Follow-up to cbe41d151d #12897
Closes #14753
This commit is contained in:
Viktor Szakats 2024-09-01 16:25:49 +02:00
parent 83bcd335cd
commit 3362994948
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
5 changed files with 29 additions and 3 deletions

View File

@ -314,6 +314,8 @@ mark_as_advanced(CURL_DISABLE_PROGRESS_METER)
option(CURL_DISABLE_PROXY "Disable proxy support" OFF)
mark_as_advanced(CURL_DISABLE_PROXY)
option(CURL_DISABLE_RTSP "Disable RTSP" OFF)
mark_as_advanced(CURL_DISABLE_SHA512_256)
option(CURL_DISABLE_SHA512_256 "Disable SHA-512/256 hash algorithm" OFF)
mark_as_advanced(CURL_DISABLE_RTSP)
option(CURL_DISABLE_SHUFFLE_DNS "Disable shuffle DNS feature" OFF)
mark_as_advanced(CURL_DISABLE_SHUFFLE_DNS)

View File

@ -4646,6 +4646,25 @@ AS_HELP_STRING([--disable-progress-meter],[Disable progress-meter]),
AC_MSG_RESULT(yes)
)
dnl ************************************************************
dnl disable SHA-512/256 hash algorithm
dnl
AC_MSG_CHECKING([whether to support the SHA-512/256 hash algorithm])
AC_ARG_ENABLE(sha512-256,
AS_HELP_STRING([--enable-sha512-256],[Enable SHA-512/256 hash algorithm (default)])
AS_HELP_STRING([--disable-sha512-256],[Disable SHA-512/256 hash algorithm]),
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
AC_DEFINE(CURL_DISABLE_SHA512_256, 1, [disable SHA-512/256 hash algorithm])
;;
*)
AC_MSG_RESULT(yes)
;;
esac ],
AC_MSG_RESULT(yes)
)
dnl ************************************************************
dnl disable shuffle DNS support
dnl

View File

@ -144,6 +144,10 @@ Disable support for proxies
Disable the RTSP protocol.
## `CURL_DISABLE_SHA512_256`
Disable the SHA-512/256 hash algorithm.
## `CURL_DISABLE_SHUFFLE_DNS`
Disable the shuffle DNS feature

View File

@ -134,6 +134,9 @@
/* disables RTSP */
#cmakedefine CURL_DISABLE_RTSP 1
/* disables SHA-512/256 hash algorithm */
#cmakedefine CURL_DISABLE_SHA512_256 1
/* disabled shuffle DNS feature */
#cmakedefine CURL_DISABLE_SHUFFLE_DNS 1

View File

@ -93,9 +93,7 @@ sub scan_file {
while(<F>) {
while(s/(CURL_DISABLE_[A-Z0-9_]+)//) {
my ($sym)=($1);
if(not $sym =~ /^(CURL_DISABLE_SHA512_256)/) { # Skip this symbol, to be implemented
$file{$sym} = $source;
}
$file{$sym} = $source;
}
}
close F;