On 16 Jan 2014, at 20.49, Nicolai <[email protected]> wrote:
>
> Things are moving in the right direction!  The last six months have seen
> MAJOR improvements in crypto.  If you want to be a part of it, pick up
> DNSCrypt or DNSCurve.  Get a recent Chromium and play with QUIC.  Read
> about MinimaLT.  Strong, fast encryption is coming.  And I think OpenBSD
> 5.5 will be light years ahead when it's released in May.


DNSCurve, I was already trying to compile it yesterday. Wonderful:


# ./configure.nacl

Took a long, long time to complete and didn’t produce any output at all.



# ./configure.curvedns
Finished configuring CurveDNS, ready for compiling.
Chosen/picked ABI:              x86
Chosen/picked compiler:         gcc
Chosen/picked compiler options: -m32 -O3 -fomit-frame-pointer -funroll-loops

We are now ready to compile, run 'make' to do so.

# make
gcc -m32 -O3 -fomit-frame-pointer -funroll-loops -Wall -fno-strict-aliasing
-O3 -Inacl/build/include/x86  -c curvedns-keygen.c
In file included from misc.h:49,
                 from curvedns-keygen.c:46:
ip.h:54:31: error: ev.h: No such file or directory
In file included from misc.h:49,
                 from curvedns-keygen.c:46:
ip.h:78: error: expected '=', ',', ';', 'asm' or '__attribute__' before
'global_ip_internal_timeout'
ip.h:79: error: expected '=', ',', ';', 'asm' or '__attribute__' before
'global_ip_tcp_external_timeout'
*** Error code 1

Stop in /usr/local/src/curvedns-0.87 (line 79 of Makefile).


Seems that it can’t even find headers in /usr/local/include, which is where
the OpenBSD pack for libev installs the header, so I had to add that:

# vim Makefile

# If you have libev at a non-standard place, specify that here:
EV=/usr/local
EVCFLAGS=-I$(EV)/include
EVLDFLAGS=-L$(EV)/lib


And then we get a bit further:

# make
gcc -m32 -O3 -fomit-frame-pointer -funroll-loops -Wall -fno-strict-aliasing
-O3 -Inacl/build/include/x86 -I/usr/local/include -c curvedns-keygen.c
gcc -m32 -O3 -fomit-frame-pointer -funroll-loops -Wall -fno-strict-aliasing
-O3 -Inacl/build/include/x86 -I/usr/local/include -c debug.c
gcc -m32 -O3 -fomit-frame-pointer -funroll-loops -Wall -fno-strict-aliasing
-O3 -Inacl/build/include/x86 -I/usr/local/include -c ip.c
gcc -m32 -O3 -fomit-frame-pointer -funroll-loops -Wall -fno-strict-aliasing
-O3 -Inacl/build/include/x86 -I/usr/local/include -c misc.c
misc.c: In function 'misc_base32_decode':
misc.c:291: error: 'EPROTO' undeclared (first use in this function)
misc.c:291: error: (Each undeclared identifier is reported only once
misc.c:291: error: for each function it appears in.)
*** Error code 1

Stop in /usr/local/src/curvedns-0.87 (line 76 of Makefile).



What’s this EPROTO and do I really need to care? I commented it out in misc.c,
dnscurve.c and dns.c:

PROTO:
    //errno = EPROTO;
    return 0;
}



And then:

# make
gcc -m32 -O3 -fomit-frame-pointer -funroll-loops -Wall -fno-strict-aliasing
-O3 -Inacl/build/include/x86 -I/usr/local/include -c dns.c
gcc -m32 -O3 -fomit-frame-pointer -funroll-loops -Wall -fno-strict-aliasing
-O3 -Inacl/build/include/x86 -I/usr/local/include -c curvedns.c
In file included from curvedns.c:37:
/usr/include/sys/socket.h:162: error: expected specifier-qualifier-list before
'u_int8_t'
/usr/include/sys/socket.h:180: error: expected specifier-qualifier-list before
'u_int8_t'
/usr/include/sys/socket.h:378: error: expected specifier-qualifier-list before
'socklen_t'
/usr/include/sys/socket.h:405: error: expected specifier-qualifier-list before
'socklen_t'
In file included from curvedns.c:37:
/usr/include/sys/socket.h:462: error: expected declaration specifiers or '...'
before 'socklen_t'
/usr/include/sys/socket.h:463: error: expected declaration specifiers or '...'
before 'socklen_t'
/usr/include/sys/socket.h:464: error: expected declaration specifiers or '...'
before 'socklen_t'
/usr/include/sys/socket.h:465: error: expected declaration specifiers or '...'
before 'uid_t'
/usr/include/sys/socket.h:465: error: expected declaration specifiers or '...'
before 'gid_t'
/usr/include/sys/socket.h:466: error: expected declaration specifiers or '...'
before 'socklen_t'
/usr/include/sys/socket.h:467: error: expected declaration specifiers or '...'
before 'socklen_t'
/usr/include/sys/socket.h:468: error: expected declaration specifiers or '...'
before 'socklen_t'
/usr/include/sys/socket.h:470: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'recv'
/usr/include/sys/socket.h:471: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'recvfrom'
/usr/include/sys/socket.h:472: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'recvmsg'
/usr/include/sys/socket.h:473: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'send'
/usr/include/sys/socket.h:474: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'sendto'
/usr/include/sys/socket.h:476: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'sendmsg'
/usr/include/sys/socket.h:477: error: expected declaration specifiers or '...'
before 'socklen_t'
curvedns.c: In function 'getenvoptions':
curvedns.c:75: error: 'struct sockaddr' has no member named 'sa_family'
curvedns.c:81: error: 'struct sockaddr' has no member named 'sa_family'
curvedns.c:81: error: 'struct sockaddr' has no member named 'sa_family'
curvedns.c: In function 'main':
curvedns.c:164: error: 'struct sockaddr' has no member named 'sa_family'
*** Error code 1

Stop in /usr/local/src/curvedns-0.87 (line 57 of Makefile).


So I added sys/types.h to curvedns.c:

#include <sys/types.h>
#include <sys/socket.h>     /* for AF_UNSPEC */



And voila, it compiles:

make
gcc -m32 -O3 -fomit-frame-pointer -funroll-loops -Wall -fno-strict-aliasing
-O3 -Inacl/build/include/x86 -I/usr/local/include -c curvedns.c
gcc -Lnacl/build/lib/x86 -L/usr/local/lib debug.o ip.o misc.o dnscurve.o dns.o
cache.a event.a curvedns.o -lev -lnacl -o curvedns


Don’t know how well it works just yet, but it compiles.


-mike

Reply via email to