From 88882e31cdb6d1c3dedecdeffc207ed33cf043f4 Mon Sep 17 00:00:00 2001 From: Martin Hurton Date: Fri, 4 Oct 2013 08:20:55 +0200 Subject: [PATCH] Stop curve handshake when cookie box verification fails --- src/curve_server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/curve_server.cpp b/src/curve_server.cpp index afe07cff..a3244418 100644 --- a/src/curve_server.cpp +++ b/src/curve_server.cpp @@ -371,7 +371,7 @@ int zmq::curve_server_t::process_initiate (msg_t *msg_) // Check cookie plain text is as expected [C' + s'] if (memcmp (cookie_plaintext + crypto_secretbox_ZEROBYTES, cn_client, 32) || memcmp (cookie_plaintext + crypto_secretbox_ZEROBYTES + 32, cn_secret, 32)) { - errno = EAGAIN; + errno = EPROTO; return -1; }