]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
configure: improve nettle and gnutls check
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 10 Mar 2020 13:02:08 +0000 (14:02 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 10 Mar 2020 14:52:28 +0000 (15:52 +0100)
Before enabling NTS, check for more gnutls functions (some added in
3.6.3) to avoid build failures with older gnutls versions. Also, make
sure that nettle supports the new AES interface (added in 3.0).

configure

index a4c7b8841f458a6f303ea83b20b633e513a07347..0417deb5e59e14d2b5bdfa287853df373f9b7923 100755 (executable)
--- a/configure
+++ b/configure
@@ -971,8 +971,12 @@ if [ $feat_ntp = "1" ] && [ $feat_nts = "1" ] && [ $try_gnutls = "1" ] && \
   test_cflags="`pkg_config --cflags gnutls`"
   test_link="`pkg_config --libs gnutls`"
   if test_code 'gnutls' 'gnutls/gnutls.h' \
-    "$test_cflags" "$test_link" \
-    'gnutls_init(NULL, 0);'
+    "$test_cflags" "$test_link" '
+      return gnutls_init(NULL, 0) +
+        gnutls_priority_init2(NULL, "", NULL, GNUTLS_PRIORITY_INIT_DEF_APPEND) +
+        gnutls_prf_rfc5705(NULL, 0, "", 0, "", 16, NULL);' &&
+    test_code 'AES128 in nettle' 'nettle/aes.h' '' "$LIBS" \
+      'aes128_set_encrypt_key(NULL, NULL);'
   then
     EXTRA_OBJECTS="$EXTRA_OBJECTS nts_ke_client.o nts_ke_server.o nts_ke_session.o"
     EXTRA_OBJECTS="$EXTRA_OBJECTS nts_ntp_auth.o nts_ntp_client.o nts_ntp_server.o"