-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #201 from martinling/truncated-descriptors
Fix handling of truncated descriptors
- Loading branch information
Showing
5 changed files
with
251 additions
and
71 deletions.
There are no files selected for viewing
This file contains 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
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
Device 16: Unknown | ||
No device descriptor | ||
Configuration 1 | ||
Configuration descriptor | ||
Length: 9 bytes | ||
Type: 0x02 | ||
Total length: 285 bytes | ||
Number of interfaces: 3 | ||
Configuration number: 1 | ||
Configuration string: #4 (not seen) | ||
Attributes: 0xA0 | ||
Max power: 100mA | ||
Function 5: Audio | ||
Interface association descriptor | ||
Length: 8 bytes | ||
Type: 0x0B | ||
First interface: 0 | ||
Interface count: 2 | ||
Function class: 0x01: Audio | ||
Function subclass: 0x00 | ||
Function protocol: 0x20 | ||
Function number: 5 | ||
Interface 0: Audio | ||
Interface descriptor | ||
Length: 9 bytes | ||
Type: 0x04 | ||
Interface number: 0 | ||
Alternate setting: 0 | ||
Number of endpoints: 1 | ||
Class: 0x01: Audio | ||
Subclass: 0x01: Control Device | ||
Protocol: 0x20 | ||
Interface string: #5 (not seen) | ||
Class descriptor 0x24, 9 bytes | ||
Class descriptor 0x24, 8 bytes | ||
Class descriptor 0x24, 17 bytes | ||
Class descriptor 0x24, 12 bytes | ||
Class descriptor 0x24, 18 bytes | ||
Class descriptor 0x24, 16 bytes | ||
Endpoint 7 IN (interrupt) | ||
Endpoint descriptor | ||
Length: 7 bytes | ||
Type: 0x05 | ||
Endpoint address: 0x87 | ||
Attributes: 0x03 | ||
Max packet size: 16 bytes | ||
Interval: 0x08 | ||
Interface 1: Audio | ||
Interface descriptor | ||
Length: 9 bytes | ||
Type: 0x04 | ||
Interface number: 1 | ||
Alternate setting: 0 | ||
Number of endpoints: 0 | ||
Class: 0x01: Audio | ||
Subclass: 0x02: Streaming | ||
Protocol: 0x20 | ||
Interface string: #5 (not seen) | ||
Interface 1 alt 1: Audio | ||
Interface descriptor | ||
Length: 9 bytes | ||
Type: 0x04 | ||
Interface number: 1 | ||
Alternate setting: 1 | ||
Number of endpoints: 1 | ||
Class: 0x01: Audio | ||
Subclass: 0x02: Streaming | ||
Protocol: 0x20 | ||
Interface string: #5 (not seen) | ||
Class descriptor 0x24, 16 bytes | ||
Class descriptor 0x24, 6 bytes | ||
Endpoint 4 OUT (isochronous) | ||
Endpoint descriptor | ||
Length: 7 bytes | ||
Type: 0x05 | ||
Endpoint address: 0x04 | ||
Attributes: 0x09 | ||
Max packet size: 248 bytes | ||
Interval: 0x01 | ||
Class descriptor 0x25, 8 bytes | ||
Interface 1 alt 2: Audio | ||
Interface descriptor | ||
Length: 9 bytes | ||
Type: 0x04 | ||
Interface number: 1 | ||
Alternate setting: 2 | ||
Number of endpoints: 1 | ||
Class: 0x01: Audio | ||
Subclass: 0x02: Streaming | ||
Protocol: 0x20 | ||
Interface string: #5 (not seen) | ||
Class descriptor 0x24, 16 bytes | ||
Class descriptor 0x24, 6 bytes | ||
Endpoint 4 OUT (isochronous) | ||
Endpoint descriptor | ||
Length: 7 bytes | ||
Type: 0x05 | ||
Endpoint address: 0x04 | ||
Attributes: 0x09 | ||
Max packet size: 372 bytes | ||
Interval: 0x01 | ||
Class descriptor 0x25, 8 bytes | ||
Interface 1 alt 3: Audio | ||
Interface descriptor | ||
Length: 9 bytes | ||
Type: 0x04 | ||
Interface number: 1 | ||
Alternate setting: 3 | ||
Number of endpoints: 1 | ||
Class: 0x01: Audio | ||
Subclass: 0x02: Streaming | ||
Protocol: 0x20 | ||
Interface string: #5 (not seen) | ||
Class descriptor 0x24, 16 bytes | ||
Class descriptor 0x24, 6 bytes | ||
Endpoint 4 OUT (isochronous) | ||
Endpoint descriptor | ||
Length: 7 bytes | ||
Type: 0x05 | ||
Endpoint address: 0x04 | ||
Attributes: 0x09 | ||
Max packet size: 496 bytes | ||
Interval: 0x01 | ||
Truncated class descriptor 0x25 (3 of 8 bytes) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Getting configuration descriptor #0 for device 16, reading 255 bytes | ||
SETUP transaction on 16.0 with 8 data bytes, ACK: [80, 06, 00, 02, 00, 00, FF, 00] | ||
SETUP packet on 16.0, CRC 1E | ||
DATA0 packet with CRC A4E9 and 8 data bytes: [80, 06, 00, 02, 00, 00, FF, 00] | ||
ACK packet | ||
9 times: IN transaction on 16.0, NAK | ||
IN packet on 16.0, CRC 1E | ||
NAK packet | ||
IN transaction on 16.0 with 64 data bytes, ACK: [09, 02, 1D, 01, 03, 01, 04, A0, 32, 08, 0B, 00, 02, 01, 00, 20, 05, 09, 04, 00, 00, 01, 01, 01, 20, 05, 09, 24, 01, 00, 02, 04, 50, 00, 00, 08, 24, 0A, 04, 07, 07, 00, 00, 11, 24, 02, 0A, 01, 01, 00, 04, 02, 03, 00, 00, 00, 00, 00, 00, 00, 0C, 24, 03, 10] | ||
IN packet on 16.0, CRC 1E | ||
DATA1 packet with CRC C464 and 64 data bytes: [09, 02, 1D, 01, 03, 01, 04, A0, 32, 08, 0B, 00, 02, 01, 00, 20, 05, 09, 04, 00, 00, 01, 01, 01, 20, 05, 09, 24, 01, 00, 02, 04, 50, 00, 00, 08, 24, 0A, 04, 07, 07, 00, 00, 11, 24, 02, 0A, 01, 01, 00, 04, 02, 03, 00, 00, 00, 00, 00, 00, 00, 0C, 24, 03, 10] | ||
ACK packet | ||
5 times: IN transaction on 16.0, NAK | ||
IN packet on 16.0, CRC 1E | ||
NAK packet | ||
IN transaction on 16.0 with 64 data bytes, ACK: [02, 03, 0A, 16, 04, 00, 00, 00, 12, 24, 06, 16, 0A, 03, 00, 00, 00, 0C, 00, 00, 00, 0C, 00, 00, 00, 00, 10, 24, 09, 19, DA, 0B, 01, 16, 02, 03, 00, 00, 00, 00, 00, 00, 07, 05, 87, 03, 10, 00, 08, 09, 04, 01, 00, 00, 01, 02, 20, 05, 09, 04, 01, 01, 01, 01] | ||
IN packet on 16.0, CRC 1E | ||
DATA0 packet with CRC 0D37 and 64 data bytes: [02, 03, 0A, 16, 04, 00, 00, 00, 12, 24, 06, 16, 0A, 03, 00, 00, 00, 0C, 00, 00, 00, 0C, 00, 00, 00, 00, 10, 24, 09, 19, DA, 0B, 01, 16, 02, 03, 00, 00, 00, 00, 00, 00, 07, 05, 87, 03, 10, 00, 08, 09, 04, 01, 00, 00, 01, 02, 20, 05, 09, 04, 01, 01, 01, 01] | ||
ACK packet | ||
10 times: IN transaction on 16.0, NAK | ||
IN packet on 16.0, CRC 1E | ||
NAK packet | ||
IN transaction on 16.0 with 64 data bytes, ACK: [02, 20, 05, 10, 24, 01, 0A, 00, 01, 01, 00, 00, 00, 02, 03, 00, 00, 00, 00, 06, 24, 02, 01, 02, 10, 07, 05, 04, 09, F8, 00, 01, 08, 25, 01, 00, 00, 00, 00, 00, 09, 04, 01, 02, 01, 01, 02, 20, 05, 10, 24, 01, 0A, 00, 01, 01, 00, 00, 00, 02, 03, 00, 00, 00] | ||
IN packet on 16.0, CRC 1E | ||
DATA1 packet with CRC BBBE and 64 data bytes: [02, 20, 05, 10, 24, 01, 0A, 00, 01, 01, 00, 00, 00, 02, 03, 00, 00, 00, 00, 06, 24, 02, 01, 02, 10, 07, 05, 04, 09, F8, 00, 01, 08, 25, 01, 00, 00, 00, 00, 00, 09, 04, 01, 02, 01, 01, 02, 20, 05, 10, 24, 01, 0A, 00, 01, 01, 00, 00, 00, 02, 03, 00, 00, 00] | ||
ACK packet | ||
16 times: IN transaction on 16.0, NAK | ||
IN packet on 16.0, CRC 1E | ||
NAK packet | ||
IN transaction on 16.0 with 63 data bytes, ACK: [00, 06, 24, 02, 01, 03, 18, 07, 05, 04, 09, 74, 01, 01, 08, 25, 01, 00, 00, 00, 00, 00, 09, 04, 01, 03, 01, 01, 02, 20, 05, 10, 24, 01, 0A, 00, 01, 01, 00, 00, 00, 02, 03, 00, 00, 00, 00, 06, 24, 02, 01, 04, 20, 07, 05, 04, 09, F0, 01, 01, 08, 25, 01] | ||
IN packet on 16.0, CRC 1E | ||
DATA0 packet with CRC 1E7A and 63 data bytes: [00, 06, 24, 02, 01, 03, 18, 07, 05, 04, 09, 74, 01, 01, 08, 25, 01, 00, 00, 00, 00, 00, 09, 04, 01, 03, 01, 01, 02, 20, 05, 10, 24, 01, 0A, 00, 01, 01, 00, 00, 00, 02, 03, 00, 00, 00, 00, 06, 24, 02, 01, 04, 20, 07, 05, 04, 09, F0, 01, 01, 08, 25, 01] | ||
ACK packet | ||
OUT transaction on 16.0 with no data, ACK | ||
OUT packet on 16.0, CRC 1E | ||
DATA1 packet with CRC 0000 and no data | ||
ACK packet |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
analyzer-test-bad-cable | ||
bad-crcs | ||
bad-descriptor-length | ||
emf2022-badge | ||
hackrf-connect | ||
hackrf-dfu-enum | ||
|