Go to file
Simon Giesecke 5d4e30eb13 Replace console output by monitoring events for curve security issues (#2645)
* 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
2017-08-03 14:15:56 +01:00
.github Problem: contributing guidelines unclear for new devs 2016-12-18 11:46:08 +00:00
builds Add socket option BINDTODEVICE 2017-07-31 15:31:47 +01:00
doc Add socket option BINDTODEVICE 2017-07-31 15:31:47 +01:00
include Replace console output by monitoring events for curve security issues (#2645) 2017-08-03 14:15:56 +01:00
m4 Problem: Coverage option broken with LLVM GCOV 2016-05-09 13:27:41 +01:00
packaging Problem: OBS _service sets version to unix timestamp.commitid 2017-04-29 13:08:25 +01:00
perf Merge pull request #1764 from GreatFruitOmsk/master 2016-02-03 16:21:53 +01:00
RELICENSE add license grant for minrk 2017-07-17 13:57:53 +02:00
src Replace console output by monitoring events for curve security issues (#2645) 2017-08-03 14:15:56 +01:00
tests Replace console output by monitoring events for curve security issues (#2645) 2017-08-03 14:15:56 +01:00
tools Problem: copyright year is still 2015 2016-01-28 15:07:31 +01:00
.gitignore Problem: no mixed FD and zmq socket zmq_poll test 2016-12-15 12:03:48 +00:00
.hgeol Line-ending conversion rules for hg-git users and enabled use of .gitignore by hg-git users 2011-11-19 10:02:23 +01:00
.mailmap Fix mailmap entry for Max Skaller 2015-12-11 15:26:42 +01:00
.travis.yml Replace console output by monitoring events for curve security issues (#2645) 2017-08-03 14:15:56 +01:00
acinclude.m4 Add socket option BINDTODEVICE 2017-07-31 15:31:47 +01:00
appveyor.yml appveyor: Use correct CURVE security options 2017-04-05 08:57:48 +02:00
AUTHORS Problem: not on the authors list 2017-03-21 19:07:15 +01:00
autogen.sh Fix small typo 2016-11-04 14:21:33 +01:00
branding.bmp Add ZeroMQ branding. 2012-06-12 21:30:24 -04:00
ci_build.sh Problem: ASAN test doesn't print good traces with GCC 4.8 2017-05-01 22:57:05 +01:00
ci_deploy.sh Problem: no way to deploy releases to OBS 2017-04-30 16:15:15 +01:00
CMakeLists.txt Add socket option BINDTODEVICE 2017-07-31 15:31:47 +01:00
configure.ac Add socket option BINDTODEVICE 2017-07-31 15:31:47 +01:00
COPYING missing COPYING file added 2010-02-16 17:50:36 +01:00
COPYING.LESSER Added note about tivotisation 2013-07-29 10:42:15 +02:00
Dockerfile Add Docker support 2014-07-11 22:42:55 -03:00
Doxygen.cfg Problem: No default doxygen cfg for ZeroMQ project 2016-04-28 14:14:38 +01:00
FindSodium.cmake CMake: use libsodium if available, else use tweet_nacl 2015-10-23 04:06:57 +02:00
INSTALL Problem: using Wine requires system tuning 2017-07-31 15:59:39 +01:00
installer.ico Add ZeroMQ branding. 2012-06-12 21:30:24 -04:00
Makefile.am Problem: test_many_sockets is flacky on OSX 2017-05-01 22:57:05 +01:00
NEWS Problem: 4.2.2 is out, version(s) are out of date 2017-02-18 17:56:55 +00:00
README.cygwin.md Implement a definitive cygwin target for libzmq. 2014-12-29 17:39:19 -05:00
README.doxygen.md Problem: No default doxygen cfg for ZeroMQ project 2016-04-28 14:14:38 +01:00
README.md Problem: no coveralls.io badge in README.md 2016-03-13 22:23:56 +00:00
version.sh m4_esyscmd_s doesnt seem to be portable across different systems 2011-02-07 15:06:20 +01:00
ZeroMQConfig.cmake.in cmake: Use LOCATION property only for imported targets 2017-04-05 11:26:13 +02:00

ZeroMQ

Build Status Build status Coverage Status

Welcome

The ZeroMQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by specialised messaging middleware products. ZeroMQ sockets provide an abstraction of asynchronous message queues, multiple messaging patterns, message filtering (subscriptions), seamless access to multiple transport protocols and more.

Building and installation

See the INSTALL file included with the distribution.

Resources

Extensive documentation is provided with the distribution. Refer to doc/zmq.html, or "man zmq" after you have installed libzmq on your system.

Website: http://www.zeromq.org/

Development mailing list: zeromq-dev@lists.zeromq.org Announcements mailing list: zeromq-announce@lists.zeromq.org

Git repository: http://github.com/zeromq/libzmq

ZeroMQ developers can also be found on the IRC channel #zeromq, on the Freenode network (irc.freenode.net).

License

The project license is specified in COPYING and COPYING.LESSER.

libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library.

libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.