]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
gnulib: update git submodule
authorDaiki Ueno <ueno@gnu.org>
Mon, 25 May 2020 16:37:51 +0000 (18:37 +0200)
committerDaiki Ueno <ueno@gnu.org>
Fri, 29 May 2020 15:24:34 +0000 (17:24 +0200)
This brings in the new fopen-gnu module and the RF_SENSITIVE flag for
fread_file and read_file.  This also adds the following changes to be
consistent with the latest changes in Gnulib:
- the callers of fread_file and read_file to be adjusted for the FLAGS
  argument
- "attribute.h" needs to be used extensively

Signed-off-by: Daiki Ueno <ueno@gnu.org>
20 files changed:
.gitignore
bootstrap.conf
configure.ac
doc/examples/ex-ocsp-client.c
gnulib
lib/cert-cred-rawpk.c
lib/cert-cred-x509.c
lib/datum.h
lib/file.c
lib/gnutls_int.h
lib/x509/verify-high2.c
src/certtool-common.c
src/certtool.c
src/cli.c
src/ocsptool.c
tests/atfork.c
tests/mpi.c
tests/pkcs12_s2k.c
tests/tls13/anti_replay.c
tests/utils.h

index e19ca802cb646744d9ba90d935121491a313e5c7..88c4d33b6835ca9c8d00602259b76e4b4015c4cf 100644 (file)
@@ -189,7 +189,8 @@ fuzz/*_fuzzer
 *.gcda
 *.gcno
 *.gcov
-gl
+/gl/*
+!/gl/override
 /GNUmakefile
 GnuTLS-*-coverage/
 gnutls-*.tar.*
index 4c186d6c37825efc05639453819ad9f2551ece7c..dcf346d6c63c48d1454ed1b8e3ebd57ea560c07b 100644 (file)
@@ -25,10 +25,10 @@ checkout_only_file=
 local_gl_dir=gl/override/
 required_submodules="tests/suite/tls-fuzzer/python-ecdsa tests/suite/tls-fuzzer/tlsfuzzer tests/suite/tls-fuzzer/tlslite-ng devel/nettle devel/libtasn1"
 
-# Reproduce by: gnulib-tool --import --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --lgpl=2 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files alloca byteswap c-ctype extensions func gendocs getline gettext-h gettimeofday hash-pjw-bare havelib intprops ldd lib-msvc-compat lib-symbol-versions maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html read-file secure_getenv snprintf stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r unistd vasprintf verify vsnprintf warnings
+# Reproduce by: gnulib-tool --import --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --lgpl=2 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files alloca attribute byteswap c-ctype extensions func gendocs getline gettext-h gettimeofday hash-pjw-bare havelib intprops ldd lib-msvc-compat lib-symbol-versions maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html read-file secure_getenv snprintf stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r unistd vasprintf verify vsnprintf warnings
 
 gnulib_modules="
-alloca byteswap c-ctype c-strcase extensions func gendocs getline gettext-h gettimeofday hash hash-pjw-bare havelib arpa_inet inet_ntop inet_pton intprops ldd lib-msvc-compat lib-symbol-versions maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html read-file secure_getenv setsockopt snprintf stdint strcase strdup-posix strndup strtok_r strverscmp sys_socket sys_stat sys_types time_r unistd valgrind-tests vasprintf verify vsnprintf warnings
+alloca attribute byteswap c-ctype c-strcase extensions func gendocs getline gettext-h gettimeofday hash hash-pjw-bare havelib arpa_inet inet_ntop inet_pton intprops ldd lib-msvc-compat lib-symbol-versions maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html read-file secure_getenv setsockopt snprintf stdint strcase strdup-posix strndup strtok_r strverscmp sys_socket sys_stat sys_types time_r unistd valgrind-tests vasprintf verify vsnprintf warnings
 "
 
 unistring_modules="
index 2aca4b9fcaa3a165979c142773ef0486df2bdb6a..bb32073be5baf63af93263ab4ba6e730d7be90fc 100644 (file)
@@ -1104,7 +1104,6 @@ AC_DEFINE([GNUTLS_INTERNAL_BUILD], 1, [We allow temporarily usage of deprecated
 
 AC_DEFINE([fread_file], [_gnutls_fread_file], [static lib rename])
 AC_DEFINE([read_file], [_gnutls_read_file], [static lib rename])
-AC_DEFINE([read_binary_file], [_gnutls_read_binary_file], [static lib rename])
 
 dnl configuration options for config file parsing (inih)
 AC_DEFINE([INI_MAX_LINE], 2048, [inih maximum line size])
index 33eff67a6c927d4f8f7ab1a97e8d243fcbc5927a..f0b56fffe2a2919ee292cd1cef66d2771393f3e8 100644 (file)
@@ -183,7 +183,7 @@ static gnutls_x509_crt_t load_cert(const char *cert_file)
         if (ret < 0)
                 exit(1);
 
-        data.data = (void *) read_binary_file(cert_file, &size);
+        data.data = (void *) read_file(cert_file, RF_BINARY, &size);
         data.size = size;
 
         if (!data.data) {
diff --git a/gnulib b/gnulib
index 02c8a3da2c4462ecf78944af9f6fd2c986fa536c..fb64a78174042189f4d012cbd748d565f021cd69 160000 (submodule)
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 02c8a3da2c4462ecf78944af9f6fd2c986fa536c
+Subproject commit fb64a78174042189f4d012cbd748d565f021cd69
index cfa65eb3188047717074393322f0fd952a2fb1c5..1d086156abd1b38ef3dd00772bb6e724669538fd 100644 (file)
@@ -292,7 +292,7 @@ int gnutls_certificate_set_rawpk_key_file(gnutls_certificate_credentials_t cred,
 
        } else {
                /* Read our raw public-key into memory from file */
-               rawpubkey.data = (void*) read_binary_file(rawpkfile, &key_size);
+               rawpubkey.data = (void*) read_file(rawpkfile, RF_BINARY, &key_size);
                if (rawpubkey.data == NULL) {
                        gnutls_privkey_deinit(privkey);
 
index 4e86a59ba68c6cabf5ffab4465e224986b28c01b..453b832ac248757f542b4f90a63bcf91d395b923 100644 (file)
@@ -543,7 +543,7 @@ read_cert_file(gnutls_certificate_credentials_t res,
                return read_cert_url(res, key, certfile);
        }
 
-       data = read_binary_file(certfile, &size);
+       data = read_file(certfile, RF_BINARY, &size);
 
        if (data == NULL) {
                gnutls_assert();
@@ -588,7 +588,7 @@ _gnutls_read_key_file(gnutls_certificate_credentials_t res,
                            (GNUTLS_E_UNIMPLEMENTED_FEATURE);
        }
 
-       data = read_binary_file(keyfile, &size);
+       data = read_file(keyfile, RF_BINARY, &size);
 
        if (data == NULL) {
                gnutls_assert();
@@ -1447,7 +1447,7 @@ int
        size_t size;
        int ret;
 
-       p12blob.data = (void *) read_binary_file(pkcs12file, &size);
+       p12blob.data = (void *) read_file(pkcs12file, RF_BINARY, &size);
        p12blob.size = (unsigned int) size;
        if (p12blob.data == NULL) {
                gnutls_assert();
index 3d86a0dc728bf17244415a2a809a600b1899779d..35b9e3b97c8607ffddad73d68b08df9d7eb41a7b 100644 (file)
 /* This will copy the provided data in @dat. If the provided data are
  * NULL or zero-size @dat will be NULL as well.
  */
-attr_warn_unused_result attr_nonnull((1))
+NODISCARD ATTRIBUTE_NONNULL((1))
 int _gnutls_set_datum(gnutls_datum_t * dat, const void *data,
                      size_t data_size);
 
 /* This will always return a non-NULL, and zero-terminated string in @dat.
  */
-attr_warn_unused_result attr_nonnull((1))
+NODISCARD ATTRIBUTE_NONNULL((1))
 int _gnutls_set_strdatum(gnutls_datum_t * dat, const void *data,
                         size_t data_size);
 
@@ -48,7 +48,7 @@ void _gnutls_free_datum(gnutls_datum_t * dat)
        }
 }
 
-inline static attr_nonnull_all
+inline static ATTRIBUTE_NONNULL()
 void _gnutls_free_temp_key_datum(gnutls_datum_t * dat)
 {
        if (dat->data != NULL) {
@@ -59,7 +59,7 @@ void _gnutls_free_temp_key_datum(gnutls_datum_t * dat)
        dat->size = 0;
 }
 
-inline static attr_nonnull_all
+inline static ATTRIBUTE_NONNULL()
 void _gnutls_free_key_datum(gnutls_datum_t * dat)
 {
        if (dat->data != NULL) {
index cec1281bd1eda5e7e2e3c58f00d8a43967dcc11d..2bcdee8b7e90de4cd1c7faf0458b6dee757de9c4 100644 (file)
@@ -55,7 +55,7 @@ int gnutls_load_file(const char *filename, gnutls_datum_t * data)
 {
        size_t len;
 
-       data->data = (void *) read_binary_file(filename, &len);
+       data->data = (void *) read_file(filename, RF_BINARY, &len);
        if (data->data == NULL)
                return GNUTLS_E_FILE_ERROR;
 
index 9959c822025f77e622576ecc23cd8dbe650eee13..4db7a2534d62d26086cc66659ba65403ea0a3327 100644 (file)
@@ -55,6 +55,8 @@ typedef int ssize_t;
 
 #include <nettle/memxor.h>
 
+#include "attribute.h"
+
 #define ENABLE_ALIGN16
 
 #ifdef __clang_major
@@ -76,26 +78,6 @@ typedef int ssize_t;
 # define unlikely
 #endif
 
-#if _GNUTLS_GCC_VERSION >= 30300
-# define attr_nonnull_all __attribute__ ((nonnull))
-# define attr_nonnull(a)  __attribute__ ((nonnull a))
-#else
-# define attr_nonnull_all
-# define attr_nonnull(a)
-#endif
-
-#if _GNUTLS_GCC_VERSION >= 30400 && (_GNUTLS_CLANG_VERSION == 0 || _GNUTLS_CLANG_VERSION >= 40000)
-# define attr_warn_unused_result __attribute__((warn_unused_result))
-#else
-# define attr_warn_unused_result
-#endif
-
-#if _GNUTLS_GCC_VERSION >= 70100
-# define FALLTHROUGH __attribute__ ((fallthrough))
-#else
-# define FALLTHROUGH
-#endif
-
 #include <gnutls/gnutls.h>
 #include <gnutls/dtls.h>
 #include <gnutls/abstract.h>
index 50020d074c191314107070912ccbd33e9829cc7e..9820595e9763dbde575e03b4e5c8a2f0d972fad9 100644 (file)
@@ -356,7 +356,7 @@ gnutls_x509_trust_list_add_trust_file(gnutls_x509_trust_list_t list,
                } else
 #endif
                {
-                       cas.data = (void *) read_binary_file(ca_file, &size);
+                       cas.data = (void *) read_file(ca_file, RF_BINARY, &size);
                        if (cas.data == NULL) {
                                gnutls_assert();
                                return GNUTLS_E_FILE_ERROR;
@@ -366,7 +366,7 @@ gnutls_x509_trust_list_add_trust_file(gnutls_x509_trust_list_t list,
        }
 
        if (crl_file) {
-               crls.data = (void *) read_binary_file(crl_file, &size);
+               crls.data = (void *) read_file(crl_file, RF_BINARY, &size);
                if (crls.data == NULL) {
                        gnutls_assert();
                        return GNUTLS_E_FILE_ERROR;
@@ -551,7 +551,7 @@ gnutls_x509_trust_list_remove_trust_file(gnutls_x509_trust_list_t list,
        } else
 #endif
        {
-               cas.data = (void *) read_binary_file(ca_file, &size);
+               cas.data = (void *) read_file(ca_file, RF_BINARY, &size);
                if (cas.data == NULL) {
                        gnutls_assert();
                        return GNUTLS_E_FILE_ERROR;
index c76352c9d8fdf823b1de4a8c63aca035f27e56a6..ade6b1b569feb9b4529ea7b4393f3cee330f2d80 100644 (file)
@@ -270,7 +270,7 @@ gnutls_privkey_t load_private_key(int mand, common_info_st * info)
        if (gnutls_url_is_supported(info->privkey) != 0)
                return _load_url_privkey(info->privkey);
 
-       dat.data = (void *) read_binary_file(info->privkey, &size);
+       dat.data = (void *) read_file(info->privkey, RF_BINARY, &size);
        dat.size = size;
 
        if (!dat.data) {
@@ -313,7 +313,7 @@ load_x509_private_key(int mand, common_info_st * info)
                app_exit(1);
        }
 
-       dat.data = (void *) read_binary_file(info->privkey, &size);
+       dat.data = (void *) read_file(info->privkey, RF_BINARY, &size);
        dat.size = size;
 
        if (!dat.data) {
@@ -519,7 +519,7 @@ gnutls_x509_crq_t load_request(common_info_st * info)
                app_exit(1);
        }
 
-       dat.data = (void *) read_binary_file(info->request, &size);
+       dat.data = (void *) read_file(info->request, RF_BINARY, &size);
        dat.size = size;
 
        if (!dat.data) {
@@ -560,7 +560,7 @@ gnutls_privkey_t load_ca_private_key(common_info_st * info)
        if (gnutls_url_is_supported(info->ca_privkey) != 0)
                return _load_url_privkey(info->ca_privkey);
 
-       dat.data = (void *) read_binary_file(info->ca_privkey, &size);
+       dat.data = (void *) read_file(info->ca_privkey, RF_BINARY, &size);
        dat.size = size;
 
        if (!dat.data) {
@@ -610,7 +610,7 @@ gnutls_x509_crt_t load_ca_cert(unsigned mand, common_info_st * info)
                return crt;
        }
 
-       dat.data = (void *) read_binary_file(info->ca, &size);
+       dat.data = (void *) read_file(info->ca, RF_BINARY, &size);
        dat.size = size;
 
        if (!dat.data) {
@@ -657,7 +657,7 @@ gnutls_pubkey_t load_pubkey(int mand, common_info_st * info)
                app_exit(1);
        }
 
-       dat.data = (void *) read_binary_file(info->pubkey, &size);
+       dat.data = (void *) read_file(info->pubkey, RF_BINARY, &size);
        dat.size = size;
 
        if (!dat.data) {
@@ -1090,7 +1090,7 @@ void dh_info(FILE * infile, FILE * outfile, common_info_st * ci)
                app_exit(1);
        }
 
-       params.data = (void *) fread_file(infile, &size);
+       params.data = (void *) fread_file(infile, 0, &size);
        params.size = size;
 
        if (params.data == NULL) {
index a46f774114a8b79734ab8e4e0ddeb9f83777d5ce..0e24ac82816e7cc923efb8fd075adb0e7a282333 100644 (file)
@@ -1530,7 +1530,7 @@ void certificate_info(int pubkey, common_info_st * cinfo)
        gnutls_datum_t pem;
        unsigned int crt_num;
 
-       pem.data = (void *) fread_file(infile, &size);
+       pem.data = (void *) fread_file(infile, 0, &size);
        pem.size = size;
 
        if (!pem.data) {
@@ -1651,7 +1651,7 @@ void crl_info(common_info_st *cinfo)
                app_exit(1);
        }
 
-       pem.data = (void *) fread_file(infile, &size);
+       pem.data = (void *) fread_file(infile, 0, &size);
        pem.size = size;
 
        if (!pem.data) {
@@ -1723,7 +1723,7 @@ void crq_info(common_info_st *cinfo)
                app_exit(1);
        }
 
-       pem.data = (void *) fread_file(infile, &size);
+       pem.data = (void *) fread_file(infile, 0, &size);
        pem.size = size;
 
        if (!pem.data) {
@@ -2241,7 +2241,7 @@ static void load_data(common_info_st *cinfo, gnutls_datum_t *data)
                app_exit(1);
        }
 
-       data->data = (void *) fread_file(fp, &size);
+       data->data = (void *) fread_file(fp, 0, &size);
        if (data->data == NULL) {
                fprintf(stderr, "Error reading data file");
                app_exit(1);
@@ -2513,7 +2513,7 @@ static void verify_chain(common_info_st * cinfo)
                app_exit(1);
        }
 
-       buf = (void *) fread_file(infile, &size);
+       buf = (void *) fread_file(infile, 0, &size);
        if (buf == NULL) {
                fprintf(stderr, "Error reading certificate chain");
                app_exit(1);
@@ -2530,7 +2530,7 @@ static void verify_certificate(common_info_st * cinfo)
        char *cas = NULL;
        size_t cert_size;
 
-       cert = (void *) fread_file(infile, &cert_size);
+       cert = (void *) fread_file(infile, 0, &cert_size);
        if (cert == NULL) {
                fprintf(stderr, "Error reading certificate chain");
                app_exit(1);
@@ -2573,7 +2573,7 @@ void verify_crl(common_info_st * cinfo)
                app_exit(1);
        }
 
-       pem.data = (void *) fread_file(infile, &size);
+       pem.data = (void *) fread_file(infile, 0, &size);
        pem.size = size;
 
        if (!pem.data) {
@@ -2661,7 +2661,7 @@ void verify_pkcs7(common_info_st * cinfo, const char *purpose, unsigned display_
                app_exit(1);
        }
 
-       data.data = (void *) fread_file(infile, &size);
+       data.data = (void *) fread_file(infile, 0, &size);
        data.size = size;
 
        if (!data.data) {
@@ -2785,7 +2785,7 @@ void pkcs7_sign(common_info_st * cinfo, unsigned embed)
                app_exit(1);
        }
 
-       data.data = (void *) fread_file(infile, &size);
+       data.data = (void *) fread_file(infile, 0, &size);
        data.size = size;
 
        if (!data.data) {
@@ -3404,7 +3404,7 @@ void pkcs12_info(common_info_st * cinfo)
                app_exit(1);
        }
 
-       data.data = (void *) fread_file(infile, &size);
+       data.data = (void *) fread_file(infile, 0, &size);
        data.size = size;
 
        if (!data.data) {
@@ -3593,7 +3593,7 @@ void pkcs8_info(void)
        size_t size;
        gnutls_datum_t data;
 
-       data.data = (void *) fread_file(infile, &size);
+       data.data = (void *) fread_file(infile, 0, &size);
        data.size = size;
 
        if (!data.data) {
@@ -3618,7 +3618,7 @@ void pkcs7_info(common_info_st *cinfo, unsigned display_data)
                app_exit(1);
        }
 
-       data.data = (void *) fread_file(infile, &size);
+       data.data = (void *) fread_file(infile, 0, &size);
        data.size = size;
 
        if (!data.data) {
@@ -3787,7 +3787,7 @@ gnutls_pubkey_t find_pubkey(gnutls_x509_crt_t crt, common_info_st * cinfo)
                        pubkey = load_pubkey(0, cinfo);
 
                        if (pubkey == NULL) { /* load from stdin */
-                               pem.data = (void *) fread_file(infile, &size);
+                               pem.data = (void *) fread_file(infile, 0, &size);
                                pem.size = size;
 
                                if (!pem.data) {
@@ -3931,7 +3931,7 @@ void certificate_fpr(common_info_st * cinfo)
        crt = load_cert(0, cinfo);
 
        if (crt == NULL) {
-               pem.data = (void *) fread_file(infile, &size);
+               pem.data = (void *) fread_file(infile, 0, &size);
                pem.size = size;
 
                if (!pem.data) {
index c3d074f08423a2e30ec29b85156517493907925a..cf0ef2ac983623c0534f5c382934b70dced7bd38 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -1036,7 +1036,7 @@ static int try_resume(socket_st * hd)
                        fprintf(stderr, "could not open %s\n", OPT_ARG(EARLYDATA));
                        exit(1);
                }
-               edata.data = (void *) fread_file(fp, &size);
+               edata.data = (void *) fread_file(fp, 0, &size);
                edata.size = size;
                fclose(fp);
        }
index 3b7940962c8d1b13ef3209dee9cca8ede15cb385..a963de039a9c7434ad93c9c058111afdd890d756 100644 (file)
@@ -99,10 +99,9 @@ static void request_info(void)
 
        if (HAVE_OPT(LOAD_REQUEST))
                dat.data =
-                   (void *) read_binary_file(OPT_ARG(LOAD_REQUEST),
-                                             &size);
+                   (void *) read_file(OPT_ARG(LOAD_REQUEST), RF_BINARY, &size);
        else
-               dat.data = (void *) fread_file(infile, &size);
+               dat.data = (void *) fread_file(infile, 0, &size);
        if (dat.data == NULL) {
                fprintf(stderr, "error reading request\n");
                app_exit(1);
@@ -236,10 +235,9 @@ static void response_info(void)
 
        if (HAVE_OPT(LOAD_RESPONSE))
                dat.data =
-                   (void *) read_binary_file(OPT_ARG(LOAD_RESPONSE),
-                                             &size);
+                   (void *) read_file(OPT_ARG(LOAD_RESPONSE), RF_BINARY, &size);
        else
-               dat.data = (void *) fread_file(infile, &size);
+               dat.data = (void *) fread_file(infile, 0, &size);
        if (dat.data == NULL) {
                fprintf(stderr, "error reading response\n");
                app_exit(1);
@@ -348,7 +346,7 @@ static int _verify_response(gnutls_datum_t * data, gnutls_datum_t * nonce,
 
        if (HAVE_OPT(LOAD_TRUST)) {
                dat.data =
-                   (void *) read_binary_file(OPT_ARG(LOAD_TRUST), &size);
+                   (void *) read_file(OPT_ARG(LOAD_TRUST), RF_BINARY, &size);
                if (dat.data == NULL) {
                        fprintf(stderr, "error reading --load-trust: %s\n",
                                OPT_ARG(LOAD_TRUST));
@@ -524,10 +522,9 @@ static void verify_response(gnutls_datum_t *nonce)
 
        if (HAVE_OPT(LOAD_RESPONSE))
                dat.data =
-                   (void *) read_binary_file(OPT_ARG(LOAD_RESPONSE),
-                                             &size);
+                   (void *) read_file(OPT_ARG(LOAD_RESPONSE), RF_BINARY, &size);
        else
-               dat.data = (void *) fread_file(infile, &size);
+               dat.data = (void *) fread_file(infile, 0, &size);
        if (dat.data == NULL) {
                fprintf(stderr, "error reading response\n");
                app_exit(1);
index 42c4851efd176c784329e61abffb506eed53fdd1..654519dc7cbca2ca52a4c02f9f57b2d335118563 100644 (file)
@@ -32,7 +32,6 @@
 #include <sys/wait.h>
 #endif
 
-#include "utils.h"
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
@@ -46,6 +45,10 @@ void doit(void)
 #include "../lib/atfork.h"
 #include "../lib/atfork.c"
 
+/* utils.h must be loaded after gnutls_int.h, as it redefines some
+ * macros from gnulib */
+#include "utils.h"
+
 void doit(void)
 {
        pid_t pid;
index 604024622d71d49d64b1c66333db1125253056ab..65a0dd05166352303071a0ddd164e2ee8b152b3f 100644 (file)
 
 #include <stdio.h>
 
-#include "utils.h"
 #include "../lib/gnutls_int.h"
 #include "../lib/mpi.h"
 #include "../lib/errors.h"
 #include "../lib/debug.h"
 
+/* utils.h must be loaded after gnutls_int.h, as it redefines some
+ * macros from gnulib */
+#include "utils.h"
+
 static void tls_log_func(int level, const char *str)
 {
        fprintf(stderr, "|<%d>| %s", level, str);
index 7301f293f5f50aee15062cbb66987f2c2b074564..1516afbf35d0bf8f441e425c2d12d708b6ee7ff9 100644 (file)
 
 #include <stdio.h>
 
-#include <utils.h>
 #include "../lib/gnutls_int.h"
 #include "../lib/x509/x509_int.h"
 #include "../lib/debug.h"
 
+/* utils.h must be loaded after gnutls_int.h, as it redefines some
+ * macros from gnulib */
+#include <utils.h>
+
 static void tls_log_func(int level, const char *str)
 {
        fprintf(stderr, "|<%d>| %s", level, str);
index e0aea00385070a99644dd4c51e7a7570960da7bb..506c11596a120a07b3754f2829c3b15cbd5efedc 100644 (file)
 #include <assert.h>
 #include <stdint.h>
 
-#include "utils.h"
 #include "virt-time.h"
 #include "../../lib/tls13/anti_replay.h"
 #include "../../lib/system.h"
 
+/* utils.h must be loaded after gnutls_int.h, as it redefines some
+ * macros from gnulib */
+#include "utils.h"
+
 #define MAX_CLIENT_HELLO_RECORDED 10
 
 struct storage_st {
index 61d6dc9f9ed6bc415cdd3bb6f0cf85a295b9a43e..935368088a0dbfa175bc510fe5b61ce731ef523f 100644 (file)
 # error tests cannot be compiled with NDEBUG defined
 #endif
 
-#if _GNUTLS_GCC_VERSION >= 70100
-#define FALLTHROUGH      __attribute__ ((fallthrough))
-#endif
-
 #ifndef FALLTHROUGH
+#if _GNUTLS_GCC_VERSION >= 70100
+# define FALLTHROUGH      __attribute__ ((fallthrough))
+#else
 # define FALLTHROUGH
 #endif
+#endif
 
 /* number of elements within an array */
 #define countof(a) (sizeof(a)/sizeof(*(a)))