summaryrefslogtreecommitdiff
path: root/toxcore/net_crypto.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-05-02 15:25:18 -0400
committerirungentoo <irungentoo@gmail.com>2014-05-02 15:25:18 -0400
commit8b29ac8eae8feea8b2c12e56482dd8845e8c7d35 (patch)
tree3703cc5e0aa0fcad6f2c6a4a2a0b7c6df78be161 /toxcore/net_crypto.c
parentaca18f65c38c41fce73f50252d6c38c3b8fce9e5 (diff)
Fixed one case of the handshake not being sent.
Diffstat (limited to 'toxcore/net_crypto.c')
-rw-r--r--toxcore/net_crypto.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c
index 1dce61b2..d71ccdda 100644
--- a/toxcore/net_crypto.c
+++ b/toxcore/net_crypto.c
@@ -560,6 +560,19 @@ static int handle_packet_connection(Net_Crypto *c, int crypt_connection_id, uint
560 560
561 encrypt_precompute(conn->peersessionpublic_key, conn->sessionsecret_key, conn->shared_key); 561 encrypt_precompute(conn->peersessionpublic_key, conn->sessionsecret_key, conn->shared_key);
562 562
563 if (conn->status == CRYPTO_CONN_COOKIE_REQUESTING) {
564 uint8_t handshake_packet[HANDSHAKE_PACKET_LENGTH];
565
566 if (create_crypto_handshake(c, handshake_packet, cookie, conn->sent_nonce, conn->sessionpublic_key,
567 conn->public_key) != sizeof(handshake_packet))
568 return -1;
569
570 if (new_temp_packet(c, crypt_connection_id, handshake_packet, sizeof(handshake_packet)) != 0)
571 return -1;
572
573 send_temp_packet(c, crypt_connection_id);
574 }
575
563 conn->status = CRYPTO_CONN_NOT_CONFIRMED; 576 conn->status = CRYPTO_CONN_NOT_CONFIRMED;
564 } else { 577 } else {
565 return -1; 578 return -1;