feat(ios): 7.1 slice 2 — folder-key server lifecycle + desktop-format wraps, FP plaintext-leak guard (#223) #231
No reviewers
Labels
No labels
epic
phase-0
phase-1
phase-2
phase-3
phase-4
phase-5
phase-6
phase-7
phase-8
phase-9
priority/P0
priority/P1
priority/P2
type/backend
type/client
type/docs
type/ops
type/security
type/spike
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/failsulit!231
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/ios-folder-key-lifecycle"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Second iOS 7.1 slice: folder keys move from local-only keychain to the SERVER lifecycle, and every plaintext-upload fallback is removed (audit #214 leak family).
Folder-key lifecycle
wrapped_kek/kem_ciphertext(+ owner_* duplicates) — desktop contract/shares/received) → FolderDto wrap → transitional DERIVED fallback (HKDF-SHA256 over the account master key, byte-identical to desktop derive_folder_kek) for the wrap-less tenant rootLeak guards (audit #214 family)
Share creation moves to the real contract
POST /shareswith the desktop-compatible envelopebase64(JSON{kem_ciphertext, wrapped_kek})— the ghost/shares/file+/shares/folder+ ShareFileRequest/ShareFolderRequest shapes 400'd every time and are deletedKnown limitation (documented, slice 3): desktop↔iOS folder-key INTEROP is still blocked by the iOS ML-KEM placeholder (HKDF-derived, not ML-KEM-768) and a differing hybrid combine — the wire formats now match, the crypto doesn't. iOS-internal roundtrips are fully working and tested.
Tests: FolderKeyWrapTests — owner-wrap roundtrip, cross-account refusal, desktop-envelope JSON shape. iOS test EXECUTION remains blocked (no macOS runner in fleet — ios-ci runs-on macos-15; local simulator service-hub failure) — compile verified via build-for-testing; server suite 1102 green (untouched surfaces).
Part of M4 epic #223; follow-ups in #222 scope.
Slice 2 of the iOS file-stack migration: folder keys move from local-only keychain to the SERVER lifecycle, and every plaintext-upload fallback is removed. - CryptoManager: createOwnerFolderKeyWrap/openFolderKeyWrap — hybrid KEM wrap of the folder KEK to the owner's own keys, POSTed as wrapped_kek/kem_ciphertext on folder create (server stores them; any device holding the account keys resolves). iOS-internal layout documented (kaz ‖ ml concat, SHA256 combine) with the desktop divergence (ml ‖ kaz + HKDF) called out for the slice-3 convergence. - FileRepositoryImpl: createFolder sends the owner wrap; new resolveFolderKey chain — keychain cache → /shares/received envelope → FolderDto wrap → transitional DERIVED fallback (HKDF-SHA256 over the account master key, byte-identical to desktop derive_folder_kek, so desktop-legacy root content decrypts on iOS); upload REQUIRES the key (plaintext leak posture removed) and download fails LOUDLY instead of serving/caching ciphertext. - ShareRepositoryImpl: shareFile/shareFolder POST the real /shares contract with the desktop-compatible envelope base64(JSON{kem_ciphertext, wrapped_kek}) (ghost /shares/file + /shares/folder 400'd always). - FileProviderExtension: plaintext-fallback uploads REMOVED — all unresolvable paths throw (audit #214 leak family). - Dead code: MoveRequest/MoveFolderRequest/AccessibleFilesResponse/ PaginationMeta/ShareFileRequest/ShareFolderRequest removed. - Share model: fractional-seconds date decoding (server wire format; decoder-level .iso8601 silently killed the received-shares parse). - Tests: FolderKeyWrapTests — owner-wrap roundtrip, cross-account refusal, desktop-envelope JSON shape. Review: dual-pass (ponytail + correctness). Critical findings fixed: root-folder uploads (wrap-less tenant root → transitional derived key, desktop-identical), share-create response decode (server returns FLAT Share, not {data}), received-shares fractional-date decode, download poisoned-cache elimination. Known limitation (documented): desktop↔iOS folder-key INTEROP still blocked by the iOS ML-KEM placeholder — slice 3. iOS unit-test execution remains blocked by the local simulator service-hub failure and the missing macOS CI runner (ios-ci needs macos-15; fleet is linux-only) — compile verified via build-for-testing; server suite 1102 green; desktop TS 1282 green.