Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6402a97cf3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
JesusMcCloud
left a comment
There was a problem hiding this comment.
more comments than requested changes, but the regression test for equality and hashcode contracts should really make it into this PR
There was a problem hiding this comment.
add regression tests. for equality (success and failure cases, property-based). I know it is fine now, but if we change it up again in the future, it might not be any more
| } | ||
| // The claims as RFC 9901, 7.1 processes them, so that the positions DCQL selects are those of | ||
| // SdJwtDecoded.disclosuresByPath, from which the disclosures to present are taken | ||
| is SubjectCredentialStore.StoreEntry.SdJwt -> catchingUnwrapped { |
There was a problem hiding this comment.
I am 95% sure that conflating "no claims", with "cannot reconstruct" is a non-issue and this function's signature is fine, but please double check on the remaining 5%
There was a problem hiding this comment.
It's cleaner to throw here, you're right
| // OpenID4VP 1.0, 6.1: multiple: "If omitted, the default value is false" | ||
| require(credentialQuery.multiple || presentations.size == 1) { | ||
| "Credential query $id does not allow for multiple submissions, but received ${presentations.size}" | ||
| } |
There was a problem hiding this comment.
how in the name of the lich king was such a spec ever approved!? no matter…
|
|
||
| private fun processArray(input: JsonArray): JsonArray = JsonArray( | ||
| input.mapNotNull { element -> | ||
| /** Positions count only the elements kept, so decoys and withheld elements shift no index (step 3.d). */ |
There was a problem hiding this comment.
what is a decoy?
Follow-up Q: can we also booby-trap the array?
There was a problem hiding this comment.
| private fun processArray(input: JsonArray): JsonArray = JsonArray( | ||
| input.mapNotNull { element -> | ||
| /** Positions count only the elements kept, so decoys and withheld elements shift no index (step 3.d). */ | ||
| private fun processArray(input: JsonArray, path: List<DCQLClaimsPathPointerSegment>): JsonArray { |
There was a problem hiding this comment.
I don't feel confident giving a verdict on the correctness of this function
d0de121 to
1a8d504
Compare
|
@codex review again |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The salt and the claim name of a disclosure "MUST be a string" (RFC 9901, 4.2.1). The parser read both with `jsonPrimitive.content`, so it accepted numbers, booleans and even `null` as their text, while it rejected any salt that is not base64url, which RFC 9901 does not require. `SelectiveDisclosureItem.salt` is now the salt string exactly as in the disclosure; a constructor taking a `ByteArray` base64url-encodes it, so existing callers keep working. Non-string salts and claim names are rejected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The holder reconstructed an SD-JWT with its own algorithm in SdJwtDecoded, which dropped empty objects and arrays and skipped arrays nested in arrays, while validation processed it per RFC 9901, 7.1. Positions of array elements therefore differed between the two. SdJwtDecoded is now built by the validation's processDisclosures, which also records the position of each disclosed claim as a claims path pointer (disclosuresByPath), counting no decoys, and the arrays that contain array element digests. disclosuresFor(pointers) returns the disclosures of the selected claims with their ancestors and sub-claims (RFC 9901, 7.2; OpenID4VP 1.0, 6.4, 7.3). ValidatedCredential.SdJwtVc is built from it, and StoreEntry.SdJwt derives it on first use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The holder matched DCQL claims queries on a mix of the raw issuer-signed payload and SdJwtDecoded, then walked the issuer-signed payload to find the disclosures at the selected positions. Both counted array elements differently, e.g. next to decoy digests or objects without disclosed claims, so a holder could disclose another array element than the one selected. The holder's view of an SD-JWT is now SdJwtDecoded.reconstructedJsonObject, and the disclosures to present are SdJwtDecoded.disclosuresFor the selected positions, so both use the same positions (RFC 9901, 7.1 and 7.2; OpenID4VP 1.0, 6.4, 7.3). The walk over the issuer-signed payload is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The verifier replaced every array index in a DCQL query by null, so an index into a fully visible array matched any element, e.g. ["nationalities", 0] accepted a presentation with "DE" at index 1. Each presentation is now matched against its own copy of the credential query, in which an index becomes null only for arrays that, as issued, contain array element digests (SdJwtDecoded.arraysWithElementDigests): only there can a withheld element or a decoy shift the positions of the disclosed elements (RFC 9901, 7.1 step 3.d and 4.2.5). Indices into other arrays are checked at their position. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wtVc ValidatedCredential.SdJwtVc carries its SdJwtDecoded as decoded, so its sdJwtSigned, reconstructedJsonObject and disclosures only repeat that view. They are deprecated in favor of decoded.sdJwtSigned, decoded.reconstructedJsonObject and decoded.validDisclosures, and all callers in VC-K read from decoded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1a8d504 to
0fea5fd
Compare
Fixes some arcane details for SD-JWT processing (mostly regarding arrays and possibly decoy elements within, messing up index handling), and unifies the view on a reconstructed SD-JWT object (extending the existing
SdJwtDecoded)