mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-26 10:32:58 +01:00
Problem: use of libsodium vs. tweetnacl is confused
It's unclear which we need and in the source code, conditional code
treats tweetnacl as a subclass of libsodium, which is inaccurate.
Solution: redesign the configure/cmake API for this:
* tweetnacl is present by default and cannot be enabled
* libsodium can be enabled using --with-libsodium, which replaces
the built-in tweetnacl
* CURVE encryption can be disabled entirely using --enable-curve=no
The macros we define in platform.hpp are:
ZMQ_HAVE_CURVE 1 // When CURVE is enabled
HAVE_LIBSODIUM 1 // When we are using libsodium
HAVE_TWEETNACL 1 // When we're using tweetnacl (default)
As of this patch, the default build of libzmq always has CURVE
security, and always uses tweetnacl.
This commit is contained in:
@@ -682,7 +682,7 @@ bool zmq::stream_engine_t::handshake ()
|
||||
plain_client_t (options);
|
||||
alloc_assert (mechanism);
|
||||
}
|
||||
#ifdef HAVE_LIBSODIUM
|
||||
#ifdef ZMQ_HAVE_CURVE
|
||||
else
|
||||
if (options.mechanism == ZMQ_CURVE
|
||||
&& memcmp (greeting_recv + 12, "CURVE\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 20) == 0) {
|
||||
|
||||
Reference in New Issue
Block a user