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
This commit is contained in:
Simon Giesecke 2017-08-03 15:20:35 +02:00 committed by Luca Boccassi
parent 5d4e30eb13
commit c191909c0e

View File

@ -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);
}