.
Using Gentoo (4.8.0-gentoo x86_64 Intel(R) Core(TM) i7-2860QM CPU @ 2.50GHz) I have also configuration and compilation errors following the instructions. For libcurve.
I have uploaded the following patch to get around the issue ...
diff -rup a/configure.ac b/configure.ac
--- a/configure.ac 2016-10-14 12:09:03.759810377 -0400
+++ b/configure.ac 2016-10-14 12:06:42.131814561 -0400
@@ -72,48 +72,48 @@ PREVIOUS_CFLAGS="${CFLAGS}"
PREVIOUS_LIBS="${LIBS}"
-was_libzmq_check_lib_detected=no
+was_zmq_check_lib_detected=no
-PKG_CHECK_MODULES([libzmq], [libzmq >= 0.0.0],
+PKG_CHECK_MODULES([zmq], [zmq >= 0.0.0],
[
],
[
- AC_ARG_WITH([libzmq],
+ AC_ARG_WITH([zmq],
[
- AS_HELP_STRING([--with-libzmq],
- [Specify libzmq prefix])
+ AS_HELP_STRING([--with-zmq],
+ [Specify zmq prefix])
],
- [search_libzmq="yes"],
+ [search_zmq="yes"],
[])
- libzmq_synthetic_cflags=""
- libzmq_synthetic_libs="-lzmq"
+ zmq_synthetic_cflags=""
+ zmq_synthetic_libs="-lzmq"
- if test "x$search_libzmq" = "xyes"; then
- if test -r "${with_libzmq}/include/zmq.h"; then
- libzmq_synthetic_cflags="-I${with_libzmq}/include"
- libzmq_synthetic_libs="-L${with_libzmq}/lib -lzmq"
+ if test "x$search_zmq" = "xyes"; then
+ if test -r "${with_zmq}/include/zmq.h"; then
+ zmq_synthetic_cflags="-I${with_zmq}/include"
+ zmq_synthetic_libs="-L${with_zmq}/lib -lzmq"
else
- AC_MSG_ERROR([${with_libzmq}/include/zmq.h not found. Please check libzmq prefix])
+ AC_MSG_ERROR([${with_zmq}/include/zmq.h not found. Please check zmq prefix])
fi
fi
- AC_CHECK_LIB([libzmq], [zmq_init],
+ AC_CHECK_LIB([zmq], [zmq_init],
[
- CFLAGS="${libzmq_synthetic_cflags} ${CFLAGS}"
- LDFLAGS="${libzmq_synthetic_libs} ${LDFLAGS}"
- LIBS="${libzmq_synthetic_libs} ${LIBS}"
+ CFLAGS="${zmq_synthetic_cflags} ${CFLAGS}"
+ LDFLAGS="${zmq_synthetic_libs} ${LDFLAGS}"
+ LIBS="${zmq_synthetic_libs} ${LIBS}"
- AC_SUBST([libzmq_CFLAGS],[${libzmq_synthetic_cflags}])
- AC_SUBST([libzmq_LIBS],[${libzmq_synthetic_libs}])
- was_libzmq_check_lib_detected=yes
+ AC_SUBST([zmq_CFLAGS],[${zmq_synthetic_cflags}])
+ AC_SUBST([zmq_LIBS],[${zmq_synthetic_libs}])
+ was_zmq_check_lib_detected=yes
],
- [AC_MSG_ERROR([cannot link with -lzmq, install libzmq])])
+ [AC_MSG_ERROR([cannot link with -lzmq, install zmq])])
])
-if test "x$was_libzmq_check_lib_detected" = "xno"; then
- CFLAGS="${libzmq_CFLAGS} ${CFLAGS}"
- LIBS="${libzmq_LIBS} ${LIBS}"
+if test "x$was_zmq_check_lib_detected" = "xno"; then
+ CFLAGS="${zmq_CFLAGS} ${CFLAGS}"
+ LIBS="${zmq_LIBS} ${LIBS}"
fi
was_uuid_check_lib_detected=no
@@ -164,31 +164,31 @@ fi
was_czmq_check_lib_detected=no
-PKG_CHECK_MODULES([czmq], [libczmq >= 0.0.0],
+PKG_CHECK_MODULES([czmq], [czmq >= 0.0.0],
[
],
[
- AC_ARG_WITH([libczmq],
+ AC_ARG_WITH([czmq],
[
- AS_HELP_STRING([--with-libczmq],
- [Specify libczmq prefix])
+ AS_HELP_STRING([--with-czmq],
+ [Specify czmq prefix])
],
- [search_libczmq="yes"],
+ [search_czmq="yes"],
[])
czmq_synthetic_cflags=""
czmq_synthetic_libs="-lczmq"
- if test "x$search_libczmq" = "xyes"; then
- if test -r "${with_libczmq}/include/czmq.h"; then
- czmq_synthetic_cflags="-I${with_libczmq}/include"
- czmq_synthetic_libs="-L${with_libczmq}/lib -lczmq"
+ if test "x$search_czmq" = "xyes"; then
+ if test -r "${with_czmq}/include/czmq.h"; then
+ czmq_synthetic_cflags="-I${with_czmq}/include"
+ czmq_synthetic_libs="-L${with_czmq}/lib -lczmq"
else
- AC_MSG_ERROR([${with_libczmq}/include/czmq.h not found. Please check libczmq prefix])
+ AC_MSG_ERROR([${with_czmq}/include/czmq.h not found. Please check czmq prefix])
fi
fi
- AC_CHECK_LIB([libczmq], [zctx_test],
+ AC_CHECK_LIB([czmq], [zctx_test],
[
CFLAGS="${czmq_synthetic_cflags} ${CFLAGS}"
LDFLAGS="${czmq_synthetic_libs} ${LDFLAGS}"
@@ -198,7 +198,7 @@ PKG_CHECK_MODULES([czmq], [libczmq >= 0.
AC_SUBST([czmq_LIBS],[${czmq_synthetic_libs}])
was_czmq_check_lib_detected=yes
],
- [AC_MSG_ERROR([cannot link with -lczmq, install libczmq])])
+ [AC_MSG_ERROR([cannot link with -lczmq, install czmq])])
])
if test "x$was_czmq_check_lib_detected" = "xno"; then
@@ -206,48 +206,48 @@ if test "x$was_czmq_check_lib_detected"
LIBS="${czmq_LIBS} ${LIBS}"
fi
-was_libsodium_check_lib_detected=no
+was_sodium_check_lib_detected=no
-PKG_CHECK_MODULES([libsodium], [libsodium >= 0.0.0],
+PKG_CHECK_MODULES([sodium], [sodium >= 0.0.0],
[
],
[
- AC_ARG_WITH([libsodium],
+ AC_ARG_WITH([sodium],
[
- AS_HELP_STRING([--with-libsodium],
- [Specify libsodium prefix])
+ AS_HELP_STRING([--with-sodium],
+ [Specify sodium prefix])
],
- [search_libsodium="yes"],
+ [search_sodium="yes"],
[])
- libsodium_synthetic_cflags=""
- libsodium_synthetic_libs="-lsodium"
+ sodium_synthetic_cflags=""
+ sodium_synthetic_libs="-lsodium"
- if test "x$search_libsodium" = "xyes"; then
- if test -r "${with_libsodium}/include/sodium.h"; then
- libsodium_synthetic_cflags="-I${with_libsodium}/include"
- libsodium_synthetic_libs="-L${with_libsodium}/lib -lsodium"
+ if test "x$search_sodium" = "xyes"; then
+ if test -r "${with_sodium}/include/sodium.h"; then
+ sodium_synthetic_cflags="-I${with_sodium}/include"
+ sodium_synthetic_libs="-L${with_sodium}/lib -lsodium"
else
- AC_MSG_ERROR([${with_libsodium}/include/sodium.h not found. Please check libsodium prefix])
+ AC_MSG_ERROR([${with_sodium}/include/sodium.h not found. Please check sodium prefix])
fi
fi
- AC_CHECK_LIB([libsodium], [sodium_init],
+ AC_CHECK_LIB([sodium], [sodium_init],
[
- CFLAGS="${libsodium_synthetic_cflags} ${CFLAGS}"
- LDFLAGS="${libsodium_synthetic_libs} ${LDFLAGS}"
- LIBS="${libsodium_synthetic_libs} ${LIBS}"
+ CFLAGS="${sodium_synthetic_cflags} ${CFLAGS}"
+ LDFLAGS="${sodium_synthetic_libs} ${LDFLAGS}"
+ LIBS="${sodium_synthetic_libs} ${LIBS}"
- AC_SUBST([libsodium_CFLAGS],[${libsodium_synthetic_cflags}])
- AC_SUBST([libsodium_LIBS],[${libsodium_synthetic_libs}])
- was_libsodium_check_lib_detected=yes
+ AC_SUBST([sodium_CFLAGS],[${sodium_synthetic_cflags}])
+ AC_SUBST([sodium_LIBS],[${sodium_synthetic_libs}])
+ was_sodium_check_lib_detected=yes
],
- [AC_MSG_ERROR([cannot link with -lsodium, install libsodium])])
+ [AC_MSG_ERROR([cannot link with -lsodium, install sodium])])
])
-if test "x$was_libsodium_check_lib_detected" = "xno"; then
- CFLAGS="${libsodium_CFLAGS} ${CFLAGS}"
- LIBS="${libsodium_LIBS} ${LIBS}"
+if test "x$was_sodium_check_lib_detected" = "xno"; then
+ CFLAGS="${sodium_CFLAGS} ${CFLAGS}"
+ LIBS="${sodium_LIBS} ${LIBS}"
fi
CFLAGS="${PREVIOUS_CFLAGS}"
diff -rup a/src/curve_client.c b/src/curve_client.c
--- a/src/curve_client.c 2016-10-14 12:17:20.363795704 -0400
+++ b/src/curve_client.c 2016-10-14 12:17:04.746796165 -0400
@@ -518,7 +518,7 @@ curve_client_test (bool verbose)
curve_client_set_metadata (client, "Client", "CURVEZMQ/curve_client");
curve_client_set_metadata (client, "Identity", "E475DA11");
curve_client_set_verbose (client, verbose);
- curve_client_connect (client, "tcp://127.0.0.1:9005", zcert_public_key (server_cert));
+ curve_client_connect (client, "tcp://127.0.0.1:9005", (byte *)zcert_public_key (server_cert));
curve_client_sendstr (client, "Hello, World");
char *reply = curve_client_recvstr (client);
diff -rup a/src/curve_codec.c b/src/curve_codec.c
--- a/src/curve_codec.c 2016-10-14 12:17:20.363795704 -0400
+++ b/src/curve_codec.c 2016-10-14 12:17:04.746796165 -0400
@@ -496,7 +496,7 @@ s_produce_hello (curve_codec_t *self)
signature, 64,
"CurveZMQHELLO---",
self->peer_permakey, // Server public key
- zcert_secret_key (self->transcert));
+ (byte *)zcert_secret_key (self->transcert));
return command;
}
@@ -513,7 +513,7 @@ s_process_hello (curve_codec_t *self, zf
signature_received, 64,
"CurveZMQHELLO---",
hello->client,
- zcert_secret_key (self->permacert));
+ (byte *)zcert_secret_key (self->permacert));
return rc;
}
@@ -562,7 +562,7 @@ s_produce_welcome (curve_codec_t *self)
plain, 128,
"WELCOME-",
self->peer_transkey,
- zcert_secret_key (self->permacert));
+ (byte *)zcert_secret_key (self->permacert));
return command;
}
@@ -579,7 +579,7 @@ s_process_welcome (curve_codec_t *self,
plain, 128,
"WELCOME-",
self->peer_permakey, // Server public key
- zcert_secret_key (self->transcert));
+ (byte *)zcert_secret_key (self->transcert));
if (rc == 0) {
memcpy (self->peer_transkey, plain, 32);
@@ -618,7 +618,7 @@ s_produce_initiate (curve_codec_t *self)
vouch_plain, 64,
"VOUCH---",
self->peer_transkey,
- zcert_secret_key (self->permacert));
+ (byte *)zcert_secret_key (self->permacert));
// Working variables for crypto calls
size_t box_size = 128 + self->metadata_size;
@@ -697,7 +697,7 @@ s_process_initiate (curve_codec_t *self,
plain, 64,
"VOUCH---",
self->peer_permakey,
- zcert_secret_key (self->transcert));
+ (byte *)zcert_secret_key (self->transcert));
// Check vouch is short term client public key plus our public key
if (rc == 0
diff -rup a/src/curve_server.c b/src/curve_server.c
--- a/src/curve_server.c 2016-10-14 12:17:20.363795704 -0400
+++ b/src/curve_server.c 2016-10-14 12:17:04.746796165 -0400
@@ -608,7 +608,7 @@ client_task (void *args)
zcert_t *server_cert = zcert_load (TESTDIR "/server.cert");
assert (server_cert);
- curve_client_connect (client, "tcp://127.0.0.1:9006", zcert_public_key (server_cert));
+ curve_client_connect (client, "tcp://127.0.0.1:9006", (byte *)zcert_public_key (server_cert));
zcert_destroy (&server_cert);
curve_client_sendstr (client, "Hello, World");
... hope this helps someone.
.