@@ -111,13 +111,13 @@ static void test_basic(void)
111111    free (handshake_plain );
112112
113113    // Sending the handshake 
114-     ck_assert_msg (net_send (ns , mem ,  logger , sock , handshake , TCP_CLIENT_HANDSHAKE_SIZE  -  1 ,
114+     ck_assert_msg (net_send (ns , logger , sock , handshake , TCP_CLIENT_HANDSHAKE_SIZE  -  1 ,
115115                           & localhost , nullptr ) ==  TCP_CLIENT_HANDSHAKE_SIZE  -  1 ,
116116                  "An attempt to send the initial handshake minus last byte failed." );
117117
118118    do_tcp_server_delay (tcp_s , mono_time , 50 );
119119
120-     ck_assert_msg (net_send (ns , mem ,  logger , sock , handshake  +  (TCP_CLIENT_HANDSHAKE_SIZE  -  1 ), 1 , & localhost , nullptr ) ==  1 ,
120+     ck_assert_msg (net_send (ns , logger , sock , handshake  +  (TCP_CLIENT_HANDSHAKE_SIZE  -  1 ), 1 , & localhost , nullptr ) ==  1 ,
121121                  "The attempt to send the last byte of handshake failed." );
122122
123123    free (handshake );
@@ -127,7 +127,7 @@ static void test_basic(void)
127127    // Receiving server response and decrypting it 
128128    uint8_t  response [TCP_SERVER_HANDSHAKE_SIZE ];
129129    uint8_t  response_plain [TCP_HANDSHAKE_PLAIN_SIZE ];
130-     ck_assert_msg (net_recv (ns , mem ,  logger , sock , response , TCP_SERVER_HANDSHAKE_SIZE , & localhost ) ==  TCP_SERVER_HANDSHAKE_SIZE ,
130+     ck_assert_msg (net_recv (ns , logger , sock , response , TCP_SERVER_HANDSHAKE_SIZE , & localhost ) ==  TCP_SERVER_HANDSHAKE_SIZE ,
131131                  "Could/did not receive a server response to the initial handshake." );
132132    ret  =  decrypt_data (mem , self_public_key , f_secret_key , response , response  +  CRYPTO_NONCE_SIZE ,
133133                       TCP_SERVER_HANDSHAKE_SIZE  -  CRYPTO_NONCE_SIZE , response_plain );
@@ -156,7 +156,7 @@ static void test_basic(void)
156156            msg_length  =  sizeof (r_req ) -  i ;
157157        }
158158
159-         ck_assert_msg (net_send (ns , mem ,  logger , sock , r_req  +  i , msg_length , & localhost , nullptr ) ==  msg_length ,
159+         ck_assert_msg (net_send (ns , logger , sock , r_req  +  i , msg_length , & localhost , nullptr ) ==  msg_length ,
160160                      "Failed to send request after completing the handshake." );
161161        i  +=  msg_length ;
162162
@@ -169,7 +169,7 @@ static void test_basic(void)
169169    const  size_t  max_packet_size  =  4096 ;
170170    uint8_t  * packet_resp  =  (uint8_t  * )malloc (max_packet_size );
171171    ck_assert (packet_resp  !=  nullptr );
172-     int  recv_data_len  =  net_recv (ns , mem ,  logger , sock , packet_resp , 2  +  2  +  CRYPTO_PUBLIC_KEY_SIZE  +  CRYPTO_MAC_SIZE , & localhost );
172+     int  recv_data_len  =  net_recv (ns , logger , sock , packet_resp , 2  +  2  +  CRYPTO_PUBLIC_KEY_SIZE  +  CRYPTO_MAC_SIZE , & localhost );
173173    ck_assert_msg (recv_data_len  ==  2  +  2  +  CRYPTO_PUBLIC_KEY_SIZE  +  CRYPTO_MAC_SIZE ,
174174                  "Failed to receive server response to request. %d" , recv_data_len );
175175    memcpy (& size , packet_resp , 2 );
@@ -241,20 +241,20 @@ static struct sec_TCP_con *new_tcp_con(const Logger *logger, const Memory *mem,
241241    ck_assert_msg (ret  ==  TCP_CLIENT_HANDSHAKE_SIZE  -  (CRYPTO_PUBLIC_KEY_SIZE  +  CRYPTO_NONCE_SIZE ),
242242                  "Failed to encrypt the outgoing handshake." );
243243
244-     ck_assert_msg (net_send (ns , mem ,  logger , sock , handshake , TCP_CLIENT_HANDSHAKE_SIZE  -  1 ,
244+     ck_assert_msg (net_send (ns , logger , sock , handshake , TCP_CLIENT_HANDSHAKE_SIZE  -  1 ,
245245                           & localhost , nullptr ) ==  TCP_CLIENT_HANDSHAKE_SIZE  -  1 ,
246246                  "Failed to send the first portion of the handshake to the TCP relay server." );
247247
248248    do_tcp_server_delay (tcp_s , mono_time , 50 );
249249
250-     ck_assert_msg (net_send (ns , mem ,  logger , sock , handshake  +  (TCP_CLIENT_HANDSHAKE_SIZE  -  1 ), 1 , & localhost , nullptr ) ==  1 ,
250+     ck_assert_msg (net_send (ns , logger , sock , handshake  +  (TCP_CLIENT_HANDSHAKE_SIZE  -  1 ), 1 , & localhost , nullptr ) ==  1 ,
251251                  "Failed to send last byte of handshake." );
252252
253253    do_tcp_server_delay (tcp_s , mono_time , 50 );
254254
255255    uint8_t  response [TCP_SERVER_HANDSHAKE_SIZE ];
256256    uint8_t  response_plain [TCP_HANDSHAKE_PLAIN_SIZE ];
257-     ck_assert_msg (net_recv (sec_c -> ns , mem ,  logger , sock , response , TCP_SERVER_HANDSHAKE_SIZE , & localhost ) ==  TCP_SERVER_HANDSHAKE_SIZE ,
257+     ck_assert_msg (net_recv (sec_c -> ns , logger , sock , response , TCP_SERVER_HANDSHAKE_SIZE , & localhost ) ==  TCP_SERVER_HANDSHAKE_SIZE ,
258258                  "Failed to receive server handshake response." );
259259    ret  =  decrypt_data (mem , tcp_server_public_key (tcp_s ), f_secret_key , response , response  +  CRYPTO_NONCE_SIZE ,
260260                       TCP_SERVER_HANDSHAKE_SIZE  -  CRYPTO_NONCE_SIZE , response_plain );
@@ -291,7 +291,7 @@ static int write_packet_tcp_test_connection(const Logger *logger, const Memory *
291291    localhost .ip  =  get_loopback ();
292292    localhost .port  =  0 ;
293293
294-     ck_assert_msg (net_send (con -> ns , mem ,  logger , con -> sock , packet , packet_size , & localhost , nullptr ) ==  packet_size ,
294+     ck_assert_msg (net_send (con -> ns , logger , con -> sock , packet , packet_size , & localhost , nullptr ) ==  packet_size ,
295295                  "Failed to send a packet." );
296296    return  0 ;
297297}
@@ -302,7 +302,7 @@ static int read_packet_sec_tcp(const Logger *logger, struct sec_TCP_con *con, ui
302302    localhost .ip  =  get_loopback ();
303303    localhost .port  =  0 ;
304304
305-     int  rlen  =  net_recv (con -> ns , con -> mem ,  logger , con -> sock , data , length , & localhost );
305+     int  rlen  =  net_recv (con -> ns , logger , con -> sock , data , length , & localhost );
306306    ck_assert_msg (rlen  ==  length , "Did not receive packet of correct length. Wanted %i, instead got %i" , length , rlen );
307307    rlen  =  decrypt_data_symmetric (con -> mem , con -> shared_key , con -> recv_nonce , data  +  2 , length  -  2 , data );
308308    ck_assert_msg (rlen  !=  -1 , "Failed to decrypt a received packet from the Relay server." );
0 commit comments