Repository navigation
Conversation
DSPX-5117, Go side. Adds the partial_decrypt and http_range_source features and the XT_WITH_PLAINTEXT_RANGE=<offset>:<length> driver contract. The go shim maps it to otdfctl --offset/--length and answers both features from supported_features; the java and js shims report them unsupported until DSPX-5115/5116 ship. SDK.decrypt takes a plaintext_range and accepts a URL as input. test_partial_decrypt.py decrypts nine ranges of the 5 MiB multi-segment payload from a file and through the DSPX-5111 range server, compares each with the plaintext slice, bounds the bytes fetched over HTTP to head + covering segments + tail, and checks the rewrap audit event, in-range segment and root-signature tamper, and offset past end. Signed-off-by: sujan kota <sujankota@gmail.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 1
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



DSPX-5117, Go side. Stacked on #653 (needs the range server).
Changes
tdfs.py:partial_decryptandhttp_range_source.SDK.decryptgainsplaintext_range=(offset, length | None)and accepts an http(s) URL as input.XT_WITH_PLAINTEXT_RANGE=<offset>:<length>. An empty length means "to the end".cli.shmaps the variable to otdfctl--offset/--lengthand answers both features from--version --json.supported_features, the same way dpop is answered. Needs platform#4234, stacked on #4229 and #4221.cli.shreport both features as unsupported until DSPX-5115 and DSPX-5116 ship.test_partial_decrypt.pyruns every encrypt × decrypt pair on the 5 MiB multi-segment payload, from a local file and over HTTP through the range server.Local results
Run with
otdf-sdk-mgr install tip --ref pr:4234 go, platform main, andPLATFORM_VERSION=0.29.0: 17 passed, 4 failed. The failures point at the SDK, not the tests:one_whole_segment-httpandlast_segment-httpfetch one extra segment. A range that starts exactly on a segment boundary also reads and decrypts the segment before it.Reader.WriteTo(sdk/tdf.go,decryptedDataOffset+segSize < r.cursor) should use<=, asReadAtalready does. The line predates #4229, but #4229's Seek +io.Copypath is the first thing to hit it.length_zero-fileandlength_zero-httpemit no rewrap audit event. With--length 0, otdfctl returns before contacting KAS, so it exits 0 with no authorization check. DSPX-5114 requires the rewrap and audit event to match a full decrypt.Not in this PR