Repository navigation
fix(sdk): DSPX-1561 verify assertion bindings under the assertions specification - #438
Draft
dmihalcik-virtru wants to merge 1 commit into
Draft
dmihalcik-virtru wants to merge 1 commit into
dmihalcik-virtru wants to merge 1 commit into
Conversation
…ecification Each assertion is verified with exactly one key, selected once by its exact id: the per-ID key, else the default key, else the payload key with HS256 (spec Section 6.1). A failure is final, and an empty or invalid configured key, including PEM text given as an HS256 secret, is a configuration error. Each binding is verified only with the key selected from configuration and that key's algorithm; an embedded jwk or x5c must match it (Section 6.2). Embedded keys that are symmetric, private, malformed for their key type, not canonically encoded, or contradictory, and any embedded key in HMAC mode, are rejected. The JWS alg must equal the selected key's algorithm, crit headers and duplicate JOSE members are rejected, base64 is decoded strictly, claims other than assertionHash and assertionSig are ignored, and both binding forms of Section 5.1 are recognized, with binding objects reported as unsupported. Checks follow the Section 8 order, and every failure is reported as an SDK.AssertionFailureException with its reason. JSON that does not parse inside an assertion is reported as invalid-json. Key selection stays inside loadTDF, and Manifest.Assertion.verify has no side effects. Signed-off-by: Dave Mihalcik <dmihalcik@virtru.com>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
This was referenced Nov 9, 2026
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.
Proposed Changes
configuration-errorinstead of falling through to the next source.jwkorx5cmust hold the same public key (RFC 7638 thumbprint), or verification fails withsigner-not-permitted(Section 6.2). Embedded keys that are symmetric, private, malformed, not canonically encoded, or contradictory, and any embedded key in HMAC mode, fail withinvalid-embedded-key.critheader, no duplicate header or claim members, and analgequal to the selected key's. Claims other thanassertionHashandassertionSigare ignored.methodmeansjws,jwsandJWSare accepted, and STANAG 4778 binding objects are reported asunsupported-binding.SDK.AssertionFailureExceptionwith its reason. Key selection stays insideloadTDF;Manifest.Assertion.verifyhas no side effects.Stacked on: #437. This supersedes the verification change in #434; it will be rebased once that and #435 land.
Split out of #432 (draft; the complete change). Cross-SDK counterparts: opentdf/platform#4307, opentdf/web-sdk#1141; cross-SDK test: opentdf/tests#706.
Compatibility:
algorithm-mismatch.system-metadata, so those fail when only a default key is set.configuration-erroreven if another source would have verified the assertion.Checklist
Testing Instructions
mvn -pl sdk,cmdline -am test(new cases inAssertionVerificationTestandAssertionVerifierTest).