Opened 7 years ago

Closed 7 years ago

#7972 closed defect (fixed)

configure fails to detect nacl

Reported by: weasel Owned by:
Priority: Medium Milestone: Tor: 0.2.4.x-final
Component: Core Tor/Tor Version: Tor: 0.2.4.8-alpha
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Hey,

the configure script's test includes a crypto_scalarmult_curve25519.h, without specifying any extra path.

On Debian, the nacl headers are in /usr/include/nacl, so maybe add that to the -I path, or include nacl/crypto_scalarmult_curve25519.h?

Cheers,

Child Tickets

Change History (6)

comment:1 Changed 7 years ago by nickm

Status: newneeds_review

Ug.

see branch bug7972 in my public repository?

comment:2 Changed 7 years ago by weasel

...
checking crypto_scalarmult_curve25519.h usability... no
checking crypto_scalarmult_curve25519.h presence... no
checking for crypto_scalarmult_curve25519.h... no
checking nacl/crypto_scalarmult_curve25519.h usability... yes
checking nacl/crypto_scalarmult_curve25519.h presence... yes
checking for nacl/crypto_scalarmult_curve25519.h... yes
checking whether we can use curve25519 from nacl... yes

[sid-amd64-sbuild] weasel@dixie:~/tor-tree/tor$ grep -i '#define.*curve' orconfig.h
#define CURVE25519_ENABLED 1
#define HAVE_NACL_CRYPTO_SCALARMULT_CURVE25519_H 1
#define USE_CURVE25519_DONNA 1

[sid-amd64-sbuild] weasel@dixie:~/tor-tree/tor$ grep 'tor_.*can_use_curve' config.log
tor_cv_can_use_curve25519_donna_c64=yes
tor_cv_can_use_curve25519_nacl=yes

and
checking crypto_scalarmult_curve25519.h usability... no
checking crypto_scalarmult_curve25519.h presence... no
checking for crypto_scalarmult_curve25519.h... no
checking nacl/crypto_scalarmult_curve25519.h usability... yes
checking nacl/crypto_scalarmult_curve25519.h presence... yes
checking for nacl/crypto_scalarmult_curve25519.h... yes
checking whether we can use curve25519 from nacl... yes

[sid-i386-sbuild] weasel@dixie:~/tor-tree-i386/tor$ grep -i '#define.*curve' orconfig.h
#define CURVE25519_ENABLED 1
#define HAVE_NACL_CRYPTO_SCALARMULT_CURVE25519_H 1
#define USE_CURVE25519_NACL 1

[sid-i386-sbuild] weasel@dixie:~/tor-tree-i386/tor$ grep 'tor_.*can_use_curve' config.log
tor_cv_can_use_curve25519_donna_c64=no
tor_cv_can_use_curve25519_nacl=yes

I think this means it works.
--
weasel

comment:3 Changed 7 years ago by weasel

Status: needs_reviewneeds_revision

However, it doesn't link as -lnacl is missing:

[sid-i386-sbuild] weasel@dixie:~/tor-tree-i386/tor$ make
make all-am
make[1]: Entering directory `/home/weasel/tor-tree-i386/tor'
gcc -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -fwrapv -fPIE -Wall -fno-strict-aliasing -pie -z relro -z now -o src/or/tor src/or/tor_main.o src/or/libtor.a src/common/libor.a src/common/libor-crypto.a src/common/libor-event.a -lz -lm -levent -lssl -lcrypto -lrt -ldl
src/common/libor-crypto.a(crypto_curve25519.o): In function `curve25519_impl':
/home/weasel/tor-tree-i386/tor/src/common/crypto_curve25519.c:39: undefined reference to `crypto_scalarmult_curve25519_athlon'
collect2: error: ld returned 1 exit status
make[1]: * [src/or/tor] Error 1
make[1]: Leaving directory `/home/weasel/tor-tree-i386/tor'
make:
* [all] Error 2

[sid-i386-sbuild] weasel@dixie:~/tor-tree-i386/tor$ make LIBDONNA='-lnacl' # abuse an otherwise unset var to cause it to add -lnachl
make all-am
make[1]: Entering directory `/home/weasel/tor-tree-i386/tor'
gcc -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -fwrapv -fPIE -Wall -fno-strict-aliasing -pie -z relro -z now -o src/or/tor src/or/tor_main.o src/or/libtor.a src/common/libor.a src/common/libor-crypto.a -lnacl src/common/libor-event.a -lz -lm -levent -lssl -lcrypto -lrt -ldl
gcc -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -fwrapv -fPIE -Wall -fno-strict-aliasing -pie -z relro -z now -o src/test/test src/test/src_test_test-test.o src/test/src_test_test-test_addr.o src/test/src_test_test-test_cell_formats.o src/test/src_test_test-test_containers.o src/test/src_test_test-test_crypto.o src/test/src_test_test-test_data.o src/test/src_test_test-test_dir.o src/test/src_test_test-test_introduce.o src/test/src_test_test-test_microdesc.o src/test/src_test_test-test_pt.o src/test/src_test_test-test_replay.o src/test/src_test_test-test_util.o src/test/src_test_test-test_config.o src/ext/src_test_test-tinytest.o src/or/libtor.a src/common/libor.a src/common/libor-crypto.a -lnacl src/common/libor-event.a -lz -lm -levent -lssl -lcrypto -lrt -ldl
...

comment:4 Changed 7 years ago by nickm

Status: needs_revisionneeds_review

Whoops; try the branch again now?

comment:5 Changed 7 years ago by weasel

better, thanks :)

comment:6 Changed 7 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Great; merging.

Note: See TracTickets for help on using tickets.