From 2619173d9d41ea53116194344e9c4875481e3c8b Mon Sep 17 00:00:00 2001 From: Evgeny Margolis Date: Thu, 4 Nov 2021 06:57:29 -0700 Subject: [PATCH] Updated CD Device Type Id field to 32-bits to match the spec change. (#11350) --- src/credentials/CertificationDeclaration.h | 2 +- src/credentials/tests/TestCertificationDeclaration.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/credentials/CertificationDeclaration.h b/src/credentials/CertificationDeclaration.h index 0552a90676d69f..2fc29171f773d3 100644 --- a/src/credentials/CertificationDeclaration.h +++ b/src/credentials/CertificationDeclaration.h @@ -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; diff --git a/src/credentials/tests/TestCertificationDeclaration.cpp b/src/credentials/tests/TestCertificationDeclaration.cpp index 844d81b5cd44be..61c9e0c612a02d 100644 --- a/src/credentials/tests/TestCertificationDeclaration.cpp +++ b/src/credentials/tests/TestCertificationDeclaration.cpp @@ -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 };