Skip to content

Verify Link endorsements via HIs learned from the broadcast chain - #5

Open
erkki wants to merge 1 commit into
Fahdonn:drip-hardeningfrom
bear-metal:fix/link-chain-verification
Open

Verify Link endorsements via HIs learned from the broadcast chain#5
erkki wants to merge 1 commit into
Fahdonn:drip-hardeningfrom
bear-metal:fix/link-chain-verification

Conversation

@erkki

@erkki erkki commented Sep 1, 2026

Copy link
Copy Markdown

ac.pendingLinks was never populated, making the chain walk in
recursivelyProcessingLinks unreachable, and handleLink dropped every Link whose
DNSSEC HDA key was not yet cached — with no DNS connectivity no Link ever verified,
so ac.publicKey stayed null and Wrapper/Manifest verification was unreachable.

Change:

  • Record each self-certified childDET -> childHI in per-aircraft knownHIs
    (entries pass verifyDETHashLocal before insertion).
  • Verify a Link with the DNSSEC-resolved parent key when cached, falling back to the
    broadcast-learned parent HI; park it in pendingLinks when neither is available.
  • Re-check pending links whenever a new child HI arrives, regardless of whether the
    carrying Link's own endorsement verified (chain links arrive in arbitrary order).
  • Set the aircraft public key only when childDET matches the aircraft's broadcast
    DET (previously any verified link's child HI became the Wrapper/Manifest key).

Trust model: the broadcast-learned path proves each endorsement is internally
consistent (parent signed child, DETs self-certify); anchoring the chain root uses
the DNSSEC path.

Tests: Broadcast Endorsement captured over the air — Ed25519 verifies under the
parent HI and not the child HI; DET low 64 bits match cSHAKE128(upper64 | HI,
S=Context ID). Device-verified: full 4-link chain (Apex→RAA→HDA→UA) verifies with
arbitrary arrival order, offline and via DNS. Adds org.mockito:mockito-core
(testImplementation) to statically mock android.util.Log per test class rather
than enabling the module-global unitTests.returnDefaultValues. The mockito line
is identical in #3 and merges cleanly.

pendingLinks was never populated, so the chain walk in
recursivelyProcessingLinks was unreachable, and handleLink dropped every
Link whose DNSSEC HDA key was not yet cached — with no DNS connectivity
no Link ever verified.

- Record each self-certified childDET -> childHI in per-aircraft
  knownHIs (entries pass verifyDETHashLocal before insertion).
- Verify a Link with the DNSSEC-resolved parent key when cached,
  falling back to the broadcast-learned parent HI; park it in
  pendingLinks when neither is available.
- Re-check pending links whenever a new child HI arrives, regardless of
  whether the carrying Link's own endorsement verified (arrival order of
  chain links is arbitrary).
- Set the aircraft public key only when childDET matches the aircraft's
  broadcast DET (was: for any verified link, so an HDA HI could become
  the Wrapper/Manifest verification key).

Unit tests use a Broadcast Endorsement captured over the air: Ed25519
verifies under the parent HI and not the child HI; the DET low 64 bits
match cSHAKE128(upper64 | HI, S=Context ID).
android.util.Log is statically mocked (mockito) in the test class.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant