• Simon Giesecke's avatar
    Replace console output by monitoring events for curve security issues (#2645) · 5d4e30eb
    Simon Giesecke authored
    * Fixing #2002 one way of doing it
    
     * Mechanisms can implement a new method `error_detail()`
     * This error detail have three values for the moment: no_detail
     (default), protocol, encryption.
        + generic enough to make sense for all mechanisms.
        - low granularity level on information.
    
    * Fixing #2002: implementation of the error details
    
    The ZMQ_EVENT_HANDSHAKE_FAILED event carries the error details
    as value.
    
    * Removed Microsoft extenstion for enum member access
    
    This was leading to compilation error under linux.
    
    * Adaptation of CURVE test cases
    
    * Monitoring event: changed API for detailed events
    
    Removed ZMQ_EVENT_HANDSHAKE_FAILED and replaced it by:
    - ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL,
    - ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL,
    - ZMQ_EVENT_HANDSHAKE_FAILED_ENCRYPTION
    
    Adaptation of text case `security_curve`
    
    * Removed event value comparison
    
    This was introduced for the previous API model adaptation
    
    * Removed the prints in std output and added missing details
    
    `current_error_detail` was not set in every protocol error cases
    
    * Fixed initialization of current_error_detail
    
    * Fixed error in greeting test case
    
    The handshake failure due to mechanism mismatch in greeting is actually
    a protocol error. The error handling method consider it like so and
    send a protocol handshake failure monitoring event instead of no_detail.
    
    Fixed the test_security_curve expectation as well.
    
    * Upgraded tests of monitoring events
    
    The tests check the number of monitoring events received
    
    * Problem: does not build under Linux or without ZMQ_DRAFT_API
    
    Solution:
    - properly use ZMQ_DRAFT_API conditional compilation
    - use receive timeouts instead of Sleep
    
    * Problem: duplicate definition of variable 'timeout'
    
    Solution: merged definitions
    
    * Problem: inconsistent timing dependencies
    
    Solution: reduce timing dependency by using timeouts at more places
    
    * Problem: assertion failure under Linux due to unexpected monitor event
    
    Solution: output event type to aid debugging
    
    * Problem: erroneous assertion code
    
    * Problem: assertion failure with a garbage server key due to an extra third event
    
    Solution: changed assertion to expect three events (needs to be checked)
    
    * Problem: extra include directive to non-existent file
    
    Solution: removed include directive
    
    * Problem: assertion failure on appveyor for unknown reason
    
    Solution: improve debug output
    
    * Problem: no build with libsodium and draft api
    
    Solution: add build configurations with libsodium and draft api
    
    * Problem: assertion failure on CI
    
    Solution: change assertion to reflect actual behaviour on CI (at least temporarily)
    
    * Problem: error in condition in assertion code
    
    * Problem: assertion failure on CI
    
    Solution: generalize assertion to match behavior on CI
    
    * Problem: assertion failures on CI
    
    Solution: removed inconsistent assertion on no monitor events before flushing
    improved debuggability by converting function into macro
    
    * Problem: diverging test code for three analogous test cases with garbage key
    
    Solution: extract common code into function
    
    * Problem: does not build without ZMQ_BUILD_DRAFT_API
    
    Solution: introduce dummy variable
    
    * Attempt to remove workaround regarding ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL again
    
    * Problem: EAGAIN error after handshake complete if there is no more data in inbuffer
    
    Solution: Skip tcp_read attempt in that case
    
    * Problem: handshaking event emitted after handshaking failed
    
    Solution: use stream_engine_t::handshaking instead of mechanism_t::status() to determine whether still handshaking
    
    * Include error code in debug output
    
    * Improve debugging output: output flushed events
    
    * Split up ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL into ZMQ_EVENT_HANDSHAKE_FAILED_ZMTP and ZMQ_EVENT_HANDSHAKE_FAILED_ZAP
    
    * Fixed compilation without ZMQ_BUILD_DRAFT_API
    
    * Renamed ZMQ_EVENT_HANDSHAKE_SUCCEED to ZMQ_EVENT_HANDSHAKE_SUCCEEDED for language consistency
    
    * Renamed ZMQ_EVENT_HANDSHAKE_SUCCEED to ZMQ_EVENT_HANDSHAKE_SUCCEEDED for language consistency
    
    * Renamed ZMQ_EVENT_HANDSHAKE_SUCCEED to ZMQ_EVENT_HANDSHAKE_SUCCEEDED for language consistency
    
    * Fixed assert_monitor_event (require event instead of allowing no event)
    Reverted erroneous change to handshaking condition
    Renamed test_wrong_key to test_garbage_key
    Generalized assumption in test_garbage_key to allow for ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL with error == EPIPE
    
    * Better isolate test cases from each other by providing a fresh context & server for each
    
    * Added diagnostic output
    
    * Changed assertion to reflect actual behavior on CI
    
    * Fixed formatting, observe maximum line length
    
    * Fixed formatting, observe maximum line length
    
    * Increase timeout to check if this fixes valgrind run
    
    * Close server with close_zero_linger
    
    * Increase timeout to check if this fixes valgrind run
    
    * Increase timeout to check if this fixes valgrind run
    
    * Generalize assertion to also work with valgrind
    
    * Fixed formatting
    
    * Add more diagnostic output
    
    * Generalize assertion to also work with valgrind
    5d4e30eb
Name
Last commit
Last update
..
CMakeLists.txt Loading commit data...
README.md Loading commit data...
test_abstract_ipc.cpp Loading commit data...
test_ancillaries.cpp Loading commit data...
test_atomics.cpp Loading commit data...
test_base85.cpp Loading commit data...
test_bind_after_connect_tcp.cpp Loading commit data...
test_bind_src_address.cpp Loading commit data...
test_capabilities.cpp Loading commit data...
test_client_server.cpp Loading commit data...
test_conflate.cpp Loading commit data...
test_connect_delay_tipc.cpp Loading commit data...
test_connect_resolve.cpp Loading commit data...
test_connect_rid.cpp Loading commit data...
test_ctx_destroy.cpp Loading commit data...
test_ctx_options.cpp Loading commit data...
test_dgram.cpp Loading commit data...
test_diffserv.cpp Loading commit data...
test_disconnect_inproc.cpp Loading commit data...
test_filter_ipc.cpp Loading commit data...
test_fork.cpp Loading commit data...
test_getsockopt_memset.cpp Loading commit data...
test_heartbeats.cpp Loading commit data...
test_hwm.cpp Loading commit data...
test_hwm_pubsub.cpp Loading commit data...
test_immediate.cpp Loading commit data...
test_inproc_connect.cpp Loading commit data...
test_invalid_rep.cpp Loading commit data...
test_iov.cpp Loading commit data...
test_ipc_wildcard.cpp Loading commit data...
test_issue_566.cpp Loading commit data...
test_last_endpoint.cpp Loading commit data...
test_many_sockets.cpp Loading commit data...
test_metadata.cpp Loading commit data...
test_monitor.cpp Loading commit data...
test_msg_ffn.cpp Loading commit data...
test_msg_flags.cpp Loading commit data...
test_pair_inproc.cpp Loading commit data...
test_pair_ipc.cpp Loading commit data...
test_pair_tcp.cpp Loading commit data...
test_pair_tipc.cpp Loading commit data...
test_pair_vmci.cpp Loading commit data...
test_poller.cpp Loading commit data...
test_probe_router.cpp Loading commit data...
test_proxy.cpp Loading commit data...
test_proxy_single_socket.cpp Loading commit data...
test_proxy_terminate.cpp Loading commit data...
test_pub_invert_matching.cpp Loading commit data...
test_radio_dish.cpp Loading commit data...
test_req_correlate.cpp Loading commit data...
test_req_relaxed.cpp Loading commit data...
test_reqrep_device.cpp Loading commit data...
test_reqrep_device_tipc.cpp Loading commit data...
test_reqrep_inproc.cpp Loading commit data...
test_reqrep_ipc.cpp Loading commit data...
test_reqrep_tcp.cpp Loading commit data...
test_reqrep_tipc.cpp Loading commit data...
test_reqrep_vmci.cpp Loading commit data...
test_router_handover.cpp Loading commit data...
test_router_mandatory.cpp Loading commit data...
test_router_mandatory_hwm.cpp Loading commit data...
test_router_mandatory_tipc.cpp Loading commit data...
test_scatter_gather.cpp Loading commit data...
test_security_curve.cpp Loading commit data...
test_security_gssapi.cpp Loading commit data...
test_security_null.cpp Loading commit data...
test_security_plain.cpp Loading commit data...
test_setsockopt.cpp Loading commit data...
test_shutdown_stress.cpp Loading commit data...
test_shutdown_stress_tipc.cpp Loading commit data...
test_sockopt_hwm.cpp Loading commit data...
test_sodium.cpp Loading commit data...
test_spec_dealer.cpp Loading commit data...
test_spec_pushpull.cpp Loading commit data...
test_spec_rep.cpp Loading commit data...
test_spec_req.cpp Loading commit data...
test_spec_router.cpp Loading commit data...
test_srcfd.cpp Loading commit data...
test_stream.cpp Loading commit data...
test_stream_disconnect.cpp Loading commit data...
test_stream_empty.cpp Loading commit data...
test_stream_exceeds_buffer.cpp Loading commit data...
test_stream_timeout.cpp Loading commit data...
test_sub_forward.cpp Loading commit data...
test_sub_forward_tipc.cpp Loading commit data...
test_system.cpp Loading commit data...
test_term_endpoint.cpp Loading commit data...
test_term_endpoint_tipc.cpp Loading commit data...
test_thread_safe.cpp Loading commit data...
test_timeo.cpp Loading commit data...
test_timers.cpp Loading commit data...
test_udp.cpp Loading commit data...
test_unbind_inproc.cpp Loading commit data...
test_unbind_wildcard.cpp Loading commit data...
test_use_fd_ipc.cpp Loading commit data...
test_use_fd_tcp.cpp Loading commit data...
test_xpub_manual.cpp Loading commit data...
test_xpub_nodrop.cpp Loading commit data...
test_xpub_welcome_msg.cpp Loading commit data...
test_zmq_poll_fd.cpp Loading commit data...
testutil.hpp Loading commit data...