From 3d6f9c1be4b1881703fa1e7d0ba00e2a38a1b48d Mon Sep 17 00:00:00 2001 From: evgeny Date: Thu, 1 Oct 2026 16:14:39 +0300 Subject: [PATCH] Sign media test fixtures with the derived Ed25519 seeds --- tests/test_dm_media.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_dm_media.c b/tests/test_dm_media.c index f6558c72..fe16bcdb 100644 --- a/tests/test_dm_media.c +++ b/tests/test_dm_media.c @@ -100,7 +100,7 @@ static int setup(struct media_test* t) { uint8_t msg[512], join[64], adm_sig[64]; uint64_t ts = ntp_time_get_seconds(inst); int n = member_sync_build_join_msg(t->ch_x, t->ch_ed, t->ids[j], t->keys[j].public_key, ts, msg, sizeof(msg)); - if (n < 0 || sc_ed25519_sign(t->keys[j].private_key, msg, (size_t)n, join) != SC_OK) return -1; + if (n < 0 || sc_ed25519_sign(t->nodes[j]->my_ed25519_privkey, msg, (size_t)n, join) != SC_OK) return -1; const char* tags = j == S ? "{\"supernode\":\"yes\",\"ver\":\"1\"}" : j == M ? "{\"storage\":\"yes\",\"ver\":\"1\"}" : "{\"ver\":\"1\"}"; size_t off = strlen(tags); @@ -273,8 +273,11 @@ int main(void) { } struct SC_MYKEYS channel; if (sc_generate_keypair(&channel)) return 1; - memcpy(t.ch_x, channel.public_key, 32); memcpy(t.ch_priv, channel.private_key, 32); - if (sc_derive_ed25519_pubkey(t.ch_priv, t.ch_ed)) return 1; + memcpy(t.ch_x, channel.public_key, 32); + if (sc_derive_ed25519_pubkey(channel.private_key, t.ch_ed)) return 1; + uint8_t channel_seed[SHA512_DIGEST_LENGTH]; + SHA512(channel.private_key, 32, channel_seed); + memcpy(t.ch_priv, channel_seed, 32); uint8_t signed_channel[256]; size_t off = sizeof(CHANNEL); memcpy(signed_channel, CHANNEL, off);