test_security_curve.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MPL-2.0 */
2 
3 // TODO remove this workaround for handling libsodium
4 
5 // To define SIZE_MAX with older compilers
6 #define __STDC_LIMIT_MACROS
7 
8 #if defined ZMQ_CUSTOM_PLATFORM_HPP
9 #include "platform.hpp"
10 #else
11 #include "../src/platform.hpp"
12 #endif
13 
14 #ifndef ZMQ_USE_LIBSODIUM
15 #define ZMQ_USE_LIBSODIUM
16 #endif
17 
18 #include "testutil.hpp"
19 #include "testutil_security.hpp"
20 #include <unity.h>
21 
22 #include "../src/curve_client_tools.hpp"
23 #include "../src/random.hpp"
24 
26 
27 void *handler;
28 void *zap_thread;
29 void *server;
30 void *server_mon;
32 
33 void setUp ()
34 {
37  my_endpoint);
38 }
39 
40 void tearDown ()
41 {
44 }
45 
46 const int timeout = 250;
47 
48 const char large_routing_id[] = "0123456789012345678901234567890123456789"
49  "0123456789012345678901234567890123456789"
50  "0123456789012345678901234567890123456789"
51  "0123456789012345678901234567890123456789"
52  "0123456789012345678901234567890123456789"
53  "0123456789012345678901234567890123456789"
54  "012345678901234";
55 
56 static void zap_handler_large_routing_id (void * /*unused_*/)
57 {
59 }
60 
61 void expect_new_client_curve_bounce_fail (const char *server_public_,
62  const char *client_public_,
63  const char *client_secret_,
64  char *my_endpoint_,
65  void *server_,
66  void **client_mon_ = NULL,
67  int expected_client_event_ = 0,
68  int expected_client_value_ = 0)
69 {
70  curve_client_data_t curve_client_data = {server_public_, client_public_,
71  client_secret_};
73  my_endpoint_, server_, socket_config_curve_client, &curve_client_data,
74  client_mon_, expected_client_event_, expected_client_value_);
75 }
76 
77 void test_null_key (void *server_,
78  void *server_mon_,
79  char *my_endpoint_,
80  char *server_public_,
81  char *client_public_,
82  char *client_secret_)
83 {
84  expect_new_client_curve_bounce_fail (server_public_, client_public_,
85  client_secret_, my_endpoint_, server_);
86 
87  int handshake_failed_encryption_event_count =
88  expect_monitor_event_multiple (server_mon_,
91 
92  // handshake_failed_encryption_event_count should be at least two because
93  // expect_bounce_fail involves two exchanges
94  // however, with valgrind we see only one event (maybe the next one takes
95  // very long, or does not happen at all because something else takes very
96  // long)
97 
98  fprintf (stderr,
99  "count of "
100  "ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL/"
101  "ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC events: %i\n",
102  handshake_failed_encryption_event_count);
103 }
104 
106 {
109  void *client_mon;
112  bounce (server, client);
114 
117 
119 
120  event = get_monitor_event_with_timeout (client_mon, NULL, NULL, -1);
122 
124 
125  test_context_socket_close (client_mon);
126 }
127 
129 {
130  // This must be caught by the ZAP handler
131  char bogus_public[41];
132  char bogus_secret[41];
133  zmq_curve_keypair (bogus_public, bogus_secret);
134 
136  valid_server_public, bogus_public, bogus_secret, my_endpoint, server,
138 
139  int server_event_count = 0;
140  server_event_count = expect_monitor_event_multiple (
142  TEST_ASSERT_LESS_OR_EQUAL_INT (1, server_event_count);
143 
144  // there may be more than one ZAP request due to repeated attempts by the client
145  TEST_ASSERT (0 == server_event_count
147 }
148 
149 void expect_zmtp_mechanism_mismatch (void *client_,
150  char *my_endpoint_,
151  void *server_,
152  void *server_mon_)
153 {
154  // This must be caught by the curve_server class, not passed to ZAP
155  TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (client_, my_endpoint_));
156  expect_bounce_fail (server_, client_);
158 
159  expect_monitor_event_multiple (server_mon_,
162 
164 }
165 
167 {
169 
171 }
172 
174 {
177  zmq_setsockopt (client, ZMQ_PLAIN_USERNAME, "admin", 5));
179  zmq_setsockopt (client, ZMQ_PLAIN_PASSWORD, "password", 8));
180 
182 }
183 
185 {
186  // Unauthenticated messages from a vanilla socket shouldn't be received
188  // send anonymous ZMTP/1.0 greeting
189  send (s, "\x01\x00", 2, 0);
190  // send sneaky message that shouldn't be received
191  send (s, "\x08\x00sneaky\0", 9, 0);
192 
194  char *buf = s_recv (server);
195  TEST_ASSERT_NULL_MESSAGE (buf, "Received unauthenticated message");
196  close (s);
197 }
198 
199 void send_all (fd_t fd_, const char *data_, socket_size_t size_)
200 {
201  while (size_ > 0) {
202  int res = send (fd_, data_, size_, 0);
204  size_ -= res;
205  data_ += res;
206  }
207 }
208 
209 template <size_t N> void send (fd_t fd_, const char (&data_)[N])
210 {
211  send_all (fd_, data_, N - 1);
212 }
213 
214 template <size_t N> void send (fd_t fd_, const uint8_t (&data_)[N])
215 {
216  send_all (fd_, reinterpret_cast<const char *> (&data_), N);
217 }
218 
220 {
222 
224 
225  // send CURVE HELLO of wrong size
226  send (s, "\x04\x06\x05HELLO");
227 
231 
232  close (s);
233 }
234 
235 const size_t hello_length = 200;
236 const size_t welcome_length = 168;
237 
238 zmq::curve_client_tools_t make_curve_client_tools ()
239 {
240  uint8_t valid_client_secret_decoded[32];
241  uint8_t valid_client_public_decoded[32];
242 
243  zmq_z85_decode (valid_client_public_decoded, valid_client_public);
244  zmq_z85_decode (valid_client_secret_decoded, valid_client_secret);
245 
246  uint8_t valid_server_public_decoded[32];
247  zmq_z85_decode (valid_server_public_decoded, valid_server_public);
248 
249  return zmq::curve_client_tools_t (valid_client_public_decoded,
250  valid_client_secret_decoded,
251  valid_server_public_decoded);
252 }
253 
254 // same as htonll, which is only available on few platforms (recent Windows, but not on Linux, e.g.(
255 static uint64_t host_to_network (uint64_t value_)
256 {
257  // The answer is 42
258  static const int num = 42;
259 
260  // Check the endianness
261  if (*reinterpret_cast<const char *> (&num) == num) {
262  const uint32_t high_part = htonl (static_cast<uint32_t> (value_ >> 32));
263  const uint32_t low_part =
264  htonl (static_cast<uint32_t> (value_ & 0xFFFFFFFFLL));
265 
266  return (static_cast<uint64_t> (low_part) << 32) | high_part;
267  }
268  return value_;
269 }
270 
271 template <size_t N> void send_command (fd_t s_, char (&command_)[N])
272 {
273  if (N < 256) {
274  send (s_, "\x04");
275  char len = (char) N;
276  send_all (s_, &len, 1);
277  } else {
278  send (s_, "\x06");
279  uint64_t len = host_to_network (N);
280  send_all (s_, reinterpret_cast<char *> (&len), 8);
281  }
282  send_all (s_, command_, N);
283 }
284 
286 {
288 
290 
291  zmq::curve_client_tools_t tools = make_curve_client_tools ();
292 
293  // send CURVE HELLO with a misspelled command name (but otherwise correct)
294  char hello[hello_length];
295  TEST_ASSERT_SUCCESS_ERRNO (tools.produce_hello (hello, 0));
296  hello[5] = 'X';
297 
298  send_command (s, hello);
299 
303 
304  close (s);
305 }
306 
308 {
310 
312 
313  zmq::curve_client_tools_t tools = make_curve_client_tools ();
314 
315  // send CURVE HELLO with a wrong version number (but otherwise correct)
316  char hello[hello_length];
317  TEST_ASSERT_SUCCESS_ERRNO (tools.produce_hello (hello, 0));
318  hello[6] = 2;
319 
320  send_command (s, hello);
321 
325 
326  close (s);
327 }
328 
329 void flush_read (fd_t fd_)
330 {
331  int res;
332  char buf[256];
333 
334  while ((res = recv (fd_, buf, 256, 0)) == 256) {
335  }
336  TEST_ASSERT_NOT_EQUAL (-1, res);
337 }
338 
339 void recv_all (fd_t fd_, uint8_t *data_, socket_size_t len_)
340 {
341  socket_size_t received = 0;
342  while (received < len_) {
343  int res = recv (fd_, reinterpret_cast<char *> (data_), len_, 0);
345 
346  data_ += res;
347  received += res;
348  }
349 }
350 
351 void recv_greeting (fd_t fd_)
352 {
353  uint8_t greeting[64];
354  recv_all (fd_, greeting, 64);
355  // TODO assert anything about the greeting received from the server?
356 }
357 
359  char *my_endpoint_, zmq::curve_client_tools_t &tools_)
360 {
361  fd_t s = connect_socket (my_endpoint_);
362 
364  recv_greeting (s);
365 
366  // send valid CURVE HELLO
367  char hello[hello_length];
368  TEST_ASSERT_SUCCESS_ERRNO (tools_.produce_hello (hello, 0));
369 
370  send_command (s, hello);
371  return s;
372 }
373 
375 {
376  zmq::curve_client_tools_t tools = make_curve_client_tools ();
377 
379 
380  // receive but ignore WELCOME
381  flush_read (s);
382 
384  TEST_ASSERT_EQUAL_INT (-1, res);
385 
386  send (s, "\x04\x09\x08INITIATE");
387 
391 
392  close (s);
393 }
394 
396  char *my_endpoint_,
397  void *server_mon_,
398  int timeout_,
399  zmq::curve_client_tools_t &tools_)
400 {
401  fd_t s = connect_exchange_greeting_and_send_hello (my_endpoint_, tools_);
402 
403  // receive but ignore WELCOME
404  uint8_t welcome[welcome_length + 2];
405  recv_all (s, welcome, welcome_length + 2);
406 
407  uint8_t cn_precom[crypto_box_BEFORENMBYTES];
409  tools_.process_welcome (welcome + 2, welcome_length, cn_precom));
410 
411  const int res =
412  get_monitor_event_with_timeout (server_mon_, NULL, NULL, timeout_);
413  TEST_ASSERT_EQUAL_INT (-1, res);
414 
415  return s;
416 }
417 
419 {
420  zmq::curve_client_tools_t tools = make_curve_client_tools ();
422  my_endpoint, server_mon, timeout, tools);
423 
424  char initiate[257];
425  tools.produce_initiate (initiate, 257, 1, NULL, 0);
426  // modify command name
427  initiate[5] = 'X';
428 
429  send_command (s, initiate);
430 
434 
435  close (s);
436 }
437 
439 {
440  zmq::curve_client_tools_t tools = make_curve_client_tools ();
442  my_endpoint, server_mon, timeout, tools);
443 
444  char initiate[257];
445  tools.produce_initiate (initiate, 257, 1, NULL, 0);
446  // make garbage from encrypted cookie
447  initiate[30] = !initiate[30];
448 
449  send_command (s, initiate);
450 
454 
455  close (s);
456 }
457 
459 {
460  zmq::curve_client_tools_t tools = make_curve_client_tools ();
462  my_endpoint, server_mon, timeout, tools);
463 
464  char initiate[257];
465  tools.produce_initiate (initiate, 257, 1, NULL, 0);
466  // make garbage from encrypted content
467  initiate[150] = !initiate[150];
468 
469  send_command (s, initiate);
470 
474 
475  close (s);
476 }
477 
479 {
480  // Check return codes for invalid buffer sizes
481  void *client = zmq_socket (ctx_, ZMQ_DEALER);
483  errno = 0;
484  int rc =
486  assert (rc == -1 && errno == EINVAL);
487  errno = 0;
489  assert (rc == -1 && errno == EINVAL);
490  errno = 0;
492  assert (rc == -1 && errno == EINVAL);
494 }
495 
496 // TODO why isn't this const?
497 char null_key[] = "0000000000000000000000000000000000000000";
498 
500 {
501  // Check CURVE security with a null server key
502  // This will be caught by the curve_server class, not passed to ZAP
505 }
506 
508 {
509  // Check CURVE security with a null client public key
510  // This will be caught by the curve_server class, not passed to ZAP
513 }
514 
516 {
517  // Check CURVE security with a null client public key
518  // This will be caught by the curve_server class, not passed to ZAP
521 }
522 
523 
524 int main (void)
525 {
526  if (!zmq_has ("curve")) {
527  printf ("CURVE encryption not installed, skipping test\n");
528  return 0;
529  }
530 
531  zmq::random_open ();
532 
534 
535 
537 
538  UNITY_BEGIN ();
547 
548  // tests with misbehaving CURVE client
556 
557  // TODO this requires a deviating test setup, must be moved to a separate executable/fixture
558  // test with a large routing id (resulting in large metadata)
559  fprintf (stderr,
560  "test_curve_security_with_valid_credentials (large routing id)\n");
569 
570  void *ctx = zmq_ctx_new ();
573 
575 
576  return UNITY_END ();
577 }
flush_read
void flush_read(fd_t fd_)
Definition: test_security_curve.cpp:329
bounce
static void bounce(void *socket_)
Definition: test_req_relaxed.cpp:50
curve_client_data_t
Definition: testutil_security.hpp:35
ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE
#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE
Definition: zmq.h:431
zmq::random_open
void random_open()
Definition: random.cpp:59
test_null_client_secret_key
void test_null_client_secret_key()
Definition: test_security_curve.cpp:515
TEST_ASSERT_LESS_OR_EQUAL_INT
#define TEST_ASSERT_LESS_OR_EQUAL_INT(threshold, actual)
Definition: unity.h:201
data_
StringPiece data_
Definition: bytestream_unittest.cc:60
test_curve_security_invalid_keysize
void test_curve_security_invalid_keysize(void *ctx_)
Definition: test_security_curve.cpp:478
test_curve_security_invalid_hello_wrong_length
void test_curve_security_invalid_hello_wrong_length()
Definition: test_security_curve.cpp:219
setUp
void setUp()
Definition: test_security_curve.cpp:33
expect_new_client_bounce_fail
void expect_new_client_bounce_fail(char *my_endpoint_, void *server_, socket_config_fn socket_config_, void *socket_config_data_, void **client_mon_, int expected_client_event_, int expected_client_value_)
Definition: testutil_security.cpp:362
test_null_client_public_key
void test_null_client_public_key()
Definition: test_security_curve.cpp:507
ZMQ_EVENT_HANDSHAKE_FAILED_AUTH
#define ZMQ_EVENT_HANDSHAKE_FAILED_AUTH
Definition: zmq.h:423
zmq_z85_decode
ZMQ_EXPORT uint8_t * zmq_z85_decode(uint8_t *dest_, const char *string_)
Definition: zmq_utils.cpp:135
zap_ok
@ zap_ok
Definition: testutil_security.hpp:50
ZMQ_PLAIN_USERNAME
#define ZMQ_PLAIN_USERNAME
Definition: zmq.h:310
NULL
NULL
Definition: test_security_zap.cpp:405
UNITY_END
return UNITY_END()
ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND
#define ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND
Definition: zmq.h:425
test_null_server_key
void test_null_server_key()
Definition: test_security_curve.cpp:499
EINVAL
#define EINVAL
Definition: errno.hpp:25
setup_context_and_server_side
void setup_context_and_server_side(void **zap_control_, void **zap_thread_, void **server_, void **server_mon_, char *my_endpoint_, zmq_thread_fn zap_handler_, socket_config_fn socket_config_, void *socket_config_data_, const char *routing_id_)
Definition: testutil_security.cpp:264
s
XmlRpcServer s
ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC
#define ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC
Definition: zmq.h:437
RUN_TEST
#define RUN_TEST(func)
Definition: unity_internals.h:615
zmq_ctx_new
ZMQ_EXPORT void * zmq_ctx_new(void)
Definition: zmq.cpp:109
ZMQ_CURVE_SECRETKEY
#define ZMQ_CURVE_SECRETKEY
Definition: zmq.h:314
get_monitor_event_with_timeout
int get_monitor_event_with_timeout(void *monitor_, int *value_, char **address_, int timeout_)
Definition: testutil_monitoring.cpp:60
expect_zmtp_mechanism_mismatch
void expect_zmtp_mechanism_mismatch(void *client_, char *my_endpoint_, void *server_, void *server_mon_)
Definition: test_security_curve.cpp:149
test_curve_security_invalid_initiate_command_encrypted_content
void test_curve_security_invalid_initiate_command_encrypted_content()
Definition: test_security_curve.cpp:458
zap_handler_generic
void zap_handler_generic(zap_protocol_t zap_protocol_, const char *expected_routing_id_)
Definition: testutil_security.cpp:98
zmq_has
ZMQ_EXPORT int zmq_has(const char *capability_)
Definition: zmq.cpp:1763
testutil_security.hpp
ZMQ_PLAIN_PASSWORD
#define ZMQ_PLAIN_PASSWORD
Definition: zmq.h:311
setup_test_context
void setup_test_context()
Definition: testutil_unity.cpp:179
ZMQ_CURVE_SERVERKEY
#define ZMQ_CURVE_SERVERKEY
Definition: zmq.h:315
test_curve_security_invalid_initiate_command_name
void test_curve_security_invalid_initiate_command_name()
Definition: test_security_curve.cpp:418
large_routing_id
const char large_routing_id[]
Definition: test_security_curve.cpp:48
errno
int errno
teardown_test_context
void teardown_test_context()
Definition: testutil_unity.cpp:189
client
void client(int num)
Definition: test_multithread.cpp:134
send
void send(fd_t fd_, const char(&data_)[N])
Definition: test_security_curve.cpp:209
curve_client_data
static NULL curve_client_data_t curve_client_data
Definition: test_security_zap.cpp:407
test_context_socket_close_zero_linger
void * test_context_socket_close_zero_linger(void *socket_)
Definition: testutil_unity.cpp:215
s_recv
char * s_recv(void *socket_)
Definition: testutil.cpp:123
TEST_ASSERT
#define TEST_ASSERT(condition)
Definition: unity.h:120
zmq_connect
ZMQ_EXPORT int zmq_connect(void *s_, const char *addr_)
Definition: zmq.cpp:307
TEST_ASSERT_NOT_EQUAL
#define TEST_ASSERT_NOT_EQUAL(expected, actual)
Definition: unity.h:134
hello_length
const size_t hello_length
Definition: test_security_curve.cpp:235
send_all
void send_all(fd_t fd_, const char *data_, socket_size_t size_)
Definition: test_security_curve.cpp:199
test_curve_security_invalid_hello_command_name
void test_curve_security_invalid_hello_command_name()
Definition: test_security_curve.cpp:285
zmq::random_close
void random_close()
Definition: random.cpp:64
socket_size_t
size_t socket_size_t
Definition: libzmq/tests/testutil.hpp:90
connect_exchange_greeting_and_hello_welcome
fd_t connect_exchange_greeting_and_hello_welcome(char *my_endpoint_, void *server_mon_, int timeout_, zmq::curve_client_tools_t &tools_)
Definition: test_security_curve.cpp:395
expect_new_client_curve_bounce_fail
void expect_new_client_curve_bounce_fail(const char *server_public_, const char *client_public_, const char *client_secret_, char *my_endpoint_, void *server_, void **client_mon_=NULL, int expected_client_event_=0, int expected_client_value_=0)
Definition: test_security_curve.cpp:61
TEST_ASSERT_GREATER_THAN_INT
#define TEST_ASSERT_GREATER_THAN_INT(threshold, actual)
Definition: unity.h:153
ZMQ_PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH
#define ZMQ_PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH
Definition: zmq.h:438
valid_server_secret
char valid_server_secret[41]
Definition: testutil_security.cpp:55
ZMQ_EVENT_HANDSHAKE_SUCCEEDED
#define ZMQ_EVENT_HANDSHAKE_SUCCEEDED
Definition: zmq.h:417
ZMQ_DEALER
#define ZMQ_DEALER
Definition: zmq.h:263
test_curve_security_unauthenticated_message
void test_curve_security_unauthenticated_message()
Definition: test_security_curve.cpp:184
test_curve_security_with_valid_credentials
void test_curve_security_with_valid_credentials()
Definition: test_security_curve.cpp:105
zmq_setsockopt
ZMQ_EXPORT int zmq_setsockopt(void *s_, int option_, const void *optval_, size_t optvallen_)
Definition: zmq.cpp:250
event
struct _cl_event * event
Definition: glcorearb.h:4163
socket_config_curve_server
void socket_config_curve_server(void *server_, void *server_secret_)
Definition: testutil_security.cpp:66
recv_greeting
void recv_greeting(fd_t fd_)
Definition: test_security_curve.cpp:351
connect_exchange_greeting_and_send_hello
fd_t connect_exchange_greeting_and_send_hello(char *my_endpoint_, zmq::curve_client_tools_t &tools_)
Definition: test_security_curve.cpp:358
assert_no_more_monitor_events_with_timeout
#define assert_no_more_monitor_events_with_timeout(monitor, timeout)
Definition: testutil_security.hpp:75
testutil.hpp
test_null_key
void test_null_key(void *server_, void *server_mon_, char *my_endpoint_, char *server_public_, char *client_public_, char *client_secret_)
Definition: test_security_curve.cpp:77
s_
std::string s_
Definition: gmock-matchers_test.cc:4128
valid_client_public
char valid_client_public[41]
Definition: testutil_security.cpp:52
connect_socket
fd_t connect_socket(const char *endpoint_, const int af_, const int protocol_)
Definition: testutil.cpp:353
shutdown_context_and_server_side
void shutdown_context_and_server_side(void *zap_thread_, void *server_, void *server_mon_, void *zap_control_, bool zap_handler_stopped_)
Definition: testutil_security.cpp:314
my_endpoint
char my_endpoint[MAX_SOCKET_STRING]
Definition: test_security_curve.cpp:31
MAX_SOCKET_STRING
#define MAX_SOCKET_STRING
Definition: libzmq/tests/testutil.hpp:35
recv_all
void recv_all(fd_t fd_, uint8_t *data_, socket_size_t len_)
Definition: test_security_curve.cpp:339
timeout
GLbitfield GLuint64 timeout
Definition: glcorearb.h:3588
zmq_socket
ZMQ_EXPORT void * zmq_socket(void *, int type_)
Definition: zmq.cpp:230
host_to_network
static uint64_t host_to_network(uint64_t value_)
Definition: test_security_curve.cpp:255
test_context_socket
void * test_context_socket(int type_)
Definition: testutil_unity.cpp:200
server
void * server
Definition: test_security_curve.cpp:29
test_curve_security_invalid_hello_version
void test_curve_security_invalid_hello_version()
Definition: test_security_curve.cpp:307
send_command
void send_command(fd_t s_, char(&command_)[N])
Definition: test_security_curve.cpp:271
buf
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:4175
zap_handler_large_routing_id
static void zap_handler_large_routing_id(void *)
Definition: test_security_curve.cpp:56
TEST_ASSERT_EQUAL_INT
#define TEST_ASSERT_EQUAL_INT(expected, actual)
Definition: unity.h:128
error_message_buffer
char error_message_buffer[256]
Definition: test_security_curve.cpp:25
TEST_ASSERT_NULL_MESSAGE
#define TEST_ASSERT_NULL_MESSAGE(pointer, message)
Definition: unity.h:316
zmq_close
ZMQ_EXPORT int zmq_close(void *s_)
Definition: zmq.cpp:241
zmq_curve_keypair
ZMQ_EXPORT int zmq_curve_keypair(char *z85_public_key_, char *z85_secret_key_)
Definition: zmq_utils.cpp:190
value_
int value_
Definition: gmock-matchers_test.cc:571
unity.h
expect_bounce_fail
void expect_bounce_fail(void *server_, void *client_)
Definition: testutil.cpp:107
len
int len
Definition: php/ext/google/protobuf/map.c:206
server_mon
void * server_mon
Definition: test_security_curve.cpp:30
zmtp_greeting_curve
const uint8_t zmtp_greeting_curve[64]
Definition: libzmq/tests/testutil.hpp:53
ZMQ_RCVTIMEO
#define ZMQ_RCVTIMEO
Definition: zmq.h:296
create_and_connect_client
void * create_and_connect_client(char *my_endpoint_, socket_config_fn socket_config_, void *socket_config_data_, void **client_mon_)
Definition: testutil_security.cpp:338
expect_monitor_event_multiple
int expect_monitor_event_multiple(void *server_mon_, int expected_event_, int expected_err_, bool optional_)
Definition: testutil_monitoring.cpp:127
test_curve_security_with_bogus_client_credentials
void test_curve_security_with_bogus_client_credentials()
Definition: test_security_curve.cpp:128
test_curve_security_with_null_client_credentials
void test_curve_security_with_null_client_credentials()
Definition: test_security_curve.cpp:166
zmq_atomic_counter_value
ZMQ_EXPORT int zmq_atomic_counter_value(void *counter_)
Definition: zmq_utils.cpp:286
null_key
char null_key[]
Definition: test_security_curve.cpp:497
test_curve_security_with_plain_client_credentials
void test_curve_security_with_plain_client_credentials()
Definition: test_security_curve.cpp:173
valid_server_public
char valid_server_public[41]
Definition: testutil_security.cpp:54
setup_test_environment
void setup_test_environment(int timeout_seconds_)
Definition: testutil.cpp:201
UNITY_BEGIN
UNITY_BEGIN()
valid_client_secret
char valid_client_secret[41]
Definition: testutil_security.cpp:53
fd_t
zmq_fd_t fd_t
Definition: libzmq/tests/testutil.hpp:98
ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL
#define ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL
Definition: zmq.h:420
socket_config_curve_client
void socket_config_curve_client(void *client_, void *data_)
Definition: testutil_security.cpp:83
handler
void * handler
Definition: test_security_curve.cpp:27
main
int main(void)
Definition: test_security_curve.cpp:524
test_curve_security_invalid_initiate_wrong_length
void test_curve_security_invalid_initiate_wrong_length()
Definition: test_security_curve.cpp:374
greeting
static zmtp_greeting_t greeting
Definition: test_stream.cpp:27
tearDown
void tearDown()
Definition: test_security_curve.cpp:40
make_curve_client_tools
zmq::curve_client_tools_t make_curve_client_tools()
Definition: test_security_curve.cpp:238
welcome_length
const size_t welcome_length
Definition: test_security_curve.cpp:236
ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO
#define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO
Definition: zmq.h:430
zap_thread
void * zap_thread
Definition: test_security_curve.cpp:28
zmq_ctx_term
ZMQ_EXPORT int zmq_ctx_term(void *context_)
Definition: zmq.cpp:128
test_context_socket_close
void * test_context_socket_close(void *socket_)
Definition: testutil_unity.cpp:208
TEST_ASSERT_NOT_NULL
#define TEST_ASSERT_NOT_NULL(pointer)
Definition: unity.h:125
TEST_ASSERT_SUCCESS_ERRNO
#define TEST_ASSERT_SUCCESS_ERRNO(expr)
Definition: proxy_thr.cpp:47
ZMQ_CURVE_PUBLICKEY
#define ZMQ_CURVE_PUBLICKEY
Definition: zmq.h:313
test_curve_security_invalid_initiate_command_encrypted_cookie
void test_curve_security_invalid_initiate_command_encrypted_cookie()
Definition: test_security_curve.cpp:438
setup_testutil_security_curve
void setup_testutil_security_curve()
Definition: testutil_security.cpp:57
zap_requests_handled
void * zap_requests_handled
Definition: testutil_security.cpp:96


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:59