From c191909c0e063a4564a5ad11e325a029e9fe4205 Mon Sep 17 00:00:00 2001 From: Simon Giesecke Date: Thu, 3 Aug 2017 15:20:35 +0200 Subject: [PATCH] Problem: Misleading error code in case ZAP handler sends an invalid status code (#2646) Solution: Use EPROTO instead of EACCES error code in that case --- src/curve_server.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/curve_server.cpp b/src/curve_server.cpp index e6da4090..8ff6311c 100644 --- a/src/curve_server.cpp +++ b/src/curve_server.cpp @@ -317,7 +317,7 @@ int zmq::curve_server_t::process_hello (msg_t *msg_) hello_nonce, cn_client, secret_key); if (rc != 0) { // CURVE I: cannot open client HELLO -- wrong server key? - current_error_detail = encryption; + current_error_detail = encryption; errno = EPROTO; return -1; } @@ -709,7 +709,7 @@ int zmq::curve_server_t::receive_and_process_zap_reply () if (msg [3].size () != 3) { // CURVE I: ZAP handler sent invalid status code current_error_detail = zap; - errno = EACCES; + errno = EPROTO; return close_and_return (msg, -1); }