feat(keys): wrap authenticity — device-key-signed wrap uploads (task 1.11, KEY-16, H-3) #78
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!78
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/1.11-wrap-authenticity"
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?
Closes #26 (task 1.11 — the last design-audit H-finding gating M1's exit)
KEY-16: a session alone is never sufficient
Every
DeviceKeyWrapupload now requires a signature from the registered device signing key, verified server-side (via the SDKCryptoProviderFactory) before storing — fail-closed on absent signature, unknown algorithm, or key-less devices.ssdid-wrap-v1 canonical payload:
ssdid-wrap-v1|{subject}|{kem}|{wrappingPubKeyB64}|{wrappedMasterKeyB64}|{signedAtUnix}— subject is the device id (self-upload) orchallenge:{id}(pairing approve, wrapping key taken from the challenge row).Gated surfaces
POST /api/keys/wraps— signed by the caller's devicePOST /api/keys/authorize/approve— wrap signed by the approving deviceFreshness (IDA-07 step-up proxy): ±300 s new wraps, ≤120 s replacements (full IdP re-auth step-up lands with Phase 2, task 2.2). Poisoned attempts → 403 +
wrap.signature_rejectedaudit (acceptance line).Deferred (documented in code): the account-signing-key alternative needs structured PublicKeys JSON (currently opaque client-managed).
Contract migration
Legacy suites (DeviceKeyWrapTests / Phase1JourneyTests / ZkCanaryTests) updated to enroll real ed25519 keys + sign via the shared
WrapTestSigninghelper — contract change, tests updated not deleted (§2.1).Verification
TDD: 6 tests first, RED ×5, then implemented. Suite 859 / 0 failed / 39 skipped (Release + Debug) · gate 85.04% ≥ 80