Commit 0ebed80d authored by Luca Boccassi's avatar Luca Boccassi Committed by GitHub

Merge pull request #2281 from vtellier/master

Code formatting + reverted hard error handshake fail
parents 0ad600c7 48bc75e8
......@@ -417,8 +417,6 @@ ZMQ_EXPORT const char *zmq_msg_gets (zmq_msg_t *msg, const char *property);
#define ZMQ_EVENT_CLOSE_FAILED 0x0100
#define ZMQ_EVENT_DISCONNECTED 0x0200
#define ZMQ_EVENT_MONITOR_STOPPED 0x0400
#define ZMQ_EVENT_HANDSHAKE_FAILED 0x0800
#define ZMQ_EVENT_HANDSHAKE_SUCCEED 0x1000
#define ZMQ_EVENT_ALL 0xFFFF
ZMQ_EXPORT void *zmq_socket (void *, int type);
......@@ -563,6 +561,10 @@ ZMQ_EXPORT void zmq_threadclose (void* thread);
#define ZMQ_SCATTER 17
#define ZMQ_DGRAM 18
/* DRAFT 0MQ socket events and monitoring */
#define ZMQ_EVENT_HANDSHAKE_FAILED 0x0800
#define ZMQ_EVENT_HANDSHAKE_SUCCEED 0x1000
/* DRAFT Context options */
#define ZMQ_MSG_T_SIZE 6
......
......@@ -310,14 +310,13 @@ int zmq::curve_server_t::process_hello (msg_t *msg_)
sizeof hello_box,
hello_nonce, cn_client, secret_key);
if (rc != 0) {
// Hard error, the client knows a wrong server public key, it shall not try to reconnect using the same.
status_code = "100";
state = send_error;
rc = 0;
// Temporary support for security debugging
puts("CURVE I: cannot open client HELLO -- wrong server key?");
errno = EPROTO;
return -1;
}
else
state = send_welcome;
state = send_welcome;
return rc;
}
......
......@@ -46,6 +46,10 @@
#define ZMQ_SCATTER 17
#define ZMQ_DGRAM 18
/* DRAFT 0MQ socket events and monitoring */
#define ZMQ_EVENT_HANDSHAKE_FAILED 0x0800
#define ZMQ_EVENT_HANDSHAKE_SUCCEED 0x1000
/* DRAFT Context options */
#define ZMQ_MSG_T_SIZE 6
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment