diff options
Diffstat (limited to 'auto_tests/TCP_test.c')
-rw-r--r-- | auto_tests/TCP_test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/auto_tests/TCP_test.c b/auto_tests/TCP_test.c index 77327299..4fdb8a88 100644 --- a/auto_tests/TCP_test.c +++ b/auto_tests/TCP_test.c | |||
@@ -57,7 +57,7 @@ START_TEST(test_basic) | |||
57 | memcpy(handshake_plain + crypto_box_PUBLICKEYBYTES, f_nonce, crypto_box_NONCEBYTES); | 57 | memcpy(handshake_plain + crypto_box_PUBLICKEYBYTES, f_nonce, crypto_box_NONCEBYTES); |
58 | uint8_t handshake[TCP_CLIENT_HANDSHAKE_SIZE]; | 58 | uint8_t handshake[TCP_CLIENT_HANDSHAKE_SIZE]; |
59 | memcpy(handshake, f_public_key, crypto_box_PUBLICKEYBYTES); | 59 | memcpy(handshake, f_public_key, crypto_box_PUBLICKEYBYTES); |
60 | new_nonce(handshake + crypto_box_PUBLICKEYBYTES); | 60 | random_nonce(handshake + crypto_box_PUBLICKEYBYTES); |
61 | 61 | ||
62 | ret = encrypt_data(self_public_key, f_secret_key, handshake + crypto_box_PUBLICKEYBYTES, handshake_plain, | 62 | ret = encrypt_data(self_public_key, f_secret_key, handshake + crypto_box_PUBLICKEYBYTES, handshake_plain, |
63 | TCP_HANDSHAKE_PLAIN_SIZE, handshake + crypto_box_PUBLICKEYBYTES + crypto_box_NONCEBYTES); | 63 | TCP_HANDSHAKE_PLAIN_SIZE, handshake + crypto_box_PUBLICKEYBYTES + crypto_box_NONCEBYTES); |
@@ -153,7 +153,7 @@ static struct sec_TCP_con *new_TCP_con(TCP_Server *tcp_s) | |||
153 | memcpy(handshake_plain + crypto_box_PUBLICKEYBYTES, sec_c->sent_nonce, crypto_box_NONCEBYTES); | 153 | memcpy(handshake_plain + crypto_box_PUBLICKEYBYTES, sec_c->sent_nonce, crypto_box_NONCEBYTES); |
154 | uint8_t handshake[TCP_CLIENT_HANDSHAKE_SIZE]; | 154 | uint8_t handshake[TCP_CLIENT_HANDSHAKE_SIZE]; |
155 | memcpy(handshake, sec_c->public_key, crypto_box_PUBLICKEYBYTES); | 155 | memcpy(handshake, sec_c->public_key, crypto_box_PUBLICKEYBYTES); |
156 | new_nonce(handshake + crypto_box_PUBLICKEYBYTES); | 156 | random_nonce(handshake + crypto_box_PUBLICKEYBYTES); |
157 | 157 | ||
158 | ret = encrypt_data(tcp_server_public_key(tcp_s), f_secret_key, handshake + crypto_box_PUBLICKEYBYTES, handshake_plain, | 158 | ret = encrypt_data(tcp_server_public_key(tcp_s), f_secret_key, handshake + crypto_box_PUBLICKEYBYTES, handshake_plain, |
159 | TCP_HANDSHAKE_PLAIN_SIZE, handshake + crypto_box_PUBLICKEYBYTES + crypto_box_NONCEBYTES); | 159 | TCP_HANDSHAKE_PLAIN_SIZE, handshake + crypto_box_PUBLICKEYBYTES + crypto_box_NONCEBYTES); |