diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-01-16 13:56:10 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-01-16 13:56:10 -0500 |
commit | 65e6e68981d9910c5f78f2cfed6c59cbee1494c7 (patch) | |
tree | c4ac9df87c63144380a605327da0b37ea08fb1e1 | |
parent | 7fc91dc274f38dc50f2a6eef2db060c788ef3040 (diff) | |
parent | 50f527a2c9202105a84e5f6c7d2844c494a46b7d (diff) | |
download | tor-65e6e68981d9910c5f78f2cfed6c59cbee1494c7.tar.gz tor-65e6e68981d9910c5f78f2cfed6c59cbee1494c7.zip |
Merge branch 'bug7972'
-rw-r--r-- | changes/bug7972 | 5 | ||||
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | src/common/crypto_curve25519.c | 4 | ||||
-rw-r--r-- | src/or/include.am | 2 | ||||
-rw-r--r-- | src/test/include.am | 6 | ||||
-rw-r--r-- | src/tools/include.am | 4 |
6 files changed, 22 insertions, 6 deletions
diff --git a/changes/bug7972 b/changes/bug7972 new file mode 100644 index 0000000000..6e1fce69c8 --- /dev/null +++ b/changes/bug7972 @@ -0,0 +1,5 @@ + o Minor bugfixes: + - Detect nacl when its headers are in a nacl/ subdirectory. Fixes bug + 7972; bugfix on 0.2.4.8-alpha. + - Actually link against nacl when we're configured to use it. Fixes bug + 7972; bugfix on 0.2.4.8-alpha. diff --git a/configure.ac b/configure.ac index acd20838da..f047ab9027 100644 --- a/configure.ac +++ b/configure.ac @@ -689,13 +689,20 @@ if test x$enable_curve25519 != xno; then [tor_cv_can_use_curve25519_donna_c64=cross], [tor_cv_can_use_curve25519_donna_c64=no])])]) + AC_CHECK_HEADERS([crypto_scalarmult_curve25519.h \ + nacl/crypto_scalarmult_curve25519.h]) + AC_CACHE_CHECK([whether we can use curve25519 from nacl], tor_cv_can_use_curve25519_nacl, [tor_saved_LIBS="$LIBS" LIBS="$LIBS -lnacl" AC_LINK_IFELSE( [AC_LANG_PROGRAM([dnl + #ifdef HAVE_CRYPTO_SCALARMULT_CURVE25519_H #include <crypto_scalarmult_curve25519.h> + #elif defined(HAVE_NACL_CRYPTO_SCALARMULT_CURVE25519_H) + #include <nacl/crypto_scalarmult_curve25519.h> + #endif #ifdef crypto_scalarmult_curve25519_ref_BYTES #error Hey, this is the reference implementation! #endif diff --git a/src/common/crypto_curve25519.c b/src/common/crypto_curve25519.c index 5636fe63e3..88705427a8 100644 --- a/src/common/crypto_curve25519.c +++ b/src/common/crypto_curve25519.c @@ -22,7 +22,11 @@ int curve25519_donna(uint8_t *mypublic, const uint8_t *secret, const uint8_t *basepoint); #endif #ifdef USE_CURVE25519_NACL +#ifdef HAVE_CRYPTO_SCALARMULT_CURVE25519_H #include <crypto_scalarmult_curve25519.h> +#elif defined(HAVE_NACL_CRYPTO_SCALARMULT_CURVE25519_H) +#include <nacl/crypto_scalarmult_curve25519.h> +#endif #endif int diff --git a/src/or/include.am b/src/or/include.am index 08a27e17b2..241015488a 100644 --- a/src/or/include.am +++ b/src/or/include.am @@ -99,7 +99,7 @@ src_or_tor_LDADD = src/or/libtor.a src/common/libor.a \ src/common/libor-crypto.a $(LIBDONNA) \ src/common/libor-event.a \ @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \ - @TOR_LIB_WS32@ @TOR_LIB_GDI@ + @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ ORHEADERS = \ src/or/addressmap.h \ diff --git a/src/test/include.am b/src/test/include.am index f625ab7f7d..112d1a79d8 100644 --- a/src/test/include.am +++ b/src/test/include.am @@ -40,7 +40,7 @@ src_test_test_LDADD = src/or/libtor.a src/common/libor.a \ src/common/libor-crypto.a $(LIBDONNA) \ src/common/libor-event.a \ @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \ - @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ + @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ src_test_bench_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \ @TOR_LDFLAGS_libevent@ @@ -48,7 +48,7 @@ src_test_bench_LDADD = src/or/libtor.a src/common/libor.a \ src/common/libor-crypto.a $(LIBDONNA) \ src/common/libor-event.a \ @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \ - @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ + @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ noinst_HEADERS+= \ src/test/test.h @@ -60,7 +60,7 @@ src_test_test_ntor_cl_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ src_test_test_ntor_cl_LDADD = src/or/libtor.a src/common/libor.a \ src/common/libor-crypto.a $(LIBDONNA) \ @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ \ - @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ + @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ src_test_test_ntor_cl_AM_CPPFLAGS = \ -I"$(top_srcdir)/src/or" diff --git a/src/tools/include.am b/src/tools/include.am index 610864f68f..54b150a80c 100644 --- a/src/tools/include.am +++ b/src/tools/include.am @@ -10,14 +10,14 @@ src_tools_tor_gencert_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ src_tools_tor_gencert_LDADD = src/common/libor.a src/common/libor-crypto.a \ $(LIBDONNA) \ @TOR_LIB_MATH@ @TOR_ZLIB_LIBS@ @TOR_OPENSSL_LIBS@ \ - @TOR_LIB_WS32@ @TOR_LIB_GDI@ + @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ src_tools_tor_checkkey_SOURCES = src/tools/tor-checkkey.c src_tools_tor_checkkey_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ src_tools_tor_checkkey_LDADD = src/common/libor.a src/common/libor-crypto.a \ $(LIBDONNA) \ @TOR_LIB_MATH@ @TOR_ZLIB_LIBS@ @TOR_OPENSSL_LIBS@ \ - @TOR_LIB_WS32@ @TOR_LIB_GDI@ + @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ include src/tools/tor-fw-helper/include.am |