1
0
mirror of https://github.com/CPunch/Laika.git synced 2026-02-07 16:50:05 +00:00

Added key exchange to LAIKA_HANDSHAKE_*

- test keys are defined in laika.h
- bug fixes & refactoring with laikaM_growarray()
This commit is contained in:
2022-01-27 19:55:28 -06:00
parent 203b5ce38f
commit a023929190
11 changed files with 129 additions and 15 deletions

View File

@@ -10,12 +10,19 @@ struct sLaika_peer *laikaS_newPeer(void (*pktHandler)(struct sLaika_peer *peer,
peer->pktSizeTable = pktSizeTable;
peer->pList = pList;
peer->uData = uData;
peer->priv = NULL;
peer->pub = NULL;
peer->pktSize = 0;
peer->pktID = LAIKAPKT_MAXNONE;
peer->setPollOut = false;
return peer;
}
void laikaS_setKeys(struct sLaika_peer *peer, uint8_t *priv, uint8_t *pub) {
peer->priv = priv;
peer->pub = pub;
}
void laikaS_freePeer(struct sLaika_peer *peer) {
laikaS_cleanSocket(&peer->sock);
laikaM_free(peer);