Repository navigation
refactor(keyed): select FIT properties and certificate extensions through uniqueKeyed - #10875
Merged
morluto merged 1 commit intoNov 15, 2026
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. |
Contributor
[Low impact] The PR appears safe to merge; no actionable defects were found. SummaryFIT property reads and APK certificate extension reads now use
Reviews (2) · Last reviewed commit: "refactor(keyed): select FIT properties a..." · Reviewed by Greptile |
22 tasks
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.
Summary
The last two
keyed-first-matchbaseline entries now select throughuniqueKeyed. FIT reads a node property by name, and the APK v1 reader reads a certificate'sextensions [3]. The baseline reaches zero. Refs plan W7; stacked on #10874.Problem and expected behavior
FitStructure.propertyOfreturned the first property with a name vianode.properties.find(...).apkV1SignatureBlock.certificateIdentitytook the first[3]field oftbsCertificateviafields.find(...). Inside it, a repeatedsubjectKeyIdentifierextension silently let the last one win.What a repeat means, by spec:
DevicetreeParser.ts) already refuses a repeated property name in one node as malformed ("Empty or duplicate FDT property name"), matching dtc'sduplicate_property_nameserror check. A repeat is malformed, not a limitation.extensions [3] EXPLICIT. X.690 SEQUENCE components appear once, in order. RFC 5280 §4.2 says a certificate MUST NOT include more than one instance of a particular extension. A repeat is not a TBSCertificate: malformed for identity purposes.Change and scope
FitStructure.propertyOf:uniqueKeyed(keyedBy(node.properties, name)). A repeat throws the reader's existingformatFailure("FIT is malformed: declares property more than once"). The parser reaches that state first today, so this keeps the FIT reader's own rule explicit rather than first-wins.apkV1SignatureBlock.certificateIdentity:[3]throwsmalformed("tbsCertificate declares extensions more than once").subjectKeyIdentifierextension throws the matching message.unavailableIdentityInterpretationpath: the certificate is still reported, but it names no SignerInfo (certificateIndex: null).keyed-first-matchlosesFitStructure.tsandapkV1SignatureBlock.tsand is now empty.cipher,hash*). Node names are unique per path by the same parser (Duplicate FDT node path), and the guard does not match them.Contribution scope: not applicable (refactor inside existing boundaries).
Contract and boundary impact
src/domain/apkSignature/apkV1SignatureBlock.tscertificate identity;src/artifacts/fit/FitStructure.tsproperty access over the devicetree parser's nodes.extensions [3]orsubjectKeyIdentifierno longer identifies a signer.docs/public/product-catalog.json), package, or installation impact: none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
apkV1SignatureBlock.test.ts"names no certificate whose tbsCertificate repeats its extensions". It uses a new fixture helper,withRepeatedExtensions, intests/fixtures/apkSignature/v1SignatureBlock.ts.apkV1SignatureBlock.tsrestored, the new test fails (1 failed | 23 passed): the signer was associated with the first[3]. It passes with the change.subjectKeyIdentifierextension (source-derived).For evidence-bearing changes:
Validation performed
npm run check:fast— passed.node scripts/verify/architecture-guards.mjs --shrink-baselines— passed;keyed-first-matchbaseline emptied.npm run test:local -- src/domain/apkSignature/apkV1SignatureBlock.test.ts src/domain/apkSignature/apkV1Signature.test.ts src/apkSignature/apkV1Signers.test.ts— 46 passed.npm run test:local -- src/artifacts/fit/FitStructure.test.ts— 32 passed.npm run test:focused -- tests/boundary/filesystem/keyedFirstMatchGuard.test.ts src/native/AppleMachoSelection.test.ts src/native/MachoArchitectureSelection.test.ts src/domain/apkSignature/apkV1SignatureBlock.test.ts— 106 passed (after rebasing onto the collapsed refactor(native): select ELF sections through the keyed owner #10780).apkV1SignatureBlock.ts— 1 failed, as expected.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.