Skip to content

feat(lazy-reencryption): Phase 1 — Foundation (schema, archive CRUD, kek_version) - #9

Open
Erik-Castro wants to merge 1 commit into
feat/lazy-reencryptionfrom
feat/lazy-reencryption-fd
Open

feat(lazy-reencryption): Phase 1 — Foundation (schema, archive CRUD, kek_version)#9
Erik-Castro wants to merge 1 commit into
feat/lazy-reencryptionfrom
feat/lazy-reencryption-fd

Conversation

@Erik-Castro

Copy link
Copy Markdown
Owner

Summary

PR #1 of feature-branch-chain feat/lazy-reencryption. Foundation layer for lazy KEK re-encryption:

  • New kek_archive table with FK CASCADE + UNIQUE(user_id, kek_version)
  • kek_archive CRUD module: store, find_by_version, delete_version, list_for_user
  • kek_version column on secrets (DEFAULT 1)
  • secrets_count_by_kek_version() and secrets_update_ciphertext()
  • Schema migration v3→v4 (forward + rollback)
  • 11 GTest tests (8 archive CRUD + 3 migration)

Type of Change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change
  • Documentation / meta

SDD Checklist

  • secure_erase / secure_buffer used for all sensitive data on the stack/heap
  • No hardcoded secrets, keys, or passwords added
  • Error paths do not leak sensitive information in messages
  • Thread safety: shared state protected by mutex/rwlock
  • Memory: no raw delete/free without RAII wrapper
  • Input validation: all public API parameters checked

Testing Checklist

  • New tests added for the change
  • Existing tests still pass: build environment unavailable (Termux NDK mismatch)
  • Builds cleanly: build environment unavailable
  • Code formatted: verified manually
  • Memory check clean: N/A (no memory management changes in this PR)

Related Issues

Part of SDD change lazy-reencryption.

…kek_version)

- Create kek_archive table with FK CASCADE + UNIQUE(user_id, kek_version)
- Add kek_archive CRUD module (store, find_by_version, delete_version, list_for_user)
- Add kek_version column to secrets table (DEFAULT 1)
- Add secrets_count_by_kek_version() + secrets_update_ciphertext()
- Bump SSM_SCHEMA_VERSION: 3→4 with migration (forward + rollback)
- Register new files in CMakeLists
- 11 tests: 8 archive CRUD + 3 migration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant