summaryrefslogtreecommitdiff
path: root/toxcore/onion_client.h
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/onion_client.h')
-rw-r--r--toxcore/onion_client.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/toxcore/onion_client.h b/toxcore/onion_client.h
index 47d08eca..afe72ca1 100644
--- a/toxcore/onion_client.h
+++ b/toxcore/onion_client.h
@@ -61,10 +61,10 @@
61#define ONION_DATA_DHTPK CRYPTO_PACKET_DHTPK 61#define ONION_DATA_DHTPK CRYPTO_PACKET_DHTPK
62 62
63typedef struct { 63typedef struct {
64 uint8_t public_key[crypto_box_PUBLICKEYBYTES]; 64 uint8_t public_key[CRYPTO_PUBLIC_KEY_SIZE];
65 IP_Port ip_port; 65 IP_Port ip_port;
66 uint8_t ping_id[ONION_PING_ID_SIZE]; 66 uint8_t ping_id[ONION_PING_ID_SIZE];
67 uint8_t data_public_key[crypto_box_PUBLICKEYBYTES]; 67 uint8_t data_public_key[CRYPTO_PUBLIC_KEY_SIZE];
68 uint8_t is_stored; 68 uint8_t is_stored;
69 69
70 uint64_t timestamp; 70 uint64_t timestamp;
@@ -84,7 +84,7 @@ typedef struct {
84} Onion_Client_Paths; 84} Onion_Client_Paths;
85 85
86typedef struct { 86typedef struct {
87 uint8_t public_key[crypto_box_PUBLICKEYBYTES]; 87 uint8_t public_key[CRYPTO_PUBLIC_KEY_SIZE];
88 uint64_t timestamp; 88 uint64_t timestamp;
89} Last_Pinged; 89} Last_Pinged;
90 90
@@ -93,12 +93,12 @@ typedef struct {
93 uint8_t is_online; /* Set by the onion_set_friend_status function. */ 93 uint8_t is_online; /* Set by the onion_set_friend_status function. */
94 94
95 uint8_t know_dht_public_key; /* 0 if we don't know the dht public key of the other, 1 if we do. */ 95 uint8_t know_dht_public_key; /* 0 if we don't know the dht public key of the other, 1 if we do. */
96 uint8_t dht_public_key[crypto_box_PUBLICKEYBYTES]; 96 uint8_t dht_public_key[CRYPTO_PUBLIC_KEY_SIZE];
97 uint8_t real_public_key[crypto_box_PUBLICKEYBYTES]; 97 uint8_t real_public_key[CRYPTO_PUBLIC_KEY_SIZE];
98 98
99 Onion_Node clients_list[MAX_ONION_CLIENTS]; 99 Onion_Node clients_list[MAX_ONION_CLIENTS];
100 uint8_t temp_public_key[crypto_box_PUBLICKEYBYTES]; 100 uint8_t temp_public_key[CRYPTO_PUBLIC_KEY_SIZE];
101 uint8_t temp_secret_key[crypto_box_SECRETKEYBYTES]; 101 uint8_t temp_secret_key[CRYPTO_SECRET_KEY_SIZE];
102 102
103 uint64_t last_dht_pk_onion_sent; 103 uint64_t last_dht_pk_onion_sent;
104 uint64_t last_dht_pk_dht_sent; 104 uint64_t last_dht_pk_dht_sent;
@@ -136,11 +136,11 @@ typedef struct {
136 Onion_Client_Paths onion_paths_self; 136 Onion_Client_Paths onion_paths_self;
137 Onion_Client_Paths onion_paths_friends; 137 Onion_Client_Paths onion_paths_friends;
138 138
139 uint8_t secret_symmetric_key[crypto_box_KEYBYTES]; 139 uint8_t secret_symmetric_key[CRYPTO_SYMMETRIC_KEY_SIZE];
140 uint64_t last_run, first_run; 140 uint64_t last_run, first_run;
141 141
142 uint8_t temp_public_key[crypto_box_PUBLICKEYBYTES]; 142 uint8_t temp_public_key[CRYPTO_PUBLIC_KEY_SIZE];
143 uint8_t temp_secret_key[crypto_box_SECRETKEYBYTES]; 143 uint8_t temp_secret_key[CRYPTO_SECRET_KEY_SIZE];
144 144
145 Last_Pinged last_pinged[MAX_STORED_PINGED_NODES]; 145 Last_Pinged last_pinged[MAX_STORED_PINGED_NODES];
146 146
@@ -257,7 +257,7 @@ int onion_set_friend_DHT_pubkey(Onion_Client *onion_c, int friend_num, const uin
257 */ 257 */
258unsigned int onion_getfriend_DHT_pubkey(const Onion_Client *onion_c, int friend_num, uint8_t *dht_key); 258unsigned int onion_getfriend_DHT_pubkey(const Onion_Client *onion_c, int friend_num, uint8_t *dht_key);
259 259
260#define ONION_DATA_IN_RESPONSE_MIN_SIZE (crypto_box_PUBLICKEYBYTES + crypto_box_MACBYTES) 260#define ONION_DATA_IN_RESPONSE_MIN_SIZE (CRYPTO_PUBLIC_KEY_SIZE + CRYPTO_MAC_SIZE)
261#define ONION_CLIENT_MAX_DATA_SIZE (MAX_DATA_REQUEST_SIZE - ONION_DATA_IN_RESPONSE_MIN_SIZE) 261#define ONION_CLIENT_MAX_DATA_SIZE (MAX_DATA_REQUEST_SIZE - ONION_DATA_IN_RESPONSE_MIN_SIZE)
262 262
263/* Send data of length length to friendnum. 263/* Send data of length length to friendnum.