etcp+chat: add DEBUG_INFO logs for invite/crypto handshake debugging
- etcp_connections: DECRYPT FAIL now logs my_pub/peer_pub/session_ready at INFO level (debug category) - chat_sync: log invite start with pubkey/node_id/addr_count - chat_core: log pubkey set on invite connect (my_pub + peer_pub) - joindialog: GUI_INFO on decoded invite
This commit is contained in:
1 parent
b14e6321bd
commit
1eb54b722a
4 files changed
+9
-1
No files matched your search
@@ -1560,7 +1560,7 @@ void etcp_connections_read_callback_socket(socket_t sock, void* arg) {
|
||||
DEBUG_TRACE(DEBUG_CATEGORY_DEBUG, "DECRYPT OK link=%p log=%s", link, link->etcp->log_name);
|
||||
goto process_decrypted;
|
||||
}
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "DECRYPT FAIL link=%p log=%s rc=%d — trying init decrypt", link, link->etcp->log_name, dec_rc);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "etcp: DECRYPT FAIL rc=%d link=%p log=%s session_ready=%d my_pub=%016llx peer_pub=%016llx", dec_rc, link, link->etcp->log_name, link->etcp->crypto_ctx.session_ready, *(uint64_t*)link->etcp->crypto_ctx.pk->public_key, *(uint64_t*)link->etcp->crypto_ctx.peer_public_key);
|
||||
} else {
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG, "SKIP normal decrypt: link=%p session_ready=%d — trying init decrypt",
|
||||
link, link && link->etcp ? link->etcp->crypto_ctx.session_ready : -1);
|
||||
|
||||
@@ -127,6 +127,9 @@ void JoinDialog::onConnectClicked() {
|
||||
memcpy(&nodeId, hash, sizeof(nodeId));
|
||||
nodeId &= 0x7FFFFFFFFFFFFFFFULL;
|
||||
|
||||
GUI_INFO("join: decoded invite ch=%llu pubkey=%016llx... nodeId=0x%016llx addrs=%d",
|
||||
d.channelId, *(const uint64_t*)d.pubkey.constData(), nodeId, d.addrs.size());
|
||||
|
||||
m_pendingNodeId = nodeId;
|
||||
m_pendingChannelId = d.channelId;
|
||||
m_connecting = true;
|
||||
|
||||
@@ -745,6 +745,8 @@ void chat_core_connect_from_invite(struct chat_invite* inv) {
|
||||
}
|
||||
sc_init_ctx(&conn->crypto_ctx, &g_cc.inst->my_keys);
|
||||
sc_set_peer_public_key(&conn->crypto_ctx, inv->pubkey, 0);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "%s: invite connect set peer_pubkey=%016llx my_pub=%016llx peer_node=0x%016llx",
|
||||
CC_ID, *(uint64_t*)inv->pubkey, *(uint64_t*)conn->crypto_ctx.pk->public_key, inv->node_id);
|
||||
|
||||
struct cc_parallel_ctx* pctx = u_calloc(1, sizeof(struct cc_parallel_ctx));
|
||||
if (!pctx) { etcp_connection_close(conn); pst->conns[idx] = NULL; pst->timers[idx] = NULL; pst->pending_count--; continue; }
|
||||
|
||||
@@ -693,6 +693,9 @@ void chat_sync_connect_from_invite(uint64_t channel_id, uint64_t node_id,
|
||||
g_cs->pending_invite_ch_id = channel_id;
|
||||
g_cs->pending_invite_node_id = node_id;
|
||||
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "%s: invite start ch=%llu node=0x%016llx pubkey=%016llx... addrs=%d",
|
||||
CS_ID, channel_id, node_id, *(const uint64_t*)pubkey_bin, addr_count);
|
||||
|
||||
gui_bridge_post_uasync_fn(
|
||||
(void(*)(void*))chat_core_connect_from_invite, inv);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user