Verify profile signatures survive avatar and display name updates
This commit is contained in:
1 parent
9842de7ab7
commit
972910c763
2 files changed
+8
No files matched your search
@@ -109,6 +109,13 @@ private slots:
|
||||
}
|
||||
chat_core_update_my_name(testInstance, "quote\"\\name"); chat_core_sync_my_addresses(testInstance);
|
||||
for (const auto& channel : channels) {
|
||||
char profile[MS_USERINFO_MAX + 1], name[128]; uint8_t signature[64]; uint64_t timestamp;
|
||||
QCOMPARE(chat_core_get_my_profile(testInstance, channel.channelId.toLatin1().constData(), profile, sizeof(profile), signature, ×tamp), 0);
|
||||
QCOMPARE(json_flat_get(profile, "name", name, sizeof(name)), 0); QCOMPARE(QString::fromLatin1(name), QString("quote\"\\name"));
|
||||
uint8_t join[64], signedBytes[MS_USERINFO_MAX + 73]; uint64_t joinTimestamp;
|
||||
QCOMPARE(topo_node_sqlite_member_get_join(testInstance->topo_sqlite_db, channel.channelId.toLatin1().constData(), testInstance->node_id, join, &joinTimestamp), 0);
|
||||
int length = member_sync_build_update_msg(join, timestamp, profile, signedBytes, sizeof(signedBytes)); QVERIFY(length > 0);
|
||||
QCOMPARE(sc_ed25519_verify(testInstance->my_ed25519_pubkey, signedBytes, length, signature), SC_OK);
|
||||
uint8_t wire[CHAT_MEMBER_DISPLAY_SIZE]; QCOMPARE(chat_core_get_single_member(testInstance, channel.channelId.toLatin1().constData(), testInstance->node_id, wire), 0);
|
||||
QCOMPARE(mf_get64(wire + 79), testInstance->node_id);
|
||||
QCOMPARE(manager.image(channel.channelId, testInstance->node_id).pixelColor(128, 128), QColor(Qt::blue));
|
||||
|
||||
Reference in new issue
Block a user