Skip to content

Skip SSI-Type byte when parsing Type-4 Basic ID UAS IDs - #3

Open
erkki wants to merge 1 commit into
Fahdonn:drip-hardeningfrom
bear-metal:fix/basicid-ssi-type
Open

Skip SSI-Type byte when parsing Type-4 Basic ID UAS IDs#3
erkki wants to merge 1 commit into
Fahdonn:drip-hardeningfrom
bear-metal:fix/basicid-ssi-type

Conversation

@erkki

@erkki erkki commented Aug 31, 2026

Copy link
Copy Markdown

Per RFC 9374 §4, the 20-byte UAS ID field of a Type-4 (Specific Session ID) Basic ID
is [SSI Type (1)][DET (16)][padding (3)], SSI Type 1 = IETF DET. parseBasicId
copied field bytes 0..15 as the DET, so every SSI-prefixed DET was stored shifted by
one byte; isDET(), the manifest DET comparison, and the DNS lookup then operated on
a corrupted value and DRIP authentication could never bind to the aircraft.

Change: detect SSI Type 0x01 and extract the DET at offset 1; a field not starting
with 0x01 is still read as a raw 16-byte DET (legacy transmitters). Other ID types
keep the full 20-byte field. parseBasicId widened to package-private for the test.

Tests: synthetic DET round-trips for SSI-prefixed, raw, and serial-number fields.
Device-verified: DNS reverse name and isDET operate on the exact 16-byte DET.

against drip-hardening but could be rebased against main too

RFC 9374 section 4: for UAS ID type 4 (Specific Session ID) the 20-byte
UAS ID field is [SSI Type (1)] [DET (16)] [padding (3)], SSI Type 1 =
IETF DET. parseBasicId copied field bytes 0..15 as the DET, so every
SSI-prefixed DET was stored shifted by one byte and isDET(), manifest DET
comparison, and DNS lookup all operated on a corrupted value.

Detect SSI Type 0x01 and extract the DET at offset 1; a field not
starting with 0x01 is still read as a raw 16-byte DET (legacy
transmitters). Other ID types keep the full 20-byte field.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@methodmissing methodmissing left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀 LGTM - just had a comment on the legacy / backwards compat path

if (basicId.idType == Identification.IdTypeEnum.Specific_Session_ID.ordinal()) {
// RFC 9374 section 4: the 20-byte UAS ID field is
// [SSI Type (1)] [DET (16)] [padding (3)]. SSI Type 1 = IETF DET.
// Raw 16-byte DETs (no SSI Type byte) are accepted for legacy transmitters.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backwards compatibility, but still not correct though - I'm 🆗 with the temporal fallback, but there's also nothing as permanent as the temporary.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep agreed maybe this should be tighter, depends on if any legacy transmitters exist or assumptions made originally

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.

2 participants