Version signed node snapshots with persistent timestamps
This commit is contained in:
1 parent
7374d1648c
commit
ec51b2d61f
10 files changed
+440
-95
No files matched your search
@@ -129,6 +129,7 @@ struct TOPOMSG_REALITY_SOCK {
|
||||
|
||||
struct TOPOMSG_NODE {
|
||||
uint8_t flags; uint64_t group_id, node_id; uint8_t ver;
|
||||
uint64_t timestamp; // версия всей подписанной записи, Unix microseconds
|
||||
uint8_t public_key[SC_PUBKEY_SIZE], ed25519_public_key[SC_PUBKEY_SIZE];
|
||||
uint8_t x25519_self_sig[64];
|
||||
uint8_t node_name_len, local_v4_sockets, local_v4_addrs, local_v6_sockets, local_v6_addrs;
|
||||
@@ -175,6 +176,7 @@ struct TOPO_NODE {
|
||||
struct ll_entry ll;
|
||||
uint32_t group_ref_count;
|
||||
uint64_t node_id; uint8_t ver;
|
||||
uint64_t timestamp; // 0 = неподписанные bootstrap-сведения
|
||||
uint8_t public_key[SC_PUBKEY_SIZE], ed25519_public_key[SC_PUBKEY_SIZE];
|
||||
uint8_t x25519_self_sig[64];
|
||||
uint8_t client_type; // CLIENT_TYPE_SERVER/DESKTOP/MOBILE
|
||||
@@ -206,6 +208,7 @@ struct TOPO_GROUP_NODE {
|
||||
struct TOPO_NODESUBNETS* subnets; // подсети узла (v4/v6), для route_insert()
|
||||
struct ll_queue* paths; // TOPO_NODEPATH{conn,hop_count,rtt} — маршруты
|
||||
uint8_t last_ver; // последняя версия NODEINFO (защита от stale, BGP)
|
||||
uint64_t last_timestamp; // последняя принятая версия записи в группе
|
||||
uint8_t conn_mgr_type; // CONN_TYPE_DIRECT/REVERSE/INDIRECT/NONE
|
||||
uint64_t conn_mgr_intermediaries[CONN_MGR_MAX_INTERMEDIARIES]; // посредники для INDIRECT
|
||||
uint8_t conn_mgr_intermediariy_count; // количество посредников
|
||||
@@ -253,7 +256,8 @@ uint16_t topo_get_chain_rtt(struct TOPO_GROUP_NODE* nq);
|
||||
int topo_node_build_sig_msg(struct TOPO_NODE* ni, uint8_t* buf, size_t buf_size);
|
||||
|
||||
/** Sign self NODEINFO with Ed25519: build_sig_msg + sc_ed25519_sign → ni->x25519_self_sig */
|
||||
void topo_node_sign_self(struct UTUN_INSTANCE* instance, struct TOPO_NODE* ni);
|
||||
int topo_node_sign_self(struct UTUN_INSTANCE* instance, struct TOPO_NODE* ni);
|
||||
int topo_node_verify(const struct TOPO_NODE* ni);
|
||||
|
||||
static inline const struct TOPO_SOCKMETA4* topo_v4_sock_meta(const struct TOPO_NODE* ni) { return ni->v4_sock_meta; }
|
||||
static inline const struct TOPO_ADDR4* topo_v4_addrs(const struct TOPO_NODE* ni) { return ni->v4_addrs; }
|
||||
|
||||
Reference in new issue
Block a user