Macros | Functions | Variables
test_security_curve.cpp File Reference
#include "../src/platform.hpp"
#include "testutil.hpp"
#include "testutil_security.hpp"
#include <unity.h>
#include "../src/curve_client_tools.hpp"
#include "../src/random.hpp"
Include dependency graph for test_security_curve.cpp:

Go to the source code of this file.

Macros

#define __STDC_LIMIT_MACROS
 
#define ZMQ_USE_LIBSODIUM
 

Functions

fd_t connect_exchange_greeting_and_hello_welcome (char *my_endpoint_, void *server_mon_, int timeout_, zmq::curve_client_tools_t &tools_)
 
fd_t connect_exchange_greeting_and_send_hello (char *my_endpoint_, zmq::curve_client_tools_t &tools_)
 
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)
 
void expect_zmtp_mechanism_mismatch (void *client_, char *my_endpoint_, void *server_, void *server_mon_)
 
void flush_read (fd_t fd_)
 
static uint64_t host_to_network (uint64_t value_)
 
int main (void)
 
zmq::curve_client_tools_t make_curve_client_tools ()
 
void recv_all (fd_t fd_, uint8_t *data_, socket_size_t len_)
 
void recv_greeting (fd_t fd_)
 
template<size_t N>
void send (fd_t fd_, const char(&data_)[N])
 
template<size_t N>
void send (fd_t fd_, const uint8_t(&data_)[N])
 
void send_all (fd_t fd_, const char *data_, socket_size_t size_)
 
template<size_t N>
void send_command (fd_t s_, char(&command_)[N])
 
void setUp ()
 
void tearDown ()
 
void test_curve_security_invalid_hello_command_name ()
 
void test_curve_security_invalid_hello_version ()
 
void test_curve_security_invalid_hello_wrong_length ()
 
void test_curve_security_invalid_initiate_command_encrypted_content ()
 
void test_curve_security_invalid_initiate_command_encrypted_cookie ()
 
void test_curve_security_invalid_initiate_command_name ()
 
void test_curve_security_invalid_initiate_wrong_length ()
 
void test_curve_security_invalid_keysize (void *ctx_)
 
void test_curve_security_unauthenticated_message ()
 
void test_curve_security_with_bogus_client_credentials ()
 
void test_curve_security_with_null_client_credentials ()
 
void test_curve_security_with_plain_client_credentials ()
 
void test_curve_security_with_valid_credentials ()
 
void test_null_client_public_key ()
 
void test_null_client_secret_key ()
 
void test_null_key (void *server_, void *server_mon_, char *my_endpoint_, char *server_public_, char *client_public_, char *client_secret_)
 
void test_null_server_key ()
 
static void zap_handler_large_routing_id (void *)
 

Variables

char error_message_buffer [256]
 
voidhandler
 
const size_t hello_length = 200
 
const char large_routing_id []
 
char my_endpoint [MAX_SOCKET_STRING]
 
char null_key [] = "0000000000000000000000000000000000000000"
 
voidserver
 
voidserver_mon
 
const int timeout = 250
 
const size_t welcome_length = 168
 
voidzap_thread
 

Macro Definition Documentation

◆ __STDC_LIMIT_MACROS

#define __STDC_LIMIT_MACROS

Definition at line 6 of file test_security_curve.cpp.

◆ ZMQ_USE_LIBSODIUM

#define ZMQ_USE_LIBSODIUM

Definition at line 15 of file test_security_curve.cpp.

Function Documentation

◆ 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 at line 395 of file test_security_curve.cpp.

◆ connect_exchange_greeting_and_send_hello()

fd_t connect_exchange_greeting_and_send_hello ( char *  my_endpoint_,
zmq::curve_client_tools_t &  tools_ 
)

Definition at line 358 of file test_security_curve.cpp.

◆ 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 at line 61 of file test_security_curve.cpp.

◆ expect_zmtp_mechanism_mismatch()

void expect_zmtp_mechanism_mismatch ( void client_,
char *  my_endpoint_,
void server_,
void server_mon_ 
)

Definition at line 149 of file test_security_curve.cpp.

◆ flush_read()

void flush_read ( fd_t  fd_)

Definition at line 329 of file test_security_curve.cpp.

◆ host_to_network()

static uint64_t host_to_network ( uint64_t  value_)
static

Definition at line 255 of file test_security_curve.cpp.

◆ main()

int main ( void  )

Definition at line 524 of file test_security_curve.cpp.

◆ make_curve_client_tools()

zmq::curve_client_tools_t make_curve_client_tools ( )

Definition at line 238 of file test_security_curve.cpp.

◆ recv_all()

void recv_all ( fd_t  fd_,
uint8_t *  data_,
socket_size_t  len_ 
)

Definition at line 339 of file test_security_curve.cpp.

◆ recv_greeting()

void recv_greeting ( fd_t  fd_)

Definition at line 351 of file test_security_curve.cpp.

◆ send() [1/2]

template<size_t N>
void send ( fd_t  fd_,
const char(&)  data_[N] 
)

Definition at line 209 of file test_security_curve.cpp.

◆ send() [2/2]

template<size_t N>
void send ( fd_t  fd_,
const uint8_t(&)  data_[N] 
)

Definition at line 214 of file test_security_curve.cpp.

◆ send_all()

void send_all ( fd_t  fd_,
const char *  data_,
socket_size_t  size_ 
)

Definition at line 199 of file test_security_curve.cpp.

◆ send_command()

template<size_t N>
void send_command ( fd_t  s_,
char(&)  command_[N] 
)

Definition at line 271 of file test_security_curve.cpp.

◆ setUp()

void setUp ( )

Definition at line 33 of file test_security_curve.cpp.

◆ tearDown()

void tearDown ( )

Definition at line 40 of file test_security_curve.cpp.

◆ test_curve_security_invalid_hello_command_name()

void test_curve_security_invalid_hello_command_name ( )

Definition at line 285 of file test_security_curve.cpp.

◆ test_curve_security_invalid_hello_version()

void test_curve_security_invalid_hello_version ( )

Definition at line 307 of file test_security_curve.cpp.

◆ test_curve_security_invalid_hello_wrong_length()

void test_curve_security_invalid_hello_wrong_length ( )

Definition at line 219 of file test_security_curve.cpp.

◆ test_curve_security_invalid_initiate_command_encrypted_content()

void test_curve_security_invalid_initiate_command_encrypted_content ( )

Definition at line 458 of file test_security_curve.cpp.

◆ test_curve_security_invalid_initiate_command_encrypted_cookie()

void test_curve_security_invalid_initiate_command_encrypted_cookie ( )

Definition at line 438 of file test_security_curve.cpp.

◆ test_curve_security_invalid_initiate_command_name()

void test_curve_security_invalid_initiate_command_name ( )

Definition at line 418 of file test_security_curve.cpp.

◆ test_curve_security_invalid_initiate_wrong_length()

void test_curve_security_invalid_initiate_wrong_length ( )

Definition at line 374 of file test_security_curve.cpp.

◆ test_curve_security_invalid_keysize()

void test_curve_security_invalid_keysize ( void ctx_)

Definition at line 478 of file test_security_curve.cpp.

◆ test_curve_security_unauthenticated_message()

void test_curve_security_unauthenticated_message ( )

Definition at line 184 of file test_security_curve.cpp.

◆ test_curve_security_with_bogus_client_credentials()

void test_curve_security_with_bogus_client_credentials ( )

Definition at line 128 of file test_security_curve.cpp.

◆ test_curve_security_with_null_client_credentials()

void test_curve_security_with_null_client_credentials ( )

Definition at line 166 of file test_security_curve.cpp.

◆ test_curve_security_with_plain_client_credentials()

void test_curve_security_with_plain_client_credentials ( )

Definition at line 173 of file test_security_curve.cpp.

◆ test_curve_security_with_valid_credentials()

void test_curve_security_with_valid_credentials ( )

Definition at line 105 of file test_security_curve.cpp.

◆ test_null_client_public_key()

void test_null_client_public_key ( )

Definition at line 507 of file test_security_curve.cpp.

◆ test_null_client_secret_key()

void test_null_client_secret_key ( )

Definition at line 515 of file test_security_curve.cpp.

◆ 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 at line 77 of file test_security_curve.cpp.

◆ test_null_server_key()

void test_null_server_key ( )

Definition at line 499 of file test_security_curve.cpp.

◆ zap_handler_large_routing_id()

static void zap_handler_large_routing_id ( void )
static

Definition at line 56 of file test_security_curve.cpp.

Variable Documentation

◆ error_message_buffer

char error_message_buffer[256]

Definition at line 25 of file test_security_curve.cpp.

◆ handler

void* handler

Definition at line 27 of file test_security_curve.cpp.

◆ hello_length

const size_t hello_length = 200

Definition at line 235 of file test_security_curve.cpp.

◆ large_routing_id

const char large_routing_id[]
Initial value:
= "0123456789012345678901234567890123456789"
"0123456789012345678901234567890123456789"
"0123456789012345678901234567890123456789"
"0123456789012345678901234567890123456789"
"0123456789012345678901234567890123456789"
"0123456789012345678901234567890123456789"
"012345678901234"

Definition at line 48 of file test_security_curve.cpp.

◆ my_endpoint

char my_endpoint[MAX_SOCKET_STRING]

Definition at line 31 of file test_security_curve.cpp.

◆ null_key

char null_key[] = "0000000000000000000000000000000000000000"

Definition at line 497 of file test_security_curve.cpp.

◆ server

void* server

Definition at line 29 of file test_security_curve.cpp.

◆ server_mon

void* server_mon

Definition at line 30 of file test_security_curve.cpp.

◆ timeout

const int timeout = 250

Definition at line 46 of file test_security_curve.cpp.

◆ welcome_length

const size_t welcome_length = 168

Definition at line 236 of file test_security_curve.cpp.

◆ zap_thread

void* zap_thread

Definition at line 28 of file test_security_curve.cpp.



libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:04