aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-01-16 10:29:11 -0500
committerNick Mathewson <nickm@torproject.org>2013-01-16 10:29:11 -0500
commitb987081941bda22e5e37a09c75ffc790c270624b (patch)
tree06837e1f3a483cb5ea133b5f808c3d5fafd7be52
parentf57722d23ec82b711fffc46a8649a8651df7125a (diff)
downloadtor-b987081941bda22e5e37a09c75ffc790c270624b.tar
tor-b987081941bda22e5e37a09c75ffc790c270624b.tar.gz
Check for nacl headers in nacl/ subdir
Fix for bug 7972
-rw-r--r--changes/bug79723
-rw-r--r--configure.ac7
-rw-r--r--src/common/crypto_curve25519.c4
3 files changed, 14 insertions, 0 deletions
diff --git a/changes/bug7972 b/changes/bug7972
new file mode 100644
index 000000000..b751ced18
--- /dev/null
+++ b/changes/bug7972
@@ -0,0 +1,3 @@
+ o Minor bugfixes:
+ - Detect nacl when its headers are in a nacl/ subdirectory. Fixes bug
+ 7972; bugfix on 0.2.4.8-alpha.
diff --git a/configure.ac b/configure.ac
index acd20838d..f047ab902 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 5636fe63e..88705427a 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