-
Notifications
You must be signed in to change notification settings - Fork 1
FEE wrap material on blob_encryption_params (FIL-480) #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e054d52
feat(registry,migrations): FEE wrap material on blob_locations (FIL-480)
claude 3f445a1
refactor: Tighten up migration comment
Peeja 9c91922
fix(registry): enforce all-or-nothing FEE invariant in PutLocation (F…
claude 3db7e44
style(inmem): gofmt test map alignment (FIL-480)
claude b3b1e3a
Merge branch 'main' into claude/fil-480-cipgkz
bajtos b864480
feat(registry): store FEE params in their own table
bajtos 893e930
feat(registry): add a dedicated re-wrap method
bajtos f83f9c0
Merge branch 'main' into claude/fil-480-cipgkz
bajtos d666f5f
stop storing RegionWrappedCEK and RegionKeyVersion in DB
bajtos bf5de99
Merge branch 'main' into claude/fil-480-cipgkz
bajtos f08520e
refactor(registry): trim FEE params to the read path
bajtos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| -- +goose Up | ||
| -- FEE (FilOne encryption envelope) per-blob wrap material, added to | ||
| -- ingot.blob_locations. When Ingot encrypts an object's body, each body blob is | ||
| -- stored as an independent COSE/STREAM ciphertext envelope; a range GET must be | ||
| -- able to decrypt any byte span of that envelope WITHOUT first fetching and | ||
| -- parsing its header. These columns cache exactly the inputs the read path's | ||
| -- aesstream decryptor needs, so a read unwraps the CEK (under the region KEK) | ||
| -- and goes straight to a body-range fetch — no envelope-header round-trip. | ||
| -- | ||
| -- All columns are nullable. An unencrypted blob carries a location row with | ||
| -- these columns NULL. Raw CEK bytes are never stored — only the CEK wrapped | ||
| -- under the region KEK (region_wrapped_cek) plus the key-version / recipient | ||
| -- identifiers needed to unwrap it. Per-blob crypto-shred is nulling these | ||
| -- columns (or deleting the row) — no separate mechanism. Re-wrap under a | ||
| -- rotated region key updates region_wrapped_cek and region_key_version in | ||
| -- place. | ||
| ALTER TABLE ingot.blob_locations | ||
| ADD COLUMN region_wrapped_cek bytea, -- CEK wrapped under the region KEK (A256KW) | ||
| ADD COLUMN region_key_version text, -- opaque id of the region KEK version used (rotation re-wrap) | ||
| ADD COLUMN tenant_recipient_kid text, -- opaque id of the Hilt wrap key (insurance-recovery unwrap) | ||
| ADD COLUMN base_nonce bytea, -- COSE iv: the STREAM nonce seed for this blob's ciphertext | ||
| ADD COLUMN chunk_size bigint, -- FEE chunk size from the COSE protected header | ||
| ADD COLUMN protected_header bytea; -- raw COSE protected header bytes (Enc_structure/AAD reconstruction) | ||
|
|
||
| -- +goose Down | ||
| ALTER TABLE ingot.blob_locations | ||
| DROP COLUMN protected_header, | ||
| DROP COLUMN chunk_size, | ||
| DROP COLUMN base_nonce, | ||
| DROP COLUMN tenant_recipient_kid, | ||
| DROP COLUMN region_key_version, | ||
| DROP COLUMN region_wrapped_cek; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just use
bytes.Clone?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Written by Claude.
Done, and removed the local
cloneByteshelper in favour ofbytes.Cloneeverywhere in the file.