Skip to content

Commit

Permalink
Updated CD Device Type Id field to 32-bits to match the spec change. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
emargolis authored and pull[bot] committed Apr 4, 2022
1 parent e611e88 commit 1138699
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/credentials/CertificationDeclaration.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct CertificationElements
uint16_t VendorId;
uint16_t ProductIds[kMaxProductIdsCountPerCD];
uint8_t ProductIdsCount;
uint16_t DeviceTypeId;
uint32_t DeviceTypeId;
char CertificateId[kCertificateIdLength + 1];
uint8_t SecurityLevel;
uint16_t SecurityInformation;
Expand Down
8 changes: 4 additions & 4 deletions src/credentials/tests/TestCertificationDeclaration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,11 @@ static void TestCD_EncodeDecode_Errors(nlTestSuite * inSuite, void * inContext)
NL_TEST_ASSERT(inSuite, EncodeCertificationElements(sTestCMS_CertElements01, encodedCDPayload) == CHIP_ERROR_BUFFER_TOO_SMALL);

// Test Decode Error: CHIP_ERROR_INVALID_INTEGER_VALUE
// Manually modified sTestCMS_CDContent01[]: updated DeviceTypeId element to 4-octet (0x25, 0x03, 0x34, 0x12, --> 0x26, 0x03,
// 0x34, 0x12, 0xFF, 0xFF,)
// Manually modified sTestCMS_CDContent01[]: updated VendorId element to 4-octet
// (0x25, 0x01, 0xf1, 0xff, --> 0x26, 0x01, 0xf1, 0xff, 0xff, 0xff,)
static constexpr uint8_t sTestCMS_CDContent01_Err01[] = {
0x15, 0x24, 0x00, 0x01, 0x25, 0x01, 0xf1, 0xff, 0x36, 0x02, 0x05, 0x00, 0x80, 0x18, 0x26, 0x03, 0x34, 0x12, 0xFF,
0xFF, 0x2c, 0x04, 0x13, 0x5a, 0x49, 0x47, 0x32, 0x30, 0x31, 0x34, 0x31, 0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30,
0x15, 0x24, 0x00, 0x01, 0x26, 0x01, 0xf1, 0xff, 0xff, 0xff, 0x36, 0x02, 0x05, 0x00, 0x80, 0x18, 0x25, 0x03, 0x34,
0x12, 0x2c, 0x04, 0x13, 0x5a, 0x49, 0x47, 0x32, 0x30, 0x31, 0x34, 0x31, 0x5a, 0x42, 0x33, 0x33, 0x30, 0x30, 0x30,
0x31, 0x2d, 0x32, 0x34, 0x24, 0x05, 0x00, 0x24, 0x06, 0x00, 0x25, 0x07, 0x94, 0x26, 0x24, 0x08, 0x00, 0x18
};

Expand Down

0 comments on commit 1138699

Please sign in to comment.