diff options
author | irungentoo <irungentoo@gmail.com> | 2014-05-17 12:33:22 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-05-17 12:33:22 -0400 |
commit | a5da6df1442f0615e727292ab58f90f169e090cf (patch) | |
tree | 17a53efdd3dc5675dcf11499c0aa59c0179ceaa8 /toxcore/onion_client.h | |
parent | 454cadb91c57eb689eddbf41d61d66af54aa1e0f (diff) |
Net_crypto can now handle packets sent as TCP OOB packets.
Added timestamp to know which DHT public key is good in case
onion_client and net_crypto report different ones.
Diffstat (limited to 'toxcore/onion_client.h')
-rw-r--r-- | toxcore/onion_client.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/toxcore/onion_client.h b/toxcore/onion_client.h index 06909380..1d56333a 100644 --- a/toxcore/onion_client.h +++ b/toxcore/onion_client.h | |||
@@ -82,6 +82,7 @@ typedef struct { | |||
82 | uint8_t is_online; /* Set by the onion_set_friend_status function. */ | 82 | uint8_t is_online; /* Set by the onion_set_friend_status function. */ |
83 | 83 | ||
84 | uint8_t is_fake_clientid; /* 0 if we don't know the fake client id of the other 1 if we do. */ | 84 | uint8_t is_fake_clientid; /* 0 if we don't know the fake client id of the other 1 if we do. */ |
85 | uint64_t fake_client_id_timestamp; | ||
85 | uint8_t fake_client_id[crypto_box_PUBLICKEYBYTES]; | 86 | uint8_t fake_client_id[crypto_box_PUBLICKEYBYTES]; |
86 | uint8_t real_client_id[crypto_box_PUBLICKEYBYTES]; | 87 | uint8_t real_client_id[crypto_box_PUBLICKEYBYTES]; |
87 | 88 | ||
@@ -177,10 +178,10 @@ int onion_getfriendip(Onion_Client *onion_c, int friend_num, IP_Port *ip_port); | |||
177 | 178 | ||
178 | /* Copy friends DHT public key into dht_key. | 179 | /* Copy friends DHT public key into dht_key. |
179 | * | 180 | * |
180 | * return -1 on failure (no key copied). | 181 | * return 0 on failure (no key copied). |
181 | * return 0 on success (key copied). | 182 | * return timestamp on success (key copied). |
182 | */ | 183 | */ |
183 | int onion_getfriend_DHT_pubkey(Onion_Client *onion_c, int friend_num, uint8_t *dht_key); | 184 | uint64_t onion_getfriend_DHT_pubkey(Onion_Client *onion_c, int friend_num, uint8_t *dht_key); |
184 | 185 | ||
185 | #define ONION_DATA_IN_RESPONSE_MIN_SIZE (crypto_box_PUBLICKEYBYTES + crypto_box_MACBYTES) | 186 | #define ONION_DATA_IN_RESPONSE_MIN_SIZE (crypto_box_PUBLICKEYBYTES + crypto_box_MACBYTES) |
186 | #define ONION_CLIENT_MAX_DATA_SIZE (MAX_DATA_REQUEST_SIZE - ONION_DATA_IN_RESPONSE_MIN_SIZE) | 187 | #define ONION_CLIENT_MAX_DATA_SIZE (MAX_DATA_REQUEST_SIZE - ONION_DATA_IN_RESPONSE_MIN_SIZE) |