mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 18:05:06 -05:00
hash: add gnutls support
Add support for crypto hash functions in gnutls (internally using nettle). This can be useful to avoid directly linking with nettle to avoid ABI breaks.
This commit is contained in:
29
configure
vendored
29
configure
vendored
@@ -934,15 +934,34 @@ if [ $feat_sechash = "1" ] && [ "x$HASH_LINK" = "x" ] && [ $try_tomcrypt = "1" ]
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $feat_sechash = "1" ] && [ "x$HASH_LINK" = "x" ] && [ $try_gnutls = "1" ]; then
|
||||
test_cflags="`pkg_config --cflags gnutls`"
|
||||
test_link="`pkg_config --libs gnutls`"
|
||||
if test_code 'gnutls' 'gnutls/crypto.h' \
|
||||
"$test_cflags" "$test_link" '
|
||||
return gnutls_hash(NULL, NULL, 0);'
|
||||
then
|
||||
HASH_OBJ="hash_gnutls.o"
|
||||
HASH_LINK="$test_link"
|
||||
MYCPPFLAGS="$MYCPPFLAGS $test_cflags"
|
||||
add_def FEAT_SECHASH
|
||||
fi
|
||||
fi
|
||||
|
||||
EXTRA_OBJECTS="$EXTRA_OBJECTS $HASH_OBJ"
|
||||
EXTRA_CLI_OBJECTS="$EXTRA_CLI_OBJECTS $HASH_OBJ"
|
||||
LIBS="$LIBS $HASH_LINK"
|
||||
|
||||
if [ $feat_ntp = "1" ] && [ $feat_nts = "1" ] && [ $try_gnutls = "1" ]; then
|
||||
test_cflags="`pkg_config --cflags gnutls`"
|
||||
test_link="`pkg_config --libs gnutls`"
|
||||
if test_code 'gnutls' 'gnutls/gnutls.h' \
|
||||
"$test_cflags" "$test_link" '
|
||||
if [ "$HASH_OBJ" = "hash_gnutls.o" ]; then
|
||||
test_cflags=""
|
||||
test_link=""
|
||||
else
|
||||
test_cflags="`pkg_config --cflags gnutls`"
|
||||
test_link="`pkg_config --libs gnutls`"
|
||||
fi
|
||||
if test_code 'TLS1.3 in gnutls' 'gnutls/gnutls.h' \
|
||||
"$test_cflags" "$test_link $LIBS" '
|
||||
return gnutls_init(NULL, 0) + GNUTLS_TLS1_3 +
|
||||
gnutls_priority_init2(NULL, "", NULL, GNUTLS_PRIORITY_INIT_DEF_APPEND) +
|
||||
gnutls_prf_rfc5705(NULL, 0, "", 0, "", 16, NULL);'
|
||||
@@ -956,7 +975,7 @@ if [ $feat_ntp = "1" ] && [ $feat_nts = "1" ] && [ $try_gnutls = "1" ]; then
|
||||
add_def HAVE_NETTLE_SIV_CMAC
|
||||
else
|
||||
if test_code 'SIV in gnutls' 'gnutls/crypto.h' \
|
||||
"$test_cflags" "$test_link" '
|
||||
"$test_cflags" "$test_link $LIBS" '
|
||||
return gnutls_aead_cipher_init(NULL, GNUTLS_CIPHER_AES_128_SIV, NULL);'
|
||||
then
|
||||
EXTRA_OBJECTS="$EXTRA_OBJECTS siv_gnutls.o"
|
||||
|
||||
Reference in New Issue
Block a user