[zeromq-dev] pyzmq curve example code

MinRK benjaminrk at gmail.com
Tue Feb 25 01:02:02 CET 2014


How did you build libzmq and/or install pyzmq? It could be that you don't
have libsodium linked, in which case the curve_keypair would fail. If
that's the case, obviously the error message should be better.

-MinRK


On Mon, Feb 24, 2014 at 3:47 PM, Greg Ward <greg at gerg.ca> wrote:

> Hey all --
>
> I'm playing around with the security examples in latest master of
> pyzmq. Looks promising, but not perfect. In particular, I'm stuck by
> this failure:
>
>   $ python generate_keys.py
>   Traceback (most recent call last):
>     File "generate_keys.py", line 50, in <module>
>       generate_certificates(os.path.dirname(__file__))
>     File "generate_keys.py", line 31, in generate_certificates
>       server_public_file, server_secret_file =
> zmq.auth.create_certificates(keys_dir, "server")
>     File "/data/src/pyzmq/zmq/auth.py", line 74, in create_certificates
>       public_key, secret_key = zmq.curve_keypair()
>     File "utils.pyx", line 53, in zmq.backend.cython.utils.curve_keypair
> (zmq/backend/cython/utils.c:820)
>     File "/data/src/pyzmq/zmq/error.py", line 128, in _check_rc
>       raise ZMQError(errno)
>   zmq.error.ZMQError: No such file or directory
>
> I'm digging through the code now to figure out 1) which zmq call
> failed, 2) what file or directory doesn't exist, and 3) how to improve
> that exception to report the guilty filename.
>
> (N.B. line numbers in that stack trace don't match upstream: I've
> hacked in some print statements to figure out what's going on.)
>
> Answers:
>
> 1) It's almost certain that zmq_curve_keypair() is failing, being called
>    from curve_keypair() in zmq/backend/cython/utils.pyx.
>
> 2) I don't see any file I/O in pyzmq's curve_keypair(), or in ZMQ itself.
>    No idea where the "No such file or directory" error is coming from.
>
> 3) Even less of an idea.
>
> Any clues? Hints are welcome. I'm happy to submit a pull request if
> only I can figure out what's going on.
>
> Thanks --
>
>         Greg
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140224/cd126a9a/attachment.htm>


More information about the zeromq-dev mailing list