]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Check for nacl headers in nacl/ subdir
authorNick Mathewson <nickm@torproject.org>
Wed, 16 Jan 2013 15:29:11 +0000 (10:29 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 16 Jan 2013 15:29:11 +0000 (10:29 -0500)
Fix for bug 7972

changes/bug7972 [new file with mode: 0644]
configure.ac
src/common/crypto_curve25519.c

diff --git a/changes/bug7972 b/changes/bug7972
new file mode 100644 (file)
index 0000000..b751ced
--- /dev/null
@@ -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.
index acd20838dae647e67212d63b5c1641556ccf991e..f047ab9027908911bc6be9e4f8ba51eac5e1dd0b 100644 (file)
@@ -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
index 5636fe63e3e2e8c45a9117a3ad4fa98067b99932..88705427a8f1d84ee392350b6b4e408c6effe63e 100644 (file)
@@ -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