#include "system.h"
-#include "cipher.h"
#include "connection.h"
-#include "crypto.h"
#include "logger.h"
#include "meshlink_internal.h"
#include "net.h"
static bool mykeyused = false;
void send_key_changed(void) {
- send_request(everyone, "%d %x %s", KEY_CHANGED, rand(), mesh->self->name);
+ send_request(mesh->everyone, "%d %x %s", KEY_CHANGED, rand(), mesh->self->name);
/* Force key exchange for connections using SPTPS */
- for splay_each(node_t, n, node_tree)
+ for splay_each(node_t, n, mesh->nodes)
if(n->status.reachable && n->status.validkey)
sptps_force_kex(&n->sptps);
}
sptps_stop(&to->sptps);
to->status.validkey = false;
to->status.waitingforkey = true;
- to->last_req_key = now.tv_sec;
+ to->last_req_key = mesh->loop.now.tv_sec;
to->incompression = mesh->self->incompression;
return sptps_start(&to->sptps, to, true, true, mesh->self->connection->ecdsa, to->ecdsa, label, sizeof label, send_initial_sptps_data, receive_sptps_record);
}
}
logger(DEBUG_PROTOCOL, LOG_INFO, "Learned ECDSA public key from %s (%s)", from->name, from->hostname);
- append_config_file(from->name, "ECDSAPublicKey", pubkey);
+ append_config_file(mesh, from->name, "ECDSAPublicKey", pubkey);
return true;
}
sptps_stop(&from->sptps);
from->status.validkey = false;
from->status.waitingforkey = true;
- from->last_req_key = now.tv_sec;
+ from->last_req_key = mesh->loop.now.tv_sec;
sptps_start(&from->sptps, from, false, true, mesh->self->connection->ecdsa, from->ecdsa, label, sizeof label, send_sptps_data, receive_sptps_record);
sptps_receive_data(&from->sptps, buf, len);
return true;