[zeromq-dev] pyzmq curve example code

Greg Ward greg at gerg.ca
Tue Feb 25 00:47:49 CET 2014

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>
    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.)


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 --


More information about the zeromq-dev mailing list