Require current admission for live invitation and attachment authorization

This commit is contained in:
evgeny committed 2026-11-03 16:35:40 +01:00
1 parent d20111318c
commit 673c2a3752
2 files changed
+5 -1

No files matched your search

+4
View File
@@ -1610,6 +1610,10 @@ done:
/* Строгий допуск radio/attachments: ни ожидание, ни исключение не разрешают действие. */
int member_sync_verified_ed25519(struct UTUN_INSTANCE* inst, const char* channel, uint64_t author, uint8_t key[32]) {
if (!inst || !topo_node_sqlite_member_allowed(inst->topo_sqlite_db, channel, author)) {
DEBUG_WARN(DEBUG_CATEGORY_MEMBER_SYNC, "member admission denied ch=%s node=%016llx",
channel ? channel : "-", (unsigned long long)author); return -1;
}
enum ms_author_status status = member_sync_author_key(inst, channel, author, key);
if (status == MS_AUTHOR_ACTIVE) return 0;
DEBUG_WARN(DEBUG_CATEGORY_MEMBER_SYNC, "member verification denied ch=%s node=%016llx status=%d",
+1 -1
View File
@@ -40,7 +40,7 @@ enum ms_author_status {
enum ms_author_status member_sync_author_key(struct UTUN_INSTANCE* inst, const char* channel,
uint64_t author, uint8_t key[32]);
/* Проверить source=0/deleted=0, привязку node_id/X25519 и доверенный Ed25519,
/* Проверить source=0/deleted=0/admitted=1, привязку node_id/X25519 и доверенный Ed25519,
* join_sig и подпись непосредственного пригласившего (либо ключом канала для signed_by=0).
* Не обходит цепочку предков. inst/channel/key обязательны, channel — канонический uint64 decimal.
* 0 — ключ записан в key[32], -1 — отказ, key не меняется. */