Add the connections workspace (sidebar, editable slots, per-slot activity, removal dialog with focus wrapping), remove the downloadable local HTML and unreleased identity backup/restore, and start the 0.0.5 draft changelog. Restore the released 0.0.3/0.0.4 changelog entries. Enable focus emulation in browser checks so background tabs receive focus/blur events. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
82 lines
4.4 KiB
Markdown
82 lines
4.4 KiB
Markdown
# Remembered-device protocol and storage
|
|
|
|
Phase 3 adds optional hosted-browser identities. Temporary sessions still use
|
|
manual fingerprint comparison.
|
|
This is an application protocol design and implementation review, not an
|
|
independent cryptographic audit.
|
|
|
|
## Authentication transcript
|
|
|
|
A device has an ECDSA P-256 key pair. An identity-enabled connection code uses
|
|
signaling envelope version 4 with a public key (65-byte uncompressed point,
|
|
lowercase hex) and a fresh 32-byte cryptographically random nonce. Both local
|
|
and remote SDP fingerprints continue to be validated as full SHA-256 values.
|
|
Temporary codes use version 3. Old builds reject version 4 before connecting.
|
|
Current builds accept both; if either participant uses a temporary identity,
|
|
both must manually verify fingerprints and no device is remembered.
|
|
|
|
When both codes advertise identities, each FileSession ready frame includes an
|
|
ECDSA/SHA-256 signature. The signed UTF-8 bytes are JSON.stringify of this ordered
|
|
array, with no optional fields:
|
|
|
|
```
|
|
["HellCon device proof", 1, 4, role,
|
|
offerPublicKey, offerNonce, answerPublicKey, answerNonce,
|
|
offerFingerprint, answerFingerprint]
|
|
```
|
|
|
|
The role is `offerer` or `answerer`. Fingerprints are uppercase hex bytes separated
|
|
by one space. Signatures use Web Crypto's 64-byte P1363 encoding, lowercase hex.
|
|
The recipient verifies the other role with the other public key. Both keys,
|
|
both fresh nonces, and both DTLS certificate fingerprints are bound to the proof.
|
|
Roles and domain/version separation prevent reflection and cross-protocol use;
|
|
fresh contributions from both peers prevent replay into a new connection.
|
|
The signed fingerprints bind the identity to the encrypted transport. A proof
|
|
from another connection cannot authenticate an attacker-controlled DTLS peer.
|
|
|
|
A local user either compares both full fingerprints or explicitly selects an
|
|
expected saved public key. A nickname alone has no protocol meaning. A matching
|
|
expected key permits local verification to proceed automatically, but metadata
|
|
and file data stay gated until the peer's fresh signature verifies. Unknown,
|
|
changed, missing, or downgraded identities require manual fingerprint comparison.
|
|
A changed key never replaces a saved contact automatically. An invalid or missing
|
|
signature in a negotiated identity session closes the session. Each file still
|
|
requires acceptance. The session receive queue is bounded to 2 MiB while signature
|
|
verification is pending and throughout transfers; the existing 1 MiB send windows
|
|
remain unchanged.
|
|
|
|
Contacts may only be saved after both peers' ready frames pass verification.
|
|
Manual first pairing therefore authenticates the keys through the compared
|
|
transport fingerprints and proofs. Public identities in codes are linkable;
|
|
the UI makes this explicit before opt-in. No identities or nicknames are added
|
|
to diagnostic logs, and nicknames are not sent to peers.
|
|
|
|
## Storage and recovery
|
|
|
|
IndexedDB holds a CryptoKey private key, the public key, and at most 100 contacts.
|
|
New private keys are non-extractable; existing stored keys remain usable.
|
|
Browser storage does not protect against compromised app code, a hostile host,
|
|
or compromised browser: app code can still use a stored key to sign.
|
|
The identity-use checkbox defaults off after page load. Clearing site data loses
|
|
identity and contacts; an empty store never creates trust automatically. Storage
|
|
errors leave temporary sessions available. Unreadable storage can be explicitly
|
|
cleared before creating a new identity and pairing again. Atomic revision checks
|
|
reject stale writes from other tabs instead of overwriting a newer identity or
|
|
contact list. Identity deletion requires explicit consent and is disabled during
|
|
a session.
|
|
Before each identity-enabled connection, settings are read again from storage.
|
|
A contact forgotten in another tab loses automatic verification on the next
|
|
connection; a replaced or deleted local identity requires opting in again.
|
|
A failed refresh stops setup instead of using cached trust.
|
|
|
|
There is no central revocation service. Contacts must forget a compromised key.
|
|
|
|
Review checks: both role directions, substitution of either identity, alteration
|
|
of either nonce or fingerprint, forged signatures, replay into fresh contexts,
|
|
metadata gating during asynchronous verification, non-extractable private keys,
|
|
and persistence/reconnection with real browser CryptoKeys. These
|
|
checks do not replace an independent protocol review.
|
|
|
|
Web Crypto algorithm and key-storage reference:
|
|
https://www.w3.org/TR/WebCryptoAPI/
|