On Sun, 2018-03-25 at 10:37 +0200, Niels Möller wrote:
nisse@lysator.liu.se (Niels Möller) writes:
Nikos Mavrogiannopoulos n.mavrogiannopoulos@gmail.com writes:
is a bit strange. Maybe it's missing an #include <nettle/version.h> ?
That's very strange. bignum.h already includes version.h, so that should have been ok. I've also explicitly added it and re-run with the same results: https://gitlab.com/gnutls/nettle/-/jobs/58340605
I'll try reproducing locally.
It turns out it was a typo, with below fix, compilation works fine:
--- a/lib/nettle/pk.c +++ b/lib/nettle/pk.c @@ -1062,7 +1062,7 @@ _wrap_nettle_pk_verify(gnutls_pk_algorithm_t algo, return ret; }
-#if NETTLE_MAJOR_VERSION < 3 || (NETTLE_MAJOR_VERSION == 3 && NETTLE_MINOR_VERSION < 4) +#if NETTLE_VERSION_MAJOR < 3 || (NETTLE_VERSION_MAJOR == 3 && NETTLE_VERSION_MINOR < 4) # ifdef ENABLE_NON_SUITEB_CURVES # define nettle_get_secp_192r1() &nettle_secp_192r1 # define nettle_get_secp_224r1() &nettle_secp_224r1
Thank you. I've committed a fix at: https://gitlab.com/gnutls/gnutls/merge_requests/614
The compilation flag -Wundef would have caught this.
I have never tried it, but it looks easy to fail on legal scenarios. If for example we compile with any version of nettle 3.1 or later (3.1 doesn't have version.h), that macro would make it fail. Extrapolating it to more dependencies would make a valid run extremely likely to fail compilation.
regards, Nikos