a room-key proposal signs the hash the verifier checks, and the ping's pill shortens a raw id

This commit is contained in:
KeelrLeek committed 2026-09-03 13:52:04 -05:00
1 parent 6f7452c803
commit 8093adc89e
3 files changed
+40 -2

No files matched your search

+6 -1
View File
@@ -523,7 +523,12 @@ pub async fn propose(app: &tauri::AppHandle, space_owner_b58: &str, space_b58: &
};
pr::apply_proposal(&manifest, &hash, &p).map_err(|e| e.to_string())?;
p.sig = match room {
Some(secret) => persona_state::sign_local(pr::SIGN_DOMAIN, &secret, &pr::proposal_sig_body(&p)),
// sign_payload() first: everything here signs blake3(body), and the
// verifier hashes before it checks. Handing over the raw body makes a
// signature that validates nowhere.
Some(secret) => {
persona_state::sign_local(pr::SIGN_DOMAIN, &secret, &pr::sign_payload(&pr::proposal_sig_body(&p)))
}
None => sign(app, pr::sign_payload(&pr::proposal_sig_body(&p))).await?,
};
if !pr::proposal_valid(&p) {