iOS dual-signature blob order differs from desktop (kaz‖ml vs ml‖kaz) — cross-platform share verification will fail #236
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#236
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Discovered in the slice-3 dual-pass review (epic #223).
The gap: when wrapping a key for a recipient, iOS concatenates the dual signature as
kazSignSignature + mlDsaSignature(CryptoManager.swift wrapKeyForRecipient), while desktop concatenatesml_dsa ‖ kaz_signand splits ml-first at a fixed 3309 bytes (crypto_service.rs). An iOS-produced signature blob can never verify on desktop (and desktop's split sizes are themselves flagged 'needs determining' in code).Same bug class as the KEM wire order fixed in #235-adjacent slice-3 work — silent cross-platform contract mismatch.
Suggested resolution: switch iOS to the desktop order (ml ‖ kaz), pin with a bidirectional signature vector test like tests/fixtures/ml-kem-hybrid-vectors.json does for the KEMs, and pin desktop's split sizes explicitly.
Also same class (from the same review):
GET /api/invitations+/sentresponse envelope drift vs ReceivedInvitationsResponse/SentInvitationsResponse (see #234); AuthRepositoryImpl posts /invitations/token/{token}/accept which has no server route.Relates to #223, #234.
RESOLVED via PR #239 (merged
9ba3928) — all three contract breaks fixed, dual-pass review clean (0 Critical; the 3 Importants were fixed in-PR: consumer count guards were already in, invited_by_name Email fallback added server-side, server-side shape assertions added, decoder extracted + 4 unit tests).mlDSA ‖ kazSIGN(desktop sign_with_key order; ML-DSA fixed 3309 makes ML-first the only deterministic split). Latent — nothing transmits the blob yet — fixed before wiring.tenant_name+invited_by_name(fixes desktop blank-name rendering too); iOS decodes the real paged envelope — both list screens work at runtime again, and server-side shape assertions pin the contract so removing the fields fails the server suite.Also: APIClient date decoding made fractional-seconds-tolerant (extracted
makeDecoder()+ 4 unit tests); dead KAZ-SIGN level-128 compat constants removed.Still open, same contract-drift family (desktop side):
per_pagevspage_sizenaming mismatch and unboundstatusquery param in desktop invitationStore (TS-tolerated today);/shares/invitationsenvelope drift (iOSInvitationsListResponse{invitations}vs server PagedResponse{items}) — both worth a desktop-side PR.