android: voice messages + attachments architecture plan, build fixes

This commit is contained in:
evgeny committed 2026-07-28 23:07:23 +03:00
1 parent f8d7c21a79
commit e751e6ee69
17 files changed
+299 -329

No files matched your search

+15 -7
View File
@@ -21,7 +21,6 @@
#include "../lib/u_async.h"
#include "../lib/debug_config.h"
#include "../lib/sha256.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -101,12 +100,21 @@ static int instance_init_common(struct UTUN_INSTANCE* instance, struct UASYNC* u
return -1;
}
// Derive node_id from pubkey if not set in config
if (!instance->node_id) {
uint8_t pubkey[SC_PUBKEY_SIZE];
sc_compute_public_key_from_private(instance->my_keys.private_key, pubkey);
instance->node_id = sc_derive_node_id_from_pubkey(pubkey);
DEBUG_INFO(DEBUG_CATEGORY_CONFIG, "node_id derived from pubkey: %016llx", (unsigned long long)instance->node_id);
/* Always verify node_id matches pubkey, fix if mismatched */
{
uint8_t pub_bin[SC_PUBKEY_SIZE];
sc_compute_public_key_from_private(instance->my_keys.private_key, pub_bin);
uint64_t derived = sc_derive_node_id_from_pubkey(pub_bin);
DEBUG_INFO(DEBUG_CATEGORY_CONFIG, "node_id check: config=%016llx derived=%016llx match=%d",
(unsigned long long)instance->node_id, (unsigned long long)derived,
(instance->node_id == derived));
if (!instance->node_id || instance->node_id != derived) {
if (instance->node_id)
DEBUG_WARN(DEBUG_CATEGORY_CONFIG, "node_id mismatch: config=%016llx derived=%016llx — fixing",
(unsigned long long)instance->node_id, (unsigned long long)derived);
instance->node_id = derived;
config->global.my_node_id = derived;
}
}
if (sc_derive_ed25519_pubkey(instance->my_keys.private_key, instance->my_ed25519_pubkey) != SC_OK) {