diff options
-rw-r--r-- | toxcore/net_crypto.c | 13 |
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; |