nettle/backport: fix xts-backport guarding check
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Sun, 14 Jul 2019 09:17:18 +0000 (12:17 +0300)
committerDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Sun, 14 Jul 2019 09:17:18 +0000 (12:17 +0300)
Check for nettle_xts_encrypt_message() function rather than just
xts_encrypt_message(). All functions in nettle are renamed to contain
`nettle_` prefix.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
configure.ac
lib/nettle/backport/xts.c
lib/nettle/backport/xts.h

index 9728f316ed6ec3fb3d67c3c40d34feeef6de1629..c388704bbb99db3bc26d9f390dc889a2b2dfb011 100644 (file)
@@ -573,7 +573,7 @@ LIBS=$save_LIBS
 # Check if nettle has XTS support
 save_LIBS=$LIBS
 LIBS="$LIBS $NETTLE_LIBS"
-AC_CHECK_FUNCS(xts_encrypt_message)
+AC_CHECK_FUNCS(nettle_xts_encrypt_message)
 LIBS=$save_LIBS
 
 # Check for Gosthash94 with CryptoPro S-box support
index a7ef120aa0f0352f0e650c7f21717b7a564fa2b8..d8c258f650fb7d31ea5cb507b558d03810466096 100644 (file)
@@ -29,7 +29,7 @@
 #include <config.h>
 #endif
 
-#ifndef HAVE_XTS_ENCRYPT_MESSAGE
+#ifndef HAVE_NETTLE_XTS_ENCRYPT_MESSAGE
 #include "xts.h"
 
 #include <assert.h>
@@ -270,4 +270,4 @@ xts_aes256_decrypt_message(struct xts_aes256_key *xts_key,
                         tweak, length, dst, src);
 }
 
-#endif /* HAVE_XTS_ENCRYPT_MESSAGE */
+#endif /* HAVE_NETTLE_XTS_ENCRYPT_MESSAGE */
index 238e31272a03359839a1998284f67135385b6376..8c52f9a09299cbbe190ab15d0aef5f8e0afdeaa0 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef GNUTLS_LIB_NETTLE_BACKPORT_XTS_H
 #define GNUTLS_LIB_NETTLE_BACKPORT_XTS_H
 
-#ifdef HAVE_XTS_ENCRYPT_MESSAGE
+#ifdef HAVE_NETTLE_XTS_ENCRYPT_MESSAGE
 #include <nettle/xts.h>
 
 #else /* Nettle version is old, use a vendored version instead */
@@ -117,6 +117,6 @@ xts_aes256_decrypt_message(struct xts_aes256_key *xts_key,
 
 #endif /* NETTLE_XTS_H_INCLUDED */
 
-#endif /* HAVE_XTS_ENCRYPT_MESSAGE */
+#endif /* HAVE_NETTLE_XTS_ENCRYPT_MESSAGE */
 
 #endif /* GNUTLS_LIB_NETTLE_BACKPORT_XTS_H */