Commit Graph
9 Commits
Author SHA1 Message Date
zeekay 7d1d9ef701 kms/release: add F2/B4 nonce-binding regression suite
Five test cases asserting the audit-required nonce binding properties:

  1. Round-trip — Issue() → Release(returnedNonce) → success
  2. Wrong nonce — forged nonce ≠ issued → ErrNonceMismatch
  3. Cross-job replay — Issue(A,X) → Release(B,X) → ErrNonceMismatch
  4. Cross-epoch replay — Issue(N,A) → Rotate → Release(N+1,A) refused
  5. Double-Release — Issue → Release → Release → ErrAlreadyConsumed

All five PASS under -race. Pinned to the 7cc39bd binding fix.
2025-12-28 17:33:30 -08:00
zeekay 8f32ddab66 kms/release: bind nonce to (epoch, jobID) and persist replay state
Closes Blue audit B4. Four nonce-binding gaps in the ReleaseGate are
closed in one pass:

1. Nonce derivation is now HMAC-SHA256(rootKey, "kms/release/v1" ||
   epoch || jobID || rand32). A nonce issued for jobID A cannot be
   replayed under jobID B even if the random component is identical.

2. Issue() persists (jobID, nonce, epoch, expires) in a NonceStore.
   Release() looks up the stored nonce and constant-time-compares it
   against req.Nonce. The forged-nonce path now refuses with
   ErrNonceMismatch instead of silently accepting any 32 bytes.

3. AAD now binds the issued nonce: epoch || jobID || teePub || nonce.
   Two Release() calls with the same (epoch, jobID) but different
   issuances produce distinct AADs; sealed keys are non-fungible
   across issuances even after a process restart.

4. State (epoch + pending nonces + consumed-set) is durable via the
   NonceStore interface. Two implementations:
   - MemoryNonceStore for tests / single-shot dev
   - DatabaseNonceStore for prod (luxfi/database; pair with encdb +
     ZapDB for at-rest encryption per Hanzo Base pattern)

Replay window default 1h; pending TTL 1h. GC reclaims both.

Tests cover all five required scenarios + nonce-binding + AAD-binding
asserts. -race clean.

Backwards-incompatible change to NewLocalReleaseGate / NewMPCReleaseGate
/ NewHSMReleaseGate signatures; no compat shim per audit guidance.
2025-12-28 17:07:01 -08:00
zeekay ab1fec5d1f neutral: drop 'Lux'/'Hanzo' brand prefixes in user-facing strings
MPC and KMS are protocols, not products. The Go module path
github.com/luxfi/mpc remains canonical (location), but user-facing
strings (--help, README, comments, banners) are brand-neutral.
'Lux MPC' → 'MPC', 'Lux KMS' → 'KMS', 'Hanzo MPC' → 'MPC'.
2025-12-28 15:34:18 -08:00
zeekay 3fceb5dce6 feat(mpc): key listing, KMS backup/restore, API-only backend, CGGMP21 config serialization 2025-12-27 16:03:48 -08:00
zeekay 351c0d253e feat: implement MFA TOTP, real KMS encryption, smart wallet DB ops, fix dashboard stubs
Backend:
- MFA TOTP via pquerna/otp: generate secret, verify code, enforce at login
- KMS client: real AES-256-GCM encryption with Argon2id key derivation
- Smart wallet handlers: propose/execute Safe tx, submit UserOp via DB
- 9 new KMS tests, all 27 API tests passing

Frontend:
- Dashboard home fetches real vault/wallet counts, transactions, cluster status
- User menu shows actual logged-in email instead of hardcoded placeholder
- Reshare page connected to real API
- Smart wallet detail connected to real API (propose, execute, user-op)
- Loading/error states throughout
2025-12-27 14:17:51 -08:00
zeekay 7d585c39ad fix: resolve golangci-lint issues
- Fix goimports formatting in multiple files
- Remove unused keyType variables in kms_integration.go
- Clean up import formatting
2025-08-16 22:39:45 -05:00
zeekay 98421eb533 fix: update dependencies and fix e2e test issues
- Fixed shell script compatibility for macOS
- Updated e2e module dependencies
- Simplified benchmark tests
- Fixed KMS client build
2025-08-16 13:12:25 -05:00
zeekay e89da4d563 Update examples 2025-08-07 10:55:10 -05:00
zeekay ad3fe8a963 Update scripts, kms integration 2025-08-04 02:21:17 -05:00