[zeromq-dev] Curvezmq guide on handshake etc. could use some clarifications

Pieter Hintjens ph at imatix.com
Fri Oct 3 10:28:58 CEST 2014


On Thu, Oct 2, 2014 at 4:32 PM, Jonas Thiem <jonasthiem at googlemail.com> wrote:

> Thanks for your response!
> Since you referred me to zauth functionality instead of answering the
> question, I took the time to dig out the only manual section on zauth
> which I could find...

I don't know the PyZMQ auth module in detail, and assume it's using
the same mechanisms as zauth.

There is a lack of good documentation at this stage. I've written some
articles on my blog: http://hintjens.com/blog:48 and
http://hintjens.com/blog:49, with detailed examples in C. There is
also a lot more detail on the blog about how CURVE works.

> So does zauth also verify that the client owns the according private key
> and is able to decrypt stuff properly?

Yes, otherwise it would not work at all. It's not explicitly stated.
However, in the INITIATE command,

"The vouch box (80 octets), that encrypts the client's transient key
C' (32 octets) and the server permanent key S (32 octets) from the
client permanent key C to the server transient key S'."

So the server decodes the vouch using the client's public key. Only
with the matching private key can the client create such a valid vouch
box.

> 1. This question should be made more clear on either the zauth page I
> linked or the curve authentication section, since it only vaguely speaks
> of verification by public key but not of this specific issue

Please, when you ask questions on particularly tricky topics like
encryption, it's better to write small emails with clear, specific
questions. It took me quite some reading to understand what you were
asking.

If you think it's worth documenting that the client public key is
validated, via the vouch box, sure. It is a detail for the security
mechanism, not for zauth. We could expand the zmq_curve man page in
ZeroMQ, that is probably the best place for such descriptions. Would
you like to expand on that?

> 2. The zauth unit test should maybe also include a negative case for the
> full zmq auth case, right?

If you get this working, send a patch please.

> 3. The test on the page I linked seems to be included in zauth.c in CZMQ
> 2.2.0. However, it fails if actually executed on Ubuntu 14 LTS:
> lt-czmq_selftest: zsockopt.c:286: zsocket_set_curve_server: Assertion
> `rc == 0 || zmq_errno () == (156384712 + 53)' failed.

You're using a libzmq built without libsodium.

Sorry for the slow reply to your email. The response time is directly
proportional to the number of questions and different points in an
email, squared.

-Pieter



More information about the zeromq-dev mailing list