Added options for CURVE security

- ZMQ_CURVE_PUBLICKEY for clients and servers
- ZMQ_CURVE_SECRETKEY for clients
- ZMQ_CURVE_SERVERKEY for clients
- ZMQ_CURVE_SERVER for servers
- added tools/curve_keygen.c as example
- updated man pages
This commit is contained in:
Pieter Hintjens
2013-06-20 18:09:12 +02:00
parent 65c84abdb5
commit d9bb16725e
10 changed files with 222 additions and 40 deletions

View File

@@ -28,6 +28,8 @@
#include "tcp_address.hpp"
#include "../include/zmq.h"
#define CURVE_KEYSIZE 32
namespace zmq
{
struct options_t
@@ -125,6 +127,7 @@ namespace zmq
// Security mechanism for all connections on this socket
int mechanism;
// If peer is acting as server for PLAIN or CURVE mechanisms
int as_server;
@@ -132,14 +135,10 @@ namespace zmq
std::string plain_username;
std::string plain_password;
unsigned char public_key_size;
unsigned char public_key [32];
unsigned char secret_key_size;
unsigned char secret_key [32];
unsigned char server_key_size;
unsigned char server_key [32];
// Security credentials for CURVE mechanism
uint8_t curve_public_key [CURVE_KEYSIZE];
uint8_t curve_secret_key [CURVE_KEYSIZE];
uint8_t curve_server_key [CURVE_KEYSIZE];
// ID of the socket.
int socket_id;