core: fix signed-out clipboard delivered as base64 instead of plaintext

The send path always base64-encodes (seal_b64), but the receive path only
called open_b64 when crypto was enabled — so with an empty account (crypto
disabled) the base64 layer was never undone and clipboards arrived as
"aGVsbG8tb3Zlci1sYW4=" instead of "hello-over-lan".

Make open_b64 unconditional, symmetric with the always-on seal_b64: it
base64-decodes then open()s, which passes through when crypto is disabled.
The file path already uses raw seal/open with no base64, so only the text
path needed the change. Pre-existing since the E2E commit 33d0fb7.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 21:01:26 -05:00
parent b85df3fadd
commit 61f4fbe678

View File

@@ -525,12 +525,12 @@ impl Engine {
} }
continue; continue;
} }
// Clipboard: decrypt (every transport carried ciphertext). // Clipboard: undo the always-on base64 layer, then
if crypto.enabled() { // decrypt if enabled (open_b64 passes through when not).
match crypto.open_b64(&m.text) { // Symmetric with send's unconditional seal_b64.
Some(plain) => m.text = plain, match crypto.open_b64(&m.text) {
None => continue, // not for us / wrong key Some(plain) => m.text = plain,
} None => continue, // not for us / wrong key
} }
if m.text.is_empty() { if m.text.is_empty() {
continue; continue;