[zeromq-dev] Adding CURVE support to JZMQ version 3.1.0

Arthur Low - Crack Semiconductor art at cracksemi.com
Wed May 27 21:43:58 CEST 2015


LIBZMQ I: security failure, self=NULL, peer=PLAIN

Hi,

Does anyone know what libzmq module generates the above message?

I am trying to debug new code added to the JZMQ 3.1.0 ZAuth.java module so 
that CURVE authentication will work.

I have libSodium installed. My machine is a Fedora 20, 64-bit AMD. Also 
libzmq (4.2.0) is installed. 

Using plain authentication works - I have added new methods to the 
src/java/org/zeromq/ZMQ.java source:

setCurvePublicKey
setCurvePrivateKey
setCurveServerKey
setCurveServer

and added these declarations to the same source file.

private static final int CURVE_SERVER = 47;
private static final int CURVE_PUBLICKEY = 48;
private static final int CURVE_SECRETKEY = 49;
private static final int CURVE_SERVERKEY = 50;

To src/main/c++/Socket.cpp,  I have added inside #ifdef statements:

#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4,1,0)

case ZMQ_CURVE_SERVER: 

wherever there is a:

case ZMQ_GSSAPI_SERVER:

The above applies to setLongSockopt and getLongSockOpt methods.

Then I have matched conditions for username and password:

#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4,0,0)
    case ZMQ_PLAIN_USERNAME:
    case ZMQ_PLAIN_PASSWORD:
#endif
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4,1,0)
    case ZMQ_CURVE_PUBLICKEY:
    case ZMQ_CURVE_SECRETKEY:
    case ZMQ_CURVE_SERVERKEY:
#endif

These apply to the setBytesSockopt and getBytesSockopt methods.

>From what I can tell, it is the connect method which initiates the 
ZAP_Request to the authentication server - but it appears that CURVE 
requests are not being sent.

Thanks in advance.

Arthur Low










More information about the zeromq-dev mailing list