diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml index 053eb96af69796..a7d8f31a819124 100644 --- a/.github/workflows/darwin.yaml +++ b/.github/workflows/darwin.yaml @@ -155,7 +155,7 @@ jobs: TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-incomplete-umbrella -Wno-unguarded-availability-new' CHIP_IS_UBSAN=YES > >(tee /tmp/darwin/framework-tests/darwin-tests-asan.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-err.log >&2) # -enableThreadSanitizer instruments the code in Matter.framework, # but to instrument the code in the underlying libCHIP we need to pass CHIP_IS_TSAN=YES - #xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableThreadSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-incomplete-umbrella -Wno-unguarded-availability-new' CHIP_IS_TSAN=YES > >(tee /tmp/darwin/framework-tests/darwin-tests-tsan.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-tsan-err.log >&2) + xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableThreadSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-incomplete-umbrella -Wno-unguarded-availability-new' CHIP_IS_TSAN=YES > >(tee /tmp/darwin/framework-tests/darwin-tests-tsan.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-tsan-err.log >&2) working-directory: src/darwin/Framework - name: Uploading log files uses: actions/upload-artifact@v3 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 129a1de287cc6b..8b6f099ca15c48 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -215,6 +215,14 @@ jobs: run: | git grep -n 'SuccessOrExit(CHIP_ERROR' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 + # git grep exits with 0 if it finds a match, but we want + # to fail (exit nonzero) on match. And we want to exclude this file, + # to avoid our grep regexp matching itself. + - name: Check for use of "SuccessOrExit(something-without-assignment(", which should probably be "SuccessOrExit(err = something(" + if: always() + run: | + git grep -n 'SuccessOrExit([^=)]*(' -- './*' ':(exclude).github/workflows/lint.yml' && exit 1 || exit 0 + - name: Check that our hardcoded SHA for clang-format on ARM mac matches the pigweed SHA. if: always() run: | diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index a5f26e3e46cec3..14a02232bde429 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -359,6 +359,9 @@ endif() if(CONFIG_OPENTHREAD_ENABLED) idf_component_get_property(openthread_lib openthread COMPONENT_LIB) list(APPEND chip_libraries $) + + idf_component_get_property(ieee802154_lib ieee802154 COMPONENT_LIB) + list(APPEND chip_libraries $) endif() if((NOT CONFIG_USE_MINIMAL_MDNS) AND (CONFIG_ENABLE_WIFI_STATION OR CONFIG_ENABLE_WIFI_AP)) @@ -436,6 +439,12 @@ list(APPEND chip_libraries $) idf_component_get_property(efuse_lib efuse COMPONENT_LIB) list(APPEND chip_libraries $) +idf_component_get_property(vfs_lib vfs COMPONENT_LIB) +list(APPEND chip_libraries $) + +idf_component_get_property(driver_lib driver COMPONENT_LIB) +list(APPEND chip_libraries $) + target_link_libraries(${COMPONENT_LIB} INTERFACE -Wl,--start-group ${chip_libraries} $ $ diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index 732f0533a3d708..9a1b92a28e1a0b 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -705,12 +705,9 @@ menu "CHIP Device Layer" depends on SEC_CERT_DAC_PROVIDER && SOC_ECDSA_SUPPORTED default y select MBEDTLS_HARDWARE_ECDSA_SIGN - select ENABLE_ESP32_FACTORY_DATA_PROVIDER - select ENABLE_ESP32_DEVICE_INSTANCE_INFO_PROVIDER help If DAC is being read from secure cert and SOC supports ECDSA signing using on-chip peripheral - then this option gets enabled. This option also selects few more that are required for commissioning - the device. + then this option gets enabled. Also, please disable ESP_SECURE_CERT_DS_PERIPHERAL from the menuconfig when this option is disabled endmenu diff --git a/examples/android/CHIPTool/app/src/main/cpp/native-lib.cpp b/examples/android/CHIPTool/app/src/main/cpp/native-lib.cpp index 4cf34c56cac0d4..4a0235adbff06e 100644 --- a/examples/android/CHIPTool/app/src/main/cpp/native-lib.cpp +++ b/examples/android/CHIPTool/app/src/main/cpp/native-lib.cpp @@ -24,13 +24,14 @@ #include #include #include +#include // This is just a sample function to demonstrate end-to-end calling in/out of CHIP stack // is working. std::string base38Encode(void) { - const uint8_t buf[6] = { 0, 1, 2, 3, 4, 5 }; - size_t size = 6; + const uint8_t buf[] = { 0, 1, 2, 3, 4, 5 }; + size_t size = ArraySize(buf); return chip::base38Encode(&buf[0], size); } diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index 474528bb9c6120..4f1be06178d2f3 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -2098,27 +2098,27 @@ endpoint 1 { } server cluster ColorControl { - ram attribute currentHue default = 0x00; - ram attribute currentSaturation default = 0x00; + persist attribute currentHue default = 0x00; + persist attribute currentSaturation default = 0x00; ram attribute remainingTime default = 0x0000; - ram attribute currentX default = 0x616B; - ram attribute currentY default = 0x607D; - ram attribute colorTemperatureMireds default = 0x00FA; - ram attribute colorMode default = 0x01; + persist attribute currentX default = 0x616B; + persist attribute currentY default = 0x607D; + persist attribute colorTemperatureMireds default = 0x00FA; + persist attribute colorMode default = 0x01; ram attribute options default = 0x00; ram attribute numberOfPrimaries; - ram attribute enhancedCurrentHue default = 0x0000; - ram attribute enhancedColorMode default = 0x01; - ram attribute colorLoopActive default = 0x00; - ram attribute colorLoopDirection default = 0x00; - ram attribute colorLoopTime default = 0x0019; + persist attribute enhancedCurrentHue default = 0x0000; + persist attribute enhancedColorMode default = 0x01; + persist attribute colorLoopActive default = 0x00; + persist attribute colorLoopDirection default = 0x00; + persist attribute colorLoopTime default = 0x0019; ram attribute colorLoopStartEnhancedHue default = 0x2300; ram attribute colorLoopStoredEnhancedHue default = 0x0000; ram attribute colorCapabilities default = 0x1F; ram attribute colorTempPhysicalMinMireds default = 0x0000; ram attribute colorTempPhysicalMaxMireds default = 0xFEFF; ram attribute coupleColorTempToLevelMinMireds; - ram attribute startUpColorTemperatureMireds; + persist attribute startUpColorTemperatureMireds; ram attribute featureMap default = 0x1F; ram attribute clusterRevision default = 5; } diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap index 5e96210d9d6c01..596c95c3110925 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap @@ -7031,7 +7031,7 @@ "side": "server", "type": "int8u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x00", @@ -7047,7 +7047,7 @@ "side": "server", "type": "int8u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x00", @@ -7079,7 +7079,7 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x616B", @@ -7095,7 +7095,7 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x607D", @@ -7143,7 +7143,7 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x00FA", @@ -7159,7 +7159,7 @@ "side": "server", "type": "enum8", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x01", @@ -7671,7 +7671,7 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x0000", @@ -7687,7 +7687,7 @@ "side": "server", "type": "enum8", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x01", @@ -7703,7 +7703,7 @@ "side": "server", "type": "int8u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x00", @@ -7719,7 +7719,7 @@ "side": "server", "type": "int8u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x00", @@ -7735,7 +7735,7 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x0019", @@ -7847,7 +7847,7 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8076,5 +8076,6 @@ "endpointVersion": 1, "deviceIdentifier": 257 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index 1034b31939d8ae..ab7999f8a6127e 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -1897,27 +1897,27 @@ endpoint 1 { } server cluster ColorControl { - ram attribute currentHue default = 0x00; - ram attribute currentSaturation default = 0x00; + persist attribute currentHue default = 0x00; + persist attribute currentSaturation default = 0x00; ram attribute remainingTime default = 0x0000; - ram attribute currentX default = 0x616B; - ram attribute currentY default = 0x607D; - ram attribute colorTemperatureMireds default = 0x00FA; - ram attribute colorMode default = 0x01; + persist attribute currentX default = 0x616B; + persist attribute currentY default = 0x607D; + persist attribute colorTemperatureMireds default = 0x00FA; + persist attribute colorMode default = 0x01; ram attribute options default = 0x00; ram attribute numberOfPrimaries; - ram attribute enhancedCurrentHue default = 0x0000; - ram attribute enhancedColorMode default = 0x01; - ram attribute colorLoopActive default = 0x00; - ram attribute colorLoopDirection default = 0x00; - ram attribute colorLoopTime default = 0x0019; + persist attribute enhancedCurrentHue default = 0x0000; + persist attribute enhancedColorMode default = 0x01; + persist attribute colorLoopActive default = 0x00; + persist attribute colorLoopDirection default = 0x00; + persist attribute colorLoopTime default = 0x0019; ram attribute colorLoopStartEnhancedHue default = 0x2300; ram attribute colorLoopStoredEnhancedHue default = 0x0000; ram attribute colorCapabilities default = 0x1F; ram attribute colorTempPhysicalMinMireds default = 0x0000; ram attribute colorTempPhysicalMaxMireds default = 0xFEFF; ram attribute coupleColorTempToLevelMinMireds; - ram attribute startUpColorTemperatureMireds; + persist attribute startUpColorTemperatureMireds; ram attribute featureMap default = 0x1F; ram attribute clusterRevision default = 5; } diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap index 1ef14ccbb3a382..c119cc3e31bbda 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap @@ -7149,7 +7149,7 @@ "side": "server", "type": "int8u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x00", @@ -7165,7 +7165,7 @@ "side": "server", "type": "int8u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x00", @@ -7197,7 +7197,7 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x616B", @@ -7213,7 +7213,7 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x607D", @@ -7261,7 +7261,7 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x00FA", @@ -7277,7 +7277,7 @@ "side": "server", "type": "enum8", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x01", @@ -7789,7 +7789,7 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x0000", @@ -7805,7 +7805,7 @@ "side": "server", "type": "enum8", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x01", @@ -7821,7 +7821,7 @@ "side": "server", "type": "int8u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x00", @@ -7837,7 +7837,7 @@ "side": "server", "type": "int8u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x00", @@ -7853,7 +7853,7 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "0x0019", @@ -7965,7 +7965,7 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "NVM", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8194,5 +8194,6 @@ "endpointVersion": 1, "deviceIdentifier": 257 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/examples/platform/nxp/se05x/DeviceAttestationSe05xCredsExample.cpp b/examples/platform/nxp/se05x/DeviceAttestationSe05xCredsExample.cpp index 5df0e38db4d171..5c8b513974f866 100644 --- a/examples/platform/nxp/se05x/DeviceAttestationSe05xCredsExample.cpp +++ b/examples/platform/nxp/se05x/DeviceAttestationSe05xCredsExample.cpp @@ -89,7 +89,7 @@ CHIP_ERROR ExampleSe05xDACProvider::GetCertificationDeclaration(MutableByteSpan //-> certification_type = 0 //-> dac_origin_vendor_id is not present //-> dac_origin_product_id is not present - const uint8_t kCdForAllExamples[541] = { + const uint8_t kCdForAllExamples[] = { 0x30, 0x82, 0x02, 0x19, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x02, 0x0a, 0x30, 0x82, 0x02, 0x06, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x82, 0x01, 0x71, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, 0x01, 0x62, diff --git a/examples/platform/nxp/se05x/DeviceAttestationSe05xCredsExample_v2.cpp b/examples/platform/nxp/se05x/DeviceAttestationSe05xCredsExample_v2.cpp index 08cab351f771aa..4b8202cd99f86a 100644 --- a/examples/platform/nxp/se05x/DeviceAttestationSe05xCredsExample_v2.cpp +++ b/examples/platform/nxp/se05x/DeviceAttestationSe05xCredsExample_v2.cpp @@ -123,7 +123,7 @@ CHIP_ERROR ExampleSe05xDACProviderv2::GetCertificationDeclaration(MutableByteSpa //-> dac_origin_vendor_id is not present //-> dac_origin_product_id is not present #if 0 - const uint8_t kCdForAllExamples[541] = { + const uint8_t kCdForAllExamples[] = { 0x30, 0x82, 0x02, 0x19, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x02, 0x0a, 0x30, 0x82, 0x02, 0x06, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x82, 0x01, 0x71, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, 0x01, 0x62, @@ -196,7 +196,7 @@ CHIP_ERROR ExampleSe05xDACProviderv2::SignWithDeviceAttestationKey(const ByteSpa }; tempBuf[0] = (uint8_t) TLV::TLVElementType::Structure; - SuccessOrExit(se05xSetCertificate(START_CONTAINER_SE05X_ID, tempBuf, 1)); + SuccessOrExit(err = se05xSetCertificate(START_CONTAINER_SE05X_ID, tempBuf, 1)); for (int i = 1; i <= NO_OF_DEV_ATTEST_MSG_TAGS_TO_PARSE; i++) { @@ -206,6 +206,7 @@ CHIP_ERROR ExampleSe05xDACProviderv2::SignWithDeviceAttestationKey(const ByteSpa { continue; } + // TODO: Should this be setting err = tlverr? SuccessOrExit(tlverr); // Transient binary object ids starting from location 0x7D300005 (TAG1_ID) to 0x7D30000D (TAG3_VALUE_ID) @@ -215,35 +216,35 @@ CHIP_ERROR ExampleSe05xDACProviderv2::SignWithDeviceAttestationKey(const ByteSpa taglen = tagReader.GetLength(); tempBuf[0] = tagReader.GetControlByte(); tempBuf[1] = i; - SuccessOrExit(se05xSetCertificate(TAG1_ID + (3 /* tag + length + value ids */ * (i - 1)), tempBuf, 2)); + SuccessOrExit(err = se05xSetCertificate(TAG1_ID + (3 /* tag + length + value ids */ * (i - 1)), tempBuf, 2)); if (taglen > 256) { tempBuf[0] = taglen & 0xFF; tempBuf[1] = (taglen >> 8) & 0xFF; - SuccessOrExit(se05xSetCertificate(TAG1_LEN_ID + (3 * (i - 1)), tempBuf, 2)); + SuccessOrExit(err = se05xSetCertificate(TAG1_LEN_ID + (3 * (i - 1)), tempBuf, 2)); } else { tempBuf[0] = taglen; - SuccessOrExit(se05xSetCertificate(TAG1_LEN_ID + (3 * (i - 1)), tempBuf, 1)); + SuccessOrExit(err = se05xSetCertificate(TAG1_LEN_ID + (3 * (i - 1)), tempBuf, 1)); } if (taglen > 0) { - SuccessOrExit(tagReader.Get(tagvalue)); - SuccessOrExit(se05xSetCertificate(TAG1_VALUE_ID + (3 * (i - 1)), tagvalue.data(), taglen)); + SuccessOrExit(err = tagReader.Get(tagvalue)); + SuccessOrExit(err = se05xSetCertificate(TAG1_VALUE_ID + (3 * (i - 1)), tagvalue.data(), taglen)); } } tempBuf[0] = (uint8_t) TLV::TLVElementType::EndOfContainer; - SuccessOrExit(se05xSetCertificate(END_CONTAINER_SE05X_ID, tempBuf, 1)); + SuccessOrExit(err = se05xSetCertificate(END_CONTAINER_SE05X_ID, tempBuf, 1)); if ((tagReader.GetRemainingLength() + 1 /* End container */) >= 16) { /* Set attestation challenge */ - SuccessOrExit(se05xSetCertificate(ATTEST_CHALLENGE_ID, (message_to_sign.end() - 16), 16)); + SuccessOrExit(err = se05xSetCertificate(ATTEST_CHALLENGE_ID, (message_to_sign.end() - 16), 16)); } - SuccessOrExit(se05xPerformInternalSign(DEV_ATTESTATION_KEY_SE05X_ID_IS, signature_se05x, &signature_se05x_len)); + SuccessOrExit(err = se05xPerformInternalSign(DEV_ATTESTATION_KEY_SE05X_ID_IS, signature_se05x, &signature_se05x_len)); err = chip::Crypto::EcdsaAsn1SignatureToRaw(chip::Crypto::kP256_FE_Length, ByteSpan{ signature_se05x, signature_se05x_len }, out_signature_buffer); diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.h index 98376a62ddd436..d90e4db486156b 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.h +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.h @@ -1,6 +1,6 @@ /** * - * Copyright (c) 2020-2022 Project CHIP Authors + * Copyright (c) 2020-2023 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -102,7 +102,7 @@ @return Onboarding payload */ -- (OnboardingPayload * _Nonnull)getOnboardingPaylod; +- (OnboardingPayload * _Nonnull)getOnboardingPayload; /*! @brief Request opening of a basic commissioning window diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm index bac90428ce2417..50c2467b85be3f 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm @@ -1,6 +1,6 @@ /** * - * Copyright (c) 2020-2022 Project CHIP Authors + * Copyright (c) 2020-2023 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,16 +59,6 @@ @interface CastingServerBridge () // queue used to serialize all work performed by the CastingServerBridge @property (atomic) dispatch_queue_t chipWorkQueue; -@property void (^_Nonnull commissioningCompleteCallback)(bool); - -@property void (^_Nonnull onConnectionSuccessCallback)(VideoPlayer *); - -@property void (^_Nonnull onConnectionFailureCallback)(MatterError *); - -@property void (^_Nonnull onNewOrUpdatedEndpointCallback)(ContentApp *); - -@property NSMutableDictionary * commandResponseCallbacks; - @property NSMutableDictionary * subscriptionEstablishedCallbacks; @property NSMutableDictionary * subscriptionReadSuccessCallbacks; @@ -102,6 +92,8 @@ - (instancetype)init return nil; } + // TODO: Constructors should not perform heavy work like initializing the Matter SDK. This should + // be moved to initializeApp or another suitable location. err = chip::DeviceLayer::PlatformMgr().InitChipStack(); if (err != CHIP_NO_ERROR) { ChipLogError(AppServer, "InitChipStack failed: %s", ErrorStr(err)); @@ -110,7 +102,6 @@ - (instancetype)init _commissionerDiscoveryDelegate = new CommissionerDiscoveryDelegateImpl(); - _commandResponseCallbacks = [NSMutableDictionary dictionary]; _subscriptionEstablishedCallbacks = [NSMutableDictionary dictionary]; _subscriptionReadSuccessCallbacks = [NSMutableDictionary dictionary]; _subscriptionReadFailureCallbacks = [NSMutableDictionary dictionary]; @@ -120,10 +111,166 @@ - (instancetype)init return self; } +/** + Dispatches the block on the Matter SDK dispatch queue. + + @param description Optional. A description of the callback to be dispatched for diagnostic purposes. + @param block The Block to be dispatched. + */ +- (void)dispatchOnMatterSDKQueue:(const NSString * _Nullable)description block:(dispatch_block_t)block +{ + if (nil != description) { + ChipLogProgress(AppServer, "[SYNC] CastingServerBridge %s", [description UTF8String]); + } + dispatch_async(_chipWorkQueue, ^{ + // The Matter SDK is not, generally, internally thread-safe. It relies upon the client to lock + // the SDK prior to any interactions after chip::DeviceLayer::PlatformMgr().InitChipStack() + // + // Note that it is presently safe to do at this point because InitChipStack is called in the + // constructor for the CastingServerBridge. + chip::DeviceLayer::StackLock lock; + + if (nil != description) { + ChipLogProgress(AppServer, "[ASYNC (CHIP)] CastingServerBridge BEGIN %s", [description UTF8String]); + } + block(); + if (nil != description) { + ChipLogProgress(AppServer, "[ASYNC (CHIP)] CastingServerBridge END %s", [description UTF8String]); + } + }); +} + +/** + Dispatches a client callback via a `dispatch_block_t` to be run on the client's `dispatch_queue_t`. + + @param queue The client's Dispatch Queue. + @param description Optional. A description of the callback to be dispatched for diagnostic purposes. + @param block The Block to be invoked to invoke the client callback. + */ +- (void)dispatchOnClientQueue:(dispatch_queue_t)queue + description:(const NSString * _Nullable)description + block:(dispatch_block_t)block +{ + // Within the CastingServerBridge, the usage pattern is typically to expose asynchronous public APIs that + // take a callback to indicate that the low-level SDK operation has been initiated (the "started" + // callback), and a separate set of result callbacks to be invoked when the low-level SDK operation + // has been completed (the "result" callbacks). + // + // All of the work is serialized on the _chipWorkQueue, with the started callback being invoked after the + // Matter SDK is called with the result callbacks. This poses a challenge because we don't have a strong + // guarantee that the Matter SDK will not complete its work and invoke the result callback before control + // is returning to the _chipWorkQueue thread; this can cause callbacks to be received in an unexpected + // order, where the result might arrive before the client knows that the call was started. + // + // To avoid this confusion, we perform a "double async" dispatch to ensure that events are delivered in a + // sensible order. First, we schedule the result callback to run on the _chipWorkQueue (so it *must* run + // after the end of the CastingServerBridge's wrapper logic that already started on the _chipWorkQueue) + // and then immediately, asynchronously dispatch the callback onto the provided client queue. + dispatch_async(_chipWorkQueue, ^{ + if (nil != description) { + ChipLogProgress(AppServer, "[ASYNC (CHIP)] CastingServerBridge dispatching %s", [description UTF8String]); + } + dispatch_async(queue, ^{ + if (nil != description) { + ChipLogProgress(AppServer, "[ASYNC (CLIENT)] CastingServerBridge BEGIN %s", [description UTF8String]); + } + block(); + if (nil != description) { + ChipLogProgress(AppServer, "[ASYNC (CLIENT)] CastingServerBridge END %s", [description UTF8String]); + } + }); + }); +} + +/** + A utility function that invokes an Objective C Block on the Matter Dispatch Queue in a thread-safe manner. + + The result of the Objective C Block will be relayed to the `blockCompleteCallback`. + + @param description Optional. A description of the Objective C Block to be invoked for diagnostic purposes. + @param callbackQueue The Dispatch Queue on which the callback shall be invoked. + @param blockCompleteCallback The callback to be invoked with the result of the Objective C Block. + @param block The Objective C Block to dispatch. + */ +- (void)withCastingServerInvokeBlock:(const NSString * _Nullable)description + callbackQueue:(dispatch_queue_t)callbackQueue + onBlockComplete:(void (^_Nonnull)(bool))blockCompleteCallback + block:(CHIP_ERROR (^_Nonnull)(CastingServer *))block +{ + [self dispatchOnMatterSDKQueue:description + block:^{ + CastingServer * castingServer = CastingServer::GetInstance(); + + // We invoke the block and capture the result on the Matter Dispatch Queue with the stack lock + // held, then use the result snapshot in the subsequent block to be asynchronously dispatched on + // the client's callback Dispatch Queue. + const CHIP_ERROR result = block(castingServer); + dispatch_async(callbackQueue, ^{ + if (nil != description) { + ChipLogProgress(AppServer, + "[ASYNC (CLIENT)] CastingServerBridge invoking %s Started Callback", + [description UTF8String]); + } + blockCompleteCallback( + [[MatterError alloc] initWithCode:result.AsInteger() + message:[NSString stringWithUTF8String:result.AsString()]]); + if (nil != description) { + ChipLogProgress(AppServer, + "[ASYNC (CLIENT)] CastingServerBridge invoked %s Started Callback", + [description UTF8String]); + } + }); + }]; +} + +/** + A utility function that invokes an Objective C Block on the Matter Dispatch Queue in a thread-safe manner. + + The result of the Objective C Block will be relayed to the `blockCompleteCallback`. The response callback is expected to be called + at a later time with the asynchronous result of the Casting Server operation (by the Casting Server). + + @param description Optional. A description of the Objective C Block to be invoked for diagnostic purposes. + @param blockCompleteCallback The callback to be invoked with the result of the Objective C Block. + @param responseCallback The callback that will eventually be invoked by the Casting Server when the operation has completed on the + remote end. + @param callbackQueue The Dispatch Queue on which the callbacks shall be invoked. + @param block The Objective C Block to dispatch. + */ +- (void)withCastingServerInvokeBlock:(const NSString * _Nullable)description + callbackQueue:(dispatch_queue_t)callbackQueue + onBlockComplete:(void (^_Nonnull)(bool))blockCompleteCallback + onResponse:(void (^_Nonnull)(bool))responseCallback + block:(CHIP_ERROR (^_Nonnull)(CastingServer *, std::function))block +{ + [self withCastingServerInvokeBlock:description + callbackQueue:callbackQueue + onBlockComplete:blockCompleteCallback + block:^(CastingServer * castingServer) { + return block(castingServer, [description, responseCallback, callbackQueue](CHIP_ERROR err) { + NSString * _description = description == nil + ? nil + : [NSString stringWithFormat:@"%@ Response Callback", description]; + + [[CastingServerBridge getSharedInstance] + dispatchOnClientQueue:callbackQueue + description:_description + block:^{ + responseCallback(CHIP_NO_ERROR == err); + }]; + }); + }]; +} + - (MatterError *)initializeApp:(AppParameters * _Nullable)appParameters clientQueue:(dispatch_queue_t _Nonnull)clientQueue initAppStatusHandler:(nullable void (^)(bool))initAppStatusHandler { + // The Matter SDK is not, generally, internally thread-safe. It relies upon the client to lock + // the SDK prior to any interactions after chip::DeviceLayer::PlatformMgr().InitChipStack() + // + // Note that it is presently safe to do at this point because InitChipStack is called in the + // constructor for the CastingServerBridge. + chip::DeviceLayer::StackLock lock; ChipLogProgress(AppServer, "CastingServerBridge().initApp() called"); CHIP_ERROR err = CHIP_NO_ERROR; @@ -277,51 +424,54 @@ - (void)discoverCommissioners:(dispatch_queue_t _Nonnull)clientQueue discoveryRequestSentHandler:(nullable void (^)(bool))discoveryRequestSentHandler discoveredCommissionerHandler:(nullable void (^)(DiscoveredNodeData *))discoveredCommissionerHandler { - ChipLogProgress(AppServer, "CastingServerBridge().discoverCommissioners() called"); - dispatch_async(_chipWorkQueue, ^{ - bool discoveryRequestStatus = true; - - if (discoveredCommissionerHandler != nil) { - TargetVideoPlayerInfo * cachedTargetVideoPlayerInfos = CastingServer::GetInstance()->ReadCachedTargetVideoPlayerInfos(); - self->_commissionerDiscoveryDelegate->SetUp(clientQueue, discoveredCommissionerHandler, cachedTargetVideoPlayerInfos); - } - CHIP_ERROR err = CastingServer::GetInstance()->DiscoverCommissioners( - discoveredCommissionerHandler != nil ? self->_commissionerDiscoveryDelegate : nullptr); - if (err != CHIP_NO_ERROR) { - ChipLogError(AppServer, "CastingServerBridge().discoverCommissioners() failed: %" CHIP_ERROR_FORMAT, err.Format()); - discoveryRequestStatus = false; - } - - dispatch_async(clientQueue, ^{ - discoveryRequestSentHandler(discoveryRequestStatus); - }); - }); + [self dispatchOnMatterSDKQueue:@"discoverCommissioners(...)" + block:^{ + bool discoveryRequestStatus = true; + + if (discoveredCommissionerHandler != nil) { + TargetVideoPlayerInfo * cachedTargetVideoPlayerInfos + = CastingServer::GetInstance()->ReadCachedTargetVideoPlayerInfos(); + self->_commissionerDiscoveryDelegate->SetUp( + clientQueue, discoveredCommissionerHandler, cachedTargetVideoPlayerInfos); + } + CHIP_ERROR err = CastingServer::GetInstance()->DiscoverCommissioners( + discoveredCommissionerHandler != nil ? self->_commissionerDiscoveryDelegate : nullptr); + if (err != CHIP_NO_ERROR) { + ChipLogError(AppServer, + "CastingServerBridge().discoverCommissioners() failed: %" CHIP_ERROR_FORMAT, err.Format()); + discoveryRequestStatus = false; + } + + dispatch_async(clientQueue, ^{ + discoveryRequestSentHandler(discoveryRequestStatus); + }); + }]; } - (void)getDiscoveredCommissioner:(int)index clientQueue:(dispatch_queue_t _Nonnull)clientQueue discoveredCommissionerHandler:(nullable void (^)(DiscoveredNodeData * _Nullable))discoveredCommissionerHandler { - ChipLogProgress(AppServer, "CastingServerBridge().getDiscoveredCommissioner() called"); - - dispatch_sync(_chipWorkQueue, ^{ - chip::Optional associatedConnectableVideoPlayer; - DiscoveredNodeData * commissioner = nil; - const chip::Dnssd::DiscoveredNodeData * cppDiscoveredNodeData - = CastingServer::GetInstance()->GetDiscoveredCommissioner(index, associatedConnectableVideoPlayer); - if (cppDiscoveredNodeData != nullptr) { - commissioner = [ConversionUtils convertToObjCDiscoveredNodeDataFrom:cppDiscoveredNodeData]; - if (associatedConnectableVideoPlayer.HasValue()) { - VideoPlayer * connectableVideoPlayer = - [ConversionUtils convertToObjCVideoPlayerFrom:associatedConnectableVideoPlayer.Value()]; - [commissioner setConnectableVideoPlayer:connectableVideoPlayer]; - } - } - - dispatch_sync(clientQueue, ^{ - discoveredCommissionerHandler(commissioner); - }); - }); + [self dispatchOnMatterSDKQueue:@"getDiscoveredCommissioner(...)" + block:^{ + chip::Optional associatedConnectableVideoPlayer; + DiscoveredNodeData * commissioner = nil; + const chip::Dnssd::DiscoveredNodeData * cppDiscoveredNodeData + = CastingServer::GetInstance()->GetDiscoveredCommissioner( + index, associatedConnectableVideoPlayer); + if (cppDiscoveredNodeData != nullptr) { + commissioner = [ConversionUtils convertToObjCDiscoveredNodeDataFrom:cppDiscoveredNodeData]; + if (associatedConnectableVideoPlayer.HasValue()) { + VideoPlayer * connectableVideoPlayer = [ConversionUtils + convertToObjCVideoPlayerFrom:associatedConnectableVideoPlayer.Value()]; + [commissioner setConnectableVideoPlayer:connectableVideoPlayer]; + } + } + + dispatch_async(clientQueue, ^{ + discoveredCommissionerHandler(commissioner); + }); + }]; } - (void)sendUserDirectedCommissioningRequest:(NSString * _Nonnull)commissionerIpAddress @@ -330,76 +480,86 @@ - (void)sendUserDirectedCommissioningRequest:(NSString * _Nonnull)commissionerIp clientQueue:(dispatch_queue_t _Nonnull)clientQueue udcRequestSentHandler:(nullable void (^)(bool))udcRequestSentHandler { - ChipLogProgress(AppServer, - "CastingServerBridge().sendUserDirectedCommissioningRequest() called with IP %s port %d platformInterface %d", - [commissionerIpAddress UTF8String], commissionerPort, platformInterface); - - dispatch_async(_chipWorkQueue, ^{ - bool udcRequestStatus; - chip::Inet::IPAddress commissionerAddrInet; - if (chip::Inet::IPAddress::FromString([commissionerIpAddress UTF8String], commissionerAddrInet) == false) { - ChipLogError(AppServer, "CastingServerBridge().sendUserDirectedCommissioningRequest() failed to parse IP address"); - udcRequestStatus = false; - } else { - chip::Inet::InterfaceId interfaceId = chip::Inet::InterfaceId(platformInterface); - - chip::Transport::PeerAddress commissionerPeerAddress - = chip::Transport::PeerAddress::UDP(commissionerAddrInet, commissionerPort, interfaceId); - - CHIP_ERROR err = CastingServer::GetInstance()->SendUserDirectedCommissioningRequest(commissionerPeerAddress); - if (err != CHIP_NO_ERROR) { - ChipLogError(AppServer, "CastingServerBridge().sendUserDirectedCommissioningRequest() failed: %" CHIP_ERROR_FORMAT, - err.Format()); - udcRequestStatus = false; - } else { - udcRequestStatus = true; - } - } - - dispatch_async(clientQueue, ^{ - udcRequestSentHandler(udcRequestStatus); - }); - }); + const NSString * description = + [NSString stringWithFormat:@"sendUserDirectedCommissioningRequest() IP %s port %d platformInterface %d", + [commissionerIpAddress UTF8String], commissionerPort, platformInterface]; + [self dispatchOnMatterSDKQueue:description + block:^{ + bool udcRequestStatus; + chip::Inet::IPAddress commissionerAddrInet; + if (chip::Inet::IPAddress::FromString([commissionerIpAddress UTF8String], commissionerAddrInet) + == false) { + ChipLogError(AppServer, + "CastingServerBridge().sendUserDirectedCommissioningRequest() failed to parse IP address"); + udcRequestStatus = false; + } else { + chip::Inet::InterfaceId interfaceId = chip::Inet::InterfaceId(platformInterface); + + chip::Transport::PeerAddress commissionerPeerAddress + = chip::Transport::PeerAddress::UDP(commissionerAddrInet, commissionerPort, interfaceId); + + CHIP_ERROR err = CastingServer::GetInstance()->SendUserDirectedCommissioningRequest( + commissionerPeerAddress); + if (err != CHIP_NO_ERROR) { + ChipLogError(AppServer, + "CastingServerBridge().sendUserDirectedCommissioningRequest() failed: " + "%" CHIP_ERROR_FORMAT, + err.Format()); + udcRequestStatus = false; + } else { + udcRequestStatus = true; + } + } + + dispatch_async(clientQueue, ^{ + udcRequestSentHandler(udcRequestStatus); + }); + }]; } - (void)sendUserDirectedCommissioningRequest:(DiscoveredNodeData * _Nonnull)commissioner clientQueue:(dispatch_queue_t _Nonnull)clientQueue udcRequestSentHandler:(nullable void (^)(bool))udcRequestSentHandler { - ChipLogProgress(AppServer, - "CastingServerBridge().sendUserDirectedCommissioningRequest() called with IP %s port %d platformInterface %d deviceName: " - "%s", - [commissioner.ipAddresses[0] UTF8String], commissioner.port, commissioner.platformInterface, - [commissioner.deviceName UTF8String]); - - dispatch_async(_chipWorkQueue, ^{ - bool udcRequestStatus; - - chip::Dnssd::DiscoveredNodeData cppCommissioner; - if ([ConversionUtils convertToCppDiscoveredNodeDataFrom:commissioner outDiscoveredNodeData:cppCommissioner] - != CHIP_NO_ERROR) { - ChipLogError(AppServer, - "CastingServerBridge().sendUserDirectedCommissioningRequest() failed to convert Commissioner(DiscoveredNodeData) " - "to Cpp type"); - udcRequestStatus = false; - } else { - CHIP_ERROR err = CastingServer::GetInstance()->SendUserDirectedCommissioningRequest(&cppCommissioner); - if (err != CHIP_NO_ERROR) { - ChipLogError(AppServer, "CastingServerBridge().sendUserDirectedCommissioningRequest() failed: %" CHIP_ERROR_FORMAT, - err.Format()); - udcRequestStatus = false; - } else { - udcRequestStatus = true; - } - } - - dispatch_async(clientQueue, ^{ - udcRequestSentHandler(udcRequestStatus); - }); - }); -} - -- (OnboardingPayload *)getOnboardingPaylod + const NSString * description = + [NSString stringWithFormat:@"sendUserDirectedCommissioningRequest(...) IP %s port %d platformInterface %d deviceName %s", + [commissioner.ipAddresses[0] UTF8String], commissioner.port, commissioner.platformInterface, + [commissioner.deviceName UTF8String]]; + + [self dispatchOnMatterSDKQueue:description + block:^{ + bool udcRequestStatus; + + chip::Dnssd::DiscoveredNodeData cppCommissioner; + if ([ConversionUtils convertToCppDiscoveredNodeDataFrom:commissioner + outDiscoveredNodeData:cppCommissioner] + != CHIP_NO_ERROR) { + ChipLogError(AppServer, + "CastingServerBridge().sendUserDirectedCommissioningRequest() failed to convert " + "Commissioner(DiscoveredNodeData) " + "to Cpp type"); + udcRequestStatus = false; + } else { + CHIP_ERROR err + = CastingServer::GetInstance()->SendUserDirectedCommissioningRequest(&cppCommissioner); + if (err != CHIP_NO_ERROR) { + ChipLogError(AppServer, + "CastingServerBridge().sendUserDirectedCommissioningRequest() failed: " + "%" CHIP_ERROR_FORMAT, + err.Format()); + udcRequestStatus = false; + } else { + udcRequestStatus = true; + } + } + + dispatch_async(clientQueue, ^{ + udcRequestSentHandler(udcRequestStatus); + }); + }]; +} + +- (OnboardingPayload *)getOnboardingPayload { return _onboardingPayload; } @@ -411,81 +571,101 @@ - (void)openBasicCommissioningWindow:(dispatch_queue_t _Nonnull)clientQueue onConnectionFailureCallback:(void (^_Nonnull)(MatterError * _Nonnull))onConnectionFailureCallback onNewOrUpdatedEndpointCallback:(void (^_Nonnull)(ContentApp * _Nonnull))onNewOrUpdatedEndpointCallback { - ChipLogProgress(AppServer, "CastingServerBridge().openBasicCommissioningWindow() called"); - - _commissioningCompleteCallback = commissioningCompleteCallback; - _onConnectionSuccessCallback = onConnectionSuccessCallback; - _onConnectionFailureCallback = onConnectionFailureCallback; - _onNewOrUpdatedEndpointCallback = onNewOrUpdatedEndpointCallback; - - CHIP_ERROR OpenBasicCommissioningWindow(std::function commissioningCompleteCallback, - std::function onConnectionSuccess, std::function onConnectionFailure, - std::function onNewOrUpdatedEndpoint); - - dispatch_async(_chipWorkQueue, ^{ - CHIP_ERROR err = CastingServer::GetInstance()->OpenBasicCommissioningWindow( - [](CHIP_ERROR err) { [CastingServerBridge getSharedInstance].commissioningCompleteCallback(CHIP_NO_ERROR == err); }, - [](TargetVideoPlayerInfo * cppTargetVideoPlayerInfo) { - VideoPlayer * videoPlayer = [ConversionUtils convertToObjCVideoPlayerFrom:cppTargetVideoPlayerInfo]; - [CastingServerBridge getSharedInstance].onConnectionSuccessCallback(videoPlayer); - }, - [](CHIP_ERROR err) { - [CastingServerBridge getSharedInstance].onConnectionFailureCallback( - [[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - [](TargetEndpointInfo * cppTargetEndpointInfo) { - ContentApp * contentApp = [ConversionUtils convertToObjCContentAppFrom:cppTargetEndpointInfo]; - [CastingServerBridge getSharedInstance].onNewOrUpdatedEndpointCallback(contentApp); - }); - - dispatch_async(clientQueue, ^{ - commissioningWindowRequestedHandler(CHIP_NO_ERROR == err); - }); - }); + [self + dispatchOnMatterSDKQueue:@"openBasicCommissioningWindow(...)" + block:^{ + CHIP_ERROR err = CastingServer::GetInstance()->OpenBasicCommissioningWindow( + [clientQueue, commissioningCompleteCallback](CHIP_ERROR err) { + [[CastingServerBridge getSharedInstance] + dispatchOnClientQueue:clientQueue + description:@"openBasicCommissioningWindow(...) commissioningCompleteCallback" + block:^{ + commissioningCompleteCallback(CHIP_NO_ERROR == err); + }]; + }, + [clientQueue, onConnectionSuccessCallback](TargetVideoPlayerInfo * cppTargetVideoPlayerInfo) { + VideoPlayer * videoPlayer = + [ConversionUtils convertToObjCVideoPlayerFrom:cppTargetVideoPlayerInfo]; + [[CastingServerBridge getSharedInstance] + dispatchOnClientQueue:clientQueue + description:@"openBasicCommissioningWindow(...) onConnectionSuccessCallback" + block:^{ + onConnectionSuccessCallback(videoPlayer); + }]; + }, + [clientQueue, onConnectionFailureCallback](CHIP_ERROR err) { + [[CastingServerBridge getSharedInstance] + dispatchOnClientQueue:clientQueue + description:@"openBasicCommissioningWindow(...) onConnectionFailureCallback" + block:^{ + onConnectionFailureCallback([[MatterError alloc] + initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }]; + }, + [clientQueue, onNewOrUpdatedEndpointCallback](TargetEndpointInfo * cppTargetEndpointInfo) { + ContentApp * contentApp = + [ConversionUtils convertToObjCContentAppFrom:cppTargetEndpointInfo]; + [[CastingServerBridge getSharedInstance] + dispatchOnClientQueue:clientQueue + description:@"openBasicCommissioningWindow(...) onNewOrUpdatedEndpointCallback" + block:^{ + onNewOrUpdatedEndpointCallback(contentApp); + }]; + }); + + dispatch_async(clientQueue, ^{ + ChipLogProgress(AppServer, "[async] Dispatching commissioningWindowRequestedHandler"); + commissioningWindowRequestedHandler(CHIP_NO_ERROR == err); + }); + }]; } - (void)getActiveTargetVideoPlayers:(dispatch_queue_t _Nonnull)clientQueue activeTargetVideoPlayersHandler:(nullable void (^)(NSMutableArray * _Nullable))activeTargetVideoPlayersHandler { - ChipLogProgress(AppServer, "CastingServerBridge().getActiveTargetVideoPlayers() called"); + [self dispatchOnMatterSDKQueue:@"getActiveTargetVideoPlayers(...)" + block:^{ + NSMutableArray * videoPlayers = [NSMutableArray new]; + TargetVideoPlayerInfo * cppTargetVideoPlayerInfo + = CastingServer::GetInstance()->GetActiveTargetVideoPlayer(); + if (cppTargetVideoPlayerInfo != nullptr && cppTargetVideoPlayerInfo->IsInitialized()) { + videoPlayers[0] = [ConversionUtils convertToObjCVideoPlayerFrom:cppTargetVideoPlayerInfo]; + } - dispatch_async(_chipWorkQueue, ^{ - NSMutableArray * videoPlayers = [NSMutableArray new]; - TargetVideoPlayerInfo * cppTargetVideoPlayerInfo = CastingServer::GetInstance()->GetActiveTargetVideoPlayer(); - if (cppTargetVideoPlayerInfo != nullptr && cppTargetVideoPlayerInfo->IsInitialized()) { - videoPlayers[0] = [ConversionUtils convertToObjCVideoPlayerFrom:cppTargetVideoPlayerInfo]; - } - - dispatch_async(clientQueue, ^{ - activeTargetVideoPlayersHandler(videoPlayers); - }); - }); + dispatch_async(clientQueue, ^{ + activeTargetVideoPlayersHandler(videoPlayers); + }); + }]; } - (void)readCachedVideoPlayers:(dispatch_queue_t _Nonnull)clientQueue readCachedVideoPlayersHandler:(nullable void (^)(NSMutableArray * _Nullable))readCachedVideoPlayersHandler { - ChipLogProgress(AppServer, "CastingServerBridge().readCachedVideoPlayers() called"); - - dispatch_async(_chipWorkQueue, ^{ - NSMutableArray * videoPlayers = nil; - TargetVideoPlayerInfo * cppTargetVideoPlayerInfos = CastingServer::GetInstance()->ReadCachedTargetVideoPlayerInfos(); - if (cppTargetVideoPlayerInfos != nullptr) { - videoPlayers = [NSMutableArray new]; - for (size_t i = 0; cppTargetVideoPlayerInfos[i].IsInitialized(); i++) { - ChipLogProgress(AppServer, - "CastingServerBridge().readCachedVideoPlayers() with nodeId: 0x" ChipLogFormatX64 - " fabricIndex: %d deviceName: %s vendorId: %d", - ChipLogValueX64(cppTargetVideoPlayerInfos[i].GetNodeId()), cppTargetVideoPlayerInfos[i].GetFabricIndex(), - cppTargetVideoPlayerInfos[i].GetDeviceName(), cppTargetVideoPlayerInfos[i].GetVendorId()); - videoPlayers[i] = [ConversionUtils convertToObjCVideoPlayerFrom:&cppTargetVideoPlayerInfos[i]]; - } - } - - dispatch_async(clientQueue, ^{ - readCachedVideoPlayersHandler(videoPlayers); - }); - }); + [self dispatchOnMatterSDKQueue:@"readCachedVideoPlayers(...)" + block:^{ + NSMutableArray * videoPlayers = nil; + TargetVideoPlayerInfo * cppTargetVideoPlayerInfos + = CastingServer::GetInstance()->ReadCachedTargetVideoPlayerInfos(); + if (cppTargetVideoPlayerInfos != nullptr) { + videoPlayers = [NSMutableArray new]; + for (size_t i = 0; cppTargetVideoPlayerInfos[i].IsInitialized(); i++) { + ChipLogProgress(AppServer, + "CastingServerBridge().readCachedVideoPlayers() with nodeId: 0x" ChipLogFormatX64 + " fabricIndex: %d deviceName: %s vendorId: %d", + ChipLogValueX64(cppTargetVideoPlayerInfos[i].GetNodeId()), + cppTargetVideoPlayerInfos[i].GetFabricIndex(), + cppTargetVideoPlayerInfos[i].GetDeviceName(), + cppTargetVideoPlayerInfos[i].GetVendorId()); + videoPlayers[i] = + [ConversionUtils convertToObjCVideoPlayerFrom:&cppTargetVideoPlayerInfos[i]]; + } + } + + dispatch_async(clientQueue, ^{ + readCachedVideoPlayersHandler(videoPlayers); + }); + }]; } - (void)verifyOrEstablishConnection:(VideoPlayer * _Nonnull)videoPlayer @@ -495,167 +675,189 @@ - (void)verifyOrEstablishConnection:(VideoPlayer * _Nonnull)videoPlayer onConnectionFailureCallback:(void (^_Nonnull)(MatterError * _Nonnull))onConnectionFailureCallback onNewOrUpdatedEndpointCallback:(void (^_Nonnull)(ContentApp * _Nonnull))onNewOrUpdatedEndpointCallback { - ChipLogProgress(AppServer, "CastingServerBridge().verifyOrEstablishConnection() called"); - _onConnectionSuccessCallback = onConnectionSuccessCallback; - _onConnectionFailureCallback = onConnectionFailureCallback; - _onNewOrUpdatedEndpointCallback = onNewOrUpdatedEndpointCallback; - - dispatch_async(_chipWorkQueue, ^{ - TargetVideoPlayerInfo targetVideoPlayerInfo; - [ConversionUtils convertToCppTargetVideoPlayerInfoFrom:videoPlayer outTargetVideoPlayerInfo:targetVideoPlayerInfo]; - - CHIP_ERROR err = CastingServer::GetInstance()->VerifyOrEstablishConnection( - targetVideoPlayerInfo, - [](TargetVideoPlayerInfo * cppTargetVideoPlayerInfo) { - VideoPlayer * videoPlayer = [ConversionUtils convertToObjCVideoPlayerFrom:cppTargetVideoPlayerInfo]; - [CastingServerBridge getSharedInstance].onConnectionSuccessCallback(videoPlayer); - }, - [](CHIP_ERROR err) { - [CastingServerBridge getSharedInstance].onConnectionFailureCallback( - [[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - [](TargetEndpointInfo * cppTargetEndpointInfo) { - ContentApp * contentApp = [ConversionUtils convertToObjCContentAppFrom:cppTargetEndpointInfo]; - [CastingServerBridge getSharedInstance].onNewOrUpdatedEndpointCallback(contentApp); - }); - - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self dispatchOnMatterSDKQueue:@"verifyOrEstablishConnection(...)" + block:^{ + TargetVideoPlayerInfo targetVideoPlayerInfo; + [ConversionUtils convertToCppTargetVideoPlayerInfoFrom:videoPlayer + outTargetVideoPlayerInfo:targetVideoPlayerInfo]; + + CHIP_ERROR err = CastingServer::GetInstance()->VerifyOrEstablishConnection( + targetVideoPlayerInfo, + [clientQueue, onConnectionSuccessCallback](TargetVideoPlayerInfo * cppTargetVideoPlayerInfo) { + VideoPlayer * videoPlayer = + [ConversionUtils convertToObjCVideoPlayerFrom:cppTargetVideoPlayerInfo]; + [[CastingServerBridge getSharedInstance] + dispatchOnClientQueue:clientQueue + description:@"onConnectionSuccessCallback" + block:^{ + onConnectionSuccessCallback(videoPlayer); + }]; + }, + [clientQueue, onConnectionFailureCallback](CHIP_ERROR err) { + [[CastingServerBridge getSharedInstance] + dispatchOnClientQueue:clientQueue + description:@"onConnectionFailureCallback" + block:^{ + onConnectionFailureCallback([[MatterError alloc] + initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }]; + }, + [clientQueue, onNewOrUpdatedEndpointCallback](TargetEndpointInfo * cppTargetEndpointInfo) { + ContentApp * contentApp = + [ConversionUtils convertToObjCContentAppFrom:cppTargetEndpointInfo]; + [[CastingServerBridge getSharedInstance] + dispatchOnClientQueue:clientQueue + description:@"onNewOrUpdatedEndpointCallback" + block:^{ + onNewOrUpdatedEndpointCallback(contentApp); + }]; + }); + + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)shutdownAllSubscriptions:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(nullable void (^)())requestSentHandler { - ChipLogProgress(AppServer, "CastingServerBridge().shutdownAllSubscriptions() called"); - dispatch_async(_chipWorkQueue, ^{ - CastingServer::GetInstance()->ShutdownAllSubscriptions(); - dispatch_async(clientQueue, ^{ - requestSentHandler(); - }); - }); + [self dispatchOnMatterSDKQueue:@"shutdownAllSubscriptions(...)" + block:^{ + CastingServer::GetInstance()->ShutdownAllSubscriptions(); + dispatch_async(clientQueue, ^{ + requestSentHandler(); + }); + }]; } - (void)startMatterServer:(dispatch_queue_t _Nonnull)clientQueue startMatterServerCompletionCallback:(nullable void (^)(MatterError * _Nonnull))startMatterServerCompletionCallback { - ChipLogProgress(AppServer, "CastingServerBridge().startMatterServer() called"); - - dispatch_async(_chipWorkQueue, ^{ - // Initialize the Matter server - CHIP_ERROR err = chip::Server::GetInstance().Init(*self->_serverInitParams); - if (err != CHIP_NO_ERROR) { - ChipLogError(AppServer, "chip::Server init failed: %s", ErrorStr(err)); - dispatch_async(clientQueue, ^{ - startMatterServerCompletionCallback( - [[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }); - return; - } - - // Initialize binding handlers - err = CastingServer::GetInstance()->InitBindingHandlers(); - if (err != CHIP_NO_ERROR) { - ChipLogError(AppServer, "Binding init failed: %s", ErrorStr(err)); - dispatch_async(clientQueue, ^{ - startMatterServerCompletionCallback( - [[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }); - return; - } - - // Now reconnect to the VideoPlayer the casting app was previously connected to (if any) - if (self->_previouslyConnectedVideoPlayer != nil) { - ChipLogProgress( - AppServer, "CastingServerBridge().startMatterServer() reconnecting to previously connected VideoPlayer..."); - err = CastingServer::GetInstance()->VerifyOrEstablishConnection( - *(self->_previouslyConnectedVideoPlayer), - [clientQueue, startMatterServerCompletionCallback](TargetVideoPlayerInfo * cppTargetVideoPlayerInfo) { - dispatch_async(clientQueue, ^{ - startMatterServerCompletionCallback( - [[MatterError alloc] initWithCode:CHIP_NO_ERROR.AsInteger() - message:[NSString stringWithUTF8String:CHIP_NO_ERROR.AsString()]]); - }); - }, - [clientQueue, startMatterServerCompletionCallback](CHIP_ERROR err) { - dispatch_async(clientQueue, ^{ - startMatterServerCompletionCallback( - [[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }, - [](TargetEndpointInfo * cppTargetEndpointInfo) {}); - } else { - dispatch_async(clientQueue, ^{ - startMatterServerCompletionCallback( - [[MatterError alloc] initWithCode:CHIP_NO_ERROR.AsInteger() - message:[NSString stringWithUTF8String:CHIP_NO_ERROR.AsString()]]); - }); - } - }); + [self dispatchOnMatterSDKQueue:@"startMatterServer(...)" + block:^{ + // Initialize the Matter server + CHIP_ERROR err = chip::Server::GetInstance().Init(*self->_serverInitParams); + if (err != CHIP_NO_ERROR) { + ChipLogError(AppServer, "chip::Server init failed: %s", ErrorStr(err)); + dispatch_async(clientQueue, ^{ + startMatterServerCompletionCallback( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + return; + } + + // Initialize binding handlers + err = CastingServer::GetInstance()->InitBindingHandlers(); + if (err != CHIP_NO_ERROR) { + ChipLogError(AppServer, "Binding init failed: %s", ErrorStr(err)); + dispatch_async(clientQueue, ^{ + startMatterServerCompletionCallback( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + return; + } + + // Now reconnect to the VideoPlayer the casting app was previously connected to (if any) + if (self->_previouslyConnectedVideoPlayer != nil) { + ChipLogProgress(AppServer, + "CastingServerBridge().startMatterServer() reconnecting to previously connected " + "VideoPlayer..."); + err = CastingServer::GetInstance()->VerifyOrEstablishConnection( + *(self->_previouslyConnectedVideoPlayer), + [clientQueue, startMatterServerCompletionCallback]( + TargetVideoPlayerInfo * cppTargetVideoPlayerInfo) { + dispatch_async(clientQueue, ^{ + startMatterServerCompletionCallback([[MatterError alloc] + initWithCode:CHIP_NO_ERROR.AsInteger() + message:[NSString stringWithUTF8String:CHIP_NO_ERROR.AsString()]]); + }); + }, + [clientQueue, startMatterServerCompletionCallback](CHIP_ERROR err) { + dispatch_async(clientQueue, ^{ + startMatterServerCompletionCallback([[MatterError alloc] + initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }, + [](TargetEndpointInfo * cppTargetEndpointInfo) {}); + } else { + dispatch_async(clientQueue, ^{ + startMatterServerCompletionCallback([[MatterError alloc] + initWithCode:CHIP_NO_ERROR.AsInteger() + message:[NSString stringWithUTF8String:CHIP_NO_ERROR.AsString()]]); + }); + } + }]; } - (void)stopMatterServer { - ChipLogProgress(AppServer, "CastingServerBridge().stopMatterServer() called"); - - dispatch_sync(_chipWorkQueue, ^{ - // capture pointer to previouslyConnectedVideoPlayer, to be deleted - TargetVideoPlayerInfo * videoPlayerForDeletion - = self->_previouslyConnectedVideoPlayer == nil ? nil : self->_previouslyConnectedVideoPlayer; - - // On shutting down the Matter server, the casting app will be automatically disconnected from any Video Players it was - // connected to. Save the VideoPlayer that the casting app was targetting and connected to, so we can reconnect to it on - // re-starting the Matter server. - TargetVideoPlayerInfo * currentTargetVideoPlayerInfo = CastingServer::GetInstance()->GetActiveTargetVideoPlayer(); - if (currentTargetVideoPlayerInfo != nil && currentTargetVideoPlayerInfo->IsInitialized() - && currentTargetVideoPlayerInfo->GetOperationalDeviceProxy() != nil) { - self->_previouslyConnectedVideoPlayer = new TargetVideoPlayerInfo(); - self->_previouslyConnectedVideoPlayer->Initialize(currentTargetVideoPlayerInfo->GetNodeId(), - currentTargetVideoPlayerInfo->GetFabricIndex(), nullptr, nullptr, currentTargetVideoPlayerInfo->GetVendorId(), - currentTargetVideoPlayerInfo->GetProductId(), currentTargetVideoPlayerInfo->GetDeviceType(), - currentTargetVideoPlayerInfo->GetDeviceName(), currentTargetVideoPlayerInfo->GetHostName(), - currentTargetVideoPlayerInfo->GetNumIPs(), - const_cast(currentTargetVideoPlayerInfo->GetIpAddresses())); - - TargetEndpointInfo * prevEndpoints = self->_previouslyConnectedVideoPlayer->GetEndpoints(); - if (prevEndpoints != nullptr) { - for (size_t i = 0; i < kMaxNumberOfEndpoints; i++) { - prevEndpoints[i].Reset(); - } - } - TargetEndpointInfo * currentEndpoints = currentTargetVideoPlayerInfo->GetEndpoints(); - for (size_t i = 0; i < kMaxNumberOfEndpoints && currentEndpoints[i].IsInitialized(); i++) { - prevEndpoints[i].Initialize(currentEndpoints[i].GetEndpointId()); - chip::ClusterId * currentClusters = currentEndpoints[i].GetClusters(); - for (size_t j = 0; j < kMaxNumberOfClustersPerEndpoint && currentClusters[j] != chip::kInvalidClusterId; j++) { - prevEndpoints[i].AddCluster(currentClusters[j]); - } - } - } else { - self->_previouslyConnectedVideoPlayer = nil; - } - - // Now shutdown the Matter server - chip::Server::GetInstance().Shutdown(); - - // Delete the old previouslyConnectedVideoPlayer, if non-nil - if (videoPlayerForDeletion != nil) { - delete videoPlayerForDeletion; - } - }); + [self + dispatchOnMatterSDKQueue:@"stopMatterServer(...)" + block:^{ + // capture pointer to previouslyConnectedVideoPlayer, to be deleted + TargetVideoPlayerInfo * videoPlayerForDeletion + = self->_previouslyConnectedVideoPlayer == nil ? nil : self->_previouslyConnectedVideoPlayer; + + // On shutting down the Matter server, the casting app will be automatically disconnected from any + // Video Players it was connected to. Save the VideoPlayer that the casting app was targetting and + // connected to, so we can reconnect to it on re-starting the Matter server. + TargetVideoPlayerInfo * currentTargetVideoPlayerInfo + = CastingServer::GetInstance()->GetActiveTargetVideoPlayer(); + if (currentTargetVideoPlayerInfo != nil && currentTargetVideoPlayerInfo->IsInitialized() + && currentTargetVideoPlayerInfo->GetOperationalDeviceProxy() != nil) { + self->_previouslyConnectedVideoPlayer = new TargetVideoPlayerInfo(); + self->_previouslyConnectedVideoPlayer->Initialize(currentTargetVideoPlayerInfo->GetNodeId(), + currentTargetVideoPlayerInfo->GetFabricIndex(), nullptr, nullptr, + currentTargetVideoPlayerInfo->GetVendorId(), currentTargetVideoPlayerInfo->GetProductId(), + currentTargetVideoPlayerInfo->GetDeviceType(), currentTargetVideoPlayerInfo->GetDeviceName(), + currentTargetVideoPlayerInfo->GetHostName(), currentTargetVideoPlayerInfo->GetNumIPs(), + const_cast(currentTargetVideoPlayerInfo->GetIpAddresses())); + + TargetEndpointInfo * prevEndpoints = self->_previouslyConnectedVideoPlayer->GetEndpoints(); + if (prevEndpoints != nullptr) { + for (size_t i = 0; i < kMaxNumberOfEndpoints; i++) { + prevEndpoints[i].Reset(); + } + } + TargetEndpointInfo * currentEndpoints = currentTargetVideoPlayerInfo->GetEndpoints(); + for (size_t i = 0; i < kMaxNumberOfEndpoints && currentEndpoints[i].IsInitialized(); i++) { + prevEndpoints[i].Initialize(currentEndpoints[i].GetEndpointId()); + chip::ClusterId * currentClusters = currentEndpoints[i].GetClusters(); + for (size_t j = 0; + j < kMaxNumberOfClustersPerEndpoint && currentClusters[j] != chip::kInvalidClusterId; + j++) { + prevEndpoints[i].AddCluster(currentClusters[j]); + } + } + } else { + self->_previouslyConnectedVideoPlayer = nil; + } + + // Now shutdown the Matter server + chip::Server::GetInstance().Shutdown(); + + // Delete the old previouslyConnectedVideoPlayer, if non-nil + if (videoPlayerForDeletion != nil) { + delete videoPlayerForDeletion; + } + }]; } - (void)disconnect:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(nullable void (^)())requestSentHandler { - ChipLogProgress(AppServer, "CastingServerBridge().disconnect() called"); - dispatch_async(_chipWorkQueue, ^{ - CastingServer::GetInstance()->Disconnect(); - dispatch_async(clientQueue, ^{ - requestSentHandler(); - }); - }); + [self dispatchOnMatterSDKQueue:@"disconnect(...)" + block:^{ + CastingServer::GetInstance()->Disconnect(); + dispatch_async(clientQueue, ^{ + requestSentHandler(); + }); + }]; } - (void)purgeCache:(dispatch_queue_t _Nonnull)clientQueue responseHandler:(void (^)(MatterError * _Nonnull))responseHandler @@ -676,24 +878,17 @@ - (void)contentLauncher_launchUrl:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress(AppServer, "CastingServerBridge().contentLauncher_launchUrl() called on Content App with endpoint ID %d", - contentApp.endpointId); - - [_commandResponseCallbacks setObject:responseCallback forKey:@"contentLauncher_launchUrl"]; - - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - CHIP_ERROR err = CastingServer::GetInstance()->ContentLauncherLaunchURL( - &endpoint, [contentUrl UTF8String], [contentDisplayStr UTF8String], [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"contentLauncher_launchUrl"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + return castingServer->ContentLauncherLaunchURL( + &endpoint, [contentUrl UTF8String], [contentDisplayStr UTF8String], responseFunction); + }]; } - (void)contentLauncher_launchContent:(ContentApp * _Nonnull)contentApp @@ -704,72 +899,84 @@ - (void)contentLauncher_launchContent:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress(AppServer, "CastingServerBridge().contentLauncher_launchContent() called on Content App with endpoint ID %d", - contentApp.endpointId); - - [_commandResponseCallbacks setObject:responseCallback forKey:@"contentLauncher_launchContent"]; + const NSString * description = + [NSString stringWithFormat:@"contentLauncher_launchContent(...) with Content App endpoint ID %d", contentApp.endpointId]; // Make a copy of params before we go async. contentSearch = [contentSearch copy]; data = [data copy]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - ListFreer listFreer; - chip::app::Clusters::ContentLauncher::Structs::ContentSearchStruct::Type cppSearch; - if (contentSearch.parameterList.count > 0) { - auto * parameterListHolder = new ListHolder( - contentSearch.parameterList.count); - listFreer.add(parameterListHolder); - - int parameterIndex = 0; - for (ContentLauncher_Parameter * parameter in contentSearch.parameterList) { - int externalIdListIndex = 0; - if (parameter.externalIDList != nil) { - auto * externalIdListHolder - = new ListHolder( - parameter.externalIDList.count); - listFreer.add(externalIdListHolder); - - for (ContentLauncher_AdditionalInfo * additionalInfo in parameter.externalIDList) { - externalIdListHolder->mList[externalIdListIndex].value = chip::CharSpan([additionalInfo.value UTF8String], - [additionalInfo.value lengthOfBytesUsingEncoding:NSUTF8StringEncoding]); - externalIdListHolder->mList[externalIdListIndex].name = chip::CharSpan([additionalInfo.name UTF8String], - [additionalInfo.name lengthOfBytesUsingEncoding:NSUTF8StringEncoding]); - externalIdListIndex++; - } - parameterListHolder->mList[parameterIndex].externalIDList = MakeOptional( - chip::app::DataModel::List( - externalIdListHolder->mList, parameter.externalIDList.count)); - } else { - parameterListHolder->mList[parameterIndex].externalIDList = chip::Optional>::Missing(); - } - - parameterListHolder->mList[parameterIndex].type - = static_cast(parameter.type); - parameterListHolder->mList[parameterIndex].value = chip::CharSpan( - [parameter.value UTF8String], [parameter.value lengthOfBytesUsingEncoding:NSUTF8StringEncoding]); - parameterIndex++; - cppSearch.parameterList - = chip::app::DataModel::List( - parameterListHolder->mList, contentSearch.parameterList.count); - } - } - - CHIP_ERROR err = CastingServer::GetInstance()->ContentLauncher_LaunchContent(&endpoint, cppSearch, autoPlay, - MakeOptional(chip::CharSpan([data UTF8String], [data lengthOfBytesUsingEncoding:NSUTF8StringEncoding])), - [](CHIP_ERROR err) { - void (^responseCallback)(bool) = [[CastingServerBridge getSharedInstance].commandResponseCallbacks - objectForKey:@"contentLauncher_launchContent"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + [self + dispatchOnMatterSDKQueue:description + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Structs::ContentSearchStruct::Type cppSearch; + if (contentSearch.parameterList.count > 0) { + auto * parameterListHolder + = new ListHolder( + contentSearch.parameterList.count); + listFreer.add(parameterListHolder); + + int parameterIndex = 0; + for (ContentLauncher_Parameter * parameter in contentSearch.parameterList) { + int externalIdListIndex = 0; + if (parameter.externalIDList != nil) { + auto * externalIdListHolder = new ListHolder< + chip::app::Clusters::ContentLauncher::Structs::AdditionalInfoStruct::Type>( + parameter.externalIDList.count); + listFreer.add(externalIdListHolder); + + for (ContentLauncher_AdditionalInfo * additionalInfo in parameter.externalIDList) { + externalIdListHolder->mList[externalIdListIndex].value + = chip::CharSpan([additionalInfo.value UTF8String], + [additionalInfo.value lengthOfBytesUsingEncoding:NSUTF8StringEncoding]); + externalIdListHolder->mList[externalIdListIndex].name + = chip::CharSpan([additionalInfo.name UTF8String], + [additionalInfo.name lengthOfBytesUsingEncoding:NSUTF8StringEncoding]); + externalIdListIndex++; + } + parameterListHolder->mList[parameterIndex].externalIDList + = MakeOptional(chip::app::DataModel::List< + const chip::app::Clusters::ContentLauncher::Structs::AdditionalInfoStruct::Type>( + externalIdListHolder->mList, parameter.externalIDList.count)); + } else { + parameterListHolder->mList[parameterIndex].externalIDList + = chip::Optional>::Missing(); + } + + parameterListHolder->mList[parameterIndex].type + = static_cast(parameter.type); + parameterListHolder->mList[parameterIndex].value + = chip::CharSpan([parameter.value UTF8String], + [parameter.value lengthOfBytesUsingEncoding:NSUTF8StringEncoding]); + parameterIndex++; + cppSearch.parameterList = chip::app::DataModel::List< + chip::app::Clusters::ContentLauncher::Structs::ParameterStruct::Type>( + parameterListHolder->mList, contentSearch.parameterList.count); + } + } + + CHIP_ERROR err = CastingServer::GetInstance()->ContentLauncher_LaunchContent(&endpoint, cppSearch, + autoPlay, + MakeOptional( + chip::CharSpan([data UTF8String], [data lengthOfBytesUsingEncoding:NSUTF8StringEncoding])), + [clientQueue, responseCallback](CHIP_ERROR err) { + [[CastingServerBridge getSharedInstance] + dispatchOnClientQueue:clientQueue + description:@"contentLauncher_launchContent(...) responseCallback" + block:^{ + responseCallback(CHIP_NO_ERROR == err); + }]; + }); + + dispatch_async(clientQueue, ^{ + requestSentHandler(CHIP_NO_ERROR == err); + }); + }]; } - (void)contentLauncher_subscribeSupportedStreamingProtocols:(ContentApp * _Nonnull)contentApp @@ -781,44 +988,46 @@ - (void)contentLauncher_subscribeSupportedStreamingProtocols:(ContentApp * _Nonn failureCallback:(void (^_Nonnull)(MatterError * _Nonnull))failureCallback subscriptionEstablishedCallback:(void (^_Nonnull)())subscriptionEstablishedCallback { - ChipLogProgress(AppServer, - "CastingServerBridge().contentLauncher_subscribeSupportedStreamingProtocols() called on Content App with endpoint ID %d", - contentApp.endpointId); - - [_subscriptionReadSuccessCallbacks setObject:successCallback forKey:@"contentLauncher_subscribeSupportedStreamingProtocols"]; - [_subscriptionReadFailureCallbacks setObject:failureCallback forKey:@"contentLauncher_subscribeSupportedStreamingProtocols"]; - [_subscriptionEstablishedCallbacks setObject:subscriptionEstablishedCallback - forKey:@"contentLauncher_subscribeSupportedStreamingProtocols"]; - - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->ContentLauncher_SubscribeToSupportedStreamingProtocols( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo::DecodableArgType - supportedStreamingProtocols) { - void (^callback)(uint32_t) = [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks - objectForKey:@"contentLauncher_subscribeSupportedStreamingProtocols"]; - callback(supportedStreamingProtocols); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks - objectForKey:@"contentLauncher_subscribeSupportedStreamingProtocols"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - minInterval, maxInterval, - [](void * context, chip::SubscriptionId subscriptionId) { - void (^callback)() = [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks - objectForKey:@"contentLauncher_subscribeSupportedStreamingProtocols"]; - callback(); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + const NSString * description = + [NSString stringWithFormat:@"contentLauncher_subscribeSupportedStreamingProtocols(...) with Content App endpoint ID %d", + contentApp.endpointId]; + [self dispatchOnMatterSDKQueue:description + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err + = CastingServer::GetInstance()->ContentLauncher_SubscribeToSupportedStreamingProtocols( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingProtocols:: + TypeInfo::DecodableArgType supportedStreamingProtocols) { + void (^callback)(uint32_t) = + [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks + objectForKey:@"contentLauncher_subscribeSupportedStreamingProtocols"]; + callback(supportedStreamingProtocols); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks + objectForKey:@"contentLauncher_subscribeSupportedStreamingProtocols"]; + callback( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }, + minInterval, maxInterval, + [](void * context, chip::SubscriptionId subscriptionId) { + void (^callback)() = + [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks + objectForKey:@"contentLauncher_subscribeSupportedStreamingProtocols"]; + callback(); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)levelControl_step:(ContentApp * _Nonnull)contentApp @@ -831,25 +1040,19 @@ - (void)levelControl_step:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress( - AppServer, "CastingServerBridge().levelControl_step() called on Content App with endpoint ID %d", contentApp.endpointId); + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - [_commandResponseCallbacks setObject:responseCallback forKey:@"levelControl_step"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->LevelControl_Step(&endpoint, - static_cast(stepMode), stepSize, transitionTime, optionMask, - optionOverride, [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"levelControl_step"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->LevelControl_Step(&endpoint, + static_cast(stepMode), stepSize, + transitionTime, optionMask, optionOverride, responseFunction); + }]; } - (void)levelControl_moveToLevel:(ContentApp * _Nonnull)contentApp @@ -861,24 +1064,19 @@ - (void)levelControl_moveToLevel:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress(AppServer, "CastingServerBridge().levelControl_moveToLevel() called on Content App with endpoint ID %d", - contentApp.endpointId); + const NSString * description = + [NSString stringWithFormat:@"levelControl_moveToLevel(...) with Content App endpoint ID %d", contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - [_commandResponseCallbacks setObject:responseCallback forKey:@"levelControl_moveToLevel"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->LevelControl_MoveToLevel( - &endpoint, level, transitionTime, optionMask, optionOverride, [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"levelControl_moveToLevel"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->LevelControl_MoveToLevel( + &endpoint, level, transitionTime, optionMask, optionOverride, responseFunction); + }]; } - (void)levelControl_subscribeCurrentLevel:(ContentApp * _Nonnull)contentApp @@ -898,34 +1096,42 @@ - (void)levelControl_subscribeCurrentLevel:(ContentApp * _Nonnull)contentApp [_subscriptionReadFailureCallbacks setObject:failureCallback forKey:@"levelControl_subscribeCurrentLevel"]; [_subscriptionEstablishedCallbacks setObject:subscriptionEstablishedCallback forKey:@"levelControl_subscribeCurrentLevel"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->LevelControl_SubscribeToCurrentLevel( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::LevelControl::Attributes::CurrentLevel::TypeInfo::DecodableArgType currentLevel) { - void (^callback)(NSNumber * _Nullable) = [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks - objectForKey:@"levelControl_subscribeCurrentLevel"]; - callback(@(currentLevel.Value())); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks - objectForKey:@"levelControl_subscribeCurrentLevel"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - minInterval, maxInterval, - [](void * context, chip::SubscriptionId subscriptionId) { - void (^callback)() = [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks - objectForKey:@"levelControl_subscribeCurrentLevel"]; - callback(); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"levelControl_subscribeCurrentLevel(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->LevelControl_SubscribeToCurrentLevel( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::LevelControl::Attributes::CurrentLevel::TypeInfo::DecodableArgType + currentLevel) { + void (^callback)(NSNumber * _Nullable) = + [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks + objectForKey:@"levelControl_subscribeCurrentLevel"]; + callback(@(currentLevel.Value())); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks + objectForKey:@"levelControl_subscribeCurrentLevel"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }, + minInterval, maxInterval, + [](void * context, chip::SubscriptionId subscriptionId) { + void (^callback)() = + [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks + objectForKey:@"levelControl_subscribeCurrentLevel"]; + callback(); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)levelControl_subscribeMinLevel:(ContentApp * _Nonnull)contentApp @@ -944,33 +1150,42 @@ - (void)levelControl_subscribeMinLevel:(ContentApp * _Nonnull)contentApp [_subscriptionReadFailureCallbacks setObject:failureCallback forKey:@"levelControl_subscribeMinLevel"]; [_subscriptionEstablishedCallbacks setObject:subscriptionEstablishedCallback forKey:@"levelControl_subscribeMinLevel"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->LevelControl_SubscribeToMinLevel( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::LevelControl::Attributes::MinLevel::TypeInfo::DecodableArgType minLevel) { - void (^callback)(uint8_t) = [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks - objectForKey:@"levelControl_subscribeMinLevel"]; - callback(minLevel); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks - objectForKey:@"levelControl_subscribeMinLevel"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - minInterval, maxInterval, - [](void * context, chip::SubscriptionId subscriptionId) { - void (^callback)() = [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks - objectForKey:@"levelControl_subscribeMinLevel"]; - callback(); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"levelControl_subscribeMinLevel(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->LevelControl_SubscribeToMinLevel( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::LevelControl::Attributes::MinLevel::TypeInfo::DecodableArgType + minLevel) { + void (^callback)(uint8_t) = + [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks + objectForKey:@"levelControl_subscribeMinLevel"]; + callback(minLevel); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks + objectForKey:@"levelControl_subscribeMinLevel"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }, + minInterval, maxInterval, + [](void * context, chip::SubscriptionId subscriptionId) { + void (^callback)() = + [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks + objectForKey:@"levelControl_subscribeMinLevel"]; + callback(); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)levelControl_subscribeMaxLevel:(ContentApp * _Nonnull)contentApp @@ -989,33 +1204,42 @@ - (void)levelControl_subscribeMaxLevel:(ContentApp * _Nonnull)contentApp [_subscriptionReadFailureCallbacks setObject:failureCallback forKey:@"levelControl_subscribeMaxLevel"]; [_subscriptionEstablishedCallbacks setObject:subscriptionEstablishedCallback forKey:@"levelControl_subscribeMaxLevel"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->LevelControl_SubscribeToMaxLevel( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::LevelControl::Attributes::MaxLevel::TypeInfo::DecodableArgType maxLevel) { - void (^callback)(uint8_t) = [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks - objectForKey:@"levelControl_subscribeMaxLevel"]; - callback(maxLevel); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks - objectForKey:@"levelControl_subscribeMaxLevel"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - minInterval, maxInterval, - [](void * context, chip::SubscriptionId subscriptionId) { - void (^callback)() = [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks - objectForKey:@"levelControl_subscribeMaxLevel"]; - callback(); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"levelControl_subscribeMaxLevel(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->LevelControl_SubscribeToMaxLevel( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::LevelControl::Attributes::MaxLevel::TypeInfo::DecodableArgType + maxLevel) { + void (^callback)(uint8_t) = + [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks + objectForKey:@"levelControl_subscribeMaxLevel"]; + callback(maxLevel); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks + objectForKey:@"levelControl_subscribeMaxLevel"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }, + minInterval, maxInterval, + [](void * context, chip::SubscriptionId subscriptionId) { + void (^callback)() = + [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks + objectForKey:@"levelControl_subscribeMaxLevel"]; + callback(); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)mediaPlayback_play:(ContentApp * _Nonnull)contentApp @@ -1023,23 +1247,17 @@ - (void)mediaPlayback_play:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress( - AppServer, "CastingServerBridge().mediaPlayback_play() called on Content App with endpoint ID %d", contentApp.endpointId); - - [_commandResponseCallbacks setObject:responseCallback forKey:@"mediaPlayback_play"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_Play(&endpoint, [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"mediaPlayback_play"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->MediaPlayback_Play(&endpoint, responseFunction); + }]; } - (void)mediaPlayback_pause:(ContentApp * _Nonnull)contentApp @@ -1047,23 +1265,17 @@ - (void)mediaPlayback_pause:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress( - AppServer, "CastingServerBridge().mediaPlayback_pause() called on Content App with endpoint ID %d", contentApp.endpointId); - - [_commandResponseCallbacks setObject:responseCallback forKey:@"mediaPlayback_pause"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_Pause(&endpoint, [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"mediaPlayback_pause"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->MediaPlayback_Pause(&endpoint, responseFunction); + }]; } - (void)mediaPlayback_stopPlayback:(ContentApp * _Nonnull)contentApp @@ -1071,23 +1283,17 @@ - (void)mediaPlayback_stopPlayback:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress(AppServer, "CastingServerBridge().mediaPlayback_stopPlayback() called on Content App with endpoint ID %d", - contentApp.endpointId); + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - [_commandResponseCallbacks setObject:responseCallback forKey:@"mediaPlayback_stopPlayback"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_StopPlayback(&endpoint, [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"mediaPlayback_stopPlayback"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->MediaPlayback_StopPlayback(&endpoint, responseFunction); + }]; } - (void)mediaPlayback_next:(ContentApp * _Nonnull)contentApp @@ -1095,23 +1301,17 @@ - (void)mediaPlayback_next:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress( - AppServer, "CastingServerBridge().mediaPlayback_next() called on Content App with endpoint ID %d", contentApp.endpointId); + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - [_commandResponseCallbacks setObject:responseCallback forKey:@"mediaPlayback_next"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_Next(&endpoint, [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"mediaPlayback_next"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->MediaPlayback_Next(&endpoint, responseFunction); + }]; } - (void)mediaPlayback_seek:(ContentApp * _Nonnull)contentApp @@ -1120,23 +1320,17 @@ - (void)mediaPlayback_seek:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress( - AppServer, "CastingServerBridge().mediaPlayback_seek() called on Content App with endpoint ID %d", contentApp.endpointId); + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - [_commandResponseCallbacks setObject:responseCallback forKey:@"mediaPlayback_seek"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_Seek(&endpoint, position, [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"mediaPlayback_seek"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->MediaPlayback_Seek(&endpoint, position, responseFunction); + }]; } - (void)mediaPlayback_skipForward:(ContentApp * _Nonnull)contentApp @@ -1145,24 +1339,18 @@ - (void)mediaPlayback_skipForward:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress(AppServer, "CastingServerBridge().mediaPlayback_skipForward() called on Content App with endpoint ID %d", - contentApp.endpointId); + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - [_commandResponseCallbacks setObject:responseCallback forKey:@"mediaPlayback_skipForward"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err - = CastingServer::GetInstance()->MediaPlayback_SkipForward(&endpoint, deltaPositionMilliseconds, [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"mediaPlayback_skipForward"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->MediaPlayback_SkipForward( + &endpoint, deltaPositionMilliseconds, responseFunction); + }]; } - (void)mediaPlayback_skipBackward:(ContentApp * _Nonnull)contentApp @@ -1171,24 +1359,18 @@ - (void)mediaPlayback_skipBackward:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress(AppServer, "CastingServerBridge().mediaPlayback_skipBackward() called on Content App with endpoint ID %d", - contentApp.endpointId); + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - [_commandResponseCallbacks setObject:responseCallback forKey:@"mediaPlayback_skipBackward"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err - = CastingServer::GetInstance()->MediaPlayback_SkipBackward(&endpoint, deltaPositionMilliseconds, [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"mediaPlayback_skipBackward"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->MediaPlayback_SkipBackward( + &endpoint, deltaPositionMilliseconds, responseFunction); + }]; } - (void)mediaPlayback_previous:(ContentApp * _Nonnull)contentApp @@ -1196,23 +1378,17 @@ - (void)mediaPlayback_previous:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress(AppServer, "CastingServerBridge().mediaPlayback_previous() called on Content App with endpoint ID %d", - contentApp.endpointId); - - [_commandResponseCallbacks setObject:responseCallback forKey:@"mediaPlayback_previous"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_Previous(&endpoint, [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"mediaPlayback_previous"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->MediaPlayback_Previous(&endpoint, responseFunction); + }]; } - (void)mediaPlayback_rewind:(ContentApp * _Nonnull)contentApp @@ -1220,23 +1396,17 @@ - (void)mediaPlayback_rewind:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress( - AppServer, "CastingServerBridge().mediaPlayback_rewind() called on Content App with endpoint ID %d", contentApp.endpointId); - - [_commandResponseCallbacks setObject:responseCallback forKey:@"mediaPlayback_rewind"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_Rewind(&endpoint, [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"mediaPlayback_rewind"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->MediaPlayback_Rewind(&endpoint, responseFunction); + }]; } - (void)mediaPlayback_fastForward:(ContentApp * _Nonnull)contentApp @@ -1244,23 +1414,17 @@ - (void)mediaPlayback_fastForward:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress(AppServer, "CastingServerBridge().mediaPlayback_fastForward() called on Content App with endpoint ID %d", - contentApp.endpointId); - - [_commandResponseCallbacks setObject:responseCallback forKey:@"mediaPlayback_fastForward"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_FastForward(&endpoint, [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"mediaPlayback_fastForward"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->MediaPlayback_FastForward(&endpoint, responseFunction); + }]; } - (void)mediaPlayback_startOver:(ContentApp * _Nonnull)contentApp @@ -1268,23 +1432,17 @@ - (void)mediaPlayback_startOver:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress(AppServer, "CastingServerBridge().mediaPlayback_startOver() called on Content App with endpoint ID %d", - contentApp.endpointId); - - [_commandResponseCallbacks setObject:responseCallback forKey:@"mediaPlayback_startOver"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_StartOver(&endpoint, [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"mediaPlayback_startOver"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->MediaPlayback_StartOver(&endpoint, responseFunction); + }]; } - (void)mediaPlayback_subscribeCurrentState:(ContentApp * _Nonnull)contentApp @@ -1304,35 +1462,43 @@ - (void)mediaPlayback_subscribeCurrentState:(ContentApp * _Nonnull)contentApp [_subscriptionReadFailureCallbacks setObject:failureCallback forKey:@"mediaPlayback_subscribeCurrentState"]; [_subscriptionEstablishedCallbacks setObject:subscriptionEstablishedCallback forKey:@"mediaPlayback_subscribeCurrentState"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_SubscribeToCurrentState( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::MediaPlayback::Attributes::CurrentState::TypeInfo::DecodableArgType currentState) { - void (^callback)(MediaPlayback_PlaybackState) = - [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks - objectForKey:@"mediaPlayback_subscribeCurrentState"]; - callback(MediaPlayback_PlaybackState(currentState)); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks - objectForKey:@"mediaPlayback_subscribeCurrentState"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - minInterval, maxInterval, - [](void * context, chip::SubscriptionId subscriptionId) { - void (^callback)() = [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks - objectForKey:@"mediaPlayback_subscribeCurrentState"]; - callback(); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"mediaPlayback_subscribeCurrentState(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_SubscribeToCurrentState( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::MediaPlayback::Attributes::CurrentState::TypeInfo::DecodableArgType + currentState) { + void (^callback)(MediaPlayback_PlaybackState) = + [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks + objectForKey:@"mediaPlayback_subscribeCurrentState"]; + callback(MediaPlayback_PlaybackState(currentState)); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks + objectForKey:@"mediaPlayback_subscribeCurrentState"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }, + minInterval, maxInterval, + [](void * context, chip::SubscriptionId subscriptionId) { + void (^callback)() = + [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks + objectForKey:@"mediaPlayback_subscribeCurrentState"]; + callback(); + }); + + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)mediaPlayback_subscribeStartTime:(ContentApp * _Nonnull)contentApp @@ -1351,33 +1517,42 @@ - (void)mediaPlayback_subscribeStartTime:(ContentApp * _Nonnull)contentApp [_subscriptionReadFailureCallbacks setObject:failureCallback forKey:@"mediaPlayback_subscribeStartTime"]; [_subscriptionEstablishedCallbacks setObject:subscriptionEstablishedCallback forKey:@"mediaPlayback_subscribeStartTime"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_SubscribeToStartTime( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::MediaPlayback::Attributes::StartTime::TypeInfo::DecodableArgType startTime) { - void (^callback)(NSNumber * _Nullable) = [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks - objectForKey:@"mediaPlayback_subscribeStartTime"]; - callback(@(startTime.Value())); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks - objectForKey:@"mediaPlayback_subscribeStartTime"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - minInterval, maxInterval, - [](void * context, chip::SubscriptionId subscriptionId) { - void (^callback)() = [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks - objectForKey:@"mediaPlayback_subscribeStartTime"]; - callback(); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"mediaPlayback_subscribeStartTime(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_SubscribeToStartTime( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::MediaPlayback::Attributes::StartTime::TypeInfo::DecodableArgType + startTime) { + void (^callback)(NSNumber * _Nullable) = + [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks + objectForKey:@"mediaPlayback_subscribeStartTime"]; + callback(@(startTime.Value())); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks + objectForKey:@"mediaPlayback_subscribeStartTime"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }, + minInterval, maxInterval, + [](void * context, chip::SubscriptionId subscriptionId) { + void (^callback)() = + [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks + objectForKey:@"mediaPlayback_subscribeStartTime"]; + callback(); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)mediaPlayback_subscribeDuration:(ContentApp * _Nonnull)contentApp @@ -1396,33 +1571,42 @@ - (void)mediaPlayback_subscribeDuration:(ContentApp * _Nonnull)contentApp [_subscriptionReadFailureCallbacks setObject:failureCallback forKey:@"mediaPlayback_subscribeDuration"]; [_subscriptionEstablishedCallbacks setObject:subscriptionEstablishedCallback forKey:@"mediaPlayback_subscribeDuration"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_SubscribeToDuration( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::MediaPlayback::Attributes::Duration::TypeInfo::DecodableArgType startTime) { - void (^callback)(NSNumber * _Nullable) = [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks - objectForKey:@"mediaPlayback_subscribeDuration"]; - callback(@(startTime.Value())); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks - objectForKey:@"mediaPlayback_subscribeDuration"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - minInterval, maxInterval, - [](void * context, chip::SubscriptionId subscriptionId) { - void (^callback)() = [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks - objectForKey:@"mediaPlayback_subscribeDuration"]; - callback(); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"mediaPlayback_subscribeDuration(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_SubscribeToDuration( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::MediaPlayback::Attributes::Duration::TypeInfo::DecodableArgType + startTime) { + void (^callback)(NSNumber * _Nullable) = + [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks + objectForKey:@"mediaPlayback_subscribeDuration"]; + callback(@(startTime.Value())); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks + objectForKey:@"mediaPlayback_subscribeDuration"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }, + minInterval, maxInterval, + [](void * context, chip::SubscriptionId subscriptionId) { + void (^callback)() = + [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks + objectForKey:@"mediaPlayback_subscribeDuration"]; + callback(); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)mediaPlayback_subscribeSampledPosition:(ContentApp * _Nonnull)contentApp @@ -1442,47 +1626,54 @@ - (void)mediaPlayback_subscribeSampledPosition:(ContentApp * _Nonnull)contentApp [_subscriptionReadFailureCallbacks setObject:failureCallback forKey:@"mediaPlayback_subscribeSampledPosition"]; [_subscriptionEstablishedCallbacks setObject:subscriptionEstablishedCallback forKey:@"mediaPlayback_subscribeSampledPosition"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_SubscribeToSampledPosition( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::MediaPlayback::Attributes::SampledPosition::TypeInfo::DecodableArgType playbackPosition) { - void (^callback)(MediaPlayback_PlaybackPosition * _Nullable) = - [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks - objectForKey:@"mediaPlayback_subscribeSampledPosition"]; - MediaPlayback_PlaybackPosition * objCPlaybackPosition = nil; - if (!playbackPosition.IsNull()) { - if (playbackPosition.Value().position.IsNull()) { - objCPlaybackPosition = - [[MediaPlayback_PlaybackPosition alloc] initWithUpdatedAt:@(playbackPosition.Value().updatedAt) - position:nil]; - } else { - objCPlaybackPosition = - [[MediaPlayback_PlaybackPosition alloc] initWithUpdatedAt:@(playbackPosition.Value().updatedAt) - position:@(playbackPosition.Value().position.Value())]; - } - callback(objCPlaybackPosition); - } - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks - objectForKey:@"mediaPlayback_subscribeSampledPosition"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - minInterval, maxInterval, - [](void * context, chip::SubscriptionId subscriptionId) { - void (^callback)() = [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks - objectForKey:@"mediaPlayback_subscribeSampledPosition"]; - callback(); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"mediaPlayback_subscribeSampledPosition(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_SubscribeToSampledPosition( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::MediaPlayback::Attributes::SampledPosition::TypeInfo::DecodableArgType + playbackPosition) { + void (^callback)(MediaPlayback_PlaybackPosition * _Nullable) = + [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks + objectForKey:@"mediaPlayback_subscribeSampledPosition"]; + MediaPlayback_PlaybackPosition * objCPlaybackPosition = nil; + if (!playbackPosition.IsNull()) { + if (playbackPosition.Value().position.IsNull()) { + objCPlaybackPosition = [[MediaPlayback_PlaybackPosition alloc] + initWithUpdatedAt:@(playbackPosition.Value().updatedAt) + position:nil]; + } else { + objCPlaybackPosition = [[MediaPlayback_PlaybackPosition alloc] + initWithUpdatedAt:@(playbackPosition.Value().updatedAt) + position:@(playbackPosition.Value().position.Value())]; + } + callback(objCPlaybackPosition); + } + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks + objectForKey:@"mediaPlayback_subscribeSampledPosition"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }, + minInterval, maxInterval, + [](void * context, chip::SubscriptionId subscriptionId) { + void (^callback)() = + [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks + objectForKey:@"mediaPlayback_subscribeSampledPosition"]; + callback(); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)mediaPlayback_subscribePlaybackSpeed:(ContentApp * _Nonnull)contentApp @@ -1502,34 +1693,42 @@ - (void)mediaPlayback_subscribePlaybackSpeed:(ContentApp * _Nonnull)contentApp [_subscriptionReadFailureCallbacks setObject:failureCallback forKey:@"mediaPlayback_subscribePlaybackSpeed"]; [_subscriptionEstablishedCallbacks setObject:subscriptionEstablishedCallback forKey:@"mediaPlayback_subscribePlaybackSpeed"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_SubscribeToPlaybackSpeed( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::TypeInfo::DecodableArgType playbackSpeed) { - void (^callback)(float) = [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks - objectForKey:@"mediaPlayback_subscribePlaybackSpeed"]; - callback(playbackSpeed); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks - objectForKey:@"mediaPlayback_subscribePlaybackSpeed"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - minInterval, maxInterval, - [](void * context, chip::SubscriptionId subscriptionId) { - void (^callback)() = [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks - objectForKey:@"mediaPlayback_subscribePlaybackSpeed"]; - callback(); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"mediaPlayback_subscribePlaybackSpeed(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_SubscribeToPlaybackSpeed( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::TypeInfo::DecodableArgType + playbackSpeed) { + void (^callback)(float) = + [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks + objectForKey:@"mediaPlayback_subscribePlaybackSpeed"]; + callback(playbackSpeed); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks + objectForKey:@"mediaPlayback_subscribePlaybackSpeed"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }, + minInterval, maxInterval, + [](void * context, chip::SubscriptionId subscriptionId) { + void (^callback)() = + [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks + objectForKey:@"mediaPlayback_subscribePlaybackSpeed"]; + callback(); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)mediaPlayback_subscribeSeekRangeEnd:(ContentApp * _Nonnull)contentApp @@ -1549,34 +1748,43 @@ - (void)mediaPlayback_subscribeSeekRangeEnd:(ContentApp * _Nonnull)contentApp [_subscriptionReadFailureCallbacks setObject:failureCallback forKey:@"mediaPlayback_subscribeSeekRangeEnd"]; [_subscriptionEstablishedCallbacks setObject:subscriptionEstablishedCallback forKey:@"mediaPlayback_subscribeSeekRangeEnd"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_SubscribeToDuration( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::TypeInfo::DecodableArgType seekRangeEnd) { - void (^callback)(NSNumber * _Nullable) = [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks - objectForKey:@"mediaPlayback_subscribeSeekRangeEnd"]; - callback(@(seekRangeEnd.Value())); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks - objectForKey:@"mediaPlayback_subscribeSeekRangeEnd"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - minInterval, maxInterval, - [](void * context, chip::SubscriptionId subscriptionId) { - void (^callback)() = [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks - objectForKey:@"mediaPlayback_subscribeSeekRangeEnd"]; - callback(); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"mediaPlayback_subscribeSeekRangeEnd(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_SubscribeToDuration( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::TypeInfo::DecodableArgType + seekRangeEnd) { + void (^callback)(NSNumber * _Nullable) = + [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks + objectForKey:@"mediaPlayback_subscribeSeekRangeEnd"]; + callback(@(seekRangeEnd.Value())); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks + objectForKey:@"mediaPlayback_subscribeSeekRangeEnd"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }, + minInterval, maxInterval, + [](void * context, chip::SubscriptionId subscriptionId) { + void (^callback)() = + [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks + objectForKey:@"mediaPlayback_subscribeSeekRangeEnd"]; + callback(); + }); + + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)mediaPlayback_subscribeSeekRangeStart:(ContentApp * _Nonnull)contentApp @@ -1596,34 +1804,42 @@ - (void)mediaPlayback_subscribeSeekRangeStart:(ContentApp * _Nonnull)contentApp [_subscriptionReadFailureCallbacks setObject:failureCallback forKey:@"mediaPlayback_subscribeSeekRangeStart"]; [_subscriptionEstablishedCallbacks setObject:subscriptionEstablishedCallback forKey:@"mediaPlayback_subscribeSeekRangeStart"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_SubscribeToDuration( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::TypeInfo::DecodableArgType seekRangeStart) { - void (^callback)(NSNumber * _Nullable) = [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks - objectForKey:@"mediaPlayback_subscribeSeekRangeStart"]; - callback(@(seekRangeStart.Value())); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks - objectForKey:@"mediaPlayback_subscribeSeekRangeStart"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - minInterval, maxInterval, - [](void * context, chip::SubscriptionId subscriptionId) { - void (^callback)() = [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks - objectForKey:@"mediaPlayback_subscribeSeekRangeStart"]; - callback(); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"mediaPlayback_subscribeSeekRangeStart(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->MediaPlayback_SubscribeToDuration( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::TypeInfo::DecodableArgType + seekRangeStart) { + void (^callback)(NSNumber * _Nullable) = + [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks + objectForKey:@"mediaPlayback_subscribeSeekRangeStart"]; + callback(@(seekRangeStart.Value())); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks + objectForKey:@"mediaPlayback_subscribeSeekRangeStart"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }, + minInterval, maxInterval, + [](void * context, chip::SubscriptionId subscriptionId) { + void (^callback)() = + [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks + objectForKey:@"mediaPlayback_subscribeSeekRangeStart"]; + callback(); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)applicationLauncher_launchApp:(ContentApp * _Nonnull)contentApp @@ -1634,29 +1850,24 @@ - (void)applicationLauncher_launchApp:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress(AppServer, "CastingServerBridge().applicationLauncher_launchApp() called on Content App with endpoint ID %d", - contentApp.endpointId); - - [_commandResponseCallbacks setObject:responseCallback forKey:@"applicationLauncher_launchApp"]; chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application; application.catalogVendorID = catalogVendorId; application.applicationID = chip::CharSpan::fromCharString([applicationId UTF8String]); - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->ApplicationLauncher_LaunchApp(&endpoint, application, - chip::MakeOptional(chip::ByteSpan(static_cast(data.bytes), data.length)), [](CHIP_ERROR err) { - void (^responseCallback)(bool) = [[CastingServerBridge getSharedInstance].commandResponseCallbacks - objectForKey:@"applicationLauncher_launchApp"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + return castingServer->ApplicationLauncher_LaunchApp(&endpoint, application, + chip::MakeOptional(chip::ByteSpan(static_cast(data.bytes), data.length)), + responseFunction); + }]; } - (void)applicationLauncher_stopApp:(ContentApp * _Nonnull)contentApp @@ -1666,28 +1877,21 @@ - (void)applicationLauncher_stopApp:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress(AppServer, "CastingServerBridge().applicationLauncher_stopApp() called on Content App with endpoint ID %d", - contentApp.endpointId); - - [_commandResponseCallbacks setObject:responseCallback forKey:@"applicationLauncher_stopApp"]; - chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application; application.catalogVendorID = catalogVendorId; application.applicationID = chip::CharSpan::fromCharString([applicationId UTF8String]); - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - CHIP_ERROR err = CastingServer::GetInstance()->ApplicationLauncher_StopApp(&endpoint, application, [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"applicationLauncher_stopApp"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->ApplicationLauncher_StopApp(&endpoint, application, responseFunction); + }]; } - (void)applicationLauncher_hideApp:(ContentApp * _Nonnull)contentApp @@ -1697,28 +1901,22 @@ - (void)applicationLauncher_hideApp:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress(AppServer, "CastingServerBridge().applicationLauncher_hideApp() called on Content App with endpoint ID %d", - contentApp.endpointId); - - [_commandResponseCallbacks setObject:responseCallback forKey:@"applicationLauncher_hideApp"]; chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type application; application.catalogVendorID = catalogVendorId; application.applicationID = chip::CharSpan::fromCharString([applicationId UTF8String]); - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - CHIP_ERROR err = CastingServer::GetInstance()->ApplicationLauncher_HideApp(&endpoint, application, [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"applicationLauncher_hideApp"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->ApplicationLauncher_HideApp(&endpoint, application, responseFunction); + }]; } - (void)targetNavigator_navigateTarget:(ContentApp * _Nonnull)contentApp @@ -1728,25 +1926,18 @@ - (void)targetNavigator_navigateTarget:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress(AppServer, "CastingServerBridge().targetNavigator_navigateTarget() called on Content App with endpoint ID %d", - contentApp.endpointId); - - [_commandResponseCallbacks setObject:responseCallback forKey:@"targetNavigator_navigateTarget"]; + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->TargetNavigator_NavigateTarget( - &endpoint, target, chip::MakeOptional(chip::CharSpan::fromCharString([data UTF8String])), [](CHIP_ERROR err) { - void (^responseCallback)(bool) = [[CastingServerBridge getSharedInstance].commandResponseCallbacks - objectForKey:@"targetNavigator_navigateTarget"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->TargetNavigator_NavigateTarget(&endpoint, target, + chip::MakeOptional(chip::CharSpan::fromCharString([data UTF8String])), responseFunction); + }]; } - (void)targetNavigator_subscribeTargetList:(ContentApp * _Nonnull)contentApp @@ -1766,49 +1957,59 @@ - (void)targetNavigator_subscribeTargetList:(ContentApp * _Nonnull)contentApp [_subscriptionReadFailureCallbacks setObject:failureCallback forKey:@"targetNavigator_subscribeTargetList"]; [_subscriptionEstablishedCallbacks setObject:subscriptionEstablishedCallback forKey:@"targetNavigator_subscribeTargetList"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->TargetNavigator_SubscribeToTargetList( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::TargetNavigator::Attributes::TargetList::TypeInfo::DecodableArgType targetList) { - void (^callback)(NSMutableArray *) = [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks - objectForKey:@"targetNavigator_subscribeTargetList"]; - NSMutableArray * objCTargetList = nil; - size_t targetInfoCount; - targetList.ComputeSize(&targetInfoCount); - if (targetInfoCount > 0) { - objCTargetList = [NSMutableArray arrayWithCapacity:targetInfoCount]; - auto iter = targetList.begin(); - while (iter.Next()) { - const chip::app::Clusters::TargetNavigator::Structs::TargetInfoStruct::DecodableType & targetInfo - = iter.GetValue(); - TargetNavigator_TargetInfoStruct * objCTargetInfoStruct = [[TargetNavigator_TargetInfoStruct alloc] - initWithIdentifier:@(targetInfo.identifier) - name:[NSString stringWithUTF8String:targetInfo.name.data()]]; - [objCTargetList addObject:objCTargetInfoStruct]; - } - } - callback(objCTargetList); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks - objectForKey:@"targetNavigator_subscribeTargetList"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - minInterval, maxInterval, - [](void * context, chip::SubscriptionId subscriptionId) { - void (^callback)() = [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks - objectForKey:@"targetNavigator_subscribeTargetList"]; - callback(); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"targetNavigator_subscribeTargetList(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->TargetNavigator_SubscribeToTargetList( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::TargetNavigator::Attributes::TargetList::TypeInfo::DecodableArgType + targetList) { + void (^callback)(NSMutableArray *) = + [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks + objectForKey:@"targetNavigator_subscribeTargetList"]; + NSMutableArray * objCTargetList = nil; + size_t targetInfoCount; + targetList.ComputeSize(&targetInfoCount); + if (targetInfoCount > 0) { + objCTargetList = [NSMutableArray arrayWithCapacity:targetInfoCount]; + auto iter = targetList.begin(); + while (iter.Next()) { + const chip::app::Clusters::TargetNavigator::Structs::TargetInfoStruct:: + DecodableType & targetInfo + = iter.GetValue(); + TargetNavigator_TargetInfoStruct * objCTargetInfoStruct = + [[TargetNavigator_TargetInfoStruct alloc] + initWithIdentifier:@(targetInfo.identifier) + name:[NSString stringWithUTF8String:targetInfo.name.data()]]; + [objCTargetList addObject:objCTargetInfoStruct]; + } + } + callback(objCTargetList); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks + objectForKey:@"targetNavigator_subscribeTargetList"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }, + minInterval, maxInterval, + [](void * context, chip::SubscriptionId subscriptionId) { + void (^callback)() = + [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks + objectForKey:@"targetNavigator_subscribeTargetList"]; + callback(); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)targetNavigator_subscribeCurrentTarget:(ContentApp * _Nonnull)contentApp @@ -1828,34 +2029,42 @@ - (void)targetNavigator_subscribeCurrentTarget:(ContentApp * _Nonnull)contentApp [_subscriptionReadFailureCallbacks setObject:failureCallback forKey:@"targetNavigator_subscribeCurrentTarget"]; [_subscriptionEstablishedCallbacks setObject:subscriptionEstablishedCallback forKey:@"targetNavigator_subscribeCurrentTarget"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->TargetNavigator_SubscribeToCurrentTarget( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::TargetNavigator::Attributes::CurrentTarget::TypeInfo::DecodableArgType currentTarget) { - void (^callback)(uint8_t) = [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks - objectForKey:@"targetNavigator_subscribeCurrentTarget"]; - callback(currentTarget); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks - objectForKey:@"targetNavigator_subscribeCurrentTarget"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - minInterval, maxInterval, - [](void * context, chip::SubscriptionId subscriptionId) { - void (^callback)() = [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks - objectForKey:@"targetNavigator_subscribeCurrentTarget"]; - callback(); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"targetNavigator_subscribeCurrentTarget(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->TargetNavigator_SubscribeToCurrentTarget( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::TargetNavigator::Attributes::CurrentTarget::TypeInfo::DecodableArgType + currentTarget) { + void (^callback)(uint8_t) = + [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks + objectForKey:@"targetNavigator_subscribeCurrentTarget"]; + callback(currentTarget); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks + objectForKey:@"targetNavigator_subscribeCurrentTarget"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }, + minInterval, maxInterval, + [](void * context, chip::SubscriptionId subscriptionId) { + void (^callback)() = + [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks + objectForKey:@"targetNavigator_subscribeCurrentTarget"]; + callback(); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)keypadInput_sendKey:(ContentApp * _Nonnull)contentApp @@ -1864,25 +2073,18 @@ - (void)keypadInput_sendKey:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress( - AppServer, "CastingServerBridge().keypadInput_sendKey() called on Content App with endpoint ID %d", contentApp.endpointId); - - [_commandResponseCallbacks setObject:responseCallback forKey:@"keypadInput_sendKey"]; + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->KeypadInput_SendKey( - &endpoint, static_cast(keyCode), [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"keypadInput_sendKey"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->KeypadInput_SendKey(&endpoint, + static_cast(keyCode), responseFunction); + }]; } - (void)applicationBasic_subscribeVendorName:(ContentApp * _Nonnull)contentApp @@ -1902,34 +2104,42 @@ - (void)applicationBasic_subscribeVendorName:(ContentApp * _Nonnull)contentApp [_subscriptionReadFailureCallbacks setObject:failureCallback forKey:@"applicationBasic_subscribeVendorName"]; [_subscriptionEstablishedCallbacks setObject:subscriptionEstablishedCallback forKey:@"applicationBasic_subscribeVendorName"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToVendorName( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::ApplicationBasic::Attributes::VendorName::TypeInfo::DecodableArgType vendorName) { - void (^callback)(NSString * _Nonnull) = [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks - objectForKey:@"applicationBasic_subscribeVendorName"]; - callback(vendorName.data() != nil ? [NSString stringWithUTF8String:vendorName.data()] : nil); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks - objectForKey:@"applicationBasic_subscribeVendorName"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - minInterval, maxInterval, - [](void * context, chip::SubscriptionId subscriptionId) { - void (^callback)() = [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks - objectForKey:@"applicationBasic_subscribeVendorName"]; - callback(); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"applicationBasic_subscribeVendorName(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToVendorName( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::ApplicationBasic::Attributes::VendorName::TypeInfo::DecodableArgType + vendorName) { + void (^callback)(NSString * _Nonnull) = + [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks + objectForKey:@"applicationBasic_subscribeVendorName"]; + callback(vendorName.data() != nil ? [NSString stringWithUTF8String:vendorName.data()] : nil); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks + objectForKey:@"applicationBasic_subscribeVendorName"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }, + minInterval, maxInterval, + [](void * context, chip::SubscriptionId subscriptionId) { + void (^callback)() = + [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks + objectForKey:@"applicationBasic_subscribeVendorName"]; + callback(); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)applicationBasic_subscribeVendorID:(ContentApp * _Nonnull)contentApp @@ -1949,33 +2159,42 @@ - (void)applicationBasic_subscribeVendorID:(ContentApp * _Nonnull)contentApp [_subscriptionReadFailureCallbacks setObject:failureCallback forKey:@"applicationBasic_subscribeVendorID"]; [_subscriptionEstablishedCallbacks setObject:subscriptionEstablishedCallback forKey:@"applicationBasic_subscribeVendorID"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToVendorID( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::ApplicationBasic::Attributes::VendorID::TypeInfo::DecodableArgType vendorID) { - void (^callback)(NSNumber * _Nonnull) = [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks - objectForKey:@"applicationBasic_subscribeVendorID"]; - callback(@(vendorID)); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks - objectForKey:@"applicationBasic_subscribeVendorID"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - minInterval, maxInterval, - [](void * context, chip::SubscriptionId subscriptionId) { - void (^callback)() = [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks - objectForKey:@"applicationBasic_subscribeVendorID"]; - callback(); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"applicationBasic_subscribeVendorID(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToVendorID( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::ApplicationBasic::Attributes::VendorID::TypeInfo::DecodableArgType + vendorID) { + void (^callback)(NSNumber * _Nonnull) = + [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks + objectForKey:@"applicationBasic_subscribeVendorID"]; + callback(@(vendorID)); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks + objectForKey:@"applicationBasic_subscribeVendorID"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }, + minInterval, maxInterval, + [](void * context, chip::SubscriptionId subscriptionId) { + void (^callback)() = + [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks + objectForKey:@"applicationBasic_subscribeVendorID"]; + callback(); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)applicationBasic_subscribeApplicationName:(ContentApp * _Nonnull)contentApp @@ -1996,34 +2215,42 @@ - (void)applicationBasic_subscribeApplicationName:(ContentApp * _Nonnull)content [_subscriptionEstablishedCallbacks setObject:subscriptionEstablishedCallback forKey:@"applicationBasic_subscribeApplicationName"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToApplicationName( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::TypeInfo::DecodableArgType applicationName) { - void (^callback)(NSString * _Nonnull) = [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks - objectForKey:@"applicationBasic_subscribeApplicationName"]; - callback([NSString stringWithUTF8String:applicationName.data()]); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks - objectForKey:@"applicationBasic_subscribeApplicationName"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - minInterval, maxInterval, - [](void * context, chip::SubscriptionId subscriptionId) { - void (^callback)() = [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks - objectForKey:@"applicationBasic_subscribeApplicationName"]; - callback(); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"applicationBasic_subscribeApplicationName(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToApplicationName( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::TypeInfo:: + DecodableArgType applicationName) { + void (^callback)(NSString * _Nonnull) = + [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks + objectForKey:@"applicationBasic_subscribeApplicationName"]; + callback([NSString stringWithUTF8String:applicationName.data()]); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks + objectForKey:@"applicationBasic_subscribeApplicationName"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }, + minInterval, maxInterval, + [](void * context, chip::SubscriptionId subscriptionId) { + void (^callback)() = + [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks + objectForKey:@"applicationBasic_subscribeApplicationName"]; + callback(); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)applicationBasic_subscribeProductID:(ContentApp * _Nonnull)contentApp @@ -2043,33 +2270,42 @@ - (void)applicationBasic_subscribeProductID:(ContentApp * _Nonnull)contentApp [_subscriptionReadFailureCallbacks setObject:failureCallback forKey:@"applicationBasic_subscribeProductID"]; [_subscriptionEstablishedCallbacks setObject:subscriptionEstablishedCallback forKey:@"applicationBasic_subscribeProductID"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToProductID( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::ApplicationBasic::Attributes::ProductID::TypeInfo::DecodableArgType productID) { - void (^callback)(uint16_t) = [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks - objectForKey:@"applicationBasic_subscribeProductID"]; - callback(productID); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks - objectForKey:@"applicationBasic_subscribeProductID"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - minInterval, maxInterval, - [](void * context, chip::SubscriptionId subscriptionId) { - void (^callback)() = [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks - objectForKey:@"applicationBasic_subscribeProductID"]; - callback(); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"applicationBasic_subscribeProductID(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToProductID( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::ApplicationBasic::Attributes::ProductID::TypeInfo::DecodableArgType + productID) { + void (^callback)(uint16_t) = + [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks + objectForKey:@"applicationBasic_subscribeProductID"]; + callback(productID); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks + objectForKey:@"applicationBasic_subscribeProductID"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }, + minInterval, maxInterval, + [](void * context, chip::SubscriptionId subscriptionId) { + void (^callback)() = + [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks + objectForKey:@"applicationBasic_subscribeProductID"]; + callback(); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)applicationBasic_subscribeApplicationVersion:(ContentApp * _Nonnull)contentApp @@ -2090,35 +2326,42 @@ - (void)applicationBasic_subscribeApplicationVersion:(ContentApp * _Nonnull)cont [_subscriptionEstablishedCallbacks setObject:subscriptionEstablishedCallback forKey:@"applicationBasic_subscribeApplicationVersion"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToApplicationVersion( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::TypeInfo::DecodableArgType - applicationVersion) { - void (^callback)(NSString * _Nonnull) = [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks - objectForKey:@"applicationBasic_subscribeApplicationVersion"]; - callback([NSString stringWithUTF8String:applicationVersion.data()]); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks - objectForKey:@"applicationBasic_subscribeApplicationVersion"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }, - minInterval, maxInterval, - [](void * context, chip::SubscriptionId subscriptionId) { - void (^callback)() = [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks - objectForKey:@"applicationBasic_subscribeApplicationVersion"]; - callback(); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"applicationBasic_subscribeApplicationVersion(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_SubscribeToApplicationVersion( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::TypeInfo:: + DecodableArgType applicationVersion) { + void (^callback)(NSString * _Nonnull) = + [[CastingServerBridge getSharedInstance].subscriptionReadSuccessCallbacks + objectForKey:@"applicationBasic_subscribeApplicationVersion"]; + callback([NSString stringWithUTF8String:applicationVersion.data()]); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].subscriptionReadFailureCallbacks + objectForKey:@"applicationBasic_subscribeApplicationVersion"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }, + minInterval, maxInterval, + [](void * context, chip::SubscriptionId subscriptionId) { + void (^callback)() = + [[CastingServerBridge getSharedInstance].subscriptionEstablishedCallbacks + objectForKey:@"applicationBasic_subscribeApplicationVersion"]; + callback(); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)applicationBasic_readVendorName:(ContentApp * _Nonnull)contentApp @@ -2133,28 +2376,35 @@ - (void)applicationBasic_readVendorName:(ContentApp * _Nonnull)contentApp [_readSuccessCallbacks setObject:successCallback forKey:@"applicationBasic_readVendorName"]; [_readFailureCallbacks setObject:failureCallback forKey:@"applicationBasic_readVendorName"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_ReadVendorName( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::ApplicationBasic::Attributes::VendorName::TypeInfo::DecodableArgType vendorName) { - void (^callback)(NSString * _Nonnull) = - [[CastingServerBridge getSharedInstance].readSuccessCallbacks objectForKey:@"applicationBasic_readVendorName"]; - callback([NSString stringWithUTF8String:vendorName.data()]); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = - [[CastingServerBridge getSharedInstance].readFailureCallbacks objectForKey:@"applicationBasic_readVendorName"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:[NSString stringWithFormat:@"%s(...)", __func__] + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_ReadVendorName( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::ApplicationBasic::Attributes::VendorName::TypeInfo::DecodableArgType + vendorName) { + void (^callback)(NSString * _Nonnull) = + [[CastingServerBridge getSharedInstance].readSuccessCallbacks + objectForKey:@"applicationBasic_readVendorName"]; + callback([NSString stringWithUTF8String:vendorName.data()]); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].readFailureCallbacks + objectForKey:@"applicationBasic_readVendorName"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)applicationBasic_readVendorID:(ContentApp * _Nonnull)contentApp @@ -2169,27 +2419,35 @@ - (void)applicationBasic_readVendorID:(ContentApp * _Nonnull)contentApp [_readSuccessCallbacks setObject:successCallback forKey:@"applicationBasic_readVendorID"]; [_readFailureCallbacks setObject:failureCallback forKey:@"applicationBasic_readVendorID"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_ReadVendorID( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::ApplicationBasic::Attributes::VendorID::TypeInfo::DecodableArgType vendorID) { - void (^callback)(NSNumber * _Nonnull) = - [[CastingServerBridge getSharedInstance].readSuccessCallbacks objectForKey:@"applicationBasic_readVendorID"]; - callback(@(vendorID)); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = - [[CastingServerBridge getSharedInstance].readFailureCallbacks objectForKey:@"applicationBasic_readVendorID"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"applicationBasic_readVendorID(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_ReadVendorID( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::ApplicationBasic::Attributes::VendorID::TypeInfo::DecodableArgType + vendorID) { + void (^callback)(NSNumber * _Nonnull) = + [[CastingServerBridge getSharedInstance].readSuccessCallbacks + objectForKey:@"applicationBasic_readVendorID"]; + callback(@(vendorID)); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].readFailureCallbacks + objectForKey:@"applicationBasic_readVendorID"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)applicationBasic_readApplicationName:(ContentApp * _Nonnull)contentApp @@ -2205,28 +2463,35 @@ - (void)applicationBasic_readApplicationName:(ContentApp * _Nonnull)contentApp [_readSuccessCallbacks setObject:successCallback forKey:@"applicationBasic_readApplicationName"]; [_readFailureCallbacks setObject:failureCallback forKey:@"applicationBasic_readApplicationName"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_ReadApplicationName( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::TypeInfo::DecodableArgType applicationName) { - void (^callback)(NSString * _Nonnull) = [[CastingServerBridge getSharedInstance].readSuccessCallbacks - objectForKey:@"applicationBasic_readApplicationName"]; - callback([NSString stringWithUTF8String:applicationName.data()]); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].readFailureCallbacks - objectForKey:@"applicationBasic_readApplicationName"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"applicationBasic_readApplicationName(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_ReadApplicationName( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::TypeInfo:: + DecodableArgType applicationName) { + void (^callback)(NSString * _Nonnull) = + [[CastingServerBridge getSharedInstance].readSuccessCallbacks + objectForKey:@"applicationBasic_readApplicationName"]; + callback([NSString stringWithUTF8String:applicationName.data()]); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].readFailureCallbacks + objectForKey:@"applicationBasic_readApplicationName"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)applicationBasic_readProductID:(ContentApp * _Nonnull)contentApp @@ -2241,27 +2506,34 @@ - (void)applicationBasic_readProductID:(ContentApp * _Nonnull)contentApp [_readSuccessCallbacks setObject:successCallback forKey:@"applicationBasic_readProductID"]; [_readFailureCallbacks setObject:failureCallback forKey:@"applicationBasic_readProductID"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_ReadProductID( - &endpoint, nullptr, - [](void * context, chip::app::Clusters::ApplicationBasic::Attributes::ProductID::TypeInfo::DecodableArgType productID) { - void (^callback)(uint16_t) = - [[CastingServerBridge getSharedInstance].readSuccessCallbacks objectForKey:@"applicationBasic_readProductID"]; - callback(productID); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = - [[CastingServerBridge getSharedInstance].readFailureCallbacks objectForKey:@"applicationBasic_readProductID"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"applicationBasic_readProductID(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_ReadProductID( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::ApplicationBasic::Attributes::ProductID::TypeInfo::DecodableArgType + productID) { + void (^callback)(uint16_t) = [[CastingServerBridge getSharedInstance].readSuccessCallbacks + objectForKey:@"applicationBasic_readProductID"]; + callback(productID); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].readFailureCallbacks + objectForKey:@"applicationBasic_readProductID"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)applicationBasic_readApplicationVersion:(ContentApp * _Nonnull)contentApp @@ -2277,29 +2549,35 @@ - (void)applicationBasic_readApplicationVersion:(ContentApp * _Nonnull)contentAp [_readSuccessCallbacks setObject:successCallback forKey:@"applicationBasic_readApplicationVersion"]; [_readFailureCallbacks setObject:failureCallback forKey:@"applicationBasic_readApplicationVersion"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_ReadApplicationVersion( - &endpoint, nullptr, - [](void * context, - chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::TypeInfo::DecodableArgType - applicationVersion) { - void (^callback)(NSString * _Nonnull) = [[CastingServerBridge getSharedInstance].readSuccessCallbacks - objectForKey:@"applicationBasic_readApplicationVersion"]; - callback([NSString stringWithUTF8String:applicationVersion.data()]); - }, - [](void * context, CHIP_ERROR err) { - void (^callback)(MatterError *) = [[CastingServerBridge getSharedInstance].readFailureCallbacks - objectForKey:@"applicationBasic_readApplicationVersion"]; - callback([[MatterError alloc] initWithCode:err.AsInteger() message:[NSString stringWithUTF8String:err.AsString()]]); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler([[MatterError alloc] initWithCode:err.AsInteger() - message:[NSString stringWithUTF8String:err.AsString()]]); - }); - }); + [self + dispatchOnMatterSDKQueue:@"applicationBasic_readApplicationVersion(...)" + block:^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->ApplicationBasic_ReadApplicationVersion( + &endpoint, nullptr, + [](void * context, + chip::app::Clusters::ApplicationBasic::Attributes::ApplicationVersion::TypeInfo:: + DecodableArgType applicationVersion) { + void (^callback)(NSString * _Nonnull) = + [[CastingServerBridge getSharedInstance].readSuccessCallbacks + objectForKey:@"applicationBasic_readApplicationVersion"]; + callback([NSString stringWithUTF8String:applicationVersion.data()]); + }, + [](void * context, CHIP_ERROR err) { + void (^callback)(MatterError *) = + [[CastingServerBridge getSharedInstance].readFailureCallbacks + objectForKey:@"applicationBasic_readApplicationVersion"]; + callback([[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler( + [[MatterError alloc] initWithCode:err.AsInteger() + message:[NSString stringWithUTF8String:err.AsString()]]); + }); + }]; } - (void)onOff_on:(ContentApp * _Nonnull)contentApp @@ -2307,22 +2585,17 @@ - (void)onOff_on:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress(AppServer, "CastingServerBridge().onOff_on() called on Content App with endpoint ID %d", contentApp.endpointId); - - [_commandResponseCallbacks setObject:responseCallback forKey:@"onOff_on"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - CHIP_ERROR err = CastingServer::GetInstance()->OnOff_On(&endpoint, [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"onOff_on"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->OnOff_On(&endpoint, responseFunction); + }]; } - (void)onOff_off:(ContentApp * _Nonnull)contentApp @@ -2330,23 +2603,17 @@ - (void)onOff_off:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress( - AppServer, "CastingServerBridge().onOff_off() called on Content App with endpoint ID %d", contentApp.endpointId); - - [_commandResponseCallbacks setObject:responseCallback forKey:@"onOff_off"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - CHIP_ERROR err = CastingServer::GetInstance()->OnOff_Off(&endpoint, [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"onOff_off"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + return castingServer->OnOff_Off(&endpoint, responseFunction); + }]; } - (void)onOff_toggle:(ContentApp * _Nonnull)contentApp @@ -2354,22 +2621,16 @@ - (void)onOff_toggle:(ContentApp * _Nonnull)contentApp clientQueue:(dispatch_queue_t _Nonnull)clientQueue requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler { - ChipLogProgress( - AppServer, "CastingServerBridge().onOff_toggle() called on Content App with endpoint ID %d", contentApp.endpointId); - - [_commandResponseCallbacks setObject:responseCallback forKey:@"onOff_toggle"]; - dispatch_async(_chipWorkQueue, ^{ - TargetEndpointInfo endpoint; - [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; - - CHIP_ERROR err = CastingServer::GetInstance()->OnOff_Toggle(&endpoint, [](CHIP_ERROR err) { - void (^responseCallback)(bool) = - [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"onOff_toggle"]; - responseCallback(CHIP_NO_ERROR == err); - }); - dispatch_async(clientQueue, ^{ - requestSentHandler(CHIP_NO_ERROR == err); - }); - }); + const NSString * description = [NSString stringWithFormat:@"%s(...) (Content App %d)", __func__, contentApp.endpointId]; + [self withCastingServerInvokeBlock:description + callbackQueue:clientQueue + onBlockComplete:requestSentHandler + onResponse:responseCallback + block:^(CastingServer * castingServer, std::function responseFunction) { + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + return castingServer->OnOff_Toggle(&endpoint, responseFunction); + }]; } @end diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CommissionerDiscoveryDelegateImpl.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CommissionerDiscoveryDelegateImpl.h index 56ac24526d831c..3d54b9acc022c6 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CommissionerDiscoveryDelegateImpl.h +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CommissionerDiscoveryDelegateImpl.h @@ -26,7 +26,7 @@ class CommissionerDiscoveryDelegateImpl : public chip::Controller::DeviceDiscove public: void SetUp(dispatch_queue_t _Nonnull clientQueue, void (^_Nonnull objCDiscoveredCommissionerHandler)(DiscoveredNodeData * _Nonnull), - TargetVideoPlayerInfo * cachedTargetVideoPlayerInfos) + TargetVideoPlayerInfo * _Nullable cachedTargetVideoPlayerInfos) { mClientQueue = clientQueue; mObjCDiscoveredCommissionerHandler = objCDiscoveredCommissionerHandler; @@ -59,7 +59,7 @@ class CommissionerDiscoveryDelegateImpl : public chip::Controller::DeviceDiscove private: void (^_Nonnull mObjCDiscoveredCommissionerHandler)(DiscoveredNodeData * _Nonnull); dispatch_queue_t _Nonnull mClientQueue; - TargetVideoPlayerInfo * mCachedTargetVideoPlayerInfos; + TargetVideoPlayerInfo * _Nullable mCachedTargetVideoPlayerInfos; }; #endif /* CommissionerDiscoveryDelegateImpl_h */ diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting/CertTestView.swift b/examples/tv-casting-app/darwin/TvCasting/TvCasting/CertTestView.swift index f38e84a7ac30fc..016b75f879f5a4 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting/CertTestView.swift +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting/CertTestView.swift @@ -1,7 +1,7 @@ /** * - * Copyright (c) 2020-2022 Project CHIP Authors + * Copyright (c) 2020-2023 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import SwiftUI struct CertTestView: View { @StateObject var viewModel = CertTestViewModel() @State private var targetContentAppId: String = "" + @State private var parallelizeTests = true var body: some View { VStack(alignment: .leading) { @@ -46,9 +47,17 @@ struct CertTestView: View { } .border(.secondary) } + HStack() { + Toggle(isOn: $parallelizeTests) { + Text("Parallelize Tests") + } + } Button("Launch Test") { - viewModel.launchTest(targetContentAppId: targetContentAppId) + viewModel.launchTests( + targetContentAppId: targetContentAppId, + inParallel: parallelizeTests + ) } .background(Color.blue) .foregroundColor(Color.white) diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting/CertTestViewModel.swift b/examples/tv-casting-app/darwin/TvCasting/TvCasting/CertTestViewModel.swift index df6c5f319be5a6..7975f80604ac50 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting/CertTestViewModel.swift +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting/CertTestViewModel.swift @@ -1,6 +1,6 @@ /** * - * Copyright (c) 2020-2022 Project CHIP Authors + * Copyright (c) 2020-2023 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,424 +18,513 @@ import Foundation import os.log -class CallbackHelper { +private class CallbackHelper { var testCaseName: String; var certTestViewModel: CertTestViewModel; - let Log = Logger(subsystem: "com.matter.casting", - category: "CertTestViewModel") + let logger = Logger(subsystem: "com.matter.casting", category: "CertTestViewModel") init(testCaseName: String, certTestViewModel: CertTestViewModel) { self.testCaseName = testCaseName self.certTestViewModel = certTestViewModel } - func responseCallback(result: Bool) + func responseCallback(succeeded: Bool) { - self.Log.info("CertTestViewModel.responseCallback.\(self.testCaseName) result \(result)") - DispatchQueue.main.async { - self.certTestViewModel.status = result ? "Test \(self.testCaseName) successful" : "Test \(self.testCaseName) failed" + logger.info("CertTestViewModel.responseCallback.\(self.testCaseName) succeeded? \(succeeded)") + if (succeeded) { + certTestViewModel.onTestPassed(testCaseName) + } else { + certTestViewModel.onTestFailed(testCaseName) } } - func requestSentHandler(result: Bool) + func requestSentHandler(succeeded: Bool) { - self.Log.info("CertTestViewModel.requestSentHandler.\(self.testCaseName) result \(result)") + logger.info("CertTestViewModel.requestSentHandler.\(self.testCaseName) succeeded? \(succeeded)") + if (!succeeded) { + certTestViewModel.onTestFailed(testCaseName) + } + } + + func requestSentHandlerError(result: MatterError) + { + logger.warning("CertTestViewModel.requestSentHandler.\(self.testCaseName). Code : \(result.code). Message : \(result.message ?? "")") + requestSentHandler(succeeded: result.code == 0) } func successCallbackString(result: String) { - self.Log.info("CertTestViewModel.successCallback.\(self.testCaseName) result \(result)") - DispatchQueue.main.async { - self.certTestViewModel.status = "Test \(self.testCaseName) successful" - } + logger.info("CertTestViewModel.successCallback.\(self.testCaseName) result \(result)") + certTestViewModel.onTestPassed(testCaseName) } func successCallbackInteger(result: UInt16) { - self.Log.info("CertTestViewModel.successCallback.\(self.testCaseName) result \(result)") - DispatchQueue.main.async { - self.certTestViewModel.status = "Test \(self.testCaseName) successful" - } + logger.info("CertTestViewModel.successCallback.\(self.testCaseName) result \(result)") + certTestViewModel.onTestPassed(testCaseName) } func successCallbackNumber(result: NSNumber) { - self.Log.info("CertTestViewModel.successCallback.\(self.testCaseName) result \(result)") - DispatchQueue.main.async { - self.certTestViewModel.status = "Test \(self.testCaseName) successful" - } + logger.info("CertTestViewModel.successCallback.\(self.testCaseName) result \(result)") + certTestViewModel.onTestPassed(testCaseName) } func failureCallback(result: MatterError) { - self.Log.info("CertTestViewModel.failureCallback.\(self.testCaseName) failed. Code : \(result.code). Message : \(result.message ?? "")") - DispatchQueue.main.async { - self.certTestViewModel.status = "Test \(self.testCaseName) failed. Code : \(result.code). Message : \(result.message ?? "")" - } - } - - func requestSentHandlerError(result: MatterError) - { - self.Log.info("CertTestViewModel.requestSentHandler.\(self.testCaseName). Code : \(result.code). Message : result.message") + logger.info("CertTestViewModel.failureCallback.\(self.testCaseName) failed. Code : \(result.code). Message : \(result.message ?? "")") + certTestViewModel.onTestFailed(testCaseName) } +} +private struct TestContext { + let castingServerBridge: CastingServerBridge + let deviceEndpoint: ContentApp + let contentAppEndpoint: ContentApp + let parallalizationEnabled: Bool } class CertTestViewModel: ObservableObject { - let Log = Logger(subsystem: "com.matter.casting", - category: "CertTestViewModel") + private let logger = Logger(subsystem: "com.matter.casting", category: "CertTestViewModel") + + private let tests: [(String, (TestContext, CallbackHelper) -> ())] = [ + ("keypadInput_sendKey", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.keypadInput_sendKey( + context.deviceEndpoint, + keyCode: 10, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("applicationLauncher_launch", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.applicationLauncher_launch( + context.deviceEndpoint, + catalogVendorId: 123, + applicationId: "exampleid", + data: nil, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("applicationLauncher_stop", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.applicationLauncher_stop( + context.deviceEndpoint, + catalogVendorId: 123, applicationId: "exampleid", + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("applicationLauncher_hide", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.applicationLauncher_hide( + context.deviceEndpoint, + catalogVendorId: 123, applicationId: "exampleid", + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("targetNavigator_navigateTarget", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.targetNavigator_navigateTarget( + context.deviceEndpoint, + target: 1, data: "", + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("contentLauncher_launchUrl", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.contentLauncher_launchUrl( + context.contentAppEndpoint, + contentUrl: "https://dummyurl", + contentDisplayStr: "Dummy Content", + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("contentLauncher_launchContent", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.contentLauncher_launchContent( + context.contentAppEndpoint, + contentSearch: ContentLauncher_ContentSearch( + parameterList: [ + ContentLauncher_Parameter( + type: ContentLauncher_ParameterEnum.Video, + value: "Dummy Video", + externalIDList: [ + ContentLauncher_AdditionalInfo( + name: "imdb", + value: "dummyId" + ), + ] + ), + ] + ), + autoPlay: true, data: "", + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("mediaPlayback_play", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.mediaPlayback_play( + context.contentAppEndpoint, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("mediaPlayback_next", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.mediaPlayback_next( + context.contentAppEndpoint, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("mediaPlayback_skipForward", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.mediaPlayback_skipForward( + context.contentAppEndpoint, + deltaPositionMilliseconds: 10000, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("mediaPlayback_skipBackward", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.mediaPlayback_skipBackward( + context.contentAppEndpoint, + deltaPositionMilliseconds: 10000, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("mediaPlayback_pause", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.mediaPlayback_pause( + context.contentAppEndpoint, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("mediaPlayback_stopPlayback", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.mediaPlayback_stopPlayback( + context.contentAppEndpoint, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("mediaPlayback_seek", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.mediaPlayback_seek( + context.contentAppEndpoint, + position: 10000, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("mediaPlayback_previous", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.mediaPlayback_previous( + context.contentAppEndpoint, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("mediaPlayback_rewind", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.mediaPlayback_rewind( + context.contentAppEndpoint, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("mediaPlayback_fastForward", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.mediaPlayback_fastForward( + context.contentAppEndpoint, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("mediaPlayback_startOver", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.mediaPlayback_startOver( + context.contentAppEndpoint, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("onOff_on", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.onOff_( + on: context.deviceEndpoint, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("onOff_off", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.onOff_off( + context.deviceEndpoint, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("onOff_toggle", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.onOff_toggle( + context.deviceEndpoint, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + }), + ("applicationBasic_readApplicationVersion", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.applicationBasic_readApplicationVersion( + context.contentAppEndpoint, + clientQueue: DispatchQueue.main, + requestSentHandler: callbackHelper.requestSentHandlerError, + successCallback: callbackHelper.successCallbackString, + failureCallback: callbackHelper.failureCallback + ) + }), + ("applicationBasic_readVendorName", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.applicationBasic_readVendorName( + context.contentAppEndpoint, + clientQueue: DispatchQueue.main, + requestSentHandler: callbackHelper.requestSentHandlerError, + successCallback: callbackHelper.successCallbackString, + failureCallback: callbackHelper.failureCallback + ) + }), + ("applicationBasic_readApplicationName", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.applicationBasic_readApplicationName( + context.contentAppEndpoint, + clientQueue: DispatchQueue.main, + requestSentHandler: callbackHelper.requestSentHandlerError, + successCallback: callbackHelper.successCallbackString, + failureCallback: callbackHelper.failureCallback + ) + }), + ("applicationBasic_readVendorID", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.applicationBasic_readVendorID( + context.contentAppEndpoint, + clientQueue: DispatchQueue.main, + requestSentHandler: callbackHelper.requestSentHandlerError, + successCallback: callbackHelper.successCallbackNumber, + failureCallback: callbackHelper.failureCallback + ) + }), + ("applicationBasic_readProductID", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.applicationBasic_readProductID( + context.contentAppEndpoint, + clientQueue: DispatchQueue.main, + requestSentHandler: callbackHelper.requestSentHandlerError, + successCallback: callbackHelper.successCallbackInteger, + failureCallback: callbackHelper.failureCallback + ) + }), + ("mediaPlayback_subscribeCurrentState", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.mediaPlayback_subscribeCurrentState( + context.contentAppEndpoint, + minInterval: 0, maxInterval: 2, + clientQueue: DispatchQueue.main, + requestSentHandler: callbackHelper.requestSentHandlerError, + successCallback: {(state : MediaPlayback_PlaybackState) -> () in}, + failureCallback: callbackHelper.failureCallback, + subscriptionEstablishedCallback: {() -> () in} + ) + }), + ("shutdownAllSubscriptions", { (context: TestContext, callbackHelper: CallbackHelper) -> () in + context.castingServerBridge.shutdownAllSubscriptions(DispatchQueue.main, + requestSentHandler: {() -> () in} + ) + }), + ] + + @Published var status: String? + + @Published var contentAppIds: [String] = [] + + private var targetVideoPlayer: VideoPlayer? + private var deviceEndpoint: ContentApp? + private var deviceSpeakerEndpoint: ContentApp? + private var testContext: TestContext? + private var testsCompleted: Int = 0 + + /** + Appends the result data to the View Model's text content. + + @param result The data to append. + */ + private func appendTestResult(_ result: String) { + status = status?.appending("\n\(result)") ?? result + } - @Published var status: String?; + /** + A helper function that logs a warning message and appends the warning to the View Model's text content. - @Published var contentAppIds: [String] = []; + @param message The message to log. + */ + private func warn(_ message: String) { + logger.warning("\(message)") + appendTestResult(message) + } - var targetVideoPlayer: VideoPlayer?; - var deviceEndpoint: ContentApp?; - var deviceSpeakerEndpoint: ContentApp?; - var testCaseName: String = ""; + /** + Executes a test and subscribes to receive callbacks when the test is complete. - func runCertTest(testCaseName: String, test: (CallbackHelper) -> ()) + @param description A description of the test to be used for logging and display to the user. + @param context A data structure representing the context in which the test is to be executed. + @param test The test to execute. + */ + private func runTest(_ description: String, context: TestContext, _ test: (TestContext, CallbackHelper) -> ()) { - self.testCaseName = testCaseName; - test(CallbackHelper(testCaseName: testCaseName, certTestViewModel: self)); + test(context, CallbackHelper(testCaseName: description, certTestViewModel: self)); } - func launchTest(targetContentAppId: String?) - { - if (targetContentAppId != nil && !targetContentAppId!.isEmpty) - { - var targetContentApp: ContentApp? - for contentApp in (targetVideoPlayer!.contentApps as! [ContentApp]) { - if(UInt16(targetContentAppId!) == contentApp.endpointId) - { - targetContentApp = contentApp - break - } + private func runNextText(context: TestContext) { + // The number of tests completed is the index of the next test to run. + let testsCompletedSnapshot = self.testsCompleted + guard testsCompletedSnapshot < self.tests.count else { + // There are no more tests to run, bail now. + return + } + + // Run the test + let (description, test) = tests[testsCompletedSnapshot] + runTest(description, context: context, test) + } + + /** + The function to be invoked when a test is completed. + + Note that this function is intentionally not thread safe (e.g. scheduled on a particular Dispatch Queue) to exercise the thread safety of the + APIs being invoked by the test cases themselves. In a real application, you would want to run this on a known Dispatch Queue for safety. + */ + private func onTestCompleted() { + // Increment the "tests completed" counter + testsCompleted += 1 + + // Run the next test, if we're running tests sequentially. + if let testContext = self.testContext { + let runningTestsSequentially = !testContext.parallalizationEnabled + if runningTestsSequentially { + runNextText(context: testContext) } + } + } - if let castingServerBridge = CastingServerBridge.getSharedInstance() - { - runCertTest(testCaseName: "keypadInput_sendKey", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.keypadInput_sendKey(deviceEndpoint!, keyCode: 10, - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "applicationLauncher_launch", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.applicationLauncher_launch(deviceEndpoint!, catalogVendorId: 123, applicationId: "exampleid", data: nil, - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "applicationLauncher_stop", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.applicationLauncher_stop(deviceEndpoint!, - catalogVendorId: 123, applicationId: "exampleid", - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "applicationLauncher_hide", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.applicationLauncher_hide(deviceEndpoint!, - catalogVendorId: 123, applicationId: "exampleid", - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "targetNavigator_navigateTarget", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.targetNavigator_navigateTarget(deviceEndpoint!, - target: 1, data: "", - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "contentLauncher_launchUrl", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.contentLauncher_launchUrl(targetContentApp!, - contentUrl: "https://dummyurl", - contentDisplayStr: "Dummy Content", - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "contentLauncher_launchContent", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.contentLauncher_launchContent(targetContentApp!, - contentSearch: ContentLauncher_ContentSearch(parameterList: [ContentLauncher_Parameter(type: ContentLauncher_ParameterEnum.Video, value: "Dummy Video", externalIDList: [ContentLauncher_AdditionalInfo(name: "imdb", value: "dummyId"),]),]), - autoPlay: true, data: "", - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "mediaPlayback_play", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.mediaPlayback_play(targetContentApp!, - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "mediaPlayback_next", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.mediaPlayback_next(targetContentApp!, - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "mediaPlayback_skipForward", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.mediaPlayback_skipForward(targetContentApp!, - deltaPositionMilliseconds: 10000, - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "mediaPlayback_skipBackward", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.mediaPlayback_skipBackward(targetContentApp!, - deltaPositionMilliseconds: 10000, - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "mediaPlayback_pause", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.mediaPlayback_pause(targetContentApp!, - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "mediaPlayback_stopPlayback", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.mediaPlayback_stopPlayback(targetContentApp!, - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "mediaPlayback_seek", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.mediaPlayback_seek(targetContentApp!, - position: 10000, - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "mediaPlayback_previous", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.mediaPlayback_previous(targetContentApp!, - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "mediaPlayback_rewind", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.mediaPlayback_rewind(targetContentApp!, - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "mediaPlayback_fastForward", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.mediaPlayback_fastForward(targetContentApp!, - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "mediaPlayback_startOver", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.mediaPlayback_startOver(targetContentApp!, - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "onOff_on", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.onOff_(on: deviceEndpoint!, - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "onOff_off", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.onOff_off(deviceEndpoint!, - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "onOff_toggle", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.onOff_toggle(deviceEndpoint!, - responseCallback:callbackHelper.responseCallback, - clientQueue: DispatchQueue.main, - requestSentHandler:callbackHelper.requestSentHandler - ) - } - ) - - runCertTest(testCaseName: "applicationBasic_readApplicationVersion", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.applicationBasic_readApplicationVersion(targetContentApp!, - clientQueue: DispatchQueue.main, - requestSentHandler: callbackHelper.requestSentHandlerError, - successCallback: callbackHelper.successCallbackString, - failureCallback: callbackHelper.failureCallback - ) - } - ) - - runCertTest(testCaseName: "applicationBasic_readVendorName", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.applicationBasic_readVendorName(targetContentApp!, - clientQueue: DispatchQueue.main, - requestSentHandler: callbackHelper.requestSentHandlerError, - successCallback: callbackHelper.successCallbackString, - failureCallback: callbackHelper.failureCallback - ) - } - ) - - runCertTest(testCaseName: "applicationBasic_readApplicationName", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.applicationBasic_readApplicationName(targetContentApp!, - clientQueue: DispatchQueue.main, - requestSentHandler: callbackHelper.requestSentHandlerError, - successCallback: callbackHelper.successCallbackString, - failureCallback: callbackHelper.failureCallback - ) - } - ) - - runCertTest(testCaseName: "applicationBasic_readVendorID", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.applicationBasic_readVendorID(targetContentApp!, - clientQueue: DispatchQueue.main, - requestSentHandler: callbackHelper.requestSentHandlerError, - successCallback: callbackHelper.successCallbackNumber, - failureCallback: callbackHelper.failureCallback - ) - } - ) - - runCertTest(testCaseName: "applicationBasic_readProductID", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.applicationBasic_readProductID(targetContentApp!, - clientQueue: DispatchQueue.main, - requestSentHandler: callbackHelper.requestSentHandlerError, - successCallback: callbackHelper.successCallbackInteger, - failureCallback: callbackHelper.failureCallback - ) - } - ) - - runCertTest(testCaseName: "mediaPlayback_subscribeCurrentState", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.mediaPlayback_subscribeCurrentState(targetContentApp!, - minInterval: 0, maxInterval: 2, clientQueue: DispatchQueue.main, - requestSentHandler: callbackHelper.requestSentHandlerError, - successCallback: {(state : MediaPlayback_PlaybackState) -> () in}, - failureCallback: callbackHelper.failureCallback, - subscriptionEstablishedCallback: {() -> () in} - ) - } - ) - - runCertTest(testCaseName: "shutdownAllSubscriptions", - test: { (callbackHelper: CallbackHelper) -> () in - castingServerBridge.shutdownAllSubscriptions(DispatchQueue.main, - requestSentHandler: {() -> () in} - ) - } - ) - + /** + The function to be invoked when a test is completed successfully. + + @param description The name of the test that passed. + */ + fileprivate func onTestPassed(_ description: String) { + onTestCompleted() + DispatchQueue.main.async { [weak self] in + guard let strongSelf = self else { + return } + strongSelf.appendTestResult("🟢 \(description) PASSED") } - else - { - Log.debug("CertTestViewModel.launchTest input(s) missing!") - self.status = "Missing input parameter(s)!" + } + + /** + The function to be invoked when a test is completed unsuccessfully. + + @param description The name of the test that failed. + */ + fileprivate func onTestFailed(_ description: String) { + onTestCompleted() + DispatchQueue.main.async { [weak self] in + guard let strongSelf = self else { + return + } + strongSelf.appendTestResult("🔴 \(description) FAILED") + } + } + + /** + Begins executing all certification tests. + + @param targetContentAppId: The Endpoint ID of the target Content App against which the tests will be run. + @param parallelizeTests: A flag that determines whether to run the tests in parallel (`true`) or sequentially (`false`). + */ + func launchTests(targetContentAppId: String?, inParallel parallelizeTests: Bool) + { + // Reset the status text at the beginning of the test run + status = "" + testContext = nil + testsCompleted = 0 + + guard let nonNilTargetContentAppId = targetContentAppId, !nonNilTargetContentAppId.isEmpty else { + warn("Missing input parameter(s)!") + return + } + + guard let targetVideoPlayer = self.targetVideoPlayer else { + warn("Target Video Player is not configured") + return + } + + guard let targetContentApp = (targetVideoPlayer.contentApps as! [ContentApp]).first( + where: { contentApp in return UInt16(targetContentAppId!) == contentApp.endpointId } + ) + else { + warn("Content App \(nonNilTargetContentAppId) is not supported") + return + } + + guard let castingServerBridge = CastingServerBridge.getSharedInstance() else { + warn("Casting Server is unavailable") + return + } + + // Set up the context for running the tests and store a snapshot in this View Model. + let testContext = TestContext( + castingServerBridge: castingServerBridge, + deviceEndpoint: deviceEndpoint!, + contentAppEndpoint: targetContentApp, + parallalizationEnabled: parallelizeTests + ) + self.testContext = testContext + + // If parallelization is enabled, we simply schedule all of the tests at the same time and let + // the Dispatch Queue figure it out; otherwise, we start the first test and schedule each + // subsequent test when the completion callback of the prior test is invoked. This also is a + // low-touch way of validating that callbacks can synchronously invoke CastingServerBridge APIs + // from the Dispatch Queue on which the callback is invoked. + if (parallelizeTests) { + for (description, test) in tests { + runTest(description, context: testContext, test) + } + } else { + runNextText(context: testContext) } } func populateAndInitializeEndpoints() { - if let castingServerBridge = CastingServerBridge.getSharedInstance() - { - castingServerBridge.getActiveTargetVideoPlayers(DispatchQueue.main, - activeTargetVideoPlayersHandler: { (targetVideoPlayers: NSMutableArray?) -> () in + guard let castingServerBridge = CastingServerBridge.getSharedInstance() else { + return + } + + castingServerBridge.getActiveTargetVideoPlayers( + DispatchQueue.main, + activeTargetVideoPlayersHandler: { (targetVideoPlayers: NSMutableArray?) -> () in let targetVideoPlayer: VideoPlayer = targetVideoPlayers![0] as! VideoPlayer if(targetVideoPlayer.isInitialized && targetVideoPlayer.isConnected) { self.targetVideoPlayer = targetVideoPlayer - for contentApp in (targetVideoPlayer.contentApps as! [ContentApp]) - { - if(contentApp.endpointId == 1) - { + for contentApp in (targetVideoPlayer.contentApps as! [ContentApp]) { + if(contentApp.endpointId == 1) { self.deviceEndpoint = contentApp - } else if(contentApp.endpointId == 2) - { + } else if(contentApp.endpointId == 2) { self.deviceSpeakerEndpoint = contentApp } else { @@ -443,7 +532,7 @@ class CertTestViewModel: ObservableObject { } } } - }) - } + } + ) } } diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting/CommissioningView.swift b/examples/tv-casting-app/darwin/TvCasting/TvCasting/CommissioningView.swift index f5cb7ddcfaeb74..923d986ce6d6d5 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting/CommissioningView.swift +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting/CommissioningView.swift @@ -1,6 +1,6 @@ /** * - * Copyright (c) 2020-2022 Project CHIP Authors + * Copyright (c) 2020-2023 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,10 +32,10 @@ struct CommissioningView: View { if(viewModel.commisisoningWindowOpened == true) { Text("Commissioning window opened.").padding() - Text("Onboarding PIN: " + String((CastingServerBridge.getSharedInstance()?.getOnboardingPaylod().setupPasscode)!)) + Text("Onboarding PIN: " + String((CastingServerBridge.getSharedInstance()?.getOnboardingPayload().setupPasscode)!)) .border(Color.blue, width: 1) .padding() - Text("Discriminator: " + String((CastingServerBridge.getSharedInstance()?.getOnboardingPaylod().setupDiscriminator)!)) + Text("Discriminator: " + String((CastingServerBridge.getSharedInstance()?.getOnboardingPayload().setupDiscriminator)!)) .border(Color.blue, width: 1) .padding() diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting/MediaPlaybackViewModel.swift b/examples/tv-casting-app/darwin/TvCasting/TvCasting/MediaPlaybackViewModel.swift index 5a93a2ffe7c3cf..d6352b29b1b920 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting/MediaPlaybackViewModel.swift +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting/MediaPlaybackViewModel.swift @@ -1,6 +1,6 @@ /** * - * Copyright (c) 2020-2022 Project CHIP Authors + * Copyright (c) 2020-2023 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ class MediaPlaybackViewModel: ObservableObject { break } } - + castingServerBridge.mediaPlayback_subscribeCurrentState(targetContentApp!, minInterval: UInt16(minInterval) ?? 0, maxInterval: UInt16(maxInterval) ?? 1, clientQueue: DispatchQueue.main, requestSentHandler: { (result: MatterError) -> () in self.Log.info("MediaPlaybackViewModel.subscribeToCurrentState.requestSentHandler result \(result)") diff --git a/scripts/tools/generate_esp32_chip_factory_bin.py b/scripts/tools/generate_esp32_chip_factory_bin.py index f5744720c6fc6c..303f5cda968fda 100755 --- a/scripts/tools/generate_esp32_chip_factory_bin.py +++ b/scripts/tools/generate_esp32_chip_factory_bin.py @@ -488,7 +488,7 @@ def generate_nvs_bin(encrypt, size, csv_filename, bin_filename): if encrypt: nvs_args.keygen = True nvs_args.keyfile = NVS_KEY_PARTITION_BIN - nvs_args.inputkey = None, + nvs_args.inputkey = None nvs_partition_gen.encrypt(nvs_args) else: nvs_partition_gen.generate(nvs_args) diff --git a/src/access/AccessControl.cpp b/src/access/AccessControl.cpp index 20b58ee0be39f3..5de61422afe68d 100644 --- a/src/access/AccessControl.cpp +++ b/src/access/AccessControl.cpp @@ -555,11 +555,12 @@ bool AccessControl::IsValid(const Entry & entry) size_t subjectCount = 0; size_t targetCount = 0; - SuccessOrExit(entry.GetAuthMode(authMode)); - SuccessOrExit(entry.GetFabricIndex(fabricIndex)); - SuccessOrExit(entry.GetPrivilege(privilege)); - SuccessOrExit(entry.GetSubjectCount(subjectCount)); - SuccessOrExit(entry.GetTargetCount(targetCount)); + CHIP_ERROR err = CHIP_NO_ERROR; + SuccessOrExit(err = entry.GetAuthMode(authMode)); + SuccessOrExit(err = entry.GetFabricIndex(fabricIndex)); + SuccessOrExit(err = entry.GetPrivilege(privilege)); + SuccessOrExit(err = entry.GetSubjectCount(subjectCount)); + SuccessOrExit(err = entry.GetTargetCount(targetCount)); #if CHIP_CONFIG_ACCESS_CONTROL_POLICY_LOGGING_VERBOSITY > 1 ChipLogProgress(DataManagement, "AccessControl: validating f=%u p=%c a=%c s=%d t=%d", fabricIndex, @@ -582,7 +583,7 @@ bool AccessControl::IsValid(const Entry & entry) for (size_t i = 0; i < subjectCount; ++i) { NodeId subject; - SuccessOrExit(entry.GetSubject(i, subject)); + SuccessOrExit(err = entry.GetSubject(i, subject)); const bool kIsCase = authMode == AuthMode::kCase; const bool kIsGroup = authMode == AuthMode::kGroup; #if CHIP_CONFIG_ACCESS_CONTROL_POLICY_LOGGING_VERBOSITY > 1 @@ -594,7 +595,7 @@ bool AccessControl::IsValid(const Entry & entry) for (size_t i = 0; i < targetCount; ++i) { Entry::Target target; - SuccessOrExit(entry.GetTarget(i, target)); + SuccessOrExit(err = entry.GetTarget(i, target)); const bool kHasCluster = target.flags & Entry::Target::kCluster; const bool kHasEndpoint = target.flags & Entry::Target::kEndpoint; const bool kHasDeviceType = target.flags & Entry::Target::kDeviceType; @@ -608,7 +609,14 @@ bool AccessControl::IsValid(const Entry & entry) return true; exit: - ChipLogError(DataManagement, "AccessControl: %s", log); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DataManagement, "AccessControl: %s %" CHIP_ERROR_FORMAT, log, err.Format()); + } + else + { + ChipLogError(DataManagement, "AccessControl: %s", log); + } return false; } diff --git a/src/app/CommandHandler.cpp b/src/app/CommandHandler.cpp index 6444a2faba9951..3fd99e9bb9ad31 100644 --- a/src/app/CommandHandler.cpp +++ b/src/app/CommandHandler.cpp @@ -326,7 +326,7 @@ Status CommandHandler::ProcessCommandDataIB(CommandDataIB::Parser & aCommandElem { ChipLogDetail(DataManagement, "Received command for Endpoint=%u Cluster=" ChipLogFormatMEI " Command=" ChipLogFormatMEI, concretePath.mEndpointId, ChipLogValueMEI(concretePath.mClusterId), ChipLogValueMEI(concretePath.mCommandId)); - SuccessOrExit(MatterPreCommandReceivedCallback(concretePath, GetSubjectDescriptor())); + SuccessOrExit(err = MatterPreCommandReceivedCallback(concretePath, GetSubjectDescriptor())); mpCallback->DispatchCommand(*this, concretePath, commandDataReader); MatterPostCommandReceivedCallback(concretePath, GetSubjectDescriptor()); } diff --git a/src/app/WriteClient.cpp b/src/app/WriteClient.cpp index 6f47d4019903f4..3391fd63579bb7 100644 --- a/src/app/WriteClient.cpp +++ b/src/app/WriteClient.cpp @@ -460,7 +460,7 @@ CHIP_ERROR WriteClient::OnMessageReceived(Messaging::ExchangeContext * apExchang if (!mChunks.IsNull()) { // Send the next chunk. - SuccessOrExit(SendWriteRequest()); + SuccessOrExit(err = SendWriteRequest()); } } else if (aPayloadHeader.HasMessageType(MsgType::StatusResponse)) diff --git a/src/app/reporting/Engine.cpp b/src/app/reporting/Engine.cpp index 89c09e697ed862..757f32126a0fa2 100644 --- a/src/app/reporting/Engine.cpp +++ b/src/app/reporting/Engine.cpp @@ -529,7 +529,7 @@ CHIP_ERROR Engine::BuildAndSendSingleReportData(ReadHandler * apReadHandler) } } - SuccessOrExit(reportDataBuilder.GetError()); + SuccessOrExit(err = reportDataBuilder.GetError()); SuccessOrExit(err = reportDataWriter.UnreserveBuffer(kReservedSizeForMoreChunksFlag + kReservedSizeForIMRevision + kReservedSizeForEndOfReportMessage)); if (hasMoreChunks) diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index c0d3e108babe65..ce355c08838a81 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -147,7 +147,7 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams) // Set up attribute persistence before we try to bring up the data model // handler. - SuccessOrExit(mAttributePersister.Init(mDeviceStorage)); + SuccessOrExit(err = mAttributePersister.Init(mDeviceStorage)); SetAttributePersistenceProvider(&mAttributePersister); { diff --git a/src/app/tests/integration/chip_im_initiator.cpp b/src/app/tests/integration/chip_im_initiator.cpp index 3f822623e49b91..bbc65055c9ebb7 100644 --- a/src/app/tests/integration/chip_im_initiator.cpp +++ b/src/app/tests/integration/chip_im_initiator.cpp @@ -347,7 +347,7 @@ CHIP_ERROR SendReadRequest() chip::Platform::MakeUnique(chip::app::InteractionModelEngine::GetInstance(), &gExchangeManager, gMockDelegate, chip::app::ReadClient::InteractionType::Read); - SuccessOrExit(readClient->SendRequest(readPrepareParams)); + SuccessOrExit(err = readClient->SendRequest(readPrepareParams)); gMockDelegate.AdoptReadClient(std::move(readClient)); diff --git a/src/app/tests/suites/certification/Test_TC_ACE_1_5.yaml b/src/app/tests/suites/certification/Test_TC_ACE_1_5.yaml index ff6b06f573fcd3..bd1b171364e62f 100644 --- a/src/app/tests/suites/certification/Test_TC_ACE_1_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACE_1_5.yaml @@ -53,24 +53,25 @@ tests: saveAs: th1FabricIndex - label: - "Step 3 & 4: TH1 puts DUT into commissioning mode, TH2 commissions DUT + "Step 2 & 3: TH1 puts DUT into commissioning mode, TH2 commissions DUT using admin node ID N2" verification: | - Open a commissioning window On TH1(Chiptool)using below command + ./chip-tool pairing open-commissioning-window 1 1 400 2000 3841 - ./chip-tool pairing open-commissioning-window 1 1 400 2000 3841 + On TH1(chip-tool) note the manual pairing code for commissioning the TH2 - [1657186324.710951][10820:10825] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0000 Status=0x0 - [1657186324.710980][10820:10825] CHIP:CTL: Successfully opened pairing window On TH(Chiptool)e device - [1657186324.711048][10820:10825] CHIP:CTL: Manual pairing code: [36253605617] - [1657186324.711108][10820:10825] CHIP:CTL: SetupQRCode: [MT:-24J0IRV01A7TB7E700] + [1684416077.831754][118314:118316] CHIP:CTL: Successfully opened pairing window on the device + [1684416077.831763][118314:118316] CHIP:CTL: Manual pairing code: [36283142515] + [1684416077.831771][118314:118316] CHIP:CTL: SetupQRCode: [MT:-24J0IRV010UJE7ZH10] + [1684416077.831791][118314:118316] CHIP:DMG: ICR moving to [AwaitingDe] + ./chip-tool pairing code 2 36283142515 --commissioner-name beta - Commission TH2(Chiptool) to DUT using manualcode generated in TH1 using open commission window + On TH2 (chip-tool) verify the commissioning completed with success - ./chip-tool pairing code 2 36253605617 --commissioner-name beta --commissioner-nodeid 223344 - [1657186359.584672][3509:3514] CHIP:CTL: Successfully finished commissioning step 'Cleanup' - [1657186359.584743][3509:3514] CHIP:TOO: Device commissioning completed with success + [1684416247.482777][118352:118354] CHIP:CTL: Successfully finished commissioning step 'Cleanup' + [1684416247.482789][118352:118354] CHIP:TOO: Device commissioning completed with success + [1684416247.482823][118352:118354] CHIP:DMG: ICR moving to [AwaitingDe] cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP @@ -132,12 +133,33 @@ tests: - label: "TH2 reads the fabric index" identity: "beta" + PICS: PICS_SDK_CI_ONLY cluster: "Operational Credentials" command: "readAttribute" attribute: "CurrentFabricIndex" response: saveAs: th2FabricIndex + #Issue https://github.com/CHIP-Specifications/chip-certification-tool/issues/768 + - label: "TH2 reads the fabric index" + verification: | + ./chip-tool operationalcredentials read current-fabric-index 2 0 --commissioner-name beta + + On TH2 (chip-tool) note the CurrentFabricIndex for the further use + + [1684416368.885484][118383:118385] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0005 DataVersion: 3654336520 + [1684416368.885511][118383:118385] CHIP:TOO: CurrentFabricIndex: 2 + [1684416368.885577][118383:118385] CHIP:EM: <<< [E:65212i S:18077 M:83303022 (Ack:184536262)] (S) Msg TX to 2:0000000000000002 [C33E] --- Type 0000:10 (SecureChannel:StandaloneAck) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + - label: "Read the commissioner node ID from the alpha fabric" identity: "alpha" cluster: "CommissionerCommands" @@ -171,6 +193,7 @@ tests: ] - label: "Read the commissioner node ID from the beta fabric" + PICS: PICS_SDK_CI_ONLY identity: "beta" cluster: "CommissionerCommands" command: "GetCommissionerNodeId" @@ -181,6 +204,7 @@ tests: - label: "TH2 writes ACL giving view privilge for basic cluster" identity: beta + PICS: PICS_SDK_CI_ONLY command: "writeAttribute" attribute: "ACL" arguments: @@ -203,6 +227,28 @@ tests: }, ] + #Issue https://github.com/CHIP-Specifications/chip-certification-tool/issues/768 + - label: "TH2 writes ACL giving view privilge for basic cluster" + verification: | + ./chip-tool accesscontrol write acl '[{"fabricIndex": 2, "privilege": 5, "authMode": 2, "subjects": [223344], "targets": [{ "cluster": 31, "endpoint": 0, "deviceType": null }]}, {"fabricIndex": 2, "privilege": 1, "authMode": 2, "subjects": null, "targets": [{ "cluster": 40, "endpoint": 0, "deviceType": null }]}]' 2 0 --commissioner-name beta + + On TH2 (chip-tool) verify the success response for the write function + + [1684416510.660175][118418:118420] CHIP:DMG: StatusIB = + [1684416510.660184][118418:118420] CHIP:DMG: { + [1684416510.660192][118418:118420] CHIP:DMG: status = 0x00 (SUCCESS), + [1684416510.660201][118418:118420] CHIP:DMG: }, + [1684416510.660211][118418:118420] CHIP:DMG: + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + - label: "TH1 reads descriptor cluster - expect SUCCESS" command: "readAttribute" cluster: "Descriptor" @@ -217,18 +263,61 @@ tests: - label: "TH2 reads descriptor cluster - expect UNSUPPORTED_ACCESS" identity: "beta" + PICS: PICS_SDK_CI_ONLY command: "readAttribute" cluster: "Descriptor" attribute: "DeviceTypeList" response: error: UNSUPPORTED_ACCESS + #Issue https://github.com/CHIP-Specifications/chip-certification-tool/issues/768 + - label: "TH2 reads descriptor cluster - expect UNSUPPORTED_ACCESS" + verification: | + ./chip-tool descriptor read device-type-list 2 0 --commissioner-name beta + + On TH2(chip-tool) verify the UNSUPPORTED_ACCESS (0x7e) response + + [1684416700.274460][118482:118484] CHIP:DMG: StatusIB = + [1684416700.274467][118482:118484] CHIP:DMG: { + [1684416700.274475][118482:118484] CHIP:DMG: status = 0x7e (UNSUPPORTED_ACCESS), + [1684416700.274482][118482:118484] CHIP:DMG: }, + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + - label: "TH2 reads basic cluster - expect SUCCESS" identity: "beta" + PICS: PICS_SDK_CI_ONLY command: "readAttribute" cluster: "Basic Information" attribute: "VendorID" + #Issue https://github.com/CHIP-Specifications/chip-certification-tool/issues/768 + - label: "TH2 writes Extension attribute value as empty list" + verification: | + ./chip-tool basicinformation read vendor-id 2 0 --commissioner-name beta + + On TH2(chip-tool) verify the success with the Vendor-id + + [1684416789.682243][118505:118507] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0002 DataVersion: 2033462723 + [1684416789.682271][118505:118507] CHIP:TOO: VendorID: 65521 + [1684416789.682327][118505:118507] CHIP:EM: <<< [E:11340i S:29188 M:208193949 (Ack:232576417)] (S) Msg TX to 2:0000000000000002 [C33E] --- Type 0000:10 (SecureChannel:StandaloneAck) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + - label: "TH1 resets ACL to default" command: "writeAttribute" attribute: "ACL" @@ -245,8 +334,33 @@ tests: - label: "TH1 sends RemoveFabric command for TH2" cluster: "Operational Credentials" + PICS: PICS_SDK_CI_ONLY command: "RemoveFabric" arguments: values: - name: "FabricIndex" value: th2FabricIndex + + #Issue https://github.com/CHIP-Specifications/chip-certification-tool/issues/768 + - label: "TH1 sends RemoveFabric command for TH2" + verification: | + ./chip-tool operationalcredentials remove-fabric 2 1 0 + + On TH1(chip-tool) verify the success with the nocresponse with statuscode is success(0) + + [1684416866.004187][118527:118529] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_003E Command=0x0000_0008 + [1684416866.004214][118527:118529] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Command 0x0000_0008 + [1684416866.004236][118527:118529] CHIP:TOO: NOCResponse: { + [1684416866.004250][118527:118529] CHIP:TOO: statusCode: 0 + [1684416866.004255][118527:118529] CHIP:TOO: fabricIndex: 2 + [1684416866.004259][118527:118529] CHIP:TOO: } + [1684416866.004270][118527:118529] CHIP:DMG: ICR moving to [AwaitingDe] + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_ACE_1_6.yaml b/src/app/tests/suites/certification/Test_TC_ACE_1_6.yaml new file mode 100644 index 00000000000000..d241d40ab6f720 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_ACE_1_6.yaml @@ -0,0 +1,672 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 42.1.6. [TC-ACE-1.6] Group auth mode + +PICS: + - MCORE.ROLE.COMMISSIONEE + - G.S + +config: + nodeId: 0x12344321 + cluster: "Basic Information" + endpoint: 0 + +tests: + - label: "PreCondition" + verification: | + N1 is the node ID of TH1 + + PIXIT.G.ENDPOINT is an endpoint with a groups cluster + disabled: true + + - label: + "TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT + using a key that is pre-installed on the TH. GroupKeySet fields are as + follows: GroupKeySetID: 0x01a3 GroupKeySecurityPolicy: TrustFirst (0) + EpochKey0: d0d1d2d3d4d5d6d7d8d9dadbdcdddedf EpochStartTime0: 2220000 + EpochKey1: d1d1d2d3d4d5d6d7d8d9dadbdcdddedf EpochStartTime1: 2220001 + EpochKey2: d2d1d2d3d4d5d6d7d8d9dadbdcdddedf EpochStartTime2: 2220002" + verification: | + ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": 419,"groupKeySecurityPolicy": 0, "epochKey0":"d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 2220000,"epochKey1":"d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 2220001,"epochKey2":"d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 2220002 }' 1 0 + Verify DUT sends SUCCESS(0x00) response on TH(chip-tool) Logs: + + [1685009144.716477][39659:39661] CHIP:DMG: ICR moving to [ResponseRe] + [1685009144.716485][39659:39661] CHIP:DMG: InvokeResponseMessage = + [1685009144.716487][39659:39661] CHIP:DMG: { + [1685009144.716489][39659:39661] CHIP:DMG: suppressResponse = false, + [1685009144.716491][39659:39661] CHIP:DMG: InvokeResponseIBs = + [1685009144.716495][39659:39661] CHIP:DMG: [ + [1685009144.716497][39659:39661] CHIP:DMG: InvokeResponseIB = + [1685009144.716500][39659:39661] CHIP:DMG: { + [1685009144.716502][39659:39661] CHIP:DMG: CommandStatusIB = + [1685009144.716505][39659:39661] CHIP:DMG: { + [1685009144.716507][39659:39661] CHIP:DMG: CommandPathIB = + [1685009144.716510][39659:39661] CHIP:DMG: { + [1685009144.716512][39659:39661] CHIP:DMG: EndpointId = 0x0, + [1685009144.716515][39659:39661] CHIP:DMG: ClusterId = 0x3f, + [1685009144.716517][39659:39661] CHIP:DMG: CommandId = 0x0, + [1685009144.716519][39659:39661] CHIP:DMG: }, + [1685009144.716523][39659:39661] CHIP:DMG: + [1685009144.716525][39659:39661] CHIP:DMG: StatusIB = + [1685009144.716527][39659:39661] CHIP:DMG: { + [1685009144.716530][39659:39661] CHIP:DMG: status = 0x00 (SUCCESS), + [1685009144.716532][39659:39661] CHIP:DMG: }, + [1685009144.716534][39659:39661] CHIP:DMG: + [1685009144.716537][39659:39661] CHIP:DMG: }, + [1685009144.716539][39659:39661] CHIP:DMG: + [1685009144.716541][39659:39661] CHIP:DMG: }, + [1685009144.716545][39659:39661] CHIP:DMG: + [1685009144.716546][39659:39661] CHIP:DMG: ], + [1685009144.716550][39659:39661] CHIP:DMG: + [1685009144.716552][39659:39661] CHIP:DMG: InteractionModelRevision = 1 + [1685009144.716554][39659:39661] CHIP:DMG: }, + [1685009144.716563][39659:39661] CHIP:DMG: R + disabled: true + + - label: + "TH binds GroupIds 0x0103, 0x0104, 0x0105 with GroupKeySetID 0x01a3 in + the GroupKeyMap attribute list on GroupKeyManagement cluster by + writing the GroupKeyMap attribute with three entries as follows: List + item 1: GroupId: 0x0103 GroupKeySetId: 0x01a3 List item 2: GroupId: + 0x0104 GroupKeySetId: 0x01a3 List item 3: GroupId: 0x0105 + GroupKeySetId: 0x01a3" + verification: | + ./chip-tool groupkeymanagement write group-key-map '[{"groupId": 259, "groupKeySetID": 419, "fabricIndex": 1},{"groupId": 260, "groupKeySetID": 419, "fabricIndex": 1},{"groupId": 261, "groupKeySetID": 419, "fabricIndex": 1}]' 1 0 + Verify DUT sends SUCCESS(0x00) response on TH(chip-tool) Logs: + + [1685009176.921320][39681:39683] CHIP:EM: Rxd Ack; Removing MessageCounter:177869766 from Retrans Table on exchange 12527i + [1685009176.921325][39681:39683] CHIP:DMG: WriteClient moving to [ResponseRe] + [1685009176.921337][39681:39683] CHIP:DMG: WriteResponseMessage = + [1685009176.921339][39681:39683] CHIP:DMG: { + [1685009176.921341][39681:39683] CHIP:DMG: AttributeStatusIBs = + [1685009176.921344][39681:39683] CHIP:DMG: [ + [1685009176.921346][39681:39683] CHIP:DMG: AttributeStatusIB = + [1685009176.921349][39681:39683] CHIP:DMG: { + [1685009176.921351][39681:39683] CHIP:DMG: AttributePathIB = + [1685009176.921354][39681:39683] CHIP:DMG: { + [1685009176.921356][39681:39683] CHIP:DMG: Endpoint = 0x0, + [1685009176.921359][39681:39683] CHIP:DMG: Cluster = 0x3f, + [1685009176.921361][39681:39683] CHIP:DMG: Attribute = 0x0000_0000, + [1685009176.921365][39681:39683] CHIP:DMG: } + [1685009176.921368][39681:39683] CHIP:DMG: + [1685009176.921370][39681:39683] CHIP:DMG: StatusIB = + [1685009176.921373][39681:39683] CHIP:DMG: { + [1685009176.921375][39681:39683] CHIP:DMG: status = 0x00 (SUCCESS), + [1685009176.921377][39681:39683] CHIP:DMG: }, + [1685009176.921380][39681:39683] CHIP:DMG: + [1685009176.921381][39681:39683] CHIP:DMG: }, + [1685009176.921385][39681:39683] CHIP:DMG: + [1685009176.921387][39681:39683] CHIP:DMG: AttributeStatusIB = + [1685009176.921389][39681:39683] CHIP:DMG: { + [1685009176.921391][39681:39683] CHIP:DMG: AttributePathIB = + [1685009176.921393][39681:39683] CHIP:DMG: { + [1685009176.921396][39681:39683] CHIP:DMG: Endpoint = 0x0, + [1685009176.921399][39681:39683] CHIP:DMG: Cluster = 0x3f, + [1685009176.921401][39681:39683] CHIP:DMG: Attribute = 0x0000_0000, + [1685009176.921403][39681:39683] CHIP:DMG: ListIndex = Null, + [1685009176.921405][39681:39683] CHIP:DMG: } + [1685009176.921409][39681:39683] CHIP:DMG: + [1685009176.921411][39681:39683] CHIP:DMG: StatusIB = + [1685009176.921413][39681:39683] CHIP:DMG: { + [1685009176.921416][39681:39683] CHIP:DMG: status = 0x00 (SUCCESS), + [1685009176.921418][39681:39683] CHIP:DMG: }, + [1685009176.921421][39681:39683] CHIP:DMG: + [1685009176.921423][39681:39683] CHIP:DMG: }, + [1685009176.921428][39681:39683] CHIP:DMG: + [1685009176.921430][39681:39683] CHIP:DMG: AttributeStatusIB = + [1685009176.921432][39681:39683] CHIP:DMG: { + [1685009176.921434][39681:39683] CHIP:DMG: AttributePathIB = + [1685009176.921436][39681:39683] CHIP:DMG: { + [1685009176.921438][39681:39683] CHIP:DMG: Endpoint = 0x0, + [1685009176.921440][39681:39683] CHIP:DMG: Cluster = 0x3f, + [1685009176.921443][39681:39683] CHIP:DMG: Attribute = 0x0000_0000, + [1685009176.921445][39681:39683] CHIP:DMG: ListIndex = Null, + [1685009176.921447][39681:39683] CHIP:DMG: } + [1685009176.921450][39681:39683] CHIP:DMG: + [1685009176.921452][39681:39683] CHIP:DMG: StatusIB = + [1685009176.921456][39681:39683] CHIP:DMG: { + [1685009176.921458][39681:39683] CHIP:DMG: status = 0x00 (SUCCESS), + [1685009176.921462][39681:39683] CHIP:DMG: }, + [1685009176.921464][39681:39683] CHIP:DMG: + [1685009176.921466][39681:39683] CHIP:DMG: }, + [1685009176.921470][39681:39683] CHIP:DMG: + [1685009176.921472][39681:39683] CHIP:DMG: AttributeStatusIB = + [1685009176.921475][39681:39683] CHIP:DMG: { + [1685009176.921477][39681:39683] CHIP:DMG: AttributePathIB = + [1685009176.921479][39681:39683] CHIP:DMG: { + [1685009176.921481][39681:39683] CHIP:DMG: Endpoint = 0x0, + [1685009176.921483][39681:39683] CHIP:DMG: Cluster = 0x3f, + [1685009176.921485][39681:39683] CHIP:DMG: Attribute = 0x0000_0000, + [1685009176.921488][39681:39683] CHIP:DMG: ListIndex = Null, + [1685009176.921491][39681:39683] CHIP:DMG: } + [1685009176.921494][39681:39683] CHIP:DMG: + [1685009176.921496][39681:39683] CHIP:DMG: StatusIB = + [1685009176.921499][39681:39683] CHIP:DMG: { + [1685009176.921501][39681:39683] CHIP:DMG: status = 0x00 (SUCCESS), + [1685009176.921503][39681:39683] CHIP:DMG: }, + [1685009176.921506][39681:39683] CHIP:DMG: + [1685009176.921508][39681:39683] CHIP:DMG: }, + [1685009176.921511][39681:39683] CHIP:DMG: + [1685009176.921513][39681:39683] CHIP:DMG: ], + [1685009176.921519][39681:39683] CHIP:DMG: + [1685009176.921521][39681:39683] CHIP:DMG: InteractionModelRevision = 1 + [1685009176.921523][39681:39683] CHIP:DMG: } + [1685009176.921551][39681:39683] CHIP:DMG: WriteClient moving to [AwaitingDe] + disabled: true + + - label: + "TH sends a AddGroup Command to the Groups cluster on Endpoint + PIXIT.G.ENDPOINT over CASE with the GroupID field set to 0x0103 and + the GroupName set to an empty string" + verification: | + ./chip-tool groups add-group 259 'grp1' 1 0 + + Verify DUT sends a AddGroupResponse with Status is set to SUCCESS and GroupID is set to 0x0103(Decimal 259) on TH(chip-tool) Logs: + + [1685009217.899494][39693:39695] CHIP:DMG: ICR moving to [ResponseRe] + [1685009217.899525][39693:39695] CHIP:DMG: InvokeResponseMessage = + [1685009217.899534][39693:39695] CHIP:DMG: { + [1685009217.899546][39693:39695] CHIP:DMG: suppressResponse = false, + [1685009217.899558][39693:39695] CHIP:DMG: InvokeResponseIBs = + [1685009217.899571][39693:39695] CHIP:DMG: [ + [1685009217.899578][39693:39695] CHIP:DMG: InvokeResponseIB = + [1685009217.899599][39693:39695] CHIP:DMG: { + [1685009217.899606][39693:39695] CHIP:DMG: CommandDataIB = + [1685009217.899616][39693:39695] CHIP:DMG: { + [1685009217.899625][39693:39695] CHIP:DMG: CommandPathIB = + [1685009217.899644][39693:39695] CHIP:DMG: { + [1685009217.899654][39693:39695] CHIP:DMG: EndpointId = 0x0, + [1685009217.899665][39693:39695] CHIP:DMG: ClusterId = 0x4, + [1685009217.899674][39693:39695] CHIP:DMG: CommandId = 0x0, + [1685009217.899689][39693:39695] CHIP:DMG: }, + [1685009217.899701][39693:39695] CHIP:DMG: + [1685009217.899713][39693:39695] CHIP:DMG: CommandFields = + [1685009217.899725][39693:39695] CHIP:DMG: { + [1685009217.899736][39693:39695] CHIP:DMG: 0x0 = 0, + [1685009217.899745][39693:39695] CHIP:DMG: 0x1 = 259, + [1685009217.899759][39693:39695] CHIP:DMG: }, + [1685009217.899766][39693:39695] CHIP:DMG: }, + [1685009217.899778][39693:39695] CHIP:DMG: + [1685009217.899785][39693:39695] CHIP:DMG: }, + [1685009217.899797][39693:39695] CHIP:DMG: + [1685009217.899804][39693:39695] CHIP:DMG: ], + [1685009217.899816][39693:39695] CHIP:DMG: + [1685009217.899824][39693:39695] CHIP:DMG: InteractionModelRevision = 1 + [1685009217.899831][39693:39695] CHIP:DMG: }, + [1685009217.899865][39693:39695] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0004 Command=0x0000_0000 + [1685009217.899888][39693:39695] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0004 Command 0x0000_0000 + [1685009217.899919][39693:39695] CHIP:TOO: AddGroupResponse: { + [1685009217.899930][39693:39695] CHIP:TOO: status: 0 + [1685009217.899938][39693:39695] CHIP:TOO: groupID: 259 + [1685009217.899946][39693:39695] CHIP:TOO: } + disabled: true + + - label: + "TH writes The ACL attribute in the Access Control cluster to add + Manage privileges for group 0x0103 and maintain the current + administrative privileges for the TH on the Access Control cluster. + The following access control list shall be used: List item 1 (TH + admin): Privilege: Administer (5) AuthMode: CASE (2) Subjects: [N1] + Targets: [{Cluster: AccessControl (0x001f), Endpoint: 0}] List item 2 + (group Manage access): Privilege: Manage (4) AuthMode: Group (3) + Subjects: group 0x0103 ([0x0103]) Targets: {Cluster: Groups (0x001d), + Endpoint: PIXIT.G.ENDPOINT}" + verification: | + ./chip-tool accesscontrol write acl '[{ "privilege": 5, "authMode": 2, "subjects": [112233], "targets": [{ "cluster": 31, "endpoint": 0, "deviceType": null }]},{ "privilege": 4, "authMode": 3, "subjects": [259], "targets": [{ "cluster": 4, "endpoint": 0, "deviceType": null }]}]' 1 0 + + Verify DUT sends SUCCESS(0x00) response on TH(chip-tool) Logs: + + [1685009242.316884][39710:39712] CHIP:EM: Rxd Ack; Removing MessageCounter:79745670 from Retrans Table on exchange 23078i + [1685009242.316900][39710:39712] CHIP:DMG: WriteClient moving to [ResponseRe] + [1685009242.316933][39710:39712] CHIP:DMG: WriteResponseMessage = + [1685009242.316942][39710:39712] CHIP:DMG: { + [1685009242.316947][39710:39712] CHIP:DMG: AttributeStatusIBs = + [1685009242.316962][39710:39712] CHIP:DMG: [ + [1685009242.316970][39710:39712] CHIP:DMG: AttributeStatusIB = + [1685009242.316993][39710:39712] CHIP:DMG: { + [1685009242.317002][39710:39712] CHIP:DMG: AttributePathIB = + [1685009242.317016][39710:39712] CHIP:DMG: { + [1685009242.317031][39710:39712] CHIP:DMG: Endpoint = 0x0, + [1685009242.317045][39710:39712] CHIP:DMG: Cluster = 0x1f, + [1685009242.317054][39710:39712] CHIP:DMG: Attribute = 0x0000_0000, + [1685009242.317064][39710:39712] CHIP:DMG: } + [1685009242.317079][39710:39712] CHIP:DMG: + [1685009242.317087][39710:39712] CHIP:DMG: StatusIB = + [1685009242.317099][39710:39712] CHIP:DMG: { + [1685009242.317109][39710:39712] CHIP:DMG: status = 0x00 (SUCCESS), + [1685009242.317120][39710:39712] CHIP:DMG: }, + [1685009242.317131][39710:39712] CHIP:DMG: + [1685009242.317140][39710:39712] CHIP:DMG: }, + [1685009242.317159][39710:39712] CHIP:DMG: + [1685009242.317167][39710:39712] CHIP:DMG: AttributeStatusIB = + [1685009242.317175][39710:39712] CHIP:DMG: { + [1685009242.317185][39710:39712] CHIP:DMG: AttributePathIB = + [1685009242.317195][39710:39712] CHIP:DMG: { + [1685009242.317206][39710:39712] CHIP:DMG: Endpoint = 0x0, + [1685009242.317218][39710:39712] CHIP:DMG: Cluster = 0x1f, + [1685009242.317229][39710:39712] CHIP:DMG: Attribute = 0x0000_0000, + [1685009242.317243][39710:39712] CHIP:DMG: ListIndex = Null, + [1685009242.317251][39710:39712] CHIP:DMG: } + [1685009242.317265][39710:39712] CHIP:DMG: + [1685009242.317272][39710:39712] CHIP:DMG: StatusIB = + [1685009242.317281][39710:39712] CHIP:DMG: { + [1685009242.317291][39710:39712] CHIP:DMG: status = 0x00 (SUCCESS), + [1685009242.317301][39710:39712] CHIP:DMG: }, + [1685009242.317310][39710:39712] CHIP:DMG: + [1685009242.317320][39710:39712] CHIP:DMG: }, + [1685009242.317336][39710:39712] CHIP:DMG: + [1685009242.317342][39710:39712] CHIP:DMG: AttributeStatusIB = + [1685009242.317353][39710:39712] CHIP:DMG: { + [1685009242.317362][39710:39712] CHIP:DMG: AttributePathIB = + [1685009242.317373][39710:39712] CHIP:DMG: { + [1685009242.317384][39710:39712] CHIP:DMG: Endpoint = 0x0, + [1685009242.317398][39710:39712] CHIP:DMG: Cluster = 0x1f, + [1685009242.317406][39710:39712] CHIP:DMG: Attribute = 0x0000_0000, + [1685009242.317417][39710:39712] CHIP:DMG: ListIndex = Null, + [1685009242.317427][39710:39712] CHIP:DMG: } + [1685009242.317441][39710:39712] CHIP:DMG: + [1685009242.317449][39710:39712] CHIP:DMG: StatusIB = + [1685009242.317460][39710:39712] CHIP:DMG: { + [1685009242.317471][39710:39712] CHIP:DMG: status = 0x00 (SUCCESS), + [1685009242.317481][39710:39712] CHIP:DMG: }, + [1685009242.317491][39710:39712] CHIP:DMG: + [1685009242.317502][39710:39712] CHIP:DMG: }, + [1685009242.317515][39710:39712] CHIP:DMG: + [1685009242.317523][39710:39712] CHIP:DMG: ], + [1685009242.317544][39710:39712] CHIP:DMG: + [1685009242.317551][39710:39712] CHIP:DMG: InteractionModelRevision = 1 + [1685009242.317558][39710:39712] CHIP:DMG: } + [1685009242.317637][39710:39712] CHIP:DMG: WriteClient moving to [AwaitingDe] + disabled: true + + - label: + "TH sends a AddGroup Command to the Groups cluster on Endpoint + PIXIT.G.ENDPOINT over CASE with the GroupID field set to 0x0104 and + the GroupName set to an empty string" + verification: | + ./chip-tool groups add-group 260 '' 1 0 + Verify DUT sends 0x7e (UNSUPPORTED_ACCESS) response on TH(chip-tool) Logs: + + [1685009266.594913][39716:39718] CHIP:EM: Rxd Ack; Removing MessageCounter:18030850 from Retrans Table on exchange 59871i + [1685009266.594918][39716:39718] CHIP:DMG: ICR moving to [ResponseRe] + [1685009266.594926][39716:39718] CHIP:DMG: InvokeResponseMessage = + [1685009266.594928][39716:39718] CHIP:DMG: { + [1685009266.594930][39716:39718] CHIP:DMG: suppressResponse = false, + [1685009266.594932][39716:39718] CHIP:DMG: InvokeResponseIBs = + [1685009266.594935][39716:39718] CHIP:DMG: [ + [1685009266.594937][39716:39718] CHIP:DMG: InvokeResponseIB = + [1685009266.594941][39716:39718] CHIP:DMG: { + [1685009266.594944][39716:39718] CHIP:DMG: CommandStatusIB = + [1685009266.594947][39716:39718] CHIP:DMG: { + [1685009266.594949][39716:39718] CHIP:DMG: CommandPathIB = + [1685009266.594951][39716:39718] CHIP:DMG: { + [1685009266.594954][39716:39718] CHIP:DMG: EndpointId = 0x0, + [1685009266.594956][39716:39718] CHIP:DMG: ClusterId = 0x4, + [1685009266.594959][39716:39718] CHIP:DMG: CommandId = 0x0, + [1685009266.594961][39716:39718] CHIP:DMG: }, + [1685009266.594964][39716:39718] CHIP:DMG: + [1685009266.594966][39716:39718] CHIP:DMG: StatusIB = + [1685009266.594969][39716:39718] CHIP:DMG: { + [1685009266.594971][39716:39718] CHIP:DMG: status = 0x7e (UNSUPPORTED_ACCESS), + [1685009266.594973][39716:39718] CHIP:DMG: }, + [1685009266.594976][39716:39718] CHIP:DMG: + [1685009266.594978][39716:39718] CHIP:DMG: }, + [1685009266.594980][39716:39718] CHIP:DMG: + [1685009266.594982][39716:39718] CHIP:DMG: }, + [1685009266.594985][39716:39718] CHIP:DMG: + [1685009266.594987][39716:39718] CHIP:DMG: ], + [1685009266.594990][39716:39718] CHIP:DMG: + [1685009266.594992][39716:39718] CHIP:DMG: InteractionModelRevision = 1 + [1685009266.594994][39716:39718] CHIP:DMG: } + disabled: true + + - label: + "TH sends a AddGroup Command to the Groups cluster with the GroupID + field set to 0x0104 and the GroupName set to an empty string. The + command is sent as a group command using GroupID 0x0103" + verification: | + ./chip-tool groups add-group 260 '' 0xffffffffffff0103 0 + disabled: true + + - label: + "TH sends a AddGroup Command to the Groups cluster with the GroupID + field set to 0x0105 and the GroupName set to an empty string. The + command is sent as a group command using GroupID 0x0104" + verification: | + ./chip-tool groups add-group 261 '' 0xffffffffffff0104 1 + disabled: true + + - label: + "TH writes The ACL attribute in the Access Control cluster to revoke + groups Management access and restore full access over CASE by setting + the following ACL list items: List item 1 (TH admin): Privilege: + Administer (5) AuthMode: CASE (2) Subjects: [N1] Targets: null" + verification: | + ./chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null }]' 1 0 + + Verify DUT sends SUCCESS(0x00) response on TH(chip-tool) Logs: + + 1685009349.509571][39773:39775] CHIP:DMG: WriteResponseMessage = + [1685009349.509581][39773:39775] CHIP:DMG: { + [1685009349.509588][39773:39775] CHIP:DMG: AttributeStatusIBs = + [1685009349.509602][39773:39775] CHIP:DMG: [ + [1685009349.509610][39773:39775] CHIP:DMG: AttributeStatusIB = + [1685009349.509620][39773:39775] CHIP:DMG: { + [1685009349.509628][39773:39775] CHIP:DMG: AttributePathIB = + [1685009349.509642][39773:39775] CHIP:DMG: { + [1685009349.509652][39773:39775] CHIP:DMG: Endpoint = 0x0, + [1685009349.509662][39773:39775] CHIP:DMG: Cluster = 0x1f, + [1685009349.509672][39773:39775] CHIP:DMG: Attribute = 0x0000_0000, + [1685009349.509684][39773:39775] CHIP:DMG: } + [1685009349.509696][39773:39775] CHIP:DMG: + [1685009349.509704][39773:39775] CHIP:DMG: StatusIB = + [1685009349.509713][39773:39775] CHIP:DMG: { + [1685009349.509721][39773:39775] CHIP:DMG: status = 0x00 (SUCCESS), + [1685009349.509733][39773:39775] CHIP:DMG: }, + [1685009349.509742][39773:39775] CHIP:DMG: + [1685009349.509750][39773:39775] CHIP:DMG: }, + [1685009349.509771][39773:39775] CHIP:DMG: + [1685009349.509778][39773:39775] CHIP:DMG: AttributeStatusIB = + [1685009349.509786][39773:39775] CHIP:DMG: { + [1685009349.509794][39773:39775] CHIP:DMG: AttributePathIB = + [1685009349.509802][39773:39775] CHIP:DMG: { + [1685009349.509811][39773:39775] CHIP:DMG: Endpoint = 0x0, + [1685009349.509820][39773:39775] CHIP:DMG: Cluster = 0x1f, + [1685009349.509829][39773:39775] CHIP:DMG: Attribute = 0x0000_0000, + [1685009349.509838][39773:39775] CHIP:DMG: ListIndex = Null, + [1685009349.509846][39773:39775] CHIP:DMG: } + [1685009349.509858][39773:39775] CHIP:DMG: + [1685009349.509866][39773:39775] CHIP:DMG: StatusIB = + [1685009349.509873][39773:39775] CHIP:DMG: { + [1685009349.509882][39773:39775] CHIP:DMG: status = 0x00 (SUCCESS), + [1685009349.509890][39773:39775] CHIP:DMG: }, + [1685009349.509900][39773:39775] CHIP:DMG: + [1685009349.509907][39773:39775] CHIP:DMG: }, + [1685009349.509919][39773:39775] CHIP:DMG: + [1685009349.509926][39773:39775] CHIP:DMG: ], + [1685009349.509942][39773:39775] CHIP:DMG: + [1685009349.509949][39773:39775] CHIP:DMG: InteractionModelRevision = 1 + [1685009349.509959][39773:39775] CHIP:DMG: } + disabled: true + + - label: + "TH sends a ViewGroup Command to the Groups cluster on Endpoint + PIXIT.G.ENDPOINT over CASE with the GroupID set to 0x0104 to confirm + that the AddGroup command from step 6 was successful" + verification: | + ./chip-tool groups view-group 0x0104 1 0 + + Verify DUT sends a ViewGroupResponse with Status is set to SUCCESS and GroupID is set to 0x0104(Decimal 260) on TH(chip-tool) Logs: + + [1685009378.715933][39785:39787] CHIP:EM: Rxd Ack; Removing MessageCounter:100204976 from Retrans Table on exchange 10510i + [1685009378.715944][39785:39787] CHIP:DMG: ICR moving to [ResponseRe] + [1685009378.715968][39785:39787] CHIP:DMG: InvokeResponseMessage = + [1685009378.715977][39785:39787] CHIP:DMG: { + [1685009378.715985][39785:39787] CHIP:DMG: suppressResponse = false, + [1685009378.715994][39785:39787] CHIP:DMG: InvokeResponseIBs = + [1685009378.716007][39785:39787] CHIP:DMG: [ + [1685009378.716015][39785:39787] CHIP:DMG: InvokeResponseIB = + [1685009378.716027][39785:39787] CHIP:DMG: { + [1685009378.716035][39785:39787] CHIP:DMG: CommandDataIB = + [1685009378.716044][39785:39787] CHIP:DMG: { + [1685009378.716051][39785:39787] CHIP:DMG: CommandPathIB = + [1685009378.716061][39785:39787] CHIP:DMG: { + [1685009378.716070][39785:39787] CHIP:DMG: EndpointId = 0x0, + [1685009378.716080][39785:39787] CHIP:DMG: ClusterId = 0x4, + [1685009378.716088][39785:39787] CHIP:DMG: CommandId = 0x1, + [1685009378.716097][39785:39787] CHIP:DMG: }, + [1685009378.716107][39785:39787] CHIP:DMG: + [1685009378.716115][39785:39787] CHIP:DMG: CommandFields = + [1685009378.716124][39785:39787] CHIP:DMG: { + [1685009378.716134][39785:39787] CHIP:DMG: 0x0 = 0, + [1685009378.716143][39785:39787] CHIP:DMG: 0x1 = 260, + [1685009378.716154][39785:39787] CHIP:DMG: 0x2 = "" (0 chars), + [1685009378.716164][39785:39787] CHIP:DMG: }, + [1685009378.716172][39785:39787] CHIP:DMG: }, + [1685009378.716184][39785:39787] CHIP:DMG: + [1685009378.716191][39785:39787] CHIP:DMG: }, + [1685009378.716203][39785:39787] CHIP:DMG: + [1685009378.716210][39785:39787] CHIP:DMG: ], + [1685009378.716224][39785:39787] CHIP:DMG: + [1685009378.716231][39785:39787] CHIP:DMG: InteractionModelRevision = 1 + [1685009378.716238][39785:39787] CHIP:DMG: }, + [1685009378.716275][39785:39787] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0004 Command=0x0000_0001 + [1685009378.716295][39785:39787] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0004 Command 0x0000_0001 + [1685009378.716326][39785:39787] CHIP:TOO: ViewGroupResponse: { + [1685009378.716337][39785:39787] CHIP:TOO: status: 0 + [1685009378.716349][39785:39787] CHIP:TOO: groupID: 260 + [1685009378.716356][39785:39787] CHIP:TOO: groupName: + [1685009378.716365][39785:39787] CHIP:TOO: } + disabled: true + + - label: + "TH sends a ViewGroup Command to the Groups cluster on Endpoint + PIXIT.G.ENDPOINT over CASE with the GroupID set to 0x0105 to confirm + that the AddGroup command from step 7 was not successful" + verification: | + ./chip-tool groups view-group 0x0105 1 0 + + [1685009398.600826][39795:39797] CHIP:DMG: InvokeResponseMessage = + [1685009398.600828][39795:39797] CHIP:DMG: { + [1685009398.600831][39795:39797] CHIP:DMG: suppressResponse = false, + [1685009398.600833][39795:39797] CHIP:DMG: InvokeResponseIBs = + [1685009398.600838][39795:39797] CHIP:DMG: [ + [1685009398.600840][39795:39797] CHIP:DMG: InvokeResponseIB = + [1685009398.600845][39795:39797] CHIP:DMG: { + [1685009398.600847][39795:39797] CHIP:DMG: CommandDataIB = + [1685009398.600850][39795:39797] CHIP:DMG: { + [1685009398.600853][39795:39797] CHIP:DMG: CommandPathIB = + [1685009398.600856][39795:39797] CHIP:DMG: { + [1685009398.600859][39795:39797] CHIP:DMG: EndpointId = 0x0, + [1685009398.600862][39795:39797] CHIP:DMG: ClusterId = 0x4, + [1685009398.600865][39795:39797] CHIP:DMG: CommandId = 0x1, + [1685009398.600867][39795:39797] CHIP:DMG: }, + [1685009398.600871][39795:39797] CHIP:DMG: + [1685009398.600874][39795:39797] CHIP:DMG: CommandFields = + [1685009398.600876][39795:39797] CHIP:DMG: { + [1685009398.600880][39795:39797] CHIP:DMG: 0x0 = 139, + [1685009398.600883][39795:39797] CHIP:DMG: 0x1 = 261, + [1685009398.600886][39795:39797] CHIP:DMG: 0x2 = "" (0 chars), + [1685009398.600889][39795:39797] CHIP:DMG: }, + [1685009398.600892][39795:39797] CHIP:DMG: }, + [1685009398.600896][39795:39797] CHIP:DMG: + [1685009398.600898][39795:39797] CHIP:DMG: }, + [1685009398.600902][39795:39797] CHIP:DMG: + [1685009398.600904][39795:39797] CHIP:DMG: ], + [1685009398.600908][39795:39797] CHIP:DMG: + [1685009398.600911][39795:39797] CHIP:DMG: InteractionModelRevision = 1 + [1685009398.600913][39795:39797] CHIP:DMG: }, + [1685009398.600925][39795:39797] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0004 Command=0x0000_0001 + [1685009398.600932][39795:39797] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0004 Command 0x0000_0001 + [1685009398.600944][39795:39797] CHIP:TOO: ViewGroupResponse: { + [1685009398.600949][39795:39797] CHIP:TOO: status: 139 + [1685009398.600952][39795:39797] CHIP:TOO: groupID: 261 + [1685009398.600955][39795:39797] CHIP:TOO: groupName: + [1685009398.600957][39795:39797] CHIP:TOO: } + [1685009398.600964][39795:39797] CHIP:DMG: ICR moving to [AwaitingDe] + disabled: true + + - label: + "TH sends a AddGroup Command to the Groups cluster with the GroupID + field set to 0x0105 and the GroupName set to an empty string. The + command is sent as a group command using GroupID 0x0103" + verification: | + ./chip-tool groups add-group 261 '' 0xffffffffffff0103 0 + disabled: true + + - label: + "TH sends a ViewGroup Command to the Groups cluster on Endpoint + PIXIT.G.ENDPOINT over CASE with the GroupID set to 0x0105 to confirm + that the AddGroup command from step 11 was not successful" + verification: | + ./chip-tool groups view-group 261 1 0 + Verify DUT sends a ViewGroupResponse with Status is set to NOT_FOUND and GroupID is set to 0x0105(Decimal 261) on TH(chip-tool) Logs: + + [1685009503.554279][40130:40132] CHIP:DMG: InvokeResponseMessage = + [1685009503.554289][40130:40132] CHIP:DMG: { + [1685009503.554295][40130:40132] CHIP:DMG: suppressResponse = false, + [1685009503.554303][40130:40132] CHIP:DMG: InvokeResponseIBs = + [1685009503.554315][40130:40132] CHIP:DMG: [ + [1685009503.554321][40130:40132] CHIP:DMG: InvokeResponseIB = + [1685009503.554331][40130:40132] CHIP:DMG: { + [1685009503.554340][40130:40132] CHIP:DMG: CommandDataIB = + [1685009503.554346][40130:40132] CHIP:DMG: { + [1685009503.554351][40130:40132] CHIP:DMG: CommandPathIB = + [1685009503.554361][40130:40132] CHIP:DMG: { + [1685009503.554370][40130:40132] CHIP:DMG: EndpointId = 0x0, + [1685009503.554380][40130:40132] CHIP:DMG: ClusterId = 0x4, + [1685009503.554389][40130:40132] CHIP:DMG: CommandId = 0x1, + [1685009503.554397][40130:40132] CHIP:DMG: }, + [1685009503.554407][40130:40132] CHIP:DMG: + [1685009503.554416][40130:40132] CHIP:DMG: CommandFields = + [1685009503.554425][40130:40132] CHIP:DMG: { + [1685009503.554436][40130:40132] CHIP:DMG: 0x0 = 139, + [1685009503.554445][40130:40132] CHIP:DMG: 0x1 = 261, + [1685009503.554456][40130:40132] CHIP:DMG: 0x2 = "" (0 chars), + [1685009503.554466][40130:40132] CHIP:DMG: }, + [1685009503.554474][40130:40132] CHIP:DMG: }, + [1685009503.554486][40130:40132] CHIP:DMG: + [1685009503.554493][40130:40132] CHIP:DMG: }, + [1685009503.554506][40130:40132] CHIP:DMG: + [1685009503.554513][40130:40132] CHIP:DMG: ], + [1685009503.554526][40130:40132] CHIP:DMG: + [1685009503.554534][40130:40132] CHIP:DMG: InteractionModelRevision = 1 + [1685009503.554541][40130:40132] CHIP:DMG: }, + [1685009503.554583][40130:40132] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0004 Command=0x0000_0001 + [1685009503.554604][40130:40132] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0004 Command 0x0000_0001 + [1685009503.554637][40130:40132] CHIP:TOO: ViewGroupResponse: { + [1685009503.554653][40130:40132] CHIP:TOO: status: 139 + [1685009503.554662][40130:40132] CHIP:TOO: groupID: 261 + [1685009503.554670][40130:40132] CHIP:TOO: groupName: + [1685009503.554678][40130:40132] CHIP:TOO: } + [1685009503.554698][40130:40132] CHIP:DMG: ICR moving + disabled: true + + - label: + "TH sends the RemoveAllGroups Command to the Groups cluster on + Endpoint PIXIT.G.ENDPOINT over CASE" + verification: | + ./chip-tool groups remove-all-groups 1 0 + + + Verify DUT sends SUCCESS(0x00) response on TH(chip-tool) Logs: + + [1685009534.554583][40143:40145] CHIP:DMG: InvokeResponseMessage = + [1685009534.554585][40143:40145] CHIP:DMG: { + [1685009534.554588][40143:40145] CHIP:DMG: suppressResponse = false, + [1685009534.554590][40143:40145] CHIP:DMG: InvokeResponseIBs = + [1685009534.554594][40143:40145] CHIP:DMG: [ + [1685009534.554596][40143:40145] CHIP:DMG: InvokeResponseIB = + [1685009534.554600][40143:40145] CHIP:DMG: { + [1685009534.554602][40143:40145] CHIP:DMG: CommandStatusIB = + [1685009534.554605][40143:40145] CHIP:DMG: { + [1685009534.554607][40143:40145] CHIP:DMG: CommandPathIB = + [1685009534.554610][40143:40145] CHIP:DMG: { + [1685009534.554613][40143:40145] CHIP:DMG: EndpointId = 0x0, + [1685009534.554616][40143:40145] CHIP:DMG: ClusterId = 0x4, + [1685009534.554618][40143:40145] CHIP:DMG: CommandId = 0x4, + [1685009534.554620][40143:40145] CHIP:DMG: }, + [1685009534.554624][40143:40145] CHIP:DMG: + [1685009534.554626][40143:40145] CHIP:DMG: StatusIB = + [1685009534.554628][40143:40145] CHIP:DMG: { + [1685009534.554631][40143:40145] CHIP:DMG: status = 0x00 (SUCCESS), + [1685009534.554633][40143:40145] CHIP:DMG: }, + [1685009534.554637][40143:40145] CHIP:DMG: + [1685009534.554640][40143:40145] CHIP:DMG: }, + [1685009534.554644][40143:40145] CHIP:DMG: + [1685009534.554646][40143:40145] CHIP:DMG: }, + [1685009534.554650][40143:40145] CHIP:DMG: + [1685009534.554652][40143:40145] CHIP:DMG: ], + [1685009534.554656][40143:40145] CHIP:DMG: + [1685009534.554658][40143:40145] CHIP:DMG: InteractionModelRevision = 1 + [1685009534.554660][40143:40145] CHIP:DMG: }, + disabled: true + + - label: + "TH resets the GroupKeyMap attribute list on GroupKeyManagement + cluster by writing the GroupKeyMap attribute with an empty list" + verification: | + ./chip-tool groupkeymanagement write group-key-map '[ ]' 1 0 + + Verify DUT sends SUCCESS(0x00) response on TH(chip-tool) Logs: + + [1685010006.001015][40429:40431] CHIP:DMG: WriteClient moving to [ResponseRe] + [1685010006.001022][40429:40431] CHIP:DMG: WriteResponseMessage = + [1685010006.001025][40429:40431] CHIP:DMG: { + [1685010006.001026][40429:40431] CHIP:DMG: AttributeStatusIBs = + [1685010006.001030][40429:40431] CHIP:DMG: [ + [1685010006.001032][40429:40431] CHIP:DMG: AttributeStatusIB = + [1685010006.001034][40429:40431] CHIP:DMG: { + [1685010006.001037][40429:40431] CHIP:DMG: AttributePathIB = + [1685010006.001039][40429:40431] CHIP:DMG: { + [1685010006.001043][40429:40431] CHIP:DMG: Endpoint = 0x0, + [1685010006.001045][40429:40431] CHIP:DMG: Cluster = 0x3f, + [1685010006.001047][40429:40431] CHIP:DMG: Attribute = 0x0000_0000, + [1685010006.001050][40429:40431] CHIP:DMG: } + [1685010006.001053][40429:40431] CHIP:DMG: + [1685010006.001055][40429:40431] CHIP:DMG: StatusIB = + [1685010006.001057][40429:40431] CHIP:DMG: { + [1685010006.001059][40429:40431] CHIP:DMG: status = 0x00 (SUCCESS), + [1685010006.001061][40429:40431] CHIP:DMG: }, + [1685010006.001064][40429:40431] CHIP:DMG: + [1685010006.001066][40429:40431] CHIP:DMG: }, + [1685010006.001068][40429:40431] CHIP:DMG: + [1685010006.001070][40429:40431] CHIP:DMG: ], + [1685010006.001073][40429:40431] CHIP:DMG: + [1685010006.001075][40429:40431] CHIP:DMG: InteractionModelRevision = 1 + [1685010006.001077][40429:40431] CHIP:DMG: } + disabled: true + + - label: + "TH resets the key set by sending the KeySetRemove command to the + GroupKeyManagement cluster over CASE with the following fields: + GroupKeySetID: 0x01a3" + verification: | + ./chip-tool groupkeymanagement key-set-remove "0x01a3" 1 0 + + Verify DUT sends SUCCESS(0x00) response on TH(chip-tool) Logs: + + [1685009579.433397][40206:40208] CHIP:DMG: InvokeResponseMessage = + [1685009579.433405][40206:40208] CHIP:DMG: { + [1685009579.433413][40206:40208] CHIP:DMG: suppressResponse = false, + [1685009579.433420][40206:40208] CHIP:DMG: InvokeResponseIBs = + [1685009579.433434][40206:40208] CHIP:DMG: [ + [1685009579.433441][40206:40208] CHIP:DMG: InvokeResponseIB = + [1685009579.433453][40206:40208] CHIP:DMG: { + [1685009579.433461][40206:40208] CHIP:DMG: CommandStatusIB = + [1685009579.433470][40206:40208] CHIP:DMG: { + [1685009579.433478][40206:40208] CHIP:DMG: CommandPathIB = + [1685009579.433493][40206:40208] CHIP:DMG: { + [1685009579.433503][40206:40208] CHIP:DMG: EndpointId = 0x0, + [1685009579.433519][40206:40208] CHIP:DMG: ClusterId = 0x3f, + [1685009579.433528][40206:40208] CHIP:DMG: CommandId = 0x3, + [1685009579.433536][40206:40208] CHIP:DMG: }, + [1685009579.433549][40206:40208] CHIP:DMG: + [1685009579.433557][40206:40208] CHIP:DMG: StatusIB = + [1685009579.433567][40206:40208] CHIP:DMG: { + [1685009579.433576][40206:40208] CHIP:DMG: status = 0x00 (SUCCESS), + [1685009579.433594][40206:40208] CHIP:DMG: }, + [1685009579.433603][40206:40208] CHIP:DMG: + [1685009579.433614][40206:40208] CHIP:DMG: }, + [1685009579.433625][40206:40208] CHIP:DMG: + [1685009579.433632][40206:40208] CHIP:DMG: }, + [1685009579.433641][40206:40208] CHIP:DMG: + [1685009579.433649][40206:40208] CHIP:DMG: ], + [1685009579.433661][40206:40208] CHIP:DMG: + [1685009579.433668][40206:40208] CHIP:DMG: InteractionModelRevision = 1 + [1685009579.433676][40206:40208] CHIP:DMG: }, + [1685009579.433713][40206:40208] CHIP:DMG: Rece + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_SC_5_3.yaml b/src/app/tests/suites/certification/Test_TC_SC_5_3.yaml index 4827111fe1685a..24b8e69392dbec 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_5_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_5_3.yaml @@ -13,10 +13,11 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 19.1.3. [TC-SC-5.3] Sending a group message - DUT to TH +name: 18.1.3. [TC-SC-5.3] Sending a group message - DUT to TH PICS: - MCORE.ROLE.COMMISSIONER + - GRPKEY.C config: nodeId: 0x12344321 @@ -33,92 +34,265 @@ tests: verification: | DUT and TH are commissioned. - DUT and TH are part of a common group. - Run TC-SC-6.1 to establish this precondition. + DUT supports Groups Cluster disabled: true - label: "TH should have the ACL entry with the AuthMode as Group by DUT" verification: | + ./chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null },{"fabricIndex": 1, "privilege": 4, "authMode": 3, "subjects": [259], "targets": null }]' 1 0 + ./chip-tool accesscontrol read acl 1 0 - Verify the Read Request Message for the data sent in the above command on TH(Reference app)log - - [1653571830.010685][3949:3949] CHIP:IM: Received Read request - [1653571830.010772][3949:3949] CHIP:DMG: ReadRequestMessage = - [1653571830.010822][3949:3949] CHIP:DMG: { - [1653571830.010863][3949:3949] CHIP:DMG: AttributePathIBs = - [1653571830.010911][3949:3949] CHIP:DMG: [ - [1653571830.010957][3949:3949] CHIP:DMG: AttributePathIB = - [1653571830.011020][3949:3949] CHIP:DMG: { - [1653571830.011072][3949:3949] CHIP:DMG: Endpoint = 0x0, - [1653571830.011132][3949:3949] CHIP:DMG: Cluster = 0x1f, - [1653571830.011191][3949:3949] CHIP:DMG: Attribute = 0x0000_0000, - [1653571830.011246][3949:3949] CHIP:DMG: } - [1653571830.011299][3949:3949] CHIP:DMG: - [1653571830.011350][3949:3949] CHIP:DMG: ], - [1653571830.011401][3949:3949] CHIP:DMG: - [1653571830.011451][3949:3949] CHIP:DMG: isFabricFiltered = true, - [1653571830.011499][3949:3949] CHIP:DMG: InteractionModelRevision = 1 - [1653571830.011543][3949:3949] CHIP:DMG: }, - [1653571830.011711][3949:3949] CHIP:DMG: IM RH moving to [GeneratingReports] - [1653571830.011855][3949:3949] CHIP:DMG: Building Reports for ReadHandler with LastReportGeneration = 0 DirtyGeneration = 0 - [1653571830.011907][3949:3949] CHIP:DMG: Cluster 1f, Attribute 0 is dirty - [1653571830.011947][3949:3949] CHIP:DMG: Reading attribute: Cluster=0x0000_001F Endpoint=0 AttributeId=0x0000_0000 (expanded=0) - [1653571830.011995][3949:3949] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_001F e=0 p=a - [1653571830.012053][3949:3949] CHIP:DMG: AccessControl: allowed + Verify that ACL entry with the AuthMode as Group is present on TH(Reference app)log: + + [1684162707.651064][28541:28543] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0000 DataVersion: 1331379855 + [1684162707.651080][28541:28543] CHIP:TOO: ACL: 2 entries + [1684162707.651089][28541:28543] CHIP:TOO: [1]: { + [1684162707.651095][28541:28543] CHIP:TOO: Privilege: 5 + [1684162707.651097][28541:28543] CHIP:TOO: AuthMode: 2 + [1684162707.651100][28541:28543] CHIP:TOO: Subjects: 1 entries + [1684162707.651103][28541:28543] CHIP:TOO: [1]: 112233 + [1684162707.651105][28541:28543] CHIP:TOO: Targets: null + [1684162707.651107][28541:28543] CHIP:TOO: FabricIndex: 1 + [1684162707.651109][28541:28543] CHIP:TOO: } + [1684162707.651113][28541:28543] CHIP:TOO: [2]: { + [1684162707.651115][28541:28543] CHIP:TOO: Privilege: 4 + [1684162707.651117][28541:28543] CHIP:TOO: AuthMode: 3 + [1684162707.651119][28541:28543] CHIP:TOO: Subjects: 1 entries + [1684162707.651122][28541:28543] CHIP:TOO: [1]: 259 + [1684162707.651124][28541:28543] CHIP:TOO: Targets: null + [1684162707.651126][28541:28543] CHIP:TOO: FabricIndex: 1 + [1684162707.651128][28541:28543] CHIP:TOO: } + disabled: true + + - label: + "DUT generates fabric-unique GroupID, GroupName, random key, EpochKey0 + and GroupKeySetID. Save the GroupID as GroupID_1, GroupName as + GroupName_1 and GroupSetID" + PICS: GRPKEY.C.C00.Tx + verification: | + GroupKeySetID = 419 + GroupID_1 = 259 + GroupName_1 = "grp1" + disabled: true + + - label: + "DUT sends KeySetWrite command to GroupKeyManagement cluster to TH on + EP0" + PICS: GRPKEY.C.C00.Tx + verification: | + ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": 419,"groupKeySecurityPolicy": 0, "epochKey0":"d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 2220000,"epochKey1":"d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 2220001,"epochKey2":"d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 2220002 }' 1 0 + + Verify that KeySetWrite with Group Set ID as 419 is present on TH(Reference app)log: + + [1684162878.418032][28333:28333] CHIP:DMG: { + [1684162878.418034][28333:28333] CHIP:DMG: suppressResponse = false, + [1684162878.418038][28333:28333] CHIP:DMG: timedRequest = false, + [1684162878.418040][28333:28333] CHIP:DMG: InvokeRequests = + [1684162878.418044][28333:28333] CHIP:DMG: [ + [1684162878.418046][28333:28333] CHIP:DMG: CommandDataIB = + [1684162878.418048][28333:28333] CHIP:DMG: { + [1684162878.418050][28333:28333] CHIP:DMG: CommandPathIB = + [1684162878.418054][28333:28333] CHIP:DMG: { + [1684162878.418057][28333:28333] CHIP:DMG: EndpointId = 0x0, + [1684162878.418059][28333:28333] CHIP:DMG: ClusterId = 0x3f, + [1684162878.418062][28333:28333] CHIP:DMG: CommandId = 0x0, + [1684162878.418065][28333:28333] CHIP:DMG: }, + [1684162878.418068][28333:28333] CHIP:DMG: + [1684162878.418071][28333:28333] CHIP:DMG: CommandFields = + [1684162878.418074][28333:28333] CHIP:DMG: { + [1684162878.418077][28333:28333] CHIP:DMG: 0x0 = + [1684162878.418079][28333:28333] CHIP:DMG: { + [1684162878.418083][28333:28333] CHIP:DMG: 0x0 = 419, + [1684162878.418087][28333:28333] CHIP:DMG: 0x1 = 0, + [1684162878.418090][28333:28333] CHIP:DMG: 0x2 = [ + [1684162878.418094][28333:28333] CHIP:DMG: 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + [1684162878.418099][28333:28333] CHIP:DMG: ] (16 bytes) + [1684162878.418102][28333:28333] CHIP:DMG: 0x3 = 2220000, + [1684162878.418105][28333:28333] CHIP:DMG: 0x4 = [ + [1684162878.418110][28333:28333] CHIP:DMG: 0xd1, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + [1684162878.418115][28333:28333] CHIP:DMG: ] (16 bytes) + [1684162878.418135][28333:28333] CHIP:DMG: 0x5 = 2220001, + [1684162878.418138][28333:28333] CHIP:DMG: 0x6 = [ + [1684162878.418143][28333:28333] CHIP:DMG: 0xd2, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + [1684162878.418146][28333:28333] CHIP:DMG: ] (16 bytes) + [1684162878.418150][28333:28333] CHIP:DMG: 0x7 = 2220002, + [1684162878.418153][28333:28333] CHIP:DMG: }, + [1684162878.418155][28333:28333] CHIP:DMG: }, + [1684162878.418157][28333:28333] CHIP:DMG: }, + [1684162878.418161][28333:28333] CHIP:DMG: + [1684162878.418169][28333:28333] CHIP:DMG: ], + [1684162878.418173][28333:28333] CHIP:DMG: + [1684162878.418174][28333:28333] CHIP:DMG: InteractionModelRevision = 1 + [1684162878.418176][28333:28333] CHIP:DMG: }, + [1684162878.418190][28333:28333] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_003F e=0 p=a + [1684162878.418196][28333:28333] CHIP:DMG: AccessControl: allowed + [1684162878.418199][28333:28333] CHIP:DMG: Received command for Endpoint=0 Cluster=0x0000_003F Command=0x0000_0000 + disabled: true + + - label: + "DUT binds GroupId with GroupKeySetID in the GroupKeyMap attribute + list on GroupKeyManagement cluster" + PICS: GRPKEY.C.A0000 + verification: | + ./chip-tool groupkeymanagement write group-key-map '[{"groupId": 259, "groupKeySetID": 419, "fabricIndex": 1},{"groupId": 257, "groupKeySetID": 419, "fabricIndex": 1}]' 1 0 + + Verify that group-key-map attribute with GroupID_1 as 259, GroupID_2 as 257 and Group Set ID as 419 is present on TH(Reference app)log: + [1684166126.545563][29258:29258] CHIP:DMG: WriteRequestMessage = + [1684166126.545565][29258:29258] CHIP:DMG: { + [1684166126.545567][29258:29258] CHIP:DMG: suppressResponse = false, + [1684166126.545569][29258:29258] CHIP:DMG: timedRequest = false, + [1684166126.545571][29258:29258] CHIP:DMG: AttributeDataIBs = + [1684166126.545575][29258:29258] CHIP:DMG: [ + [1684166126.545577][29258:29258] CHIP:DMG: AttributeDataIB = + [1684166126.545579][29258:29258] CHIP:DMG: { + [1684166126.545581][29258:29258] CHIP:DMG: AttributePathIB = + [1684166126.545583][29258:29258] CHIP:DMG: { + [1684166126.545586][29258:29258] CHIP:DMG: Endpoint = 0x0, + [1684166126.545590][29258:29258] CHIP:DMG: Cluster = 0x3f, + [1684166126.545593][29258:29258] CHIP:DMG: Attribute = 0x0000_0000, + [1684166126.545595][29258:29258] CHIP:DMG: } + [1684166126.545597][29258:29258] CHIP:DMG: + [1684166126.545600][29258:29258] CHIP:DMG: Data = [ + [1684166126.545602][29258:29258] CHIP:DMG: + [1684166126.545606][29258:29258] CHIP:DMG: ], + [1684166126.545608][29258:29258] CHIP:DMG: }, + [1684166126.545612][29258:29258] CHIP:DMG: + [1684166126.545614][29258:29258] CHIP:DMG: AttributeDataIB = + [1684166126.545616][29258:29258] CHIP:DMG: { + [1684166126.545618][29258:29258] CHIP:DMG: AttributePathIB = + [1684166126.545620][29258:29258] CHIP:DMG: { + [1684166126.545622][29258:29258] CHIP:DMG: Endpoint = 0x0, + [1684166126.545624][29258:29258] CHIP:DMG: Cluster = 0x3f, + [1684166126.545626][29258:29258] CHIP:DMG: Attribute = 0x0000_0000, + [1684166126.545629][29258:29258] CHIP:DMG: ListIndex = Null, + [1684166126.545631][29258:29258] CHIP:DMG: } + [1684166126.545634][29258:29258] CHIP:DMG: + [1684166126.545636][29258:29258] CHIP:DMG: Data = + [1684166126.545638][29258:29258] CHIP:DMG: { + [1684166126.545641][29258:29258] CHIP:DMG: 0x1 = 259, + [1684166126.545643][29258:29258] CHIP:DMG: 0x2 = 419, + [1684166126.545646][29258:29258] CHIP:DMG: }, + [1684166126.545647][29258:29258] CHIP:DMG: }, + [1684166126.545652][29258:29258] CHIP:DMG: + [1684166126.545654][29258:29258] CHIP:DMG: AttributeDataIB = + [1684166126.545656][29258:29258] CHIP:DMG: { + [1684166126.545658][29258:29258] CHIP:DMG: AttributePathIB = + [1684166126.545661][29258:29258] CHIP:DMG: { + [1684166126.545663][29258:29258] CHIP:DMG: Endpoint = 0x0, + [1684166126.545665][29258:29258] CHIP:DMG: Cluster = 0x3f, + [1684166126.545668][29258:29258] CHIP:DMG: Attribute = 0x0000_0000, + [1684166126.545671][29258:29258] CHIP:DMG: ListIndex = Null, + [1684166126.545675][29258:29258] CHIP:DMG: } + [1684166126.545677][29258:29258] CHIP:DMG: + [1684166126.545680][29258:29258] CHIP:DMG: Data = + [1684166126.545683][29258:29258] CHIP:DMG: { + [1684166126.545686][29258:29258] CHIP:DMG: 0x1 = 257, + [1684166126.545689][29258:29258] CHIP:DMG: 0x2 = 419, + [1684166126.545692][29258:29258] CHIP:DMG: }, + [1684166126.545694][29258:29258] CHIP:DMG: }, + [1684166126.545698][29258:29258] CHIP:DMG: + [1684166126.545700][29258:29258] CHIP:DMG: ], + [1684166126.545706][29258:29258] CHIP:DMG: + [1684166126.545708][29258:29258] CHIP:DMG: moreChunkedMessages = false, + [1684166126.545711][29258:29258] CHIP:DMG: InteractionModelRevision = 1 + [1684166126.545713][29258:29258] CHIP:DMG: }, + [1684166126.545732][29258:29258] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_003F e=0 p=m + disabled: true + + - label: + "DUT sends AddGroup Command to DUT on EP0 with the the following + settings GroupID: GroupID_1 GroupName: GroupName_1" + PICS: G.C.C00.Tx + verification: | + ./chip-tool groups add-group 259 'grp1' 1 1 + + Verify that AddGroup command with GroupID as 259 and group name as "grp1" is present on TH(Reference app)log: + [1684166282.551829][29258:29258] CHIP:DMG: InvokeRequestMessage = + [1684166282.551837][29258:29258] CHIP:DMG: { + [1684166282.551844][29258:29258] CHIP:DMG: suppressResponse = false, + [1684166282.551853][29258:29258] CHIP:DMG: timedRequest = false, + [1684166282.551859][29258:29258] CHIP:DMG: InvokeRequests = + [1684166282.551872][29258:29258] CHIP:DMG: [ + [1684166282.551879][29258:29258] CHIP:DMG: CommandDataIB = + [1684166282.551887][29258:29258] CHIP:DMG: { + [1684166282.551894][29258:29258] CHIP:DMG: CommandPathIB = + [1684166282.551903][29258:29258] CHIP:DMG: { + [1684166282.551912][29258:29258] CHIP:DMG: EndpointId = 0x1, + [1684166282.551920][29258:29258] CHIP:DMG: ClusterId = 0x4, + [1684166282.551928][29258:29258] CHIP:DMG: CommandId = 0x0, + [1684166282.551935][29258:29258] CHIP:DMG: }, + [1684166282.551944][29258:29258] CHIP:DMG: + [1684166282.551951][29258:29258] CHIP:DMG: CommandFields = + [1684166282.551960][29258:29258] CHIP:DMG: { + [1684166282.551970][29258:29258] CHIP:DMG: 0x0 = 259, + [1684166282.551980][29258:29258] CHIP:DMG: 0x1 = "grp1" (4 chars), + [1684166282.551989][29258:29258] CHIP:DMG: }, + [1684166282.551996][29258:29258] CHIP:DMG: }, + [1684166282.552007][29258:29258] CHIP:DMG: + [1684166282.552013][29258:29258] CHIP:DMG: ], + [1684166282.552024][29258:29258] CHIP:DMG: + [1684166282.552032][29258:29258] CHIP:DMG: InteractionModelRevision = 1 + [1684166282.552038][29258:29258] CHIP:DMG: }, + [1684166282.552074][29258:29258] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0004 e=1 p=m + [1684166282.552089][29258:29258] CHIP:DMG: AccessControl: allowed + [1684166282.552100][29258:29258] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0004 Command=0x0000_0000 disabled: true - label: - "DUT operator initiates transmission of multicast message to TH (by - interacting with DUT)" + "DUT generates fabric-unique GroupID, GroupName. Save the GroupID as + GroupID_2, GroupName as GroupName_2" verification: | - ./chip-tool groupsettings add-group grp1 0x0001 - - ./chip-tool groupsettings add-keysets 0x0042 0 0x000000000021dfe0 hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf - - ./chip-tool groupsettings bind-keyset 0x0001 0x0042 - - ./chip-tool groupsettings show-groups - - ./chip-tool identify identify 0x0078 0xffffffffffff0001 1 - - Verify Destination Node ID matches the GroupID on TH(Reference app)log : - - [1657785422.721911][2083:2083] CHIP:EM: Received Groupcast Message with GroupId of 1 - [1657785422.721988][2083:2083] CHIP:EM: Handling via exchange: 53995r, Delegate: 0xaaaac81b1430 - [1657785422.722098][2083:2083] CHIP:DMG: InvokeRequestMessage = - [1657785422.722161][2083:2083] CHIP:DMG: { - [1657785422.722220][2083:2083] CHIP:DMG: suppressResponse = false, - [1657785422.722317][2083:2083] CHIP:DMG: timedRequest = false, - [1657785422.722379][2083:2083] CHIP:DMG: InvokeRequests = - [1657785422.722475][2083:2083] CHIP:DMG: [ - [1657785422.722536][2083:2083] CHIP:DMG: CommandDataIB = - [1657785422.722636][2083:2083] CHIP:DMG: { - [1657785422.722726][2083:2083] CHIP:DMG: CommandPathIB = - [1657785422.722834][2083:2083] CHIP:DMG: { - [1657785422.722913][2083:2083] CHIP:DMG: ClusterId = 0x3, - [1657785422.723011][2083:2083] CHIP:DMG: CommandId = 0x0, - [1657785422.723095][2083:2083] CHIP:DMG: }, - [1657785422.723173][2083:2083] CHIP:DMG: - [1657785422.723242][2083:2083] CHIP:DMG: CommandFields = - [1657785422.723318][2083:2083] CHIP:DMG: { - [1657785422.723395][2083:2083] CHIP:DMG: 0x0 = 120, - [1657785422.723483][2083:2083] CHIP:DMG: }, - [1657785422.723555][2083:2083] CHIP:DMG: }, - [1657785422.723627][2083:2083] CHIP:DMG: - [1657785422.723685][2083:2083] CHIP:DMG: ], - [1657785422.723756][2083:2083] CHIP:DMG: - [1657785422.723814][2083:2083] CHIP:DMG: InteractionModelRevision = 1 - [1657785422.723872][2083:2083] CHIP:DMG: }, - [1657785422.723988][2083:2083] CHIP:DMG: Received group command for Group=1 Cluster=0x0000_0003 Command=0x0000_0000 - [1657785422.724688][2083:2083] CHIP:DMG: Processing group command for Endpoint=1 Cluster=0x0000_0003 Command=0x0000_0000 - [1657785422.724770][2083:2083] CHIP:DMG: AccessControl: checking f=1 a=g s=0xFFFFFFFFFFFF0001 t= c=0x0000_0003 e=1 p=m - [1657785422.724846][2083:2083] CHIP:DMG: AccessControl: allowed - [1657785422.724929][2083:2083] CHIP:DMG: Endpoint 1, Cluster 0x0000_0003 update version to 435c9140 - - - Verify the Multicast address follows the format "FF35:0040:FD00: and UDP port is 5540 on DUT(chip-tool)log - - <<< [E:15304i M:15000] (G) Msg TX to 1:FFFFFFFFFFFF0001 [D5AE] --- Type 0001:08 (IM:InvokeCommandRequest) - [1670395515.064662][14427:14429] CHIP:IN: (G) Sending msg 15000 to Multicast IPV6 address 'UDP:[ff35:40:fd00::100:1]:5540' - [1670395515.067533][14427:14429] CHIP:IN: Interface eth0 has a link local address + refer to log in step 3 + GroupID_2 = 257 + GroupName_2 = "grp2" + disabled: true + + - label: + "DUT sends a AddGroup Command to the Groups cluster with the GroupID + field set to GroupID_2 and the GroupName set to an GroupName_2. The + command is sent as a group command using GroupID_1" + verification: | + ./chip-tool groups add-group 257 '' 0xffffffffffff0103 1 + Verify that AddGroup command with GroupID as 257 and group name as "grp2" is generated as groupcast message from GroupID 259 is present on TH(Reference app)log: + 1684167429.420171][29723:29723] CHIP:EM: Received Groupcast Message with GroupId 0x0103 (259) + [1684167429.420179][29723:29723] CHIP:EM: Handling via exchange: 1950r, Delegate: 0x56422560dca8 + [1684166549.863617][29708:29710] CHIP:DMG: InvokeResponseMessage = + [1684166549.863619][29708:29710] CHIP:DMG: { + [1684166549.863621][29708:29710] CHIP:DMG: suppressResponse = false, + [1684166549.863623][29708:29710] CHIP:DMG: InvokeResponseIBs = + [1684166549.863627][29708:29710] CHIP:DMG: [ + [1684166549.863629][29708:29710] CHIP:DMG: InvokeResponseIB = + [1684166549.863632][29708:29710] CHIP:DMG: { + [1684166549.863634][29708:29710] CHIP:DMG: CommandDataIB = + [1684166549.863637][29708:29710] CHIP:DMG: { + [1684166549.863639][29708:29710] CHIP:DMG: CommandPathIB = + [1684166549.863641][29708:29710] CHIP:DMG: { + [1684166549.863644][29708:29710] CHIP:DMG: EndpointId = 0x1, + [1684166549.863646][29708:29710] CHIP:DMG: ClusterId = 0x4, + [1684166549.863649][29708:29710] CHIP:DMG: CommandId = 0x1, + [1684166549.863651][29708:29710] CHIP:DMG: }, + [1684166549.863653][29708:29710] CHIP:DMG: + [1684166549.863656][29708:29710] CHIP:DMG: CommandFields = + [1684166549.863658][29708:29710] CHIP:DMG: { + [1684166549.863661][29708:29710] CHIP:DMG: 0x0 = 0, + [1684166549.863664][29708:29710] CHIP:DMG: 0x1 = 257, + [1684166549.863667][29708:29710] CHIP:DMG: 0x2 = "grp2" (4 chars), + [1684166549.863669][29708:29710] CHIP:DMG: }, + [1684166549.863671][29708:29710] CHIP:DMG: }, + [1684166549.863674][29708:29710] CHIP:DMG: + [1684166549.863676][29708:29710] CHIP:DMG: }, + [1684166549.863679][29708:29710] CHIP:DMG: + [1684166549.863681][29708:29710] CHIP:DMG: ], + [1684166549.863685][29708:29710] CHIP:DMG: + [1684166549.863687][29708:29710] CHIP:DMG: InteractionModelRevision = 1 + [1684166549.863688][29708:29710] CHIP:DMG: }, + + [1684167429.420308][29723:29723] CHIP:DMG: Received group command for Group=259 Cluster=0x0000_0004 Command=0x0000_0000 + [1684167429.420390][29723:29723] CHIP:DMG: Processing group command for Endpoint=1 Cluster=0x0000_0004 Command=0x0000_0000 + [1684167429.420398][29723:29723] CHIP:DMG: AccessControl: checking f=1 a=g s=0xFFFFFFFFFFFF0103 t= c=0x0000_0004 e=1 p=m + [1684167429.420406][29723:29723] CHIP:DMG: AccessControl: allowed + + [1684167429.421010][29723:29723] CHIP:IN: Joining Multicast Group with address UDP:[ff35:40:fd00::100:101]:5540 + [1684167429.421129][29723:29723] CHIP:IN: Joined multicast group on interface wlp0s20f3 disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_SC_6_1.yaml b/src/app/tests/suites/certification/Test_TC_SC_6_1.yaml index bd8ba4c7e72f92..2e36ed9d956c2e 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_6_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_6_1.yaml @@ -14,7 +14,7 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 19.2.1. [TC-SC-6.1] Adding member to a group - DUT as Admin and TH as Group + 18.2.1. [TC-SC-6.1] Adding member to a group - DUT as Admin and TH as Group Member [DUT-Client] PICS: @@ -118,11 +118,7 @@ tests: and GroupKeySetID. Admin sets GroupKeySecurityPolicy = TrustFirst (0) EpochStartTime0 = 0" verification: | - ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": 42, - "groupKeySecurityPolicy": 0, "epochKey0": - "d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 2220000,"epochKey1": - "d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 2220001,"epochKey2": - "d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 2220002 }' 1 0 + disabled: true - label: @@ -130,6 +126,12 @@ tests: EP0" PICS: GRPKEY.C.C00.Tx verification: | + ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": 42, + "groupKeySecurityPolicy": 0, "epochKey0": + "d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 2220000,"epochKey1": + "d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 2220001,"epochKey2": + "d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 2220002 }' 1 0 + Verify TH recieves KeySetWrite command on TH(Reference app)log: [1651471040.120912][4012:4012] CHIP:EM: Received message of type 0x8 with protocolId (0, 1) and MessageCounter:2398599 on exchange 35559r diff --git a/src/app/tests/suites/credentials/TestHarnessDACProvider.cpp b/src/app/tests/suites/credentials/TestHarnessDACProvider.cpp index 50243e49dda5af..dd53e81178bb49 100644 --- a/src/app/tests/suites/credentials/TestHarnessDACProvider.cpp +++ b/src/app/tests/suites/credentials/TestHarnessDACProvider.cpp @@ -48,7 +48,7 @@ //-> dac_origin_vendor_id is not present //-> dac_origin_product_id is not present #if CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID == 0xFFF2 -constexpr const uint8_t kCdForAllExamples[541] = { +constexpr const uint8_t kCdForAllExamples[] = { 0x30, 0x82, 0x02, 0x19, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x02, 0x0a, 0x30, 0x82, 0x02, 0x06, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x82, 0x01, 0x70, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, 0x01, 0x61, 0x04, 0x82, 0x01, @@ -77,7 +77,7 @@ constexpr const uint8_t kCdForAllExamples[541] = { 0x96, 0x6c, 0x79, 0x4f, 0x1c, 0x4d, 0xd7, 0x5d, 0x15, 0x03, 0x24, 0xd8, 0xa5, 0xca, 0x82, 0x3d }; #elif CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID == 0xFFF3 -constexpr const uint8_t kCdForAllExamples[539] = { +constexpr const uint8_t kCdForAllExamples[] = { 0x30, 0x82, 0x02, 0x17, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x02, 0x08, 0x30, 0x82, 0x02, 0x04, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x82, 0x01, 0x70, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, 0x01, 0x61, 0x04, 0x82, 0x01, @@ -106,7 +106,7 @@ constexpr const uint8_t kCdForAllExamples[539] = { 0x98, 0x96, 0xc7, 0xc9, 0xc8, 0x2d, 0x4b, 0xf5, 0x76, 0xd3, 0x8f, 0xbd, 0x36, 0x5b }; #else /* Fall back to the VID=0xFFF1 CD */ -constexpr const uint8_t kCdForAllExamples[540] = { +constexpr const uint8_t kCdForAllExamples[] = { 0x30, 0x82, 0x02, 0x17, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x02, 0x08, 0x30, 0x82, 0x02, 0x04, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x82, 0x01, 0x70, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, 0x01, 0x61, 0x04, 0x82, 0x01, diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index d988b42b75c216..b7e47c41445dac 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -293,7 +293,7 @@ "Test_TC_BRBINFO_2_2", "Test_TC_BRBINFO_2_3" ], - "AccessControlEnforcement": ["Test_TC_ACE_1_2"], + "AccessControlEnforcement": ["Test_TC_ACE_1_2", "Test_TC_ACE_1_6"], "collection": [ "DeviceDiscovery", "Groups", diff --git a/src/controller/java/AndroidCommissioningWindowOpener.cpp b/src/controller/java/AndroidCommissioningWindowOpener.cpp index a1b9d88ffefa31..6679887444427d 100644 --- a/src/controller/java/AndroidCommissioningWindowOpener.cpp +++ b/src/controller/java/AndroidCommissioningWindowOpener.cpp @@ -121,8 +121,8 @@ void AndroidCommissioningWindowOpener::OnOpenCommissioningWindowResponse(void * std::string QRCode; std::string manualPairingCode; - SuccessOrExit(ManualSetupPayloadGenerator(payload).payloadDecimalStringRepresentation(manualPairingCode)); - SuccessOrExit(QRCodeSetupPayloadGenerator(payload).payloadBase38Representation(QRCode)); + SuccessOrExit(status = ManualSetupPayloadGenerator(payload).payloadDecimalStringRepresentation(manualPairingCode)); + SuccessOrExit(status = QRCodeSetupPayloadGenerator(payload).payloadBase38Representation(QRCode)); if (self->mOnSuccessMethod != nullptr) { diff --git a/src/controller/java/CHIPDeviceController-JNI.cpp b/src/controller/java/CHIPDeviceController-JNI.cpp index 297b22ac449bc0..fd87516e19dd0a 100644 --- a/src/controller/java/CHIPDeviceController-JNI.cpp +++ b/src/controller/java/CHIPDeviceController-JNI.cpp @@ -1605,7 +1605,7 @@ JNI_METHOD(void, write) VerifyOrExit(device != nullptr, err = CHIP_ERROR_INCORRECT_STATE); VerifyOrExit(device->GetSecureSession().HasValue(), err = CHIP_ERROR_MISSING_SECURE_SESSION); VerifyOrExit(attributeList != nullptr, err = CHIP_ERROR_INVALID_ARGUMENT); - SuccessOrExit(JniReferences::GetInstance().GetListSize(attributeList, listSize)); + SuccessOrExit(err = JniReferences::GetInstance().GetListSize(attributeList, listSize)); writeClient = Platform::New(device->GetExchangeManager(), callback->GetChunkedWriteCallback(), timedRequestTimeoutMs != 0 ? Optional(timedRequestTimeoutMs) @@ -1757,7 +1757,8 @@ JNI_METHOD(void, invoke) "()Lchip/devicecontroller/model/ChipPathId;", &getClusterIdMethod)); SuccessOrExit(err = JniReferences::GetInstance().FindMethod(env, invokeElement, "getCommandId", "()Lchip/devicecontroller/model/ChipPathId;", &getCommandIdMethod)); - SuccessOrExit(JniReferences::GetInstance().FindMethod(env, invokeElement, "getTlvByteArray", "()[B", &getTlvByteArrayMethod)); + SuccessOrExit( + err = JniReferences::GetInstance().FindMethod(env, invokeElement, "getTlvByteArray", "()[B", &getTlvByteArrayMethod)); endpointIdObj = env->CallObjectMethod(invokeElement, getEndpointIdMethod); VerifyOrExit(!env->ExceptionCheck(), err = CHIP_JNI_ERROR_EXCEPTION_THROWN); diff --git a/src/controller/python/chip/clusters/command.cpp b/src/controller/python/chip/clusters/command.cpp index 4dfc3fa8da2e00..468bff52d5f13d 100644 --- a/src/controller/python/chip/clusters/command.cpp +++ b/src/controller/python/chip/clusters/command.cpp @@ -153,7 +153,7 @@ PyChipError pychip_CommandSender_SendCommand(void * appContext, DeviceProxy * de VerifyOrExit(writer != nullptr, err = CHIP_ERROR_INCORRECT_STATE); reader.Init(payload, length); reader.Next(); - SuccessOrExit(writer->CopyContainer(TLV::ContextTag(CommandDataIB::Tag::kFields), reader)); + SuccessOrExit(err = writer->CopyContainer(TLV::ContextTag(CommandDataIB::Tag::kFields), reader)); } SuccessOrExit(err = sender->FinishCommand(timedRequestTimeoutMs != 0 ? Optional(timedRequestTimeoutMs) @@ -197,7 +197,7 @@ PyChipError pychip_CommandSender_SendGroupCommand(chip::GroupId groupId, chip::C VerifyOrExit(writer != nullptr, err = CHIP_ERROR_INCORRECT_STATE); reader.Init(payload, length); reader.Next(); - SuccessOrExit(writer->CopyContainer(TLV::ContextTag(CommandDataIB::Tag::kFields), reader)); + SuccessOrExit(err = writer->CopyContainer(TLV::ContextTag(CommandDataIB::Tag::kFields), reader)); } SuccessOrExit(err = sender->FinishCommand(Optional::Missing())); diff --git a/src/controller/python/chip/internal/CommissionerImpl.cpp b/src/controller/python/chip/internal/CommissionerImpl.cpp index c95bdaa7c12059..709202426755a5 100644 --- a/src/controller/python/chip/internal/CommissionerImpl.cpp +++ b/src/controller/python/chip/internal/CommissionerImpl.cpp @@ -183,17 +183,17 @@ extern "C" chip::Controller::DeviceCommissioner * pychip_internal_Commissioner_N commissionerParams.controllerICAC = icacSpan; commissionerParams.controllerNOC = nocSpan; - SuccessOrExit(DeviceControllerFactory::GetInstance().Init(factoryParams)); - err = DeviceControllerFactory::GetInstance().SetupCommissioner(commissionerParams, *result); + SuccessOrExit(err = DeviceControllerFactory::GetInstance().Init(factoryParams)); + SuccessOrExit(err = DeviceControllerFactory::GetInstance().SetupCommissioner(commissionerParams, *result)); - SuccessOrExit(result->GetCompressedFabricIdBytes(compressedFabricIdSpan)); + SuccessOrExit(err = result->GetCompressedFabricIdBytes(compressedFabricIdSpan)); ChipLogProgress(Support, "Setting up group data for Fabric Index %u with Compressed Fabric ID:", static_cast(result->GetFabricIndex())); ChipLogByteSpan(Support, compressedFabricIdSpan); defaultIpk = chip::GroupTesting::DefaultIpkValue::GetDefaultIpk(); - SuccessOrExit(chip::Credentials::SetSingleIpkEpochKey(&gGroupDataProvider, result->GetFabricIndex(), defaultIpk, - compressedFabricIdSpan)); + SuccessOrExit(err = chip::Credentials::SetSingleIpkEpochKey(&gGroupDataProvider, result->GetFabricIndex(), defaultIpk, + compressedFabricIdSpan)); } exit: ChipLogProgress(Controller, "Commissioner initialization status: %s", chip::ErrorStr(err)); diff --git a/src/credentials/attestation_verifier/DefaultDeviceAttestationVerifier.cpp b/src/credentials/attestation_verifier/DefaultDeviceAttestationVerifier.cpp index a57a45cc6e36a9..475feddb475163 100644 --- a/src/credentials/attestation_verifier/DefaultDeviceAttestationVerifier.cpp +++ b/src/credentials/attestation_verifier/DefaultDeviceAttestationVerifier.cpp @@ -72,14 +72,16 @@ static const ByteSpan kTestPaaRoots[] = { // 58u5L/VMiw== // -----END CERTIFICATE----- // -constexpr uint8_t gTestCdPubkeyBytes[65] = { 0x04, 0x3c, 0x39, 0x89, 0x22, 0x45, 0x2b, 0x55, 0xca, 0xf3, 0x89, 0xc2, 0x5b, - 0xd1, 0xbc, 0xa4, 0x65, 0x69, 0x52, 0xcc, 0xb9, 0x0e, 0x88, 0x69, 0x24, 0x9a, - 0xd8, 0x47, 0x46, 0x53, 0x01, 0x4c, 0xbf, 0x95, 0xd6, 0x87, 0x96, 0x5e, 0x03, - 0x6b, 0x52, 0x1c, 0x51, 0x03, 0x7e, 0x6b, 0x8c, 0xed, 0xef, 0xca, 0x1e, 0xb4, - 0x40, 0x46, 0x69, 0x4f, 0xa0, 0x88, 0x82, 0xee, 0xd6, 0x51, 0x9d, 0xec, 0xba }; +constexpr uint8_t gTestCdPubkeyBytes[] = { + 0x04, 0x3c, 0x39, 0x89, 0x22, 0x45, 0x2b, 0x55, 0xca, 0xf3, 0x89, 0xc2, 0x5b, 0xd1, 0xbc, 0xa4, 0x65, + 0x69, 0x52, 0xcc, 0xb9, 0x0e, 0x88, 0x69, 0x24, 0x9a, 0xd8, 0x47, 0x46, 0x53, 0x01, 0x4c, 0xbf, 0x95, + 0xd6, 0x87, 0x96, 0x5e, 0x03, 0x6b, 0x52, 0x1c, 0x51, 0x03, 0x7e, 0x6b, 0x8c, 0xed, 0xef, 0xca, 0x1e, + 0xb4, 0x40, 0x46, 0x69, 0x4f, 0xa0, 0x88, 0x82, 0xee, 0xd6, 0x51, 0x9d, 0xec, 0xba, +}; -constexpr uint8_t gTestCdPubkeyKid[20] = { 0x62, 0xfa, 0x82, 0x33, 0x59, 0xac, 0xfa, 0xa9, 0x96, 0x3e, - 0x1c, 0xfa, 0x14, 0x0a, 0xdd, 0xf5, 0x04, 0xf3, 0x71, 0x60 }; +constexpr uint8_t gTestCdPubkeyKid[] = { + 0x62, 0xfa, 0x82, 0x33, 0x59, 0xac, 0xfa, 0xa9, 0x96, 0x3e, 0x1c, 0xfa, 0x14, 0x0a, 0xdd, 0xf5, 0x04, 0xf3, 0x71, 0x60, +}; // Official CSA "Matter Certification and Testing CA" // @@ -97,7 +99,7 @@ constexpr uint8_t gTestCdPubkeyKid[20] = { 0x62, 0xfa, 0x82, 0x33, 0x59, 0xac, 0 // +mQCIQDvvDCKi7kvj4R4BoFS4BVZGCk4zJ84W4tfTTfu89lRbQ== // -----END CERTIFICATE----- // -constexpr uint8_t gCdRootCert[517] = { +constexpr uint8_t gCdRootCert[] = { 0x30, 0x82, 0x02, 0x01, 0x30, 0x82, 0x01, 0xa7, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x07, 0x63, 0x73, 0x61, 0x72, 0x6f, 0x6f, 0x74, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x52, 0x31, 0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x03, 0x43, 0x53, 0x41, 0x31, 0x2c, 0x30, 0x2a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x23, 0x4d, 0x61, @@ -141,15 +143,16 @@ constexpr uint8_t gCdRootCert[517] = { // 6GrOQ3/zXBsCIQDxorh2RXSaI8m2RCcoWaiWa0nLzQepNm3C2jrQVJmC2Q== // -----END CERTIFICATE----- // -constexpr uint8_t gCdSigningKey001PubkeyBytes[65] = { +constexpr uint8_t gCdSigningKey001PubkeyBytes[] = { 0x04, 0xcd, 0xee, 0xe9, 0x3e, 0x44, 0xf8, 0xb7, 0x2b, 0xe3, 0xd1, 0xa9, 0xc0, 0x7e, 0x21, 0x96, 0x8b, 0x9a, 0xff, 0xf3, 0xb4, 0x03, 0xf0, 0x5e, 0x16, 0x69, 0xd7, 0xb1, 0xe5, 0xca, 0xee, 0x6f, 0xc7, 0x71, 0x4b, 0x42, 0xe7, 0xe2, 0x36, 0x95, 0xe9, 0x2c, 0xd7, 0x63, 0x54, 0x73, 0xa2, 0x80, 0xae, 0x68, 0x8f, - 0x37, 0xbb, 0x94, 0x89, 0xe1, 0x16, 0x29, 0xb9, 0xb9, 0x4f, 0xf7, 0xb0, 0x99, 0x29 + 0x37, 0xbb, 0x94, 0x89, 0xe1, 0x16, 0x29, 0xb9, 0xb9, 0x4f, 0xf7, 0xb0, 0x99, 0x29, }; -constexpr uint8_t gCdSigningKey001Kid[20] = { 0xFE, 0x34, 0x3F, 0x95, 0x99, 0x47, 0x76, 0x3B, 0x61, 0xEE, - 0x45, 0x39, 0x13, 0x13, 0x38, 0x49, 0x4F, 0xE6, 0x7D, 0x8E }; +constexpr uint8_t gCdSigningKey001Kid[] = { + 0xFE, 0x34, 0x3F, 0x95, 0x99, 0x47, 0x76, 0x3B, 0x61, 0xEE, 0x45, 0x39, 0x13, 0x13, 0x38, 0x49, 0x4F, 0xE6, 0x7D, 0x8E, +}; // Official CD "Signing Key 002" // @@ -167,15 +170,16 @@ constexpr uint8_t gCdSigningKey001Kid[20] = { 0xFE, 0x34, 0x3F, 0x95, 0x99, 0x47 // h0Qfx304Tb92AiEAk+jnf2qtyfKyTEHpT3Xf3bfekqUOA+8ikB1yjL5oTsI= // -----END CERTIFICATE----- // -constexpr uint8_t gCdSigningKey002PubkeyBytes[65] = { +constexpr uint8_t gCdSigningKey002PubkeyBytes[] = { 0x04, 0x03, 0x19, 0x37, 0xe8, 0xf9, 0x42, 0x51, 0x04, 0x5d, 0xf2, 0x74, 0x57, 0xbb, 0x46, 0x25, 0x3e, 0xe3, 0x75, 0x4e, 0x8c, 0x12, 0xae, 0x28, 0x55, 0x7d, 0x80, 0x27, 0xb9, 0xd4, 0xc3, 0x56, 0xd9, 0x1b, 0x40, 0x8c, 0xff, 0x32, 0x27, 0x50, 0x17, 0xb2, 0x5f, 0x8c, 0x8b, 0xa2, 0x05, 0x16, 0xd5, 0xc8, 0x3a, - 0xf2, 0xb7, 0x24, 0x12, 0x80, 0x13, 0xdf, 0xcc, 0x8f, 0x95, 0xd2, 0x00, 0xa9, 0x0b + 0xf2, 0xb7, 0x24, 0x12, 0x80, 0x13, 0xdf, 0xcc, 0x8f, 0x95, 0xd2, 0x00, 0xa9, 0x0b, }; -constexpr uint8_t gCdSigningKey002Kid[20] = { 0xDD, 0x04, 0xDB, 0x58, 0x5B, 0x21, 0x4C, 0x1C, 0x58, 0x15, - 0x87, 0xE6, 0x56, 0x8D, 0xF4, 0x87, 0xB6, 0xDD, 0xC7, 0x01 }; +constexpr uint8_t gCdSigningKey002Kid[] = { + 0xDD, 0x04, 0xDB, 0x58, 0x5B, 0x21, 0x4C, 0x1C, 0x58, 0x15, 0x87, 0xE6, 0x56, 0x8D, 0xF4, 0x87, 0xB6, 0xDD, 0xC7, 0x01, +}; // Official CD "Signing Key 003" // @@ -193,15 +197,16 @@ constexpr uint8_t gCdSigningKey002Kid[20] = { 0xDD, 0x04, 0xDB, 0x58, 0x5B, 0x21 // AqqtZ/w7AkQCIHiVlYTaCnJsnW5/cvj9GfIv7Eb0cjdmcAkrYGbnPQzX // -----END CERTIFICATE----- // -constexpr uint8_t gCdSigningKey003PubkeyBytes[65] = { +constexpr uint8_t gCdSigningKey003PubkeyBytes[] = { 0x04, 0x9f, 0x57, 0x5c, 0xd5, 0xfd, 0xb7, 0x52, 0x1f, 0x10, 0xa4, 0xdf, 0x31, 0xf0, 0x73, 0x91, 0x2b, 0x61, 0x47, 0x28, 0xf2, 0xd3, 0x7f, 0x5b, 0x6b, 0x96, 0xbc, 0x2c, 0xbf, 0x7c, 0x0b, 0x11, 0x96, 0x90, 0x57, 0x7d, 0x55, 0x5d, 0x21, 0xa0, 0x96, 0x60, 0xa8, 0xb0, 0x82, 0xa3, 0x39, 0xea, 0x53, 0x0f, 0x7a, - 0x81, 0x2d, 0x86, 0x93, 0xb5, 0x6f, 0xd7, 0x64, 0x18, 0x5f, 0xab, 0xcd, 0x32, 0xf5 + 0x81, 0x2d, 0x86, 0x93, 0xb5, 0x6f, 0xd7, 0x64, 0x18, 0x5f, 0xab, 0xcd, 0x32, 0xf5, }; -constexpr uint8_t gCdSigningKey003Kid[20] = { 0x47, 0x10, 0x35, 0xE7, 0xC0, 0x4E, 0xAA, 0xA8, 0xBE, 0x7C, - 0x4D, 0x4C, 0x13, 0xE3, 0xE4, 0xC2, 0x09, 0x95, 0xA8, 0x4B }; +constexpr uint8_t gCdSigningKey003Kid[] = { + 0x47, 0x10, 0x35, 0xE7, 0xC0, 0x4E, 0xAA, 0xA8, 0xBE, 0x7C, 0x4D, 0x4C, 0x13, 0xE3, 0xE4, 0xC2, 0x09, 0x95, 0xA8, 0x4B, +}; // Official CD "Signing Key 004" // @@ -219,15 +224,16 @@ constexpr uint8_t gCdSigningKey003Kid[20] = { 0x47, 0x10, 0x35, 0xE7, 0xC0, 0x4E // HbLbW5t6PY4CIE8oyIHsVhNSTPcb3mwRp+Vxhs8tKhbAdwv5BGgDaAHj // -----END CERTIFICATE----- // -constexpr uint8_t gCdSigningKey004PubkeyBytes[65] = { +constexpr uint8_t gCdSigningKey004PubkeyBytes[] = { 0x04, 0x7c, 0xfc, 0x8d, 0x88, 0x10, 0xa8, 0x9c, 0xf4, 0xfa, 0x19, 0x17, 0x78, 0xf2, 0xaf, 0xec, 0x78, 0xf8, 0x51, 0x7a, 0x97, 0xa3, 0xe5, 0x7f, 0xc2, 0x13, 0xba, 0xd8, 0x88, 0xe3, 0x61, 0x1e, 0x74, 0xff, 0xb6, 0x84, 0xbd, 0xeb, 0xa8, 0xa6, 0x8b, 0x25, 0x23, 0x4a, 0x5c, 0x35, 0x8f, 0x37, 0x3b, 0xab, 0x9b, - 0x6d, 0x30, 0x4e, 0x13, 0x06, 0xdd, 0x76, 0x20, 0xa5, 0x28, 0xd1, 0x16, 0x1c, 0x0b + 0x6d, 0x30, 0x4e, 0x13, 0x06, 0xdd, 0x76, 0x20, 0xa5, 0x28, 0xd1, 0x16, 0x1c, 0x0b, }; -constexpr uint8_t gCdSigningKey004Kid[20] = { 0xF6, 0x86, 0x03, 0xA3, 0x69, 0x2E, 0x98, 0x10, 0x72, 0x41, - 0x9E, 0xA1, 0xE1, 0xAB, 0x38, 0x54, 0xBD, 0x77, 0x95, 0xD3 }; +constexpr uint8_t gCdSigningKey004Kid[] = { + 0xF6, 0x86, 0x03, 0xA3, 0x69, 0x2E, 0x98, 0x10, 0x72, 0x41, 0x9E, 0xA1, 0xE1, 0xAB, 0x38, 0x54, 0xBD, 0x77, 0x95, 0xD3, +}; // Official CD "Signing Key 005" // @@ -245,15 +251,16 @@ constexpr uint8_t gCdSigningKey004Kid[20] = { 0xF6, 0x86, 0x03, 0xA3, 0x69, 0x2E // AViq7c/mtzEAAiBZO0lVe6Qo9iQPIBWZaVx/S/YSNO9uKNa/pvFu3V+nIg== // -----END CERTIFICATE----- // -constexpr uint8_t gCdSigningKey005PubkeyBytes[65] = { +constexpr uint8_t gCdSigningKey005PubkeyBytes[] = { 0x04, 0x43, 0x8a, 0x52, 0xc6, 0x62, 0xa2, 0xa6, 0xd7, 0x26, 0x47, 0xf9, 0x5e, 0xb7, 0x53, 0x13, 0x6e, 0xe4, 0xae, 0x0f, 0xdb, 0x3a, 0xa9, 0xc1, 0x69, 0x31, 0x42, 0x6b, 0x3d, 0x08, 0x67, 0xf9, 0x10, 0x3a, 0xe7, 0xd7, 0xa1, 0xb8, 0x87, 0xe9, 0xf8, 0x13, 0xa6, 0xf2, 0x6f, 0x76, 0xbb, 0xcd, 0xa9, 0x35, 0x93, - 0x78, 0x7c, 0x12, 0x77, 0x8c, 0xa8, 0xf2, 0x97, 0x5d, 0xc4, 0x5a, 0x20, 0x42, 0xf9 + 0x78, 0x7c, 0x12, 0x77, 0x8c, 0xa8, 0xf2, 0x97, 0x5d, 0xc4, 0x5a, 0x20, 0x42, 0xf9, }; -constexpr uint8_t gCdSigningKey005Kid[20] = { 0x63, 0x7F, 0x26, 0x34, 0xAD, 0x62, 0xEA, 0xFE, 0x6A, 0xF6, - 0x62, 0xEF, 0xB9, 0x6F, 0x6F, 0xD2, 0xFC, 0xBF, 0xFC, 0x2F }; +constexpr uint8_t gCdSigningKey005Kid[] = { + 0x63, 0x7F, 0x26, 0x34, 0xAD, 0x62, 0xEA, 0xFE, 0x6A, 0xF6, 0x62, 0xEF, 0xB9, 0x6F, 0x6F, 0xD2, 0xFC, 0xBF, 0xFC, 0x2F, +}; struct MatterCDSigningKey { diff --git a/src/credentials/examples/DeviceAttestationCredsExample.cpp b/src/credentials/examples/DeviceAttestationCredsExample.cpp index f7a80162e2aaaa..a487dcef1926f9 100644 --- a/src/credentials/examples/DeviceAttestationCredsExample.cpp +++ b/src/credentials/examples/DeviceAttestationCredsExample.cpp @@ -81,7 +81,7 @@ CHIP_ERROR ExampleDACProvider::GetCertificationDeclaration(MutableByteSpan & out //-> dac_origin_vendor_id is not present //-> dac_origin_product_id is not present #if CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID == 0xFFF2 - const uint8_t kCdForAllExamples[541] = { + const uint8_t kCdForAllExamples[] = { 0x30, 0x82, 0x02, 0x19, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x02, 0x0a, 0x30, 0x82, 0x02, 0x06, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x82, 0x01, 0x70, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, 0x01, 0x61, @@ -112,7 +112,7 @@ CHIP_ERROR ExampleDACProvider::GetCertificationDeclaration(MutableByteSpan & out 0x3d }; #elif CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID == 0xFFF3 - const uint8_t kCdForAllExamples[539] = { + const uint8_t kCdForAllExamples[] = { 0x30, 0x82, 0x02, 0x17, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x02, 0x08, 0x30, 0x82, 0x02, 0x04, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x82, 0x01, 0x70, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, 0x01, 0x61, @@ -142,7 +142,7 @@ CHIP_ERROR ExampleDACProvider::GetCertificationDeclaration(MutableByteSpan & out 0xa7, 0x51, 0x79, 0x9c, 0x02, 0x98, 0x96, 0xc7, 0xc9, 0xc8, 0x2d, 0x4b, 0xf5, 0x76, 0xd3, 0x8f, 0xbd, 0x36, 0x5b }; #else /* Fall back to the VID=0xFFF1 CD */ - const uint8_t kCdForAllExamples[539] = { + const uint8_t kCdForAllExamples[] = { 0x30, 0x82, 0x02, 0x17, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x02, 0x08, 0x30, 0x82, 0x02, 0x04, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x82, 0x01, 0x70, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, 0x01, 0x61, diff --git a/src/credentials/tests/CHIPCert_error_test_vectors.cpp b/src/credentials/tests/CHIPCert_error_test_vectors.cpp index aed0b271195416..ca2b752d1731d2 100644 --- a/src/credentials/tests/CHIPCert_error_test_vectors.cpp +++ b/src/credentials/tests/CHIPCert_error_test_vectors.cpp @@ -20,7 +20,7 @@ namespace chip { namespace TestCerts { -const ByteSpan gTestCert_X509ToChip_ErrorCases[50] = { +const ByteSpan gTestCert_X509ToChip_ErrorCases[] = { ByteSpan(sChipTest_NOC_Oversized_Cert_DER), ByteSpan(sChipTest_ICAC_Oversized_Cert_DER), ByteSpan(sChipTest_RCAC_Oversized_Cert_DER), @@ -73,7 +73,7 @@ const ByteSpan gTestCert_X509ToChip_ErrorCases[50] = { ByteSpan(sChipTest_RCAC_Ext_SKID_Length_Invalid_Cert_DER), }; -const ByteSpan gTestCert_ChipToX509_ErrorCases[43] = { +const ByteSpan gTestCert_ChipToX509_ErrorCases[] = { ByteSpan(sChipTest_NOC_Oversized_Cert_CHIP), ByteSpan(sChipTest_ICAC_Oversized_Cert_CHIP), ByteSpan(sChipTest_RCAC_Oversized_Cert_CHIP), @@ -119,7 +119,7 @@ const ByteSpan gTestCert_ChipToX509_ErrorCases[43] = { ByteSpan(sChipTest_RCAC_Ext_SKID_Length_Invalid_Cert_CHIP), }; -const ByteSpan gTestCert_ChipCertLoad_ErrorCases[40] = { +const ByteSpan gTestCert_ChipCertLoad_ErrorCases[] = { ByteSpan(sChipTest_NOC_Serial_Number_Missing_Cert_CHIP), ByteSpan(sChipTest_ICAC_Serial_Number_Missing_Cert_CHIP), ByteSpan(sChipTest_RCAC_Serial_Number_Missing_Cert_CHIP), @@ -162,7 +162,7 @@ const ByteSpan gTestCert_ChipCertLoad_ErrorCases[40] = { ByteSpan(sChipTest_RCAC_Ext_SKID_Length_Invalid_Cert_CHIP), }; -const ByteSpan gTestCert_ValidateChipRCAC_ErrorCases[84] = { +const ByteSpan gTestCert_ValidateChipRCAC_ErrorCases[] = { ByteSpan(sChipTest_NOC_Oversized_Cert_CHIP), ByteSpan(sChipTest_ICAC_Oversized_Cert_CHIP), ByteSpan(sChipTest_RCAC_Oversized_Cert_CHIP), @@ -249,7 +249,7 @@ const ByteSpan gTestCert_ValidateChipRCAC_ErrorCases[84] = { ByteSpan(sChipTest_RCAC_Signature_Wrong_Cert_CHIP), }; -const ByteSpan gTestCert_GetCertType_ErrorCases[12] = { +const ByteSpan gTestCert_GetCertType_ErrorCases[] = { ByteSpan(sChipTest_NOC_Subject_MatterId_Missing_Cert_CHIP), ByteSpan(sChipTest_ICAC_Subject_MatterId_Missing_Cert_CHIP), ByteSpan(sChipTest_RCAC_Subject_MatterId_Missing_Cert_CHIP), ByteSpan(sChipTest_NOC_Subject_MatterId_Twice_Cert_CHIP), ByteSpan(sChipTest_ICAC_Subject_MatterId_Twice_Cert_CHIP), ByteSpan(sChipTest_RCAC_Subject_MatterId_Twice_Cert_CHIP), @@ -258,7 +258,7 @@ const ByteSpan gTestCert_GetCertType_ErrorCases[12] = { ByteSpan(sChipTest_ICAC_Subject_CAT_Twice_Cert_CHIP), ByteSpan(sChipTest_RCAC_Subject_CAT_Twice_Cert_CHIP), }; -const uint8_t sChipTest_NOC_Oversized_Cert_DER[744] = { +const uint8_t sChipTest_NOC_Oversized_Cert_DER[] = { 0x30, 0x82, 0x02, 0xe4, 0x30, 0x82, 0x02, 0x8b, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x03, 0x2b, 0x62, 0x5a, 0x6f, 0x49, 0x0f, 0xe1, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -296,7 +296,7 @@ const uint8_t sChipTest_NOC_Oversized_Cert_DER[744] = { 0x62, 0x18, 0x94, 0xfc, 0x47, 0x82, 0xca, 0x18, 0xdf, 0xc2, 0x8d, 0xd8, 0x61, 0xba, 0x6a, 0x4a, 0x2b, 0xa7, 0x9f, 0x66, 0x0d, 0xb1, 0x00, 0x15, 0x0d, 0xb0, 0xc1, 0xa0, 0xa7, 0x1a, }; -const uint8_t sChipTest_ICAC_Oversized_Cert_DER[678] = { +const uint8_t sChipTest_ICAC_Oversized_Cert_DER[] = { 0x30, 0x82, 0x02, 0xa2, 0x30, 0x82, 0x02, 0x48, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x29, 0x09, 0x70, 0x4f, 0xea, 0xbd, 0x5a, 0xfd, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -331,7 +331,7 @@ const uint8_t sChipTest_ICAC_Oversized_Cert_DER[678] = { 0xf1, 0xa2, 0x48, 0xb6, 0xa6, 0x34, 0x7f, 0x6e, 0x07, 0x3d, 0x2a, 0x6d, 0x7f, 0x0d, 0x41, 0xff, 0x9d, 0x08, 0x22, 0x6b, 0x55, 0xf9, 0x55, 0x19, 0x27, 0x1d, 0x5a, }; -const uint8_t sChipTest_RCAC_Oversized_Cert_DER[871] = { +const uint8_t sChipTest_RCAC_Oversized_Cert_DER[] = { 0x30, 0x82, 0x03, 0x63, 0x30, 0x82, 0x03, 0x09, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x5c, 0x9f, 0xab, 0x78, 0x4b, 0x2b, 0x96, 0x98, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x82, 0x01, 0x03, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -375,7 +375,7 @@ const uint8_t sChipTest_RCAC_Oversized_Cert_DER[871] = { 0x3a, 0x24, 0x86, 0x84, 0x86, 0xeb, 0xd9, 0xe1, 0xf8, 0x30, 0x00, 0x01, 0x7b, 0x4f, 0xe7, 0xac, 0x7b, 0xe0, 0x36, 0x25, 0x5e, 0xe2, 0xd6, 0x8a, 0xa2, 0x66, 0xa1, 0xe2, 0x0a, 0x16, 0xe6, }; -const uint8_t sChipTest_NOC_Cert_Version_V2_Cert_DER[519] = { +const uint8_t sChipTest_NOC_Cert_Version_V2_Cert_DER[] = { 0x30, 0x82, 0x02, 0x03, 0x30, 0x82, 0x01, 0xa8, 0xa0, 0x03, 0x02, 0x01, 0x01, 0x02, 0x08, 0x76, 0xe7, 0x4a, 0xc0, 0xd7, 0x71, 0xa1, 0x53, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -402,7 +402,7 @@ const uint8_t sChipTest_NOC_Cert_Version_V2_Cert_DER[519] = { 0x19, 0x02, 0x21, 0x00, 0xea, 0xb6, 0xe7, 0xa5, 0x80, 0x07, 0x00, 0xd5, 0x18, 0x02, 0x8b, 0xa1, 0x4a, 0x6d, 0xcd, 0x90, 0x41, 0x92, 0xba, 0x2e, 0xa4, 0x1c, 0xc8, 0x51, 0x09, 0x7e, 0x40, 0xc3, 0xd2, 0xe9, 0xe7, 0x89, }; -const uint8_t sChipTest_ICAC_Cert_Version_V2_Cert_DER[451] = { +const uint8_t sChipTest_ICAC_Cert_Version_V2_Cert_DER[] = { 0x30, 0x82, 0x01, 0xbf, 0x30, 0x82, 0x01, 0x65, 0xa0, 0x03, 0x02, 0x01, 0x01, 0x02, 0x08, 0x51, 0x33, 0x8b, 0x3d, 0xbe, 0x61, 0xe8, 0x79, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -426,7 +426,7 @@ const uint8_t sChipTest_ICAC_Cert_Version_V2_Cert_DER[451] = { 0x56, 0x0f, 0x04, 0xab, 0xc0, 0x96, 0xcc, 0x30, 0x1b, 0xfe, 0x5f, 0x40, 0xae, 0xdb, 0x03, 0x71, 0x08, 0x34, 0xda, 0xb8, 0xc9, 0x8f, 0x3a, 0xf2, 0x2b, 0xec, 0x65, 0xc6, 0xf3, 0x33, 0xaa, }; -const uint8_t sChipTest_RCAC_Cert_Version_V2_Cert_DER[416] = { +const uint8_t sChipTest_RCAC_Cert_Version_V2_Cert_DER[] = { 0x30, 0x82, 0x01, 0x9c, 0x30, 0x82, 0x01, 0x43, 0xa0, 0x03, 0x02, 0x01, 0x01, 0x02, 0x08, 0x7f, 0xf0, 0x89, 0x5d, 0x12, 0xf3, 0xbf, 0x04, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -448,7 +448,7 @@ const uint8_t sChipTest_RCAC_Cert_Version_V2_Cert_DER[416] = { 0x88, 0x66, 0xf0, 0x82, 0x02, 0x20, 0x44, 0x84, 0x6e, 0x9e, 0x31, 0xc7, 0x32, 0x2f, 0xdf, 0x2e, 0x59, 0xe6, 0x09, 0x41, 0x03, 0x55, 0x2f, 0x48, 0x46, 0xdb, 0xeb, 0xcd, 0x8f, 0xc6, 0xe1, 0xc1, 0x04, 0xa3, 0x19, 0x5d, 0xf5, 0x0d, }; -const uint8_t sChipTest_NOC_Sig_Algo_ECDSA_With_SHA1_Cert_DER[517] = { +const uint8_t sChipTest_NOC_Sig_Algo_ECDSA_With_SHA1_Cert_DER[] = { 0x30, 0x82, 0x02, 0x01, 0x30, 0x82, 0x01, 0xa7, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x7a, 0x6d, 0x34, 0xc7, 0xd9, 0x17, 0xfa, 0x58, 0x30, 0x09, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x01, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, @@ -475,7 +475,7 @@ const uint8_t sChipTest_NOC_Sig_Algo_ECDSA_With_SHA1_Cert_DER[517] = { 0x21, 0x00, 0xef, 0x45, 0xe8, 0xe1, 0xe3, 0x1a, 0x81, 0x67, 0x9a, 0xf3, 0x83, 0x17, 0xd0, 0x1f, 0xd0, 0x66, 0xa7, 0x09, 0x30, 0x31, 0x96, 0x7c, 0x24, 0x50, 0x6d, 0x14, 0x8c, 0xb0, 0x14, 0x94, 0x09, 0x95, }; -const uint8_t sChipTest_ICAC_Sig_Algo_ECDSA_With_SHA1_Cert_DER[448] = { +const uint8_t sChipTest_ICAC_Sig_Algo_ECDSA_With_SHA1_Cert_DER[] = { 0x30, 0x82, 0x01, 0xbc, 0x30, 0x82, 0x01, 0x64, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x12, 0x9c, 0xc3, 0x5f, 0x07, 0x99, 0x6e, 0xc8, 0x30, 0x09, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x01, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, @@ -499,7 +499,7 @@ const uint8_t sChipTest_ICAC_Sig_Algo_ECDSA_With_SHA1_Cert_DER[448] = { 0x5c, 0xd2, 0x80, 0xf7, 0xea, 0xa1, 0x5f, 0x83, 0x9b, 0x79, 0x77, 0xd0, 0x8b, 0x4d, 0x4e, 0x6e, 0xc3, 0x79, 0xd9, 0x02, 0x7c, 0xdf, 0xdd, 0xf7, 0xe2, 0xc4, 0x09, 0xbf, }; -const uint8_t sChipTest_RCAC_Sig_Algo_ECDSA_With_SHA1_Cert_DER[414] = { +const uint8_t sChipTest_RCAC_Sig_Algo_ECDSA_With_SHA1_Cert_DER[] = { 0x30, 0x82, 0x01, 0x9a, 0x30, 0x82, 0x01, 0x42, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x03, 0x3c, 0xc8, 0x89, 0xd7, 0xa4, 0x02, 0x55, 0x30, 0x09, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x01, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x30, @@ -521,7 +521,7 @@ const uint8_t sChipTest_RCAC_Sig_Algo_ECDSA_With_SHA1_Cert_DER[414] = { 0x35, 0x0b, 0x02, 0x20, 0x76, 0xc8, 0xfe, 0x24, 0x6f, 0xc5, 0x1f, 0x27, 0x77, 0x23, 0x00, 0x93, 0x72, 0xb4, 0x2b, 0x46, 0xca, 0xfa, 0x47, 0x90, 0x0c, 0xdb, 0xd2, 0x23, 0x8a, 0x01, 0x1b, 0xb5, 0xed, 0x61, 0xb7, 0x1d, }; -const uint8_t sChipTest_NOC_Validity_Not_Before_Missing_Cert_DER[505] = { +const uint8_t sChipTest_NOC_Validity_Not_Before_Missing_Cert_DER[] = { 0x30, 0x82, 0x01, 0xf5, 0x30, 0x82, 0x01, 0x9b, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x07, 0x7c, 0x49, 0xae, 0xb5, 0x1d, 0xd2, 0x9d, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -548,7 +548,7 @@ const uint8_t sChipTest_NOC_Validity_Not_Before_Missing_Cert_DER[505] = { 0xa6, 0x82, 0x29, 0x67, 0x12, 0xcc, 0xf4, 0xd5, 0x45, 0x6c, 0x45, 0x29, 0x4c, 0xed, 0xc6, 0x9d, 0x7c, 0xa5, 0xa0, 0x7b, 0xa7, 0x0a, }; -const uint8_t sChipTest_ICAC_Validity_Not_Before_Missing_Cert_DER[439] = { +const uint8_t sChipTest_ICAC_Validity_Not_Before_Missing_Cert_DER[] = { 0x30, 0x82, 0x01, 0xb3, 0x30, 0x82, 0x01, 0x58, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x78, 0x68, 0xde, 0xa3, 0xa2, 0x27, 0x1a, 0x68, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -571,7 +571,7 @@ const uint8_t sChipTest_ICAC_Validity_Not_Before_Missing_Cert_DER[439] = { 0x2e, 0x5f, 0xc1, 0xd8, 0x87, 0x02, 0x21, 0x00, 0xf9, 0x8f, 0xe5, 0x47, 0xa2, 0x00, 0x9f, 0x98, 0x37, 0x44, 0x57, 0xe6, 0x08, 0x21, 0x01, 0xa2, 0xf3, 0xc1, 0x41, 0x01, 0xbf, 0x85, 0x02, 0x89, 0x35, 0xee, 0x40, 0xb5, 0x2b, 0x16, 0x2c, 0x8c, }; -const uint8_t sChipTest_RCAC_Validity_Not_Before_Missing_Cert_DER[404] = { +const uint8_t sChipTest_RCAC_Validity_Not_Before_Missing_Cert_DER[] = { 0x30, 0x82, 0x01, 0x90, 0x30, 0x82, 0x01, 0x36, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x73, 0xf6, 0x4b, 0x8f, 0x06, 0x4c, 0x3c, 0x68, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -593,7 +593,7 @@ const uint8_t sChipTest_RCAC_Validity_Not_Before_Missing_Cert_DER[404] = { 0x11, 0xad, 0x41, 0x17, 0xcb, 0x19, 0xd2, 0xcc, 0x6d, 0xc6, 0x3e, 0xd6, 0x87, 0x4f, 0x2f, 0x7d, 0x53, 0x7d, 0x5c, 0xd7, 0x5e, 0xa7, 0xf1, 0xe1, 0x74, 0xc2, }; -const uint8_t sChipTest_NOC_Validity_Not_After_Missing_Cert_DER[506] = { +const uint8_t sChipTest_NOC_Validity_Not_After_Missing_Cert_DER[] = { 0x30, 0x82, 0x01, 0xf6, 0x30, 0x82, 0x01, 0x9b, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x1e, 0xb7, 0xb3, 0x65, 0x04, 0x23, 0x1c, 0x61, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -620,7 +620,7 @@ const uint8_t sChipTest_NOC_Validity_Not_After_Missing_Cert_DER[506] = { 0xe5, 0xbc, 0x9b, 0x96, 0xcb, 0xd9, 0xf8, 0x3b, 0xc4, 0x17, 0x81, 0x48, 0xe7, 0x23, 0xf5, 0xe1, 0x8c, 0x27, 0x75, 0x12, 0x57, 0x49, 0xe5, }; -const uint8_t sChipTest_ICAC_Validity_Not_After_Missing_Cert_DER[439] = { +const uint8_t sChipTest_ICAC_Validity_Not_After_Missing_Cert_DER[] = { 0x30, 0x82, 0x01, 0xb3, 0x30, 0x82, 0x01, 0x58, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x0e, 0x1f, 0x6a, 0x42, 0xe0, 0x60, 0x2c, 0x89, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -643,7 +643,7 @@ const uint8_t sChipTest_ICAC_Validity_Not_After_Missing_Cert_DER[439] = { 0xc3, 0xd8, 0x0d, 0x2c, 0xaa, 0x02, 0x21, 0x00, 0x98, 0x7b, 0xa6, 0x83, 0xe1, 0xdf, 0x2e, 0x4d, 0x5e, 0x86, 0x9d, 0x57, 0x17, 0xdd, 0xb2, 0x27, 0x78, 0xd8, 0x42, 0x02, 0x17, 0x1d, 0xe3, 0x2a, 0x36, 0xa0, 0xbf, 0x9a, 0xf7, 0x75, 0xcf, 0xa1, }; -const uint8_t sChipTest_RCAC_Validity_Not_After_Missing_Cert_DER[403] = { +const uint8_t sChipTest_RCAC_Validity_Not_After_Missing_Cert_DER[] = { 0x30, 0x82, 0x01, 0x8f, 0x30, 0x82, 0x01, 0x36, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x4f, 0xb4, 0x4b, 0x3b, 0x80, 0xb4, 0x1d, 0x43, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -665,7 +665,7 @@ const uint8_t sChipTest_RCAC_Validity_Not_After_Missing_Cert_DER[403] = { 0xd6, 0x12, 0x9b, 0x4f, 0xe0, 0xf5, 0x98, 0x39, 0xa2, 0xb2, 0x9a, 0x15, 0xd6, 0x2e, 0x30, 0x7d, 0xdd, 0x81, 0x96, 0x40, 0x82, 0xdd, 0x2d, 0x57, 0xea, }; -const uint8_t sChipTest_NOC_Validity_Wrong_Cert_DER[519] = { +const uint8_t sChipTest_NOC_Validity_Wrong_Cert_DER[] = { 0x30, 0x82, 0x02, 0x03, 0x30, 0x82, 0x01, 0xa8, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x07, 0x1a, 0x0d, 0x2e, 0x3a, 0xe6, 0xdd, 0xad, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -692,7 +692,7 @@ const uint8_t sChipTest_NOC_Validity_Wrong_Cert_DER[519] = { 0xb9, 0x02, 0x21, 0x00, 0xf1, 0x4b, 0xe8, 0xc0, 0x8b, 0x8c, 0xea, 0x25, 0x37, 0x61, 0x76, 0x00, 0x17, 0x67, 0x01, 0x90, 0x15, 0x5e, 0xbd, 0x31, 0xe9, 0xde, 0x2f, 0x15, 0x8c, 0x52, 0xea, 0x42, 0x31, 0x9d, 0x51, 0x67, }; -const uint8_t sChipTest_ICAC_Validity_Wrong_Cert_DER[451] = { +const uint8_t sChipTest_ICAC_Validity_Wrong_Cert_DER[] = { 0x30, 0x82, 0x01, 0xbf, 0x30, 0x82, 0x01, 0x65, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x11, 0xab, 0xf1, 0x4a, 0x5e, 0xea, 0xe0, 0x9f, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -716,7 +716,7 @@ const uint8_t sChipTest_ICAC_Validity_Wrong_Cert_DER[451] = { 0x10, 0xda, 0x6d, 0xd5, 0x00, 0x9f, 0x37, 0x7a, 0xb5, 0x04, 0x2c, 0xec, 0xea, 0x83, 0xae, 0xa0, 0xc8, 0x58, 0xf3, 0x7a, 0xa8, 0x6f, 0xab, 0xae, 0xf9, 0x81, 0x9b, 0x44, 0x9e, 0x1c, 0x42, }; -const uint8_t sChipTest_RCAC_Validity_Wrong_Cert_DER[417] = { +const uint8_t sChipTest_RCAC_Validity_Wrong_Cert_DER[] = { 0x30, 0x82, 0x01, 0x9d, 0x30, 0x82, 0x01, 0x43, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x15, 0x1e, 0x66, 0x2c, 0x5a, 0xe3, 0x26, 0x41, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -738,7 +738,7 @@ const uint8_t sChipTest_RCAC_Validity_Wrong_Cert_DER[417] = { 0x10, 0xe8, 0x14, 0xee, 0x02, 0x21, 0x00, 0xab, 0x6c, 0x21, 0xe1, 0x23, 0xe4, 0x97, 0xb6, 0x22, 0x08, 0x03, 0x47, 0xc6, 0x38, 0xa6, 0x92, 0xdd, 0x82, 0x16, 0xdd, 0x1b, 0x28, 0xb5, 0xfe, 0xd9, 0x8c, 0x24, 0x01, 0xa6, 0x2a, 0xfb, 0xfa, }; -const uint8_t sChipTest_NOC_Subject_NodeId_Invalid_Cert_DER[517] = { +const uint8_t sChipTest_NOC_Subject_NodeId_Invalid_Cert_DER[] = { 0x30, 0x82, 0x02, 0x01, 0x30, 0x82, 0x01, 0xa8, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x01, 0x99, 0x58, 0x3f, 0x2d, 0xf3, 0x3a, 0xd9, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -765,7 +765,7 @@ const uint8_t sChipTest_NOC_Subject_NodeId_Invalid_Cert_DER[517] = { 0x02, 0x20, 0x32, 0x56, 0x57, 0x69, 0x7c, 0xd2, 0xfe, 0x21, 0xf6, 0xd1, 0xef, 0xfc, 0x78, 0x13, 0x84, 0xf8, 0xf3, 0x05, 0x97, 0x91, 0x85, 0xc0, 0x83, 0x71, 0xe8, 0x7f, 0xf7, 0xc4, 0xf5, 0x87, 0xee, 0x2a, }; -const uint8_t sChipTest_NOC_Subject_FabricId_Invalid_Cert_DER[518] = { +const uint8_t sChipTest_NOC_Subject_FabricId_Invalid_Cert_DER[] = { 0x30, 0x82, 0x02, 0x02, 0x30, 0x82, 0x01, 0xa8, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x19, 0x34, 0xc8, 0x20, 0x88, 0x8c, 0x65, 0xec, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -792,7 +792,7 @@ const uint8_t sChipTest_NOC_Subject_FabricId_Invalid_Cert_DER[518] = { 0xbf, 0x02, 0x20, 0x1b, 0x7a, 0x97, 0x4b, 0x37, 0x69, 0x88, 0x56, 0xb9, 0x62, 0x34, 0xd6, 0x3e, 0xf7, 0x56, 0x50, 0x1c, 0x29, 0x47, 0x6e, 0x27, 0xe8, 0xd9, 0x71, 0x34, 0xfd, 0xcb, 0xc8, 0xdb, 0x52, 0xef, 0xd6, }; -const uint8_t sChipTest_ICAC_Subject_FabricId_Invalid_Cert_DER[451] = { +const uint8_t sChipTest_ICAC_Subject_FabricId_Invalid_Cert_DER[] = { 0x30, 0x82, 0x01, 0xbf, 0x30, 0x82, 0x01, 0x65, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x57, 0x10, 0x4f, 0x1a, 0x7a, 0xf2, 0x77, 0x1a, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -816,7 +816,7 @@ const uint8_t sChipTest_ICAC_Subject_FabricId_Invalid_Cert_DER[451] = { 0xc1, 0xae, 0x9a, 0xf5, 0x95, 0xcf, 0x16, 0x87, 0x23, 0x6a, 0x68, 0x52, 0xa2, 0x82, 0x87, 0xc5, 0xac, 0x5b, 0x30, 0xae, 0x02, 0x81, 0x33, 0x63, 0xf8, 0xb2, 0x31, 0x97, 0xba, 0xab, 0xe3, }; -const uint8_t sChipTest_RCAC_Subject_FabricId_Invalid_Cert_DER[416] = { +const uint8_t sChipTest_RCAC_Subject_FabricId_Invalid_Cert_DER[] = { 0x30, 0x82, 0x01, 0x9c, 0x30, 0x82, 0x01, 0x43, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x4b, 0x65, 0xa7, 0x63, 0x84, 0x79, 0xb3, 0xeb, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x05, 0x0c, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, @@ -838,7 +838,7 @@ const uint8_t sChipTest_RCAC_Subject_FabricId_Invalid_Cert_DER[416] = { 0x91, 0xcf, 0x95, 0xef, 0x02, 0x20, 0x11, 0xf4, 0xee, 0x61, 0x89, 0xf3, 0x93, 0xf6, 0xbc, 0x5c, 0x0f, 0x94, 0xdd, 0x78, 0x0e, 0xec, 0x52, 0x5c, 0xda, 0x5f, 0x8a, 0xb1, 0x1e, 0x49, 0x9d, 0x1b, 0x3e, 0x2f, 0xa9, 0xe6, 0xef, 0xbe, }; -const uint8_t sChipTest_NOC_Subject_CAT_Invalid_Cert_DER[544] = { +const uint8_t sChipTest_NOC_Subject_CAT_Invalid_Cert_DER[] = { 0x30, 0x82, 0x02, 0x1c, 0x30, 0x82, 0x01, 0xc2, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x69, 0xfa, 0xd2, 0x0d, 0x14, 0xc9, 0xb7, 0xd7, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -866,7 +866,7 @@ const uint8_t sChipTest_NOC_Subject_CAT_Invalid_Cert_DER[544] = { 0x41, 0xf4, 0x1c, 0xec, 0x73, 0x1d, 0x02, 0x20, 0x15, 0xac, 0x3c, 0xcb, 0x9b, 0x74, 0xf2, 0x2b, 0x49, 0x94, 0x4e, 0xe5, 0xe2, 0x0f, 0xdd, 0x1e, 0x02, 0x6c, 0x55, 0xa5, 0x96, 0x9f, 0x4c, 0xe1, 0x1d, 0x6f, 0x15, 0x31, 0x5e, 0x68, 0x0b, 0x9f, }; -const uint8_t sChipTest_ICAC_Subject_CAT_Invalid_Cert_DER[477] = { +const uint8_t sChipTest_ICAC_Subject_CAT_Invalid_Cert_DER[] = { 0x30, 0x82, 0x01, 0xd9, 0x30, 0x82, 0x01, 0x7f, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x44, 0x39, 0x2b, 0xf7, 0x87, 0x95, 0x38, 0xd0, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -891,7 +891,7 @@ const uint8_t sChipTest_ICAC_Subject_CAT_Invalid_Cert_DER[477] = { 0x06, 0xcb, 0x02, 0x20, 0x64, 0x8e, 0xfb, 0xba, 0x8d, 0x7a, 0xf6, 0xa0, 0x9d, 0xa7, 0xfb, 0x4e, 0x79, 0xc8, 0x3f, 0xab, 0xb9, 0xf9, 0x64, 0x2c, 0x92, 0x90, 0x60, 0x0e, 0x1d, 0x58, 0x70, 0x3b, 0xfa, 0x36, 0x7e, 0xf3, }; -const uint8_t sChipTest_RCAC_Subject_CAT_Invalid_Cert_DER[470] = { +const uint8_t sChipTest_RCAC_Subject_CAT_Invalid_Cert_DER[] = { 0x30, 0x82, 0x01, 0xd2, 0x30, 0x82, 0x01, 0x77, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x34, 0x5b, 0x91, 0xac, 0x69, 0x31, 0x40, 0xc6, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x3c, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -916,7 +916,7 @@ const uint8_t sChipTest_RCAC_Subject_CAT_Invalid_Cert_DER[470] = { 0xf4, 0x11, 0xda, 0xfb, 0xe0, 0xfb, 0x89, 0xa1, 0xf8, 0x5a, 0x06, 0x2d, 0xe1, 0x8d, 0x0c, 0x86, 0x7a, 0x72, 0x3f, 0x45, 0x87, 0x3f, 0xc3, 0x52, 0xae, 0xc9, 0x9b, 0x4f, 0xf8, }; -const uint8_t sChipTest_NOC_Sig_Curve_Secp256k1_Cert_DER[515] = { +const uint8_t sChipTest_NOC_Sig_Curve_Secp256k1_Cert_DER[] = { 0x30, 0x82, 0x01, 0xff, 0x30, 0x82, 0x01, 0xa5, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x25, 0x3c, 0xfb, 0x97, 0x16, 0xbe, 0x97, 0x3b, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -943,7 +943,7 @@ const uint8_t sChipTest_NOC_Sig_Curve_Secp256k1_Cert_DER[515] = { 0xdc, 0x89, 0xb1, 0x8d, 0x97, 0xc2, 0x35, 0xec, 0x06, 0xb5, 0x32, 0x26, 0x18, 0x80, 0x22, 0xa2, 0x8a, 0x66, 0x98, 0xfd, 0x2d, 0xbf, 0x6b, 0xee, 0x10, 0x93, 0x65, 0xc9, 0xac, 0xeb, 0x55, 0xfc, }; -const uint8_t sChipTest_ICAC_Sig_Curve_Secp256k1_Cert_DER[448] = { +const uint8_t sChipTest_ICAC_Sig_Curve_Secp256k1_Cert_DER[] = { 0x30, 0x82, 0x01, 0xbc, 0x30, 0x82, 0x01, 0x62, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x3e, 0xd0, 0xa1, 0x09, 0x92, 0x43, 0x48, 0x6a, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -967,7 +967,7 @@ const uint8_t sChipTest_ICAC_Sig_Curve_Secp256k1_Cert_DER[448] = { 0xb0, 0x31, 0xa1, 0xab, 0x63, 0x6c, 0x5f, 0x83, 0x0c, 0xec, 0x93, 0x35, 0xa4, 0x5e, 0x2e, 0x0e, 0xa7, 0xdc, 0x31, 0x46, 0xca, 0xb6, 0xa5, 0x15, 0x3a, 0x8e, 0xb3, 0x5f, }; -const uint8_t sChipTest_RCAC_Sig_Curve_Secp256k1_Cert_DER[414] = { +const uint8_t sChipTest_RCAC_Sig_Curve_Secp256k1_Cert_DER[] = { 0x30, 0x82, 0x01, 0x9a, 0x30, 0x82, 0x01, 0x40, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x05, 0xbb, 0x7b, 0x1b, 0xa7, 0x86, 0xfb, 0xeb, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -989,7 +989,7 @@ const uint8_t sChipTest_RCAC_Sig_Curve_Secp256k1_Cert_DER[414] = { 0x59, 0x02, 0x21, 0x00, 0xc1, 0x22, 0x16, 0x57, 0xc5, 0x96, 0x2a, 0x82, 0x03, 0x07, 0x25, 0x9b, 0x3d, 0x43, 0x3b, 0x04, 0x4d, 0xda, 0x3c, 0x74, 0xf9, 0x23, 0xdd, 0xfe, 0x5c, 0x42, 0x63, 0xef, 0xb7, 0xdb, 0x30, 0x5b, }; -const uint8_t sChipTest_NOC_Ext_Basic_Critical_Missing_Cert_DER[513] = { +const uint8_t sChipTest_NOC_Ext_Basic_Critical_Missing_Cert_DER[] = { 0x30, 0x82, 0x01, 0xfd, 0x30, 0x82, 0x01, 0xa3, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x6c, 0x14, 0x54, 0xea, 0x6d, 0xf7, 0x2f, 0xd4, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1016,7 +1016,7 @@ const uint8_t sChipTest_NOC_Ext_Basic_Critical_Missing_Cert_DER[513] = { 0xf8, 0x40, 0x00, 0xee, 0x16, 0x06, 0x28, 0x3f, 0xb3, 0x71, 0x40, 0xb8, 0x97, 0x45, 0x8d, 0x20, 0x5b, 0xb3, 0xe8, 0x3c, 0x56, 0x88, 0x32, 0xe7, 0xc5, 0xd4, 0x41, 0x1c, 0x9f, 0x1d, }; -const uint8_t sChipTest_ICAC_Ext_Basic_Critical_Missing_Cert_DER[447] = { +const uint8_t sChipTest_ICAC_Ext_Basic_Critical_Missing_Cert_DER[] = { 0x30, 0x82, 0x01, 0xbb, 0x30, 0x82, 0x01, 0x62, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x1c, 0xc8, 0xe0, 0xad, 0x3d, 0x17, 0xd7, 0xff, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1040,7 +1040,7 @@ const uint8_t sChipTest_ICAC_Ext_Basic_Critical_Missing_Cert_DER[447] = { 0xa6, 0x21, 0xd3, 0xe2, 0xf2, 0x7b, 0xf3, 0x69, 0xc7, 0xc1, 0x0e, 0x04, 0xb4, 0x9d, 0x43, 0xed, 0x83, 0x4d, 0x00, 0x68, 0xb6, 0x5c, 0x28, 0x3e, 0x01, 0xc3, 0xb2, }; -const uint8_t sChipTest_RCAC_Ext_Basic_Critical_Missing_Cert_DER[414] = { +const uint8_t sChipTest_RCAC_Ext_Basic_Critical_Missing_Cert_DER[] = { 0x30, 0x82, 0x01, 0x9a, 0x30, 0x82, 0x01, 0x40, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x4d, 0xd0, 0x17, 0x45, 0x40, 0xcc, 0x73, 0x04, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1062,7 +1062,7 @@ const uint8_t sChipTest_RCAC_Ext_Basic_Critical_Missing_Cert_DER[414] = { 0x6c, 0x02, 0x21, 0x00, 0xb1, 0x40, 0xfb, 0xd1, 0xde, 0x24, 0x27, 0x9d, 0x76, 0x23, 0x38, 0x7f, 0xd9, 0xb8, 0x5d, 0xaa, 0x5e, 0x5f, 0xe9, 0x1d, 0xac, 0x58, 0x43, 0x1c, 0x56, 0x5a, 0x83, 0x33, 0x16, 0x0b, 0x77, 0x3e, }; -const uint8_t sChipTest_NOC_Ext_Basic_Critical_Wrong_Cert_DER[513] = { +const uint8_t sChipTest_NOC_Ext_Basic_Critical_Wrong_Cert_DER[] = { 0x30, 0x82, 0x01, 0xfd, 0x30, 0x82, 0x01, 0xa3, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x2b, 0x80, 0xde, 0x0d, 0x2d, 0x96, 0x99, 0x67, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1089,7 +1089,7 @@ const uint8_t sChipTest_NOC_Ext_Basic_Critical_Wrong_Cert_DER[513] = { 0x98, 0xa5, 0x76, 0x3f, 0x2e, 0x28, 0xca, 0xfd, 0xfc, 0x54, 0x04, 0x67, 0x58, 0x81, 0xd2, 0x68, 0x9e, 0x61, 0xf7, 0x93, 0xd5, 0xdd, 0x3b, 0x41, 0x88, 0xdc, 0xa2, 0x49, 0xe8, 0x4b, }; -const uint8_t sChipTest_ICAC_Ext_Basic_Critical_Wrong_Cert_DER[448] = { +const uint8_t sChipTest_ICAC_Ext_Basic_Critical_Wrong_Cert_DER[] = { 0x30, 0x82, 0x01, 0xbc, 0x30, 0x82, 0x01, 0x62, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x74, 0xaa, 0x1a, 0xc6, 0x1f, 0x0c, 0xab, 0xfb, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1113,7 +1113,7 @@ const uint8_t sChipTest_ICAC_Ext_Basic_Critical_Wrong_Cert_DER[448] = { 0xc8, 0x05, 0xe5, 0xb1, 0x50, 0xbd, 0x91, 0x67, 0x89, 0x82, 0x6d, 0xe9, 0x33, 0x99, 0x2b, 0x88, 0x42, 0x5b, 0x9c, 0x21, 0x80, 0xfb, 0xba, 0xdb, 0x56, 0xba, 0x46, 0xf1, }; -const uint8_t sChipTest_RCAC_Ext_Basic_Critical_Wrong_Cert_DER[414] = { +const uint8_t sChipTest_RCAC_Ext_Basic_Critical_Wrong_Cert_DER[] = { 0x30, 0x82, 0x01, 0x9a, 0x30, 0x82, 0x01, 0x40, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x18, 0x80, 0x55, 0x61, 0x79, 0x66, 0xfd, 0x6c, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1135,7 +1135,7 @@ const uint8_t sChipTest_RCAC_Ext_Basic_Critical_Wrong_Cert_DER[414] = { 0x33, 0xa0, 0x02, 0x20, 0x0a, 0x2a, 0xfc, 0x09, 0x01, 0xbe, 0x30, 0x5a, 0xa7, 0x6b, 0x9f, 0xf9, 0x88, 0xee, 0xae, 0x55, 0x30, 0x4d, 0xed, 0x7f, 0x03, 0xe3, 0xf1, 0x23, 0x5a, 0x2c, 0x75, 0xd0, 0x65, 0xaf, 0x0d, 0xa0, }; -const uint8_t sChipTest_NOC_Ext_Basic_CA_Missing_Cert_DER[522] = { +const uint8_t sChipTest_NOC_Ext_Basic_CA_Missing_Cert_DER[] = { 0x30, 0x82, 0x02, 0x06, 0x30, 0x82, 0x01, 0xab, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x14, 0xba, 0x9f, 0x2c, 0xa2, 0x99, 0xec, 0xc8, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1162,7 +1162,7 @@ const uint8_t sChipTest_NOC_Ext_Basic_CA_Missing_Cert_DER[522] = { 0x8c, 0xd4, 0xdc, 0x99, 0x02, 0x21, 0x00, 0xdf, 0xae, 0xc5, 0x48, 0xe9, 0xfa, 0xd2, 0xb3, 0x35, 0x81, 0x9c, 0x6b, 0x8a, 0xfd, 0xd9, 0x9f, 0x6b, 0x71, 0xe6, 0xfc, 0xe1, 0x73, 0x30, 0x8c, 0x21, 0xf4, 0xc1, 0x54, 0x08, 0x2a, 0x87, 0xa9, }; -const uint8_t sChipTest_ICAC_Ext_Basic_CA_Missing_Cert_DER[450] = { +const uint8_t sChipTest_ICAC_Ext_Basic_CA_Missing_Cert_DER[] = { 0x30, 0x82, 0x01, 0xbe, 0x30, 0x82, 0x01, 0x65, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x06, 0x6a, 0x7b, 0xc2, 0x19, 0x51, 0xdb, 0x6d, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1186,7 +1186,7 @@ const uint8_t sChipTest_ICAC_Ext_Basic_CA_Missing_Cert_DER[450] = { 0x15, 0x24, 0x03, 0xbb, 0xdf, 0x95, 0xa4, 0x09, 0xc6, 0x56, 0x0c, 0x42, 0x86, 0xa2, 0x06, 0x12, 0x14, 0xae, 0xe0, 0x70, 0x2c, 0x99, 0x91, 0xa5, 0x8b, 0xcd, 0xad, 0x86, 0x83, 0x5e, }; -const uint8_t sChipTest_RCAC_Ext_Basic_CA_Missing_Cert_DER[417] = { +const uint8_t sChipTest_RCAC_Ext_Basic_CA_Missing_Cert_DER[] = { 0x30, 0x82, 0x01, 0x9d, 0x30, 0x82, 0x01, 0x43, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x0c, 0xcc, 0x80, 0x73, 0x53, 0xf9, 0xd3, 0x18, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1208,7 +1208,7 @@ const uint8_t sChipTest_RCAC_Ext_Basic_CA_Missing_Cert_DER[417] = { 0xf0, 0xb0, 0x0f, 0x93, 0x02, 0x21, 0x00, 0x9c, 0xfc, 0x09, 0xb9, 0xca, 0xf9, 0x7c, 0x81, 0xbd, 0x39, 0x83, 0x5f, 0x71, 0x95, 0xf4, 0x27, 0xb7, 0x21, 0x3c, 0x51, 0xa5, 0xcd, 0x00, 0x3a, 0x88, 0x09, 0x78, 0xab, 0x81, 0x3f, 0x37, 0x65, }; -const uint8_t sChipTest_NOC_Ext_Basic_PathLen_Presence_Wrong_Cert_DER[520] = { +const uint8_t sChipTest_NOC_Ext_Basic_PathLen_Presence_Wrong_Cert_DER[] = { 0x30, 0x82, 0x02, 0x04, 0x30, 0x82, 0x01, 0xab, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x69, 0xab, 0x24, 0x03, 0xde, 0x19, 0x09, 0x8e, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1235,7 +1235,7 @@ const uint8_t sChipTest_NOC_Ext_Basic_PathLen_Presence_Wrong_Cert_DER[520] = { 0x4e, 0x79, 0x0e, 0x02, 0x20, 0x3d, 0x95, 0xae, 0xd9, 0x56, 0x3a, 0x3a, 0x70, 0x29, 0xfc, 0xd7, 0x85, 0xc9, 0x96, 0x93, 0x3f, 0xe6, 0x08, 0x7b, 0x0c, 0xd6, 0xf4, 0x14, 0x76, 0x9d, 0xe6, 0xcb, 0xf3, 0xce, 0x10, 0x5d, 0x28, }; -const uint8_t sChipTest_NOC_Ext_KeyUsage_Critical_Missing_Cert_DER[512] = { +const uint8_t sChipTest_NOC_Ext_KeyUsage_Critical_Missing_Cert_DER[] = { 0x30, 0x82, 0x01, 0xfc, 0x30, 0x82, 0x01, 0xa3, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x08, 0x8c, 0x52, 0x9c, 0xd4, 0xc4, 0x91, 0x9a, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1262,7 +1262,7 @@ const uint8_t sChipTest_NOC_Ext_KeyUsage_Critical_Missing_Cert_DER[512] = { 0x54, 0x4b, 0xbd, 0xcf, 0x7d, 0x25, 0x62, 0x0c, 0xe0, 0xe4, 0x9c, 0x5b, 0x1e, 0xa5, 0xd9, 0x69, 0xca, 0xb6, 0xd5, 0xd9, 0x20, 0x12, 0xe1, 0x87, 0x72, 0xdb, 0xef, 0x46, 0x9a, }; -const uint8_t sChipTest_ICAC_Ext_KeyUsage_Critical_Missing_Cert_DER[448] = { +const uint8_t sChipTest_ICAC_Ext_KeyUsage_Critical_Missing_Cert_DER[] = { 0x30, 0x82, 0x01, 0xbc, 0x30, 0x82, 0x01, 0x62, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x54, 0xb5, 0xdf, 0x2f, 0x8d, 0x1d, 0xf4, 0x99, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1286,7 +1286,7 @@ const uint8_t sChipTest_ICAC_Ext_KeyUsage_Critical_Missing_Cert_DER[448] = { 0x14, 0x10, 0x47, 0x57, 0xca, 0x95, 0x3e, 0x04, 0x5a, 0xcc, 0x51, 0x8b, 0x28, 0xf1, 0x97, 0xb0, 0xcd, 0xa4, 0xa7, 0x97, 0xc8, 0xdb, 0xdc, 0x4d, 0x55, 0xed, 0xd4, 0x05, }; -const uint8_t sChipTest_RCAC_Ext_KeyUsage_Critical_Missing_Cert_DER[414] = { +const uint8_t sChipTest_RCAC_Ext_KeyUsage_Critical_Missing_Cert_DER[] = { 0x30, 0x82, 0x01, 0x9a, 0x30, 0x82, 0x01, 0x40, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x37, 0x51, 0x68, 0xe8, 0x9c, 0x10, 0x12, 0xd3, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1308,7 +1308,7 @@ const uint8_t sChipTest_RCAC_Ext_KeyUsage_Critical_Missing_Cert_DER[414] = { 0x6f, 0x02, 0x21, 0x00, 0xcf, 0x3f, 0xf5, 0xc5, 0x36, 0x40, 0x01, 0xa3, 0xe5, 0x99, 0x18, 0xd6, 0xf0, 0x77, 0x6f, 0x39, 0xfc, 0xb3, 0xe7, 0x41, 0xa0, 0x55, 0xe3, 0x96, 0x02, 0xb6, 0x6a, 0x51, 0x42, 0x0d, 0xfd, 0xf4, }; -const uint8_t sChipTest_NOC_Ext_KeyUsage_Critical_Wrong_Cert_DER[513] = { +const uint8_t sChipTest_NOC_Ext_KeyUsage_Critical_Wrong_Cert_DER[] = { 0x30, 0x82, 0x01, 0xfd, 0x30, 0x82, 0x01, 0xa3, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x25, 0x52, 0xa3, 0x12, 0xec, 0x0b, 0x40, 0x77, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1335,7 +1335,7 @@ const uint8_t sChipTest_NOC_Ext_KeyUsage_Critical_Wrong_Cert_DER[513] = { 0x80, 0x6d, 0x4d, 0x2d, 0x73, 0x1a, 0x54, 0x2f, 0xb3, 0x44, 0xcc, 0xff, 0x44, 0xf8, 0xdb, 0x19, 0x98, 0x5f, 0xbb, 0x3b, 0x87, 0x33, 0xd5, 0x50, 0xcf, 0x87, 0x97, 0xd2, 0xe2, 0x1c, }; -const uint8_t sChipTest_ICAC_Ext_KeyUsage_Critical_Wrong_Cert_DER[448] = { +const uint8_t sChipTest_ICAC_Ext_KeyUsage_Critical_Wrong_Cert_DER[] = { 0x30, 0x82, 0x01, 0xbc, 0x30, 0x82, 0x01, 0x62, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x76, 0x2d, 0xc2, 0xb1, 0x53, 0xd9, 0xe3, 0xa6, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1359,7 +1359,7 @@ const uint8_t sChipTest_ICAC_Ext_KeyUsage_Critical_Wrong_Cert_DER[448] = { 0x4f, 0xa1, 0x63, 0x49, 0xfc, 0xc9, 0x47, 0xf3, 0x84, 0xc3, 0x14, 0x76, 0x81, 0xfc, 0x9d, 0xb0, 0xf2, 0x59, 0xf0, 0xb9, 0xd2, 0x97, 0x14, 0x9d, 0x25, 0xdb, 0x56, 0xdd, }; -const uint8_t sChipTest_RCAC_Ext_KeyUsage_Critical_Wrong_Cert_DER[414] = { +const uint8_t sChipTest_RCAC_Ext_KeyUsage_Critical_Wrong_Cert_DER[] = { 0x30, 0x82, 0x01, 0x9a, 0x30, 0x82, 0x01, 0x40, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x65, 0x54, 0x0b, 0x4c, 0xb7, 0x69, 0x44, 0xcf, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1381,7 +1381,7 @@ const uint8_t sChipTest_RCAC_Ext_KeyUsage_Critical_Wrong_Cert_DER[414] = { 0x50, 0x89, 0x02, 0x20, 0x32, 0x4b, 0x4f, 0x9d, 0x9c, 0x59, 0xdf, 0x8c, 0xe2, 0xcc, 0x23, 0x88, 0x5a, 0x9a, 0x08, 0x3c, 0x9e, 0xfc, 0xbe, 0x00, 0xa6, 0x38, 0x0e, 0xc1, 0x22, 0xe7, 0x3d, 0xb9, 0x75, 0xa0, 0x3c, 0xfe, }; -const uint8_t sChipTest_NOC_Ext_AKID_Length_Invalid_Cert_DER[516] = { +const uint8_t sChipTest_NOC_Ext_AKID_Length_Invalid_Cert_DER[] = { 0x30, 0x82, 0x02, 0x00, 0x30, 0x82, 0x01, 0xa6, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x07, 0x4b, 0xd3, 0x4d, 0x62, 0xa5, 0x87, 0x1c, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1408,7 +1408,7 @@ const uint8_t sChipTest_NOC_Ext_AKID_Length_Invalid_Cert_DER[516] = { 0x00, 0x82, 0xed, 0x33, 0x9f, 0xdc, 0x12, 0xad, 0xdc, 0x39, 0x5d, 0x8e, 0x98, 0xe6, 0xbc, 0x80, 0x83, 0xfc, 0xd4, 0x3f, 0xc6, 0xe2, 0xf6, 0x00, 0x07, 0x0d, 0x32, 0x9f, 0x81, 0x5f, 0xf0, 0x07, 0x16, }; -const uint8_t sChipTest_ICAC_Ext_AKID_Length_Invalid_Cert_DER[450] = { +const uint8_t sChipTest_ICAC_Ext_AKID_Length_Invalid_Cert_DER[] = { 0x30, 0x82, 0x01, 0xbe, 0x30, 0x82, 0x01, 0x64, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x0c, 0x83, 0x10, 0xc0, 0x05, 0x2d, 0x01, 0xeb, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1432,7 +1432,7 @@ const uint8_t sChipTest_ICAC_Ext_AKID_Length_Invalid_Cert_DER[450] = { 0x39, 0xb7, 0x2a, 0x50, 0xe1, 0x33, 0x85, 0x76, 0xb5, 0xd3, 0x6a, 0xbe, 0x4f, 0x2a, 0x69, 0x5b, 0xb1, 0x96, 0xda, 0x69, 0x2e, 0x69, 0xe5, 0x5c, 0x85, 0x35, 0xe3, 0xb2, 0x2e, 0x8f, }; -const uint8_t sChipTest_RCAC_Ext_AKID_Length_Invalid_Cert_DER[415] = { +const uint8_t sChipTest_RCAC_Ext_AKID_Length_Invalid_Cert_DER[] = { 0x30, 0x82, 0x01, 0x9b, 0x30, 0x82, 0x01, 0x42, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x56, 0xbe, 0xff, 0x1c, 0x7e, 0x2e, 0x7c, 0x91, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1454,7 +1454,7 @@ const uint8_t sChipTest_RCAC_Ext_AKID_Length_Invalid_Cert_DER[415] = { 0x7a, 0x81, 0x16, 0x02, 0x20, 0x39, 0x5d, 0xa7, 0x59, 0x05, 0x9f, 0xc9, 0x2c, 0x40, 0x37, 0x95, 0xf8, 0xe9, 0xae, 0x2e, 0x13, 0xe6, 0x32, 0xea, 0xcf, 0x08, 0x1d, 0x25, 0x85, 0x29, 0xa3, 0xf6, 0x0a, 0x2e, 0xf1, 0x04, 0xcb, }; -const uint8_t sChipTest_NOC_Ext_SKID_Length_Invalid_Cert_DER[515] = { +const uint8_t sChipTest_NOC_Ext_SKID_Length_Invalid_Cert_DER[] = { 0x30, 0x82, 0x01, 0xff, 0x30, 0x82, 0x01, 0xa6, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x06, 0xa8, 0xdc, 0x62, 0xb1, 0x6d, 0x74, 0xc8, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1481,7 +1481,7 @@ const uint8_t sChipTest_NOC_Ext_SKID_Length_Invalid_Cert_DER[515] = { 0x15, 0x08, 0xdf, 0x21, 0x51, 0x42, 0xec, 0x23, 0xdf, 0x7b, 0x65, 0x7f, 0x08, 0xc8, 0x69, 0x53, 0x23, 0x0c, 0xe1, 0xc7, 0x8f, 0xe0, 0x90, 0x22, 0x24, 0xfc, 0x38, 0x85, 0x7c, 0x1c, 0x82, 0x98, }; -const uint8_t sChipTest_ICAC_Ext_SKID_Length_Invalid_Cert_DER[449] = { +const uint8_t sChipTest_ICAC_Ext_SKID_Length_Invalid_Cert_DER[] = { 0x30, 0x82, 0x01, 0xbd, 0x30, 0x82, 0x01, 0x64, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x01, 0xb2, 0xdd, 0x2b, 0x8e, 0x2d, 0xd5, 0x8b, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1505,7 +1505,7 @@ const uint8_t sChipTest_ICAC_Ext_SKID_Length_Invalid_Cert_DER[449] = { 0xaa, 0x82, 0x6e, 0x09, 0x7e, 0x31, 0xf6, 0x81, 0xc2, 0x99, 0x18, 0x70, 0xd6, 0x56, 0x57, 0x34, 0x81, 0x04, 0x14, 0xe7, 0x49, 0xca, 0xda, 0x83, 0x51, 0xb2, 0x32, 0x5e, 0x94, }; -const uint8_t sChipTest_RCAC_Ext_SKID_Length_Invalid_Cert_DER[414] = { +const uint8_t sChipTest_RCAC_Ext_SKID_Length_Invalid_Cert_DER[] = { 0x30, 0x82, 0x01, 0x9a, 0x30, 0x82, 0x01, 0x41, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x1e, 0xe8, 0xa2, 0xdc, 0xaa, 0x55, 0xad, 0x1d, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1527,7 +1527,7 @@ const uint8_t sChipTest_RCAC_Ext_SKID_Length_Invalid_Cert_DER[414] = { 0x25, 0x19, 0x02, 0x20, 0x3c, 0x30, 0x30, 0xff, 0xe9, 0xff, 0x30, 0x6c, 0x0c, 0x95, 0xbe, 0xd2, 0xe8, 0xb8, 0x9b, 0x94, 0xe8, 0x22, 0xe1, 0xab, 0xf2, 0x61, 0x5e, 0xd0, 0xf5, 0xa9, 0x3b, 0xef, 0x8b, 0xd7, 0xa1, 0x9e, }; -const uint8_t sChipTest_NOC_Oversized_Cert_CHIP[480] = { +const uint8_t sChipTest_NOC_Oversized_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x29, 0x65, 0x8b, 0xa1, 0xd4, 0x75, 0xa1, 0xf4, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, @@ -1552,7 +1552,7 @@ const uint8_t sChipTest_NOC_Oversized_Cert_CHIP[480] = { 0xff, 0xa8, 0xc6, 0xc5, 0xa3, 0x7d, 0x66, 0xf1, 0x0b, 0x57, 0x93, 0xa7, 0xfd, 0x85, 0xb2, 0xc0, 0xf8, 0xa3, 0x3b, 0xbb, 0xcf, 0xae, 0xdb, 0x7f, 0xb0, 0x97, 0x87, 0x3a, 0xf2, 0xb5, 0x38, 0x1c, 0xd0, 0x97, 0xa0, 0x1d, 0xea, 0x88, 0x18, }; -const uint8_t sChipTest_ICAC_Oversized_Cert_CHIP[463] = { +const uint8_t sChipTest_ICAC_Oversized_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x06, 0xc9, 0x11, 0x82, 0x34, 0xf9, 0xd2, 0x06, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x2c, @@ -1577,7 +1577,7 @@ const uint8_t sChipTest_ICAC_Oversized_Cert_CHIP[463] = { 0xbb, 0x02, 0x3f, 0x4d, 0x9b, 0x87, 0x8d, 0x2c, 0xce, 0xe0, 0x84, 0x4a, 0xd5, 0xbd, 0xc7, 0x6b, 0xc9, 0x59, 0x96, 0x1a, 0x9e, 0x18, }; -const uint8_t sChipTest_RCAC_Oversized_Cert_CHIP[654] = { +const uint8_t sChipTest_RCAC_Oversized_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x35, 0x8f, 0x90, 0xcc, 0x64, 0x3c, 0x01, 0xb6, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x2c, 0x01, 0x40, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x20, 0x4e, 0x61, 0x6d, 0x65, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x44, 0x4e, 0x20, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, @@ -1611,7 +1611,7 @@ const uint8_t sChipTest_RCAC_Oversized_Cert_CHIP[654] = { 0x63, 0xea, 0x8a, 0x98, 0xc4, 0xcd, 0x62, 0xe5, 0x10, 0xb7, 0x14, 0x92, 0x51, 0x2e, 0xcd, 0x6f, 0x2d, 0x57, 0xe5, 0x6a, 0x8e, 0x69, 0x2a, 0x18, }; -const uint8_t sChipTest_NOC_Serial_Number_Missing_Cert_CHIP[268] = { +const uint8_t sChipTest_NOC_Serial_Number_Missing_Cert_CHIP[] = { 0x15, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, @@ -1626,7 +1626,7 @@ const uint8_t sChipTest_NOC_Serial_Number_Missing_Cert_CHIP[268] = { 0x6d, 0x06, 0xba, 0x33, 0xcf, 0xbb, 0x16, 0xe5, 0xa2, 0x63, 0x35, 0x3a, 0xdb, 0x8f, 0xd4, 0xe6, 0x8b, 0x56, 0x35, 0x4b, 0x8f, 0x6d, 0xa9, 0xc5, 0x5b, 0x23, 0x6e, 0x2a, 0x5f, 0xa7, 0xe8, 0x99, 0x43, 0xa6, 0xc7, 0x37, 0x18, }; -const uint8_t sChipTest_ICAC_Serial_Number_Missing_Cert_CHIP[251] = { +const uint8_t sChipTest_ICAC_Serial_Number_Missing_Cert_CHIP[] = { 0x15, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x8d, @@ -1640,7 +1640,7 @@ const uint8_t sChipTest_ICAC_Serial_Number_Missing_Cert_CHIP[251] = { 0x08, 0xbf, 0xce, 0x42, 0x05, 0xae, 0x0f, 0x5c, 0x6c, 0x92, 0xcf, 0x43, 0x11, 0x29, 0xe4, 0xbb, 0x2f, 0xe3, 0xcc, 0xeb, 0xeb, 0xdd, 0x8f, 0xba, 0xf1, 0x90, 0x70, 0xa6, 0x1e, 0x06, 0xa1, 0x4f, 0xe5, 0x6a, 0x9b, 0x91, 0x0a, 0xdf, 0xe1, 0xb8, 0x18, }; -const uint8_t sChipTest_RCAC_Serial_Number_Missing_Cert_CHIP[241] = { +const uint8_t sChipTest_RCAC_Serial_Number_Missing_Cert_CHIP[] = { 0x15, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xeb, 0x10, 0x5a, 0xf4, 0x65, 0x0d, 0x82, 0x80, 0x0b, 0x5d, 0x05, @@ -1654,7 +1654,7 @@ const uint8_t sChipTest_RCAC_Serial_Number_Missing_Cert_CHIP[241] = { 0xde, 0xa1, 0x69, 0x83, 0x2d, 0xca, 0x8e, 0xf0, 0x8b, 0x83, 0x91, 0x16, 0x6d, 0x46, 0x08, 0xfb, 0x09, 0x1d, 0x54, 0x33, 0xf2, 0x82, 0xf6, 0x6c, 0x60, 0xc3, 0xb2, 0x3e, 0x14, 0xa0, 0x18, }; -const uint8_t sChipTest_NOC_Sig_Algo_ECDSA_With_SHA1_Cert_CHIP[279] = { +const uint8_t sChipTest_NOC_Sig_Algo_ECDSA_With_SHA1_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x54, 0xfb, 0x8c, 0x93, 0x33, 0x31, 0x5d, 0x67, 0x24, 0x02, 0x02, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, @@ -1670,7 +1670,7 @@ const uint8_t sChipTest_NOC_Sig_Algo_ECDSA_With_SHA1_Cert_CHIP[279] = { 0xa5, 0x3d, 0xa3, 0x18, 0x08, 0xfd, 0xb4, 0x73, 0x2f, 0x73, 0x41, 0x3f, 0x35, 0x32, 0xb6, 0xf7, 0x20, 0x00, 0x0c, 0x40, 0xcf, 0xc9, 0xed, 0x22, 0x6c, 0x66, 0x34, 0x21, 0x8c, 0x22, 0x59, 0xf0, 0x40, 0x30, 0xef, 0x2e, 0xc6, 0x90, 0x18, }; -const uint8_t sChipTest_ICAC_Sig_Algo_ECDSA_With_SHA1_Cert_CHIP[262] = { +const uint8_t sChipTest_ICAC_Sig_Algo_ECDSA_With_SHA1_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x2c, 0x8b, 0x70, 0xc4, 0x95, 0xa8, 0x7c, 0x31, 0x24, 0x02, 0x02, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, @@ -1685,7 +1685,7 @@ const uint8_t sChipTest_ICAC_Sig_Algo_ECDSA_With_SHA1_Cert_CHIP[262] = { 0x6e, 0x6f, 0x67, 0x8a, 0x53, 0x17, 0xcb, 0x7d, 0xab, 0x91, 0x6a, 0x26, 0x78, 0xb1, 0x52, 0x29, 0x63, 0x04, 0xb7, 0x7a, 0x62, 0x7b, 0x31, 0x2c, 0xf5, 0x41, 0x9e, 0xdc, 0x7f, 0xfb, 0x18, }; -const uint8_t sChipTest_RCAC_Sig_Algo_ECDSA_With_SHA1_Cert_CHIP[252] = { +const uint8_t sChipTest_RCAC_Sig_Algo_ECDSA_With_SHA1_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x2a, 0xff, 0xfa, 0x1a, 0x7c, 0xfd, 0x93, 0x1b, 0x24, 0x02, 0x02, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -1699,7 +1699,7 @@ const uint8_t sChipTest_RCAC_Sig_Algo_ECDSA_With_SHA1_Cert_CHIP[252] = { 0xf2, 0x9d, 0x76, 0xa1, 0x07, 0xb4, 0xeb, 0x6f, 0xaf, 0x75, 0x00, 0x44, 0xb8, 0x90, 0xd9, 0x85, 0x4e, 0x36, 0x46, 0x91, 0x97, 0x83, 0xd4, 0x44, 0xc7, 0x75, 0xbe, 0xfb, 0x73, 0x83, 0x79, 0x61, 0x66, 0xff, 0xe6, 0x7b, 0xd5, 0x3e, 0x71, 0x9d, 0x15, 0x18, }; -const uint8_t sChipTest_NOC_Issuer_Missing_Cert_CHIP[256] = { +const uint8_t sChipTest_NOC_Issuer_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x6f, 0x80, 0x7c, 0xe8, 0xac, 0x7b, 0xe7, 0x3b, 0x24, 0x02, 0x01, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -1714,7 +1714,7 @@ const uint8_t sChipTest_NOC_Issuer_Missing_Cert_CHIP[256] = { 0x22, 0xeb, 0x82, 0x73, 0x9c, 0xfc, 0x56, 0x21, 0x73, 0x40, 0x4f, 0xc1, 0x22, 0x91, 0x48, 0xb6, 0x03, 0x41, 0x97, 0x6f, 0x1e, 0x5c, 0xeb, 0x93, 0x27, 0xe9, 0x4c, 0xce, 0x4c, 0x7c, 0x3b, 0xb1, 0x41, 0xff, 0xb6, 0x18, }; -const uint8_t sChipTest_ICAC_Issuer_Missing_Cert_CHIP[249] = { +const uint8_t sChipTest_ICAC_Issuer_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x31, 0x5d, 0xfe, 0xb0, 0x7b, 0xa4, 0x90, 0xc1, 0x24, 0x02, 0x01, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xc5, 0x85, 0x81, @@ -1728,7 +1728,7 @@ const uint8_t sChipTest_ICAC_Issuer_Missing_Cert_CHIP[249] = { 0xf4, 0x9a, 0x67, 0x07, 0x77, 0x72, 0xed, 0xed, 0x99, 0xe9, 0x5a, 0x01, 0x7b, 0x2b, 0x13, 0xf4, 0x66, 0x34, 0x06, 0xa3, 0xc0, 0xf9, 0x32, 0x3d, 0xa2, 0x9c, 0x02, 0x16, 0x18, 0x33, 0x56, 0x65, 0x1b, 0x17, 0x16, 0x1e, 0x32, 0xf6, 0x18, }; -const uint8_t sChipTest_RCAC_Issuer_Missing_Cert_CHIP[239] = { +const uint8_t sChipTest_RCAC_Issuer_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x07, 0x80, 0xca, 0xab, 0x0d, 0xc1, 0x5a, 0xe2, 0x24, 0x02, 0x01, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xb0, 0x87, 0x31, 0x85, 0x54, 0xa0, 0x5b, 0x8b, 0x76, 0xed, @@ -1742,7 +1742,7 @@ const uint8_t sChipTest_RCAC_Issuer_Missing_Cert_CHIP[239] = { 0x5a, 0xe5, 0x0e, 0x1a, 0xa7, 0xc4, 0xc2, 0x2b, 0x98, 0x6b, 0x3a, 0x27, 0xc9, 0x42, 0x9a, 0x20, 0x7c, 0xdf, 0x77, 0x9e, 0x72, 0x22, 0x5c, 0xad, 0xa7, 0x5e, 0xbe, 0x59, 0xb2, 0x18, 0xf4, 0x00, 0x38, 0xe4, 0xd2, 0x2c, 0x02, 0xfe, 0x18, }; -const uint8_t sChipTest_NOC_Validity_Not_Before_Missing_Cert_CHIP[273] = { +const uint8_t sChipTest_NOC_Validity_Not_Before_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x6b, 0xcb, 0x27, 0x90, 0x3c, 0x7c, 0xe1, 0x6d, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, @@ -1757,7 +1757,7 @@ const uint8_t sChipTest_NOC_Validity_Not_Before_Missing_Cert_CHIP[273] = { 0x3f, 0xb6, 0x14, 0xf7, 0x77, 0xcc, 0x9f, 0x82, 0x1b, 0x27, 0x11, 0xa9, 0x79, 0x86, 0x32, 0xd2, 0x63, 0x6b, 0xc3, 0xb4, 0x0a, 0xf7, 0xd4, 0x6e, 0x0a, 0xa9, 0xae, 0x47, 0x58, 0xbc, 0x22, 0xc2, 0xd3, 0x94, 0x50, 0x92, 0x52, 0x36, 0xce, 0x86, 0x2c, 0x18, }; -const uint8_t sChipTest_ICAC_Validity_Not_Before_Missing_Cert_CHIP[256] = { +const uint8_t sChipTest_ICAC_Validity_Not_Before_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x38, 0xa9, 0xb1, 0x2b, 0xc6, 0x57, 0x11, 0x97, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, @@ -1772,7 +1772,7 @@ const uint8_t sChipTest_ICAC_Validity_Not_Before_Missing_Cert_CHIP[256] = { 0x0f, 0x46, 0xa1, 0xa4, 0xd0, 0x75, 0x75, 0x1a, 0x88, 0xd3, 0xc1, 0x4c, 0x2e, 0x1c, 0x97, 0xb4, 0x36, 0x9c, 0x6f, 0x7b, 0xad, 0x7f, 0xaf, 0xfd, 0xd4, 0x82, 0xa3, 0x83, 0x74, 0xe7, 0x15, 0x27, 0x87, 0x8a, 0x7e, 0x18, }; -const uint8_t sChipTest_RCAC_Validity_Not_Before_Missing_Cert_CHIP[246] = { +const uint8_t sChipTest_RCAC_Validity_Not_Before_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x0b, 0x6a, 0xed, 0xea, 0xee, 0x86, 0xde, 0xfd, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xdb, 0x94, 0xb5, 0x65, 0x07, 0xf8, @@ -1786,7 +1786,7 @@ const uint8_t sChipTest_RCAC_Validity_Not_Before_Missing_Cert_CHIP[246] = { 0xc1, 0x41, 0x72, 0x82, 0xca, 0x44, 0xae, 0x79, 0x7c, 0xbc, 0x26, 0x6d, 0x65, 0xa5, 0xbb, 0xce, 0xcd, 0x4a, 0x68, 0x97, 0xd4, 0xe4, 0xb9, 0x7c, 0xce, 0x9b, 0x94, 0xdf, 0xfa, 0x11, 0x37, 0x25, 0xca, 0xd4, 0x24, 0x18, }; -const uint8_t sChipTest_NOC_Validity_Not_After_Missing_Cert_CHIP[273] = { +const uint8_t sChipTest_NOC_Validity_Not_After_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x0f, 0x87, 0xe6, 0x31, 0x08, 0xee, 0x9e, 0x02, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, @@ -1801,7 +1801,7 @@ const uint8_t sChipTest_NOC_Validity_Not_After_Missing_Cert_CHIP[273] = { 0xee, 0x35, 0x42, 0x83, 0xb0, 0x10, 0x1f, 0x7e, 0x47, 0x1d, 0x97, 0xd5, 0x1f, 0x21, 0x24, 0xdd, 0xae, 0xf1, 0x0f, 0x62, 0x81, 0xa6, 0x82, 0x79, 0x6a, 0x6b, 0xb1, 0xca, 0xb8, 0x24, 0x1b, 0xc8, 0x3f, 0x34, 0xda, 0x71, 0x05, 0x9a, 0x58, 0xb6, 0x68, 0x18, }; -const uint8_t sChipTest_ICAC_Validity_Not_After_Missing_Cert_CHIP[256] = { +const uint8_t sChipTest_ICAC_Validity_Not_After_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x43, 0x83, 0x0b, 0x92, 0xc9, 0x87, 0xe2, 0xee, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, @@ -1816,7 +1816,7 @@ const uint8_t sChipTest_ICAC_Validity_Not_After_Missing_Cert_CHIP[256] = { 0xd4, 0x2c, 0x0f, 0x03, 0x12, 0xe6, 0xea, 0x75, 0x9b, 0xe9, 0xa1, 0x9e, 0xab, 0x2d, 0xd8, 0xf6, 0x30, 0x96, 0x54, 0x1f, 0x68, 0xca, 0x37, 0x38, 0x56, 0x2d, 0xe7, 0xc4, 0x4a, 0x93, 0x2b, 0xd7, 0x99, 0x9b, 0xf7, 0x18, }; -const uint8_t sChipTest_RCAC_Validity_Not_After_Missing_Cert_CHIP[246] = { +const uint8_t sChipTest_RCAC_Validity_Not_After_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x41, 0x35, 0xc2, 0x8c, 0x77, 0xdb, 0x75, 0x4a, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x0d, 0x3b, 0x81, 0x07, 0x3e, 0x18, @@ -1830,7 +1830,7 @@ const uint8_t sChipTest_RCAC_Validity_Not_After_Missing_Cert_CHIP[246] = { 0xf7, 0xaf, 0x4f, 0xcc, 0x2a, 0x2b, 0x47, 0xe4, 0x46, 0x63, 0x8a, 0x7f, 0xc5, 0x89, 0xc3, 0xf8, 0x7b, 0xca, 0x4e, 0xe3, 0x44, 0xac, 0x68, 0xb7, 0x4f, 0x1b, 0x74, 0x59, 0x49, 0xe9, 0xb3, 0x91, 0xbc, 0xb8, 0x26, 0x18, }; -const uint8_t sChipTest_NOC_Validity_Wrong_Cert_CHIP[279] = { +const uint8_t sChipTest_NOC_Validity_Wrong_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x4d, 0xed, 0xd4, 0x47, 0xc3, 0x55, 0x32, 0xd9, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0x6e, 0xb5, 0xb9, 0x4c, 0x26, 0x05, 0xef, 0x17, 0x1b, 0x27, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, @@ -1846,7 +1846,7 @@ const uint8_t sChipTest_NOC_Validity_Wrong_Cert_CHIP[279] = { 0x1e, 0x1f, 0xd8, 0xc7, 0x8f, 0xbf, 0x23, 0x26, 0xd8, 0x6a, 0x0f, 0x9e, 0xa3, 0x0c, 0x89, 0x42, 0xe3, 0x7e, 0x1d, 0xe7, 0xfd, 0xc4, 0x67, 0x86, 0x38, 0x71, 0xb1, 0xf9, 0xed, 0x95, 0x1a, 0xf9, 0xa5, 0xc5, 0x9b, 0xc1, 0x09, 0xc3, 0x18, }; -const uint8_t sChipTest_ICAC_Validity_Wrong_Cert_CHIP[262] = { +const uint8_t sChipTest_ICAC_Validity_Wrong_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x1e, 0x9a, 0xc4, 0x8a, 0x23, 0x78, 0xcf, 0x0c, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0x6e, 0xb5, 0xb9, 0x4c, 0x26, 0x05, 0xef, 0x17, 0x1b, 0x27, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, @@ -1861,7 +1861,7 @@ const uint8_t sChipTest_ICAC_Validity_Wrong_Cert_CHIP[262] = { 0x6a, 0x04, 0x6a, 0x4a, 0xa7, 0x08, 0x92, 0x84, 0x40, 0xeb, 0x13, 0x5c, 0xcc, 0x31, 0x49, 0x24, 0x97, 0x6d, 0x9e, 0xfe, 0x54, 0xb8, 0xf8, 0x18, 0x29, 0xa3, 0xe0, 0xa7, 0x6c, 0xe4, 0x18, }; -const uint8_t sChipTest_RCAC_Validity_Wrong_Cert_CHIP[252] = { +const uint8_t sChipTest_RCAC_Validity_Wrong_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x7b, 0x0d, 0x87, 0x15, 0xd2, 0xff, 0x7a, 0xaa, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0x6e, 0xb5, 0xb9, 0x4c, 0x26, 0x05, 0xef, 0x17, 0x1b, 0x27, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -1875,7 +1875,7 @@ const uint8_t sChipTest_RCAC_Validity_Wrong_Cert_CHIP[252] = { 0xb4, 0xd8, 0x7e, 0xe7, 0xb8, 0x1b, 0xba, 0x9c, 0x06, 0x25, 0xc8, 0x1f, 0x41, 0x7f, 0xf4, 0xa8, 0xf3, 0x24, 0x27, 0xc1, 0x1b, 0xd3, 0xb5, 0x92, 0xf0, 0x4b, 0x22, 0x76, 0x43, 0xaa, 0x4a, 0x39, 0xd0, 0xe1, 0x6e, 0x4b, 0x1a, 0x16, 0xbe, 0xdb, 0xc5, 0x18, }; -const uint8_t sChipTest_NOC_Subject_Missing_Cert_CHIP[256] = { +const uint8_t sChipTest_NOC_Subject_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x6c, 0x48, 0x44, 0x56, 0x76, 0x58, 0x7d, 0x3a, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -1890,7 +1890,7 @@ const uint8_t sChipTest_NOC_Subject_Missing_Cert_CHIP[256] = { 0x53, 0x4f, 0xad, 0xef, 0x9d, 0x40, 0xa7, 0x98, 0xd9, 0x90, 0xb0, 0xc5, 0xa2, 0xf9, 0xec, 0xd3, 0x1b, 0xdf, 0xb0, 0xff, 0xd9, 0x8b, 0x5b, 0xb4, 0x56, 0x56, 0x33, 0x6c, 0xcf, 0x8a, 0x73, 0x1e, 0xa5, 0xa4, 0x31, 0x18, }; -const uint8_t sChipTest_ICAC_Subject_Missing_Cert_CHIP[239] = { +const uint8_t sChipTest_ICAC_Subject_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x4c, 0x80, 0xee, 0xf8, 0x60, 0x56, 0xb5, 0x5d, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x9c, 0x65, 0x9e, 0x72, 0x11, 0x1a, 0x46, 0xc3, 0x63, 0x2b, @@ -1904,7 +1904,7 @@ const uint8_t sChipTest_ICAC_Subject_Missing_Cert_CHIP[239] = { 0x7c, 0x3e, 0x6f, 0xef, 0x43, 0x64, 0x63, 0x8a, 0xd9, 0xb9, 0x75, 0x4b, 0x97, 0x8b, 0x58, 0x18, 0xa5, 0x49, 0x08, 0xf4, 0xed, 0x81, 0x68, 0x37, 0x5d, 0x80, 0xcb, 0x74, 0x50, 0x0b, 0x35, 0x1d, 0xdb, 0x44, 0x26, 0x11, 0x64, 0x1a, 0x18, }; -const uint8_t sChipTest_RCAC_Subject_Missing_Cert_CHIP[239] = { +const uint8_t sChipTest_RCAC_Subject_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x07, 0x1f, 0xdc, 0xe5, 0x49, 0xe6, 0xe1, 0x8c, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0xd6, 0x52, 0x68, 0xc9, 0xe5, 0x7e, 0x30, 0x19, 0x0d, 0x5a, @@ -1918,7 +1918,7 @@ const uint8_t sChipTest_RCAC_Subject_Missing_Cert_CHIP[239] = { 0x50, 0x58, 0x46, 0xbf, 0x2a, 0xc0, 0xe3, 0x78, 0x6f, 0x57, 0x60, 0x2d, 0x4e, 0x28, 0x37, 0xd5, 0x38, 0xd8, 0x9b, 0xe6, 0x26, 0xf4, 0xa6, 0x32, 0x2c, 0x46, 0x47, 0xa0, 0x43, 0x85, 0x05, 0x9c, 0x11, 0x91, 0x7b, 0x34, 0xf0, 0x0f, 0x18, }; -const uint8_t sChipTest_NOC_Subject_MatterId_Missing_Cert_CHIP[269] = { +const uint8_t sChipTest_NOC_Subject_MatterId_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x41, 0xbb, 0x5a, 0x27, 0xc8, 0x71, 0x48, 0xd1, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, @@ -1933,7 +1933,7 @@ const uint8_t sChipTest_NOC_Subject_MatterId_Missing_Cert_CHIP[269] = { 0x8b, 0x7c, 0xae, 0xec, 0x7c, 0xcc, 0x77, 0x11, 0xc1, 0x7a, 0xfb, 0x5c, 0x8f, 0xa4, 0x84, 0x80, 0xdc, 0x80, 0x65, 0x39, 0x38, 0xdf, 0xcb, 0xdb, 0xad, 0x73, 0x1c, 0xd3, 0x6a, 0xaa, 0xa1, 0x82, 0x05, 0x9e, 0x38, 0x59, 0xeb, 0x18, }; -const uint8_t sChipTest_ICAC_Subject_MatterId_Missing_Cert_CHIP[252] = { +const uint8_t sChipTest_ICAC_Subject_MatterId_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x02, 0x92, 0x32, 0x69, 0x1c, 0x9a, 0xb0, 0x4f, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -1947,7 +1947,7 @@ const uint8_t sChipTest_ICAC_Subject_MatterId_Missing_Cert_CHIP[252] = { 0xa1, 0x43, 0x72, 0x82, 0xc5, 0x03, 0x2e, 0x6e, 0xd5, 0x3d, 0x02, 0xb7, 0x64, 0xd7, 0x80, 0xc8, 0xa1, 0xb6, 0x32, 0xeb, 0x89, 0x34, 0x10, 0x90, 0xd4, 0x67, 0xac, 0x48, 0x33, 0x7d, 0x6b, 0x9d, 0xdc, 0x49, 0x83, 0x10, 0x5b, 0xd0, 0x21, 0x02, 0xb8, 0x18, }; -const uint8_t sChipTest_RCAC_Subject_MatterId_Missing_Cert_CHIP[232] = { +const uint8_t sChipTest_RCAC_Subject_MatterId_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x2c, 0x6a, 0x90, 0x63, 0x29, 0x20, 0x60, 0xdb, 0x24, 0x02, 0x01, 0x37, 0x03, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x6d, 0xf1, 0x43, 0x2c, 0x22, 0xf6, 0x58, 0xdc, 0x77, 0x9e, 0x6a, 0x93, 0x23, 0xb3, 0xcc, 0xfe, 0x4f, @@ -1961,7 +1961,7 @@ const uint8_t sChipTest_RCAC_Subject_MatterId_Missing_Cert_CHIP[232] = { 0x69, 0xe3, 0x6e, 0xc7, 0xe4, 0x56, 0xdf, 0x8c, 0x2b, 0x03, 0x52, 0xa0, 0x05, 0xb1, 0x38, 0x46, 0x03, 0x37, 0x48, 0x44, 0x73, 0x3f, 0x62, 0x8e, 0xdd, 0xba, 0x04, 0x9a, 0x3e, 0xd4, 0x5c, 0x18, }; -const uint8_t sChipTest_NOC_Subject_NodeId_Invalid_Cert_CHIP[279] = { +const uint8_t sChipTest_NOC_Subject_NodeId_Invalid_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x44, 0xa5, 0x3e, 0x51, 0x07, 0xc9, 0xf8, 0x65, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x09, 0x00, 0x00, 0x00, 0xf0, 0xff, @@ -1977,7 +1977,7 @@ const uint8_t sChipTest_NOC_Subject_NodeId_Invalid_Cert_CHIP[279] = { 0xea, 0x20, 0xf3, 0x77, 0xe4, 0x22, 0x5e, 0xb3, 0xa2, 0x08, 0x7d, 0x75, 0xf2, 0x76, 0x88, 0xa3, 0xa6, 0x03, 0xde, 0x0b, 0xf8, 0x06, 0xdc, 0x2b, 0x40, 0x77, 0x8c, 0xa0, 0x33, 0x1a, 0xb5, 0xad, 0xbf, 0xe0, 0x9a, 0x4e, 0xf3, 0x67, 0x18, }; -const uint8_t sChipTest_NOC_Subject_MatterId_Twice_Cert_CHIP[289] = { +const uint8_t sChipTest_NOC_Subject_MatterId_Twice_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x19, 0x6f, 0xed, 0x31, 0x86, 0x42, 0x1d, 0x5c, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, @@ -1993,7 +1993,7 @@ const uint8_t sChipTest_NOC_Subject_MatterId_Twice_Cert_CHIP[289] = { 0x68, 0x5d, 0xef, 0x9f, 0x11, 0xf2, 0x87, 0x66, 0x6d, 0xa1, 0x80, 0x64, 0x08, 0xc4, 0xb6, 0x2e, 0x92, 0x94, 0xcd, 0x50, 0xa8, 0x1a, 0x78, 0x28, 0x15, 0x6f, 0xca, 0x06, 0x79, 0xcc, 0xe1, 0xe6, 0xbd, 0x5d, 0x54, 0xd4, 0x18, }; -const uint8_t sChipTest_ICAC_Subject_MatterId_Twice_Cert_CHIP[272] = { +const uint8_t sChipTest_ICAC_Subject_MatterId_Twice_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x4f, 0x53, 0x27, 0xd3, 0x0c, 0x7a, 0x0b, 0xee, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, @@ -2008,7 +2008,7 @@ const uint8_t sChipTest_ICAC_Subject_MatterId_Twice_Cert_CHIP[272] = { 0xfa, 0xc4, 0xef, 0xf7, 0x4a, 0x75, 0x88, 0x02, 0x78, 0x52, 0x90, 0x95, 0xa9, 0x16, 0x96, 0xaa, 0xbc, 0x15, 0x19, 0x0a, 0x5e, 0x87, 0x4a, 0x15, 0x5a, 0x37, 0x4c, 0x65, 0xfe, 0x1c, 0x0d, 0xd9, 0x82, 0x16, 0xe7, 0xfe, 0x0f, 0xa0, 0xad, 0xf6, 0x18, }; -const uint8_t sChipTest_RCAC_Subject_MatterId_Twice_Cert_CHIP[272] = { +const uint8_t sChipTest_RCAC_Subject_MatterId_Twice_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x7f, 0x9d, 0x5f, 0xe8, 0x9a, 0xbb, 0x50, 0xcc, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x14, 0x02, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, @@ -2023,7 +2023,7 @@ const uint8_t sChipTest_RCAC_Subject_MatterId_Twice_Cert_CHIP[272] = { 0x08, 0xfb, 0x0f, 0x24, 0x14, 0xc6, 0x81, 0x81, 0x08, 0xc9, 0xb1, 0x2c, 0x74, 0x84, 0xc0, 0xcf, 0xf1, 0x38, 0xfb, 0x0f, 0x81, 0xef, 0x68, 0xb8, 0x4d, 0x63, 0xbe, 0x62, 0x01, 0x6c, 0x9b, 0xd5, 0x4d, 0x1d, 0xf6, 0x52, 0xb4, 0xe9, 0x74, 0x4c, 0x18, }; -const uint8_t sChipTest_NOC_Subject_FabricId_Missing_Cert_CHIP[269] = { +const uint8_t sChipTest_NOC_Subject_FabricId_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x6b, 0xf3, 0xa6, 0xf6, 0x6d, 0x62, 0x92, 0xc9, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x18, @@ -2038,7 +2038,7 @@ const uint8_t sChipTest_NOC_Subject_FabricId_Missing_Cert_CHIP[269] = { 0x19, 0x90, 0xaa, 0x54, 0x8f, 0x17, 0x85, 0xcb, 0x3b, 0x1c, 0x60, 0x32, 0x35, 0xd8, 0x46, 0xa8, 0x63, 0xca, 0xf5, 0xdc, 0x1c, 0xc9, 0x4c, 0x53, 0x09, 0x9c, 0xf4, 0xda, 0xb3, 0xc9, 0x65, 0xaf, 0x42, 0xe6, 0x86, 0x7c, 0x77, 0x18, }; -const uint8_t sChipTest_NOC_Subject_FabricId_Invalid_Cert_CHIP[272] = { +const uint8_t sChipTest_NOC_Subject_FabricId_Invalid_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x17, 0x7e, 0xe9, 0xbf, 0x7f, 0x75, 0x4f, 0x60, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x24, @@ -2053,7 +2053,7 @@ const uint8_t sChipTest_NOC_Subject_FabricId_Invalid_Cert_CHIP[272] = { 0xd5, 0x91, 0x2d, 0xe1, 0x72, 0x0e, 0x7e, 0x84, 0x2a, 0x16, 0x11, 0x73, 0x06, 0x64, 0x7a, 0xb8, 0xad, 0x06, 0xba, 0xf3, 0x71, 0x75, 0xbd, 0x2a, 0xd8, 0x9e, 0x50, 0x4d, 0xd0, 0x34, 0x71, 0xa6, 0x2a, 0xba, 0x57, 0x73, 0x3a, 0xfc, 0xd9, 0xb2, 0x18, }; -const uint8_t sChipTest_ICAC_Subject_FabricId_Invalid_Cert_CHIP[255] = { +const uint8_t sChipTest_ICAC_Subject_FabricId_Invalid_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x79, 0x8a, 0x09, 0x98, 0x36, 0x21, 0x95, 0xaa, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x24, 0x15, 0x00, 0x18, 0x24, 0x07, 0x01, 0x24, @@ -2068,7 +2068,7 @@ const uint8_t sChipTest_ICAC_Subject_FabricId_Invalid_Cert_CHIP[255] = { 0x9a, 0x35, 0x47, 0x85, 0xaa, 0xe2, 0xad, 0xea, 0x59, 0xdc, 0x7f, 0x32, 0xcf, 0xe2, 0xef, 0xc8, 0x1d, 0x13, 0x5a, 0xce, 0x18, 0x6a, 0xea, 0xa8, 0xcf, 0x41, 0xe4, 0x1a, 0x00, 0x4b, 0x7a, 0x9d, 0xe0, 0xac, 0x18, }; -const uint8_t sChipTest_RCAC_Subject_FabricId_Invalid_Cert_CHIP[238] = { +const uint8_t sChipTest_RCAC_Subject_FabricId_Invalid_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x66, 0x22, 0xe8, 0xf6, 0x23, 0xcc, 0x9e, 0x07, 0x24, 0x02, 0x01, 0x37, 0x03, 0x24, 0x15, 0x00, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x24, 0x15, 0x00, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, 0x9d, 0x9c, 0x47, 0x62, 0x98, 0x2d, 0x5d, 0x08, 0x0f, 0x88, 0x6b, @@ -2082,7 +2082,7 @@ const uint8_t sChipTest_RCAC_Subject_FabricId_Invalid_Cert_CHIP[238] = { 0xab, 0x78, 0xd7, 0x36, 0xdd, 0xe3, 0xcc, 0x37, 0x5b, 0xb3, 0x86, 0xfe, 0x04, 0x8e, 0x24, 0x33, 0x3f, 0xf2, 0xb6, 0xd9, 0xe0, 0x8b, 0xc4, 0xfb, 0xd6, 0x1c, 0x7a, 0xc3, 0xcd, 0x07, 0x2e, 0x42, 0xff, 0x57, 0x0e, 0x33, 0x8f, 0x18, }; -const uint8_t sChipTest_NOC_Subject_FabricId_Twice_Cert_CHIP[289] = { +const uint8_t sChipTest_NOC_Subject_FabricId_Twice_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x53, 0x17, 0xb7, 0x28, 0xbe, 0x42, 0x7c, 0xd8, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, @@ -2098,7 +2098,7 @@ const uint8_t sChipTest_NOC_Subject_FabricId_Twice_Cert_CHIP[289] = { 0x0c, 0x5f, 0x4d, 0x25, 0xbc, 0xd4, 0x59, 0xda, 0x32, 0x94, 0x6f, 0x59, 0x39, 0xa9, 0xbb, 0x46, 0x8c, 0x4f, 0x84, 0x2d, 0x31, 0x98, 0x0d, 0xb0, 0x0f, 0x54, 0xcd, 0x04, 0x9d, 0xc1, 0xd0, 0x6d, 0xc5, 0xd6, 0xf9, 0x08, 0x18, }; -const uint8_t sChipTest_ICAC_Subject_FabricId_Twice_Cert_CHIP[272] = { +const uint8_t sChipTest_ICAC_Subject_FabricId_Twice_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x69, 0xd9, 0x64, 0x57, 0x40, 0x86, 0x9b, 0x99, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x27, @@ -2113,7 +2113,7 @@ const uint8_t sChipTest_ICAC_Subject_FabricId_Twice_Cert_CHIP[272] = { 0xed, 0x9e, 0x00, 0x88, 0x8f, 0x16, 0x17, 0xbb, 0x30, 0xfe, 0x1b, 0xbd, 0x4e, 0xb6, 0xa8, 0xeb, 0x7b, 0x7e, 0x6e, 0x55, 0xec, 0x42, 0xaf, 0x92, 0x9b, 0xfa, 0x18, 0xbd, 0x6a, 0x80, 0xf0, 0x78, 0xa9, 0x93, 0x8a, 0x09, 0x93, 0x7d, 0x94, 0x23, 0x18, }; -const uint8_t sChipTest_RCAC_Subject_FabricId_Twice_Cert_CHIP[272] = { +const uint8_t sChipTest_RCAC_Subject_FabricId_Twice_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x11, 0xaf, 0xf1, 0x5d, 0x5b, 0x2a, 0xb1, 0xd8, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x27, 0x15, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x27, @@ -2128,7 +2128,7 @@ const uint8_t sChipTest_RCAC_Subject_FabricId_Twice_Cert_CHIP[272] = { 0xa4, 0x41, 0x9a, 0xff, 0x38, 0x3b, 0x5e, 0x4b, 0x93, 0x9a, 0x91, 0x2c, 0xe8, 0xb6, 0xb3, 0xab, 0x74, 0xc9, 0xfc, 0xe5, 0x05, 0x4b, 0x2c, 0xc8, 0xf4, 0xf2, 0xee, 0x11, 0xb2, 0x14, 0x06, 0xb2, 0x06, 0xdb, 0xdf, 0x95, 0x4b, 0xad, 0xbe, 0x0d, 0x18, }; -const uint8_t sChipTest_NOC_Subject_CAT_Invalid_Cert_CHIP[285] = { +const uint8_t sChipTest_NOC_Subject_CAT_Invalid_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x5a, 0xbc, 0xd8, 0x11, 0xf5, 0xa4, 0x99, 0xb7, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, @@ -2144,7 +2144,7 @@ const uint8_t sChipTest_NOC_Subject_CAT_Invalid_Cert_CHIP[285] = { 0xce, 0x7f, 0x79, 0xff, 0xa5, 0x3c, 0x00, 0x41, 0xe4, 0x49, 0x4b, 0x9a, 0x20, 0xba, 0x48, 0x5b, 0x1d, 0xd2, 0x54, 0x25, 0x56, 0x0a, 0x4c, 0xed, 0xa5, 0x6c, 0x5a, 0x47, 0xc0, 0x31, 0xd6, 0xa0, 0x18, }; -const uint8_t sChipTest_ICAC_Subject_CAT_Invalid_Cert_CHIP[268] = { +const uint8_t sChipTest_ICAC_Subject_CAT_Invalid_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x2a, 0xef, 0x84, 0xb8, 0x2d, 0x91, 0xfb, 0x38, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x26, @@ -2159,7 +2159,7 @@ const uint8_t sChipTest_ICAC_Subject_CAT_Invalid_Cert_CHIP[268] = { 0xec, 0xc4, 0x51, 0xd9, 0x0f, 0xbe, 0x3e, 0x53, 0x27, 0xf4, 0x4b, 0x3d, 0xaa, 0xbf, 0x57, 0xbf, 0x93, 0x2b, 0xc1, 0xf3, 0xa8, 0xfd, 0x19, 0x07, 0xb3, 0x80, 0x5a, 0x4f, 0x19, 0x13, 0xe7, 0x4e, 0x29, 0x68, 0xe9, 0x43, 0x18, }; -const uint8_t sChipTest_RCAC_Subject_CAT_Invalid_Cert_CHIP[264] = { +const uint8_t sChipTest_RCAC_Subject_CAT_Invalid_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x54, 0x65, 0x73, 0x85, 0xbf, 0x7a, 0xd6, 0xcf, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x26, 0x16, 0x00, 0x00, 0xcd, 0xab, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x26, 0x16, 0x00, 0x00, 0xcd, @@ -2174,7 +2174,7 @@ const uint8_t sChipTest_RCAC_Subject_CAT_Invalid_Cert_CHIP[264] = { 0x05, 0x98, 0xe9, 0x11, 0xe0, 0x8f, 0xec, 0xd6, 0x28, 0x3a, 0x76, 0x32, 0xba, 0x3c, 0x1f, 0x36, 0xac, 0xcf, 0xbf, 0x58, 0x11, 0xf5, 0x9d, 0x09, 0x27, 0xfe, 0x1c, 0xde, 0x69, 0x8d, 0xba, 0x86, 0x18, }; -const uint8_t sChipTest_NOC_Subject_CAT_Twice_Cert_CHIP[291] = { +const uint8_t sChipTest_NOC_Subject_CAT_Twice_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x20, 0xe6, 0xe5, 0x46, 0x55, 0x2a, 0xc3, 0x4f, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, @@ -2190,7 +2190,7 @@ const uint8_t sChipTest_NOC_Subject_CAT_Twice_Cert_CHIP[291] = { 0x12, 0x92, 0x69, 0x7b, 0x81, 0x6a, 0xc4, 0x0d, 0xe9, 0x41, 0x57, 0x8b, 0x4c, 0xbb, 0x6f, 0x40, 0x27, 0x16, 0x31, 0xa4, 0xf6, 0x1b, 0x13, 0xfe, 0x32, 0xb1, 0x01, 0xf4, 0x1c, 0xfb, 0xab, 0x2f, 0x0d, 0x7f, 0xf7, 0x14, 0x1a, 0x3e, 0x18, }; -const uint8_t sChipTest_ICAC_Subject_CAT_Twice_Cert_CHIP[274] = { +const uint8_t sChipTest_ICAC_Subject_CAT_Twice_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x79, 0xbc, 0x9a, 0x7b, 0xbf, 0xe4, 0xc1, 0x38, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -2206,7 +2206,7 @@ const uint8_t sChipTest_ICAC_Subject_CAT_Twice_Cert_CHIP[274] = { 0x7c, 0xd0, 0x3c, 0x29, 0x09, 0x41, 0xed, 0xb8, 0x1f, 0xa6, 0x35, 0x5d, 0x12, 0xac, 0x01, 0xe7, 0x85, 0xf3, 0x00, 0xd1, 0x46, 0xff, 0x8a, 0xf5, 0xe2, 0xb7, 0xb5, 0xa3, 0xb5, 0xd3, 0x0b, 0xf6, 0xd3, 0x18, }; -const uint8_t sChipTest_RCAC_Subject_CAT_Twice_Cert_CHIP[276] = { +const uint8_t sChipTest_RCAC_Subject_CAT_Twice_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x4b, 0x51, 0x29, 0x6c, 0x51, 0x83, 0x07, 0x2f, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x26, 0x16, 0x10, 0x00, 0xcd, 0xab, 0x26, 0x16, 0x18, 0x00, 0xcd, 0xab, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, @@ -2222,7 +2222,7 @@ const uint8_t sChipTest_RCAC_Subject_CAT_Twice_Cert_CHIP[276] = { 0x59, 0xe0, 0xf3, 0x47, 0xe8, 0x67, 0xb4, 0xce, 0xac, 0x71, 0x26, 0xe4, 0x7a, 0x7f, 0x81, 0x08, 0x6d, 0xfa, 0xc5, 0x84, 0x88, 0x7e, 0x8e, 0x17, 0x3a, 0xe6, 0x46, 0x17, 0x6e, 0x4a, 0xa2, 0x01, 0xef, 0x12, 0x08, 0x18, }; -const uint8_t sChipTest_NOC_Sig_Curve_Secp256k1_Cert_CHIP[279] = { +const uint8_t sChipTest_NOC_Sig_Curve_Secp256k1_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x58, 0x17, 0x5b, 0x5f, 0x85, 0xea, 0xf7, 0x8b, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, @@ -2238,7 +2238,7 @@ const uint8_t sChipTest_NOC_Sig_Curve_Secp256k1_Cert_CHIP[279] = { 0x24, 0x53, 0xb0, 0x23, 0x8d, 0xd5, 0x9a, 0x09, 0x61, 0x79, 0x02, 0x8d, 0x41, 0x78, 0x60, 0xf3, 0x0e, 0x29, 0xa5, 0x86, 0x4c, 0xf0, 0xa1, 0xe2, 0xca, 0x63, 0xd1, 0xb9, 0x6a, 0x48, 0x6a, 0xb4, 0x30, 0x1a, 0xf1, 0xe6, 0x72, 0x18, 0x18, }; -const uint8_t sChipTest_ICAC_Sig_Curve_Secp256k1_Cert_CHIP[262] = { +const uint8_t sChipTest_ICAC_Sig_Curve_Secp256k1_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x4b, 0x48, 0x12, 0x3b, 0xd2, 0x84, 0x19, 0x26, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, @@ -2253,7 +2253,7 @@ const uint8_t sChipTest_ICAC_Sig_Curve_Secp256k1_Cert_CHIP[262] = { 0xa5, 0x6a, 0xbb, 0x02, 0xaf, 0x94, 0x4f, 0xc4, 0x67, 0x79, 0x95, 0xbd, 0x82, 0x16, 0x36, 0x11, 0x1c, 0xa9, 0x76, 0x30, 0x87, 0x5c, 0x99, 0xf5, 0x64, 0x76, 0x4b, 0x54, 0x1e, 0x5e, 0x18, }; -const uint8_t sChipTest_RCAC_Sig_Curve_Secp256k1_Cert_CHIP[252] = { +const uint8_t sChipTest_RCAC_Sig_Curve_Secp256k1_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x3e, 0xf1, 0x12, 0x9c, 0x45, 0xd2, 0xc5, 0x56, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x02, 0x30, 0x09, 0x41, 0x04, @@ -2267,7 +2267,7 @@ const uint8_t sChipTest_RCAC_Sig_Curve_Secp256k1_Cert_CHIP[252] = { 0x8b, 0x5f, 0x5d, 0x8e, 0xd9, 0xcc, 0x75, 0xcb, 0x6d, 0x16, 0xb3, 0x41, 0xb6, 0x28, 0x09, 0xd9, 0x22, 0xdd, 0xe5, 0x23, 0x14, 0x97, 0x7a, 0x30, 0x2e, 0x1b, 0xb6, 0x67, 0x89, 0x6a, 0x4c, 0xe8, 0x20, 0xdb, 0x3b, 0x19, 0x44, 0x83, 0x4e, 0x4a, 0x66, 0x18, }; -const uint8_t sChipTest_NOC_PublicKey_Wrong_Cert_CHIP[279] = { +const uint8_t sChipTest_NOC_PublicKey_Wrong_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x13, 0xf3, 0xa8, 0xa4, 0x1e, 0x62, 0x47, 0x21, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, @@ -2283,7 +2283,7 @@ const uint8_t sChipTest_NOC_PublicKey_Wrong_Cert_CHIP[279] = { 0xcc, 0xba, 0xb4, 0x02, 0x73, 0x8b, 0xeb, 0xd1, 0x61, 0xa9, 0xe3, 0xc2, 0xf2, 0xbb, 0x3a, 0x97, 0x7a, 0xfb, 0x00, 0x68, 0x7b, 0x45, 0x3c, 0x74, 0xc3, 0xdd, 0xdf, 0x5b, 0xf4, 0x79, 0x1b, 0x09, 0x2e, 0x22, 0x13, 0xe0, 0x77, 0x7d, 0x18, }; -const uint8_t sChipTest_ICAC_PublicKey_Wrong_Cert_CHIP[262] = { +const uint8_t sChipTest_ICAC_PublicKey_Wrong_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x0e, 0x0d, 0x45, 0xcd, 0xc3, 0x15, 0x11, 0x23, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, @@ -2298,7 +2298,7 @@ const uint8_t sChipTest_ICAC_PublicKey_Wrong_Cert_CHIP[262] = { 0x46, 0x26, 0xd4, 0x91, 0x3d, 0x7d, 0xf6, 0x16, 0xe4, 0x34, 0x26, 0xd1, 0xb3, 0xc5, 0x4a, 0x77, 0x61, 0x46, 0x4f, 0xc9, 0x80, 0x2b, 0x6a, 0xae, 0xb0, 0x29, 0x19, 0xf0, 0x22, 0xfe, 0x18, }; -const uint8_t sChipTest_RCAC_PublicKey_Wrong_Cert_CHIP[252] = { +const uint8_t sChipTest_RCAC_PublicKey_Wrong_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x00, 0xe0, 0xca, 0x7a, 0xf4, 0xe5, 0xf7, 0x8f, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -2312,7 +2312,7 @@ const uint8_t sChipTest_RCAC_PublicKey_Wrong_Cert_CHIP[252] = { 0x34, 0xa3, 0x76, 0x31, 0x7f, 0x5f, 0x26, 0xcb, 0xe0, 0x57, 0x73, 0xc1, 0x30, 0x86, 0x5a, 0x4a, 0x5c, 0x3f, 0xa7, 0xf7, 0x41, 0x90, 0x3b, 0x97, 0xf0, 0xbb, 0xfc, 0x19, 0x86, 0xdf, 0xcf, 0x64, 0x8a, 0x47, 0x9c, 0x71, 0xe1, 0x3b, 0xa7, 0xa0, 0xea, 0x18, }; -const uint8_t sChipTest_NOC_Ext_Basic_Missing_Cert_CHIP[274] = { +const uint8_t sChipTest_NOC_Ext_Basic_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x00, 0xe0, 0x71, 0xab, 0x27, 0xaa, 0xa5, 0x83, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, @@ -2328,7 +2328,7 @@ const uint8_t sChipTest_NOC_Ext_Basic_Missing_Cert_CHIP[274] = { 0x32, 0x54, 0x3c, 0x8a, 0xcb, 0xbd, 0x13, 0xc3, 0x5e, 0x1c, 0x13, 0xc7, 0xfa, 0xc7, 0x9e, 0x40, 0xe5, 0xc8, 0xa5, 0x40, 0x76, 0xff, 0xe1, 0x11, 0x9d, 0xea, 0xcf, 0xa9, 0x8b, 0x60, 0xd9, 0x69, 0xcc, 0x18, }; -const uint8_t sChipTest_ICAC_Ext_Basic_Missing_Cert_CHIP[257] = { +const uint8_t sChipTest_ICAC_Ext_Basic_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x34, 0x0c, 0xdd, 0x5f, 0xfa, 0x7c, 0x8c, 0xae, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -2343,7 +2343,7 @@ const uint8_t sChipTest_ICAC_Ext_Basic_Missing_Cert_CHIP[257] = { 0xb8, 0x82, 0xe7, 0xf6, 0xb8, 0x32, 0xe4, 0xef, 0x5c, 0xb5, 0x6f, 0xed, 0xd5, 0x9a, 0x92, 0x51, 0x48, 0x87, 0x7f, 0x77, 0xb0, 0xc4, 0xcd, 0xd8, 0x37, 0x08, 0xe6, 0xf1, 0xa4, 0x77, 0x1c, 0x40, 0xa0, 0x4d, 0x96, 0xc3, 0x18, }; -const uint8_t sChipTest_RCAC_Ext_Basic_Missing_Cert_CHIP[247] = { +const uint8_t sChipTest_RCAC_Ext_Basic_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x13, 0x05, 0x5d, 0xd2, 0xa1, 0x17, 0x56, 0xdd, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -2357,7 +2357,7 @@ const uint8_t sChipTest_RCAC_Ext_Basic_Missing_Cert_CHIP[247] = { 0xd1, 0xe7, 0xb7, 0xa0, 0xc1, 0xd7, 0xc0, 0xa3, 0x20, 0x8c, 0xb5, 0xce, 0x75, 0x77, 0x16, 0xb8, 0xfd, 0x3a, 0x79, 0x9a, 0x00, 0x09, 0x02, 0xbe, 0x54, 0xb8, 0x5b, 0x8a, 0xe0, 0xfa, 0xd8, 0x48, 0x3d, 0xbe, 0xd9, 0xa6, 0x18, }; -const uint8_t sChipTest_NOC_Ext_Basic_CA_Missing_Cert_CHIP[277] = { +const uint8_t sChipTest_NOC_Ext_Basic_CA_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x01, 0xd0, 0xb3, 0x6c, 0x8d, 0x34, 0x5a, 0x06, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, @@ -2373,7 +2373,7 @@ const uint8_t sChipTest_NOC_Ext_Basic_CA_Missing_Cert_CHIP[277] = { 0x39, 0x3e, 0x48, 0xb2, 0x63, 0x8d, 0xdb, 0xae, 0x5f, 0xe6, 0x26, 0x8d, 0x05, 0x6b, 0xca, 0xeb, 0x82, 0xb0, 0x7c, 0xde, 0xb0, 0x72, 0xda, 0xf0, 0x75, 0x66, 0x40, 0x90, 0x8a, 0xbd, 0x80, 0x69, 0x17, 0x1b, 0x98, 0x63, 0x18, }; -const uint8_t sChipTest_ICAC_Ext_Basic_CA_Missing_Cert_CHIP[260] = { +const uint8_t sChipTest_ICAC_Ext_Basic_CA_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x10, 0x0d, 0xad, 0x02, 0x89, 0x70, 0x22, 0xae, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -2388,7 +2388,7 @@ const uint8_t sChipTest_ICAC_Ext_Basic_CA_Missing_Cert_CHIP[260] = { 0xb0, 0xef, 0x73, 0xb7, 0x5f, 0xd8, 0x32, 0x7f, 0xe7, 0x03, 0xf3, 0xef, 0x8a, 0x16, 0x7d, 0x6f, 0xe0, 0xd7, 0xf9, 0x82, 0x4f, 0x6a, 0x1a, 0x70, 0xec, 0x2f, 0x74, 0x41, 0x95, 0x52, 0x23, 0x4e, 0x45, 0xed, 0x11, 0xbd, 0x58, 0xe4, 0x07, 0x18, }; -const uint8_t sChipTest_RCAC_Ext_Basic_CA_Missing_Cert_CHIP[250] = { +const uint8_t sChipTest_RCAC_Ext_Basic_CA_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x6b, 0xb5, 0x91, 0x53, 0x37, 0xee, 0x45, 0x2a, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -2402,7 +2402,7 @@ const uint8_t sChipTest_RCAC_Ext_Basic_CA_Missing_Cert_CHIP[250] = { 0x9e, 0x5c, 0x4e, 0xd8, 0x7d, 0xfb, 0x92, 0xa6, 0x21, 0xb6, 0x94, 0xa0, 0xb1, 0x1e, 0x01, 0x93, 0x59, 0x39, 0x01, 0xc0, 0x73, 0x10, 0x9a, 0x1d, 0xfa, 0x00, 0x2e, 0xbc, 0xcc, 0x81, 0x3c, 0xcf, 0x12, 0x0c, 0x79, 0xbc, 0x43, 0x37, 0x6f, 0x18, }; -const uint8_t sChipTest_NOC_Ext_Basic_CA_Wrong_Cert_CHIP[279] = { +const uint8_t sChipTest_NOC_Ext_Basic_CA_Wrong_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x33, 0xc1, 0xc7, 0x50, 0x36, 0x97, 0x62, 0xc1, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, @@ -2418,7 +2418,7 @@ const uint8_t sChipTest_NOC_Ext_Basic_CA_Wrong_Cert_CHIP[279] = { 0x22, 0x44, 0x5d, 0x44, 0xc0, 0x06, 0x89, 0x1a, 0x9c, 0x43, 0x80, 0xb0, 0xa5, 0x06, 0x3f, 0x17, 0xef, 0x00, 0x11, 0x2f, 0x6d, 0xcf, 0xe4, 0x4a, 0x41, 0x2c, 0x2f, 0xd0, 0xc1, 0x03, 0xf2, 0xba, 0x43, 0x53, 0xb1, 0x6d, 0x9a, 0x90, 0x18, }; -const uint8_t sChipTest_ICAC_Ext_Basic_CA_Wrong_Cert_CHIP[262] = { +const uint8_t sChipTest_ICAC_Ext_Basic_CA_Wrong_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x22, 0xb0, 0x7e, 0x34, 0xb5, 0xa2, 0xa9, 0x4c, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, @@ -2433,7 +2433,7 @@ const uint8_t sChipTest_ICAC_Ext_Basic_CA_Wrong_Cert_CHIP[262] = { 0xff, 0xdd, 0xc1, 0x17, 0x6b, 0xdf, 0x77, 0xb5, 0xb8, 0xc1, 0xa1, 0x22, 0xd8, 0xbf, 0x4f, 0x63, 0x3b, 0x92, 0x26, 0x96, 0xf8, 0xde, 0x9c, 0xc0, 0x23, 0x06, 0x3a, 0x41, 0x58, 0x23, 0x18, }; -const uint8_t sChipTest_RCAC_Ext_Basic_CA_Wrong_Cert_CHIP[252] = { +const uint8_t sChipTest_RCAC_Ext_Basic_CA_Wrong_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x23, 0x34, 0xfc, 0x3d, 0xef, 0x9a, 0xdc, 0x0c, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -2447,7 +2447,7 @@ const uint8_t sChipTest_RCAC_Ext_Basic_CA_Wrong_Cert_CHIP[252] = { 0x04, 0x6b, 0x88, 0x46, 0x11, 0x49, 0xf0, 0xd3, 0x74, 0x0b, 0xe0, 0x71, 0x98, 0x32, 0x49, 0x3a, 0x2e, 0x16, 0x8e, 0x39, 0xd6, 0x12, 0x4e, 0x5f, 0xe2, 0xf4, 0xad, 0x98, 0xdb, 0x5d, 0x49, 0x9d, 0x5c, 0x76, 0xac, 0x4b, 0xbb, 0x81, 0xd2, 0x83, 0x9f, 0x18, }; -const uint8_t sChipTest_NOC_Ext_Basic_PathLen_Presence_Wrong_Cert_CHIP[279] = { +const uint8_t sChipTest_NOC_Ext_Basic_PathLen_Presence_Wrong_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x0b, 0x86, 0x21, 0x41, 0x75, 0x05, 0x6a, 0x67, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, @@ -2463,7 +2463,7 @@ const uint8_t sChipTest_NOC_Ext_Basic_PathLen_Presence_Wrong_Cert_CHIP[279] = { 0x5d, 0x1a, 0xe4, 0x7b, 0xfa, 0xe5, 0x1f, 0x34, 0x1e, 0x39, 0x94, 0xb1, 0x1b, 0xbb, 0x99, 0x10, 0xc3, 0x2b, 0xf9, 0x5b, 0xff, 0x1a, 0xce, 0xb8, 0x24, 0x86, 0xb5, 0x1b, 0x60, 0x03, 0xcc, 0x27, 0x94, 0x48, 0x2d, 0x82, 0x42, 0x3a, 0x18, }; -const uint8_t sChipTest_ICAC_Ext_Basic_PathLen_Presence_Wrong_Cert_CHIP[262] = { +const uint8_t sChipTest_ICAC_Ext_Basic_PathLen_Presence_Wrong_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x5a, 0xf2, 0x09, 0x6a, 0x40, 0x21, 0x27, 0xc8, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, @@ -2478,7 +2478,7 @@ const uint8_t sChipTest_ICAC_Ext_Basic_PathLen_Presence_Wrong_Cert_CHIP[262] = { 0x86, 0x0b, 0xb8, 0xc0, 0x8b, 0x0a, 0x39, 0x00, 0xb5, 0x6b, 0xfd, 0x4a, 0x7e, 0x88, 0x5c, 0xae, 0x2a, 0xbe, 0x65, 0x2a, 0x38, 0xcc, 0xf5, 0xdb, 0xf7, 0xdf, 0x68, 0xbe, 0xf0, 0x2a, 0x18, }; -const uint8_t sChipTest_RCAC_Ext_Basic_PathLen_Presence_Wrong_Cert_CHIP[252] = { +const uint8_t sChipTest_RCAC_Ext_Basic_PathLen_Presence_Wrong_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x11, 0xab, 0x40, 0x8a, 0x5e, 0x23, 0x2a, 0xb7, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -2492,7 +2492,7 @@ const uint8_t sChipTest_RCAC_Ext_Basic_PathLen_Presence_Wrong_Cert_CHIP[252] = { 0x81, 0x15, 0x95, 0xd8, 0x44, 0x9b, 0x28, 0x61, 0x1d, 0x06, 0xee, 0x26, 0x33, 0xad, 0x4b, 0x5d, 0x30, 0x46, 0x26, 0xe0, 0x13, 0xfc, 0x6c, 0xcf, 0x95, 0x3b, 0x17, 0xa4, 0xf8, 0xea, 0xd2, 0x67, 0x63, 0xb4, 0x42, 0xb1, 0x9d, 0x67, 0x56, 0xf5, 0x2e, 0x18, }; -const uint8_t sChipTest_NOC_Ext_Basic_PathLen2_Cert_CHIP[279] = { +const uint8_t sChipTest_NOC_Ext_Basic_PathLen2_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x7b, 0xfb, 0x4a, 0xdc, 0x30, 0xef, 0x6f, 0x33, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, @@ -2508,7 +2508,7 @@ const uint8_t sChipTest_NOC_Ext_Basic_PathLen2_Cert_CHIP[279] = { 0x85, 0xd7, 0x9b, 0xfa, 0x3f, 0xab, 0x71, 0x5e, 0x76, 0x64, 0x77, 0x8f, 0x1c, 0xf3, 0xe7, 0xe0, 0x38, 0xc3, 0x55, 0x1e, 0xc9, 0xdb, 0x07, 0xc2, 0x4b, 0x52, 0x60, 0xa0, 0x1d, 0xc6, 0x21, 0x02, 0x2a, 0x40, 0x15, 0xda, 0x7e, 0x05, 0x18, }; -const uint8_t sChipTest_ICAC_Ext_Basic_PathLen2_Cert_CHIP[262] = { +const uint8_t sChipTest_ICAC_Ext_Basic_PathLen2_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x12, 0x85, 0x81, 0xb1, 0x01, 0x89, 0x25, 0xac, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, @@ -2523,7 +2523,7 @@ const uint8_t sChipTest_ICAC_Ext_Basic_PathLen2_Cert_CHIP[262] = { 0xef, 0x95, 0x75, 0xf9, 0xf8, 0xe1, 0x96, 0xff, 0x97, 0x20, 0x2d, 0xec, 0xf2, 0x78, 0x8a, 0xae, 0x29, 0xea, 0xf0, 0x1a, 0x53, 0x58, 0xd6, 0x46, 0xb8, 0x25, 0x83, 0xd8, 0xe9, 0xd0, 0x18, }; -const uint8_t sChipTest_RCAC_Ext_Basic_PathLen2_Cert_CHIP[252] = { +const uint8_t sChipTest_RCAC_Ext_Basic_PathLen2_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x55, 0xc3, 0xe6, 0xec, 0xd7, 0x17, 0xdd, 0xd5, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -2537,7 +2537,7 @@ const uint8_t sChipTest_RCAC_Ext_Basic_PathLen2_Cert_CHIP[252] = { 0xcd, 0x1a, 0x64, 0x14, 0x55, 0x22, 0xad, 0x60, 0x55, 0xa3, 0xcb, 0xe7, 0x5f, 0x28, 0xd8, 0xe0, 0x7b, 0xbe, 0x54, 0x07, 0x31, 0x12, 0x03, 0x65, 0x8f, 0x56, 0x0b, 0x6e, 0xd6, 0x12, 0x90, 0x66, 0x74, 0x30, 0x08, 0x67, 0x93, 0x02, 0x43, 0x90, 0x7d, 0x18, }; -const uint8_t sChipTest_NOC_Ext_KeyUsage_Missing_Cert_CHIP[276] = { +const uint8_t sChipTest_NOC_Ext_KeyUsage_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x7a, 0xb2, 0x45, 0x84, 0xb2, 0x67, 0x7b, 0x5e, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, @@ -2553,7 +2553,7 @@ const uint8_t sChipTest_NOC_Ext_KeyUsage_Missing_Cert_CHIP[276] = { 0x9c, 0xaa, 0xd2, 0x94, 0x5e, 0x9d, 0x67, 0x46, 0x9e, 0x93, 0x9e, 0x28, 0xca, 0x68, 0x06, 0x6a, 0x0b, 0xc6, 0x34, 0xfc, 0x75, 0xa0, 0x07, 0xe2, 0xd2, 0x8f, 0xe3, 0x18, 0x12, 0x82, 0xc0, 0x92, 0xbe, 0x69, 0xd2, 0x18, }; -const uint8_t sChipTest_ICAC_Ext_KeyUsage_Missing_Cert_CHIP[259] = { +const uint8_t sChipTest_ICAC_Ext_KeyUsage_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x25, 0x48, 0x17, 0x8e, 0xd6, 0x4d, 0x72, 0xf4, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -2568,7 +2568,7 @@ const uint8_t sChipTest_ICAC_Ext_KeyUsage_Missing_Cert_CHIP[259] = { 0x33, 0x44, 0xdd, 0x40, 0xcd, 0x3c, 0xb6, 0x97, 0x16, 0x20, 0xf0, 0x28, 0x20, 0x8c, 0x4e, 0x35, 0x93, 0xe6, 0x82, 0x2e, 0xcd, 0x27, 0x52, 0xde, 0xd3, 0x5e, 0x21, 0x1a, 0x69, 0x53, 0x84, 0x3a, 0xbb, 0x0d, 0x53, 0x3e, 0xf0, 0x6f, 0x18, }; -const uint8_t sChipTest_RCAC_Ext_KeyUsage_Missing_Cert_CHIP[249] = { +const uint8_t sChipTest_RCAC_Ext_KeyUsage_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x40, 0xdb, 0xdb, 0x9f, 0x3a, 0xb7, 0xfb, 0xec, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -2582,7 +2582,7 @@ const uint8_t sChipTest_RCAC_Ext_KeyUsage_Missing_Cert_CHIP[249] = { 0x8c, 0x63, 0xa9, 0x31, 0x30, 0x67, 0xe4, 0xd5, 0x8b, 0x96, 0xd0, 0x2f, 0x9a, 0x2e, 0x9f, 0xe2, 0x6d, 0xc4, 0xe0, 0x44, 0x58, 0x7b, 0x67, 0x70, 0x6d, 0xc7, 0x4d, 0x5b, 0x2c, 0x31, 0x32, 0x5b, 0x31, 0x7d, 0x8b, 0xfc, 0x14, 0x86, 0x18, }; -const uint8_t sChipTest_NOC_Ext_KeyUsage_KeyCertSign_Wrong_Cert_CHIP[279] = { +const uint8_t sChipTest_NOC_Ext_KeyUsage_KeyCertSign_Wrong_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x61, 0xec, 0xf8, 0xbb, 0x7d, 0x9a, 0x24, 0xd4, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, @@ -2598,7 +2598,7 @@ const uint8_t sChipTest_NOC_Ext_KeyUsage_KeyCertSign_Wrong_Cert_CHIP[279] = { 0x22, 0x56, 0xae, 0x8a, 0xa4, 0x60, 0xa6, 0x63, 0x3a, 0x60, 0xd7, 0xaf, 0x6e, 0x51, 0xaf, 0xcf, 0xb9, 0xcd, 0xc8, 0x9f, 0x7b, 0x9e, 0xc9, 0xe2, 0x9c, 0x20, 0x89, 0x55, 0x0d, 0x27, 0xe2, 0xff, 0x36, 0xa1, 0x6b, 0x96, 0x66, 0x02, 0x18, }; -const uint8_t sChipTest_ICAC_Ext_KeyUsage_KeyCertSign_Wrong_Cert_CHIP[262] = { +const uint8_t sChipTest_ICAC_Ext_KeyUsage_KeyCertSign_Wrong_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x02, 0x5a, 0x32, 0xde, 0x7e, 0x72, 0xfe, 0x3f, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, @@ -2613,7 +2613,7 @@ const uint8_t sChipTest_ICAC_Ext_KeyUsage_KeyCertSign_Wrong_Cert_CHIP[262] = { 0xf1, 0x74, 0x5d, 0x0b, 0xee, 0x0a, 0xc7, 0xa1, 0x5a, 0x2d, 0x35, 0x94, 0xdf, 0x98, 0x16, 0x01, 0x3b, 0x70, 0x2c, 0xa3, 0x13, 0xe6, 0x91, 0x05, 0x64, 0x00, 0x75, 0x88, 0xbb, 0x3e, 0x18, }; -const uint8_t sChipTest_RCAC_Ext_KeyUsage_KeyCertSign_Wrong_Cert_CHIP[252] = { +const uint8_t sChipTest_RCAC_Ext_KeyUsage_KeyCertSign_Wrong_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x3c, 0x32, 0x40, 0xab, 0x13, 0x12, 0xb7, 0xba, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -2627,7 +2627,7 @@ const uint8_t sChipTest_RCAC_Ext_KeyUsage_KeyCertSign_Wrong_Cert_CHIP[252] = { 0x9a, 0x08, 0xb4, 0x45, 0x3e, 0xdd, 0xac, 0xff, 0xe4, 0xfc, 0x82, 0x57, 0x7b, 0x35, 0xf1, 0x3c, 0xcb, 0x9d, 0x82, 0xf1, 0x9d, 0x0c, 0x2e, 0xe9, 0xd5, 0x5d, 0x26, 0x03, 0x40, 0x7a, 0xdb, 0x52, 0xd6, 0x2f, 0xc3, 0x48, 0x0e, 0x5e, 0xb7, 0x93, 0xdc, 0x18, }; -const uint8_t sChipTest_NOC_Ext_AKID_Missing_Cert_CHIP[256] = { +const uint8_t sChipTest_NOC_Ext_AKID_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x0b, 0x1e, 0xe3, 0x0f, 0xf4, 0x00, 0xb3, 0x03, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, @@ -2642,7 +2642,7 @@ const uint8_t sChipTest_NOC_Ext_AKID_Missing_Cert_CHIP[256] = { 0x4d, 0xdc, 0x80, 0x9b, 0x67, 0xeb, 0x30, 0xc4, 0x85, 0x35, 0x67, 0x81, 0x71, 0xd3, 0x7e, 0x1c, 0x36, 0xf9, 0x14, 0x96, 0xd0, 0xb5, 0x10, 0x8b, 0x05, 0x5e, 0x3a, 0x9b, 0x4b, 0xa8, 0x76, 0xe5, 0x41, 0x0f, 0xe1, 0x18, }; -const uint8_t sChipTest_ICAC_Ext_AKID_Missing_Cert_CHIP[239] = { +const uint8_t sChipTest_ICAC_Ext_AKID_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x52, 0x3d, 0xe1, 0x2f, 0xae, 0x0b, 0xeb, 0x15, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -2656,7 +2656,7 @@ const uint8_t sChipTest_ICAC_Ext_AKID_Missing_Cert_CHIP[239] = { 0x45, 0x31, 0x76, 0x59, 0xe9, 0x42, 0x90, 0xcf, 0x61, 0x42, 0x83, 0xdb, 0x6d, 0x02, 0xeb, 0x49, 0xe9, 0x52, 0xcd, 0x3f, 0x21, 0xc3, 0xe5, 0xf2, 0x6a, 0x4e, 0x7f, 0x98, 0x55, 0xb1, 0xb8, 0x2c, 0x34, 0x80, 0xac, 0x28, 0xbb, 0x44, 0x18, }; -const uint8_t sChipTest_RCAC_Ext_AKID_Missing_Cert_CHIP[229] = { +const uint8_t sChipTest_RCAC_Ext_AKID_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x1c, 0x8e, 0xf7, 0xa3, 0xf9, 0xde, 0x11, 0x3e, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -2669,7 +2669,7 @@ const uint8_t sChipTest_RCAC_Ext_AKID_Missing_Cert_CHIP[229] = { 0xcd, 0x37, 0xd2, 0x6c, 0x77, 0xb6, 0xf5, 0xa2, 0xaf, 0xd1, 0x3b, 0xe2, 0x50, 0xaa, 0xc0, 0x3b, 0x48, 0x29, 0xcc, 0x21, 0x3c, 0x6a, 0x6c, 0x56, 0xf5, 0x12, 0xad, 0x93, 0x69, 0x4c, 0xf9, 0x8c, 0xf3, 0xcc, 0x65, 0x26, 0xab, 0x9e, 0xf7, 0x18, }; -const uint8_t sChipTest_NOC_Ext_AKID_Length_Invalid_Cert_CHIP[278] = { +const uint8_t sChipTest_NOC_Ext_AKID_Length_Invalid_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x50, 0xc7, 0xf7, 0x27, 0x54, 0x2f, 0xa3, 0xf4, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, @@ -2685,7 +2685,7 @@ const uint8_t sChipTest_NOC_Ext_AKID_Length_Invalid_Cert_CHIP[278] = { 0xd5, 0x38, 0x73, 0x2e, 0x44, 0xf3, 0xb9, 0x6e, 0x9a, 0x23, 0x7d, 0x21, 0x4c, 0xb9, 0xae, 0xe8, 0x95, 0xc8, 0x44, 0x0b, 0x6a, 0x93, 0x90, 0x60, 0x6b, 0xfa, 0xd8, 0x75, 0xfd, 0x3e, 0xd7, 0x49, 0x82, 0xfb, 0x76, 0xac, 0x17, 0x18, }; -const uint8_t sChipTest_ICAC_Ext_AKID_Length_Invalid_Cert_CHIP[261] = { +const uint8_t sChipTest_ICAC_Ext_AKID_Length_Invalid_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x52, 0x2a, 0xac, 0x6e, 0xca, 0x29, 0xe1, 0x43, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, @@ -2700,7 +2700,7 @@ const uint8_t sChipTest_ICAC_Ext_AKID_Length_Invalid_Cert_CHIP[261] = { 0x29, 0x54, 0x42, 0x6c, 0xbf, 0x3f, 0x5c, 0xb2, 0xcb, 0xf3, 0xe2, 0x1a, 0x35, 0xb7, 0xb1, 0x36, 0x68, 0xbf, 0xd0, 0xad, 0x1b, 0xad, 0x89, 0x0c, 0x49, 0x4c, 0x47, 0x7f, 0xf9, 0x18, }; -const uint8_t sChipTest_RCAC_Ext_AKID_Length_Invalid_Cert_CHIP[251] = { +const uint8_t sChipTest_RCAC_Ext_AKID_Length_Invalid_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x06, 0x0c, 0x59, 0xd1, 0xc8, 0x43, 0xeb, 0xce, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -2714,7 +2714,7 @@ const uint8_t sChipTest_RCAC_Ext_AKID_Length_Invalid_Cert_CHIP[251] = { 0x11, 0x51, 0x32, 0x54, 0xd1, 0xb7, 0xf0, 0x14, 0x66, 0x08, 0x3d, 0x5f, 0x38, 0xb9, 0x90, 0x14, 0x3b, 0x83, 0xe8, 0x88, 0x57, 0x53, 0xf4, 0xe1, 0x10, 0xa6, 0x74, 0x0d, 0x22, 0x16, 0x85, 0x49, 0x90, 0x8a, 0x10, 0xf9, 0x88, 0xe6, 0x83, 0x57, 0x18, }; -const uint8_t sChipTest_NOC_Ext_SKID_Missing_Cert_CHIP[256] = { +const uint8_t sChipTest_NOC_Ext_SKID_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x2e, 0x4c, 0xee, 0x19, 0x9f, 0xa2, 0xad, 0x45, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, @@ -2729,7 +2729,7 @@ const uint8_t sChipTest_NOC_Ext_SKID_Missing_Cert_CHIP[256] = { 0x9b, 0xea, 0x3d, 0x11, 0x3a, 0x71, 0x7a, 0x81, 0xcb, 0x9f, 0x21, 0xf9, 0x29, 0xe5, 0x59, 0x5a, 0x96, 0xf8, 0xa3, 0x68, 0xf7, 0xc8, 0xe7, 0xe6, 0x8f, 0xc3, 0xda, 0xb5, 0x21, 0x44, 0x76, 0x8a, 0x2d, 0x01, 0x61, 0x18, }; -const uint8_t sChipTest_ICAC_Ext_SKID_Missing_Cert_CHIP[239] = { +const uint8_t sChipTest_ICAC_Ext_SKID_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x37, 0x66, 0x06, 0x6f, 0x0b, 0x93, 0x68, 0xb6, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -2743,7 +2743,7 @@ const uint8_t sChipTest_ICAC_Ext_SKID_Missing_Cert_CHIP[239] = { 0xb8, 0xa7, 0xac, 0x8f, 0x17, 0x8b, 0xe5, 0x82, 0xd8, 0xe8, 0x5e, 0x32, 0x62, 0xfe, 0xa1, 0xdb, 0x28, 0x02, 0x53, 0xce, 0x8c, 0xf1, 0x51, 0x81, 0x09, 0xf9, 0x6c, 0x1a, 0x79, 0x8c, 0xbb, 0xff, 0x55, 0x81, 0xa3, 0xef, 0xdb, 0x35, 0x18, }; -const uint8_t sChipTest_RCAC_Ext_SKID_Missing_Cert_CHIP[229] = { +const uint8_t sChipTest_RCAC_Ext_SKID_Missing_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x4e, 0xdf, 0xe6, 0xc4, 0xc5, 0xcc, 0x38, 0x50, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -2756,7 +2756,7 @@ const uint8_t sChipTest_RCAC_Ext_SKID_Missing_Cert_CHIP[229] = { 0xef, 0x8c, 0x08, 0xdb, 0x01, 0x83, 0x3c, 0x63, 0x91, 0x49, 0xda, 0x9d, 0x47, 0x49, 0x23, 0x1f, 0x16, 0x81, 0x65, 0x4b, 0x51, 0xc3, 0xb3, 0x88, 0xa7, 0x0d, 0x8c, 0x36, 0x66, 0x07, 0x4d, 0x6f, 0xa8, 0x95, 0xfe, 0x31, 0xa7, 0xa3, 0x36, 0x18, }; -const uint8_t sChipTest_NOC_Ext_SKID_Length_Invalid_Cert_CHIP[278] = { +const uint8_t sChipTest_NOC_Ext_SKID_Length_Invalid_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x16, 0x2a, 0x4d, 0xfa, 0x70, 0x32, 0x14, 0x48, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, @@ -2772,7 +2772,7 @@ const uint8_t sChipTest_NOC_Ext_SKID_Length_Invalid_Cert_CHIP[278] = { 0x03, 0x77, 0x1a, 0x7c, 0xde, 0x66, 0x90, 0x35, 0x31, 0x9e, 0x44, 0xac, 0xc9, 0x14, 0xb2, 0x7a, 0x1e, 0x48, 0xb7, 0xa0, 0xce, 0x1c, 0x6a, 0x1e, 0x8f, 0xa6, 0x4e, 0xa1, 0xb4, 0xe9, 0xb0, 0xc9, 0x9c, 0x4b, 0x84, 0xa6, 0x11, 0x18, }; -const uint8_t sChipTest_ICAC_Ext_SKID_Length_Invalid_Cert_CHIP[261] = { +const uint8_t sChipTest_ICAC_Ext_SKID_Length_Invalid_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x31, 0x69, 0xff, 0xf4, 0x94, 0x51, 0xeb, 0x37, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, @@ -2787,7 +2787,7 @@ const uint8_t sChipTest_ICAC_Ext_SKID_Length_Invalid_Cert_CHIP[261] = { 0xc1, 0x68, 0x62, 0xb4, 0x35, 0x85, 0x73, 0xb5, 0xc1, 0x2f, 0xcc, 0x90, 0xeb, 0xbd, 0xdb, 0x6c, 0x8b, 0x8c, 0x93, 0x24, 0x1b, 0x25, 0xc4, 0x6f, 0x75, 0x9e, 0x4e, 0x95, 0xf9, 0x18, }; -const uint8_t sChipTest_RCAC_Ext_SKID_Length_Invalid_Cert_CHIP[251] = { +const uint8_t sChipTest_RCAC_Ext_SKID_Length_Invalid_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x02, 0xb4, 0xb6, 0x62, 0x7b, 0xff, 0x57, 0x93, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -2801,7 +2801,7 @@ const uint8_t sChipTest_RCAC_Ext_SKID_Length_Invalid_Cert_CHIP[251] = { 0xb7, 0xbf, 0xfd, 0x64, 0xad, 0x39, 0xaa, 0x06, 0x97, 0x73, 0x06, 0x34, 0x3a, 0xbc, 0x17, 0x21, 0x38, 0x1f, 0xd2, 0x40, 0xaf, 0x35, 0x0a, 0x1a, 0x4e, 0x58, 0xeb, 0x6b, 0xb2, 0x41, 0x92, 0xce, 0xc4, 0xe5, 0x06, 0x4b, 0xf2, 0xcf, 0xbf, 0x38, 0x18, }; -const uint8_t sChipTest_NOC_Signature_Wrong_Cert_CHIP[279] = { +const uint8_t sChipTest_NOC_Signature_Wrong_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x07, 0x8d, 0xc6, 0xdc, 0x67, 0x57, 0xed, 0xe4, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, @@ -2817,7 +2817,7 @@ const uint8_t sChipTest_NOC_Signature_Wrong_Cert_CHIP[279] = { 0x67, 0x16, 0x2a, 0x20, 0x20, 0xc6, 0x9f, 0xf1, 0xb1, 0x93, 0x2b, 0x3c, 0xbe, 0xb2, 0xe0, 0x1d, 0x74, 0x22, 0xd2, 0x50, 0x25, 0x70, 0xef, 0x9a, 0x31, 0xcd, 0x4c, 0x2c, 0x62, 0x98, 0x23, 0xe8, 0xcb, 0xd0, 0x12, 0x2a, 0x71, 0x30, 0x18, }; -const uint8_t sChipTest_ICAC_Signature_Wrong_Cert_CHIP[262] = { +const uint8_t sChipTest_ICAC_Signature_Wrong_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x4d, 0x7b, 0x5c, 0x64, 0x3e, 0x8f, 0xf8, 0x21, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, @@ -2832,7 +2832,7 @@ const uint8_t sChipTest_ICAC_Signature_Wrong_Cert_CHIP[262] = { 0xd5, 0x13, 0xef, 0x70, 0x6e, 0xa5, 0x29, 0xa7, 0x66, 0x73, 0x44, 0x81, 0xeb, 0x6a, 0xa2, 0xce, 0x0a, 0x91, 0x40, 0xcf, 0xa5, 0xd0, 0x50, 0x58, 0x4f, 0x1f, 0x2b, 0xb6, 0x7e, 0xd0, 0x18, }; -const uint8_t sChipTest_RCAC_Signature_Wrong_Cert_CHIP[252] = { +const uint8_t sChipTest_RCAC_Signature_Wrong_Cert_CHIP[] = { 0x15, 0x30, 0x01, 0x08, 0x6c, 0x65, 0x68, 0x4e, 0x24, 0xa0, 0x80, 0xbf, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, diff --git a/src/credentials/tests/TestCertificationDeclaration.cpp b/src/credentials/tests/TestCertificationDeclaration.cpp index 17a3667d90ce56..4fc4426668acbe 100644 --- a/src/credentials/tests/TestCertificationDeclaration.cpp +++ b/src/credentials/tests/TestCertificationDeclaration.cpp @@ -162,7 +162,7 @@ static constexpr uint8_t sTestCMS_SignedMessage02[] = { // -p 8013 -p 8014 -p 8015 -p 8016 -p 8017 -p 8018 -p 8019 -p 801a -p 801b -p 801c -p 801d -p 801e -p 801f -d 0016 -c // "ZIG0000000000000000" -l 0 -i 0 -n 0001 -t 0 // -static constexpr uint8_t gUntrustedCd[333] = { +static constexpr uint8_t gUntrustedCd[] = { 0x30, 0x82, 0x01, 0x49, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x01, 0x3a, 0x30, 0x82, 0x01, 0x36, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x81, 0xa2, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x81, 0x94, 0x04, 0x81, 0x91, 0x15, 0x24, @@ -181,7 +181,7 @@ static constexpr uint8_t gUntrustedCd[333] = { 0x1e, 0xf5, 0x68, 0x00, 0x23, 0x86, 0xba, 0x39, 0xe7, 0xab, 0x2d, 0xe5, 0x71, 0xe5, 0x36, 0x4e, 0xd0, 0x38, }; -static constexpr uint8_t gUntrustedCdCert[481] = { +static constexpr uint8_t gUntrustedCdCert[] = { 0x30, 0x82, 0x01, 0xdd, 0x30, 0x82, 0x01, 0x83, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x14, 0x4e, 0x84, 0xea, 0x0a, 0x68, 0x5b, 0xbe, 0xe2, 0xfb, 0x2d, 0xed, 0x76, 0xaf, 0xa1, 0x92, 0xc4, 0x3a, 0xce, 0x9b, 0x03, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, @@ -207,18 +207,19 @@ static constexpr uint8_t gUntrustedCdCert[481] = { 0xd4, 0x77, 0xb2, 0xf2, 0xae, 0x65, 0xbd, 0x9d, 0xfe, 0x2f, 0xf8, 0x38, 0xfc, 0x47, 0x45, 0x4f, 0x0c, 0x30, 0xfd }; -static constexpr uint8_t gUntrustedCdVerifyingKeyBytes[65] = { 0x04, 0xbc, 0x87, 0x13, 0x3a, 0x19, 0x16, 0x87, 0x04, 0x34, 0x1b, - 0x78, 0xc5, 0x70, 0x41, 0x21, 0x14, 0xbb, 0xe5, 0x3f, 0x62, 0x45, - 0x70, 0xe8, 0xf2, 0x37, 0x78, 0x77, 0x1a, 0xf3, 0x5c, 0xd8, 0x04, - 0x21, 0xc8, 0x2d, 0x40, 0x7f, 0xee, 0x37, 0xf5, 0xa5, 0x9f, 0x17, - 0x26, 0x33, 0x00, 0x4d, 0xf7, 0x66, 0xa3, 0x3a, 0x50, 0x75, 0x9f, - 0xcf, 0xd2, 0xb2, 0x1b, 0x5e, 0x58, 0x75, 0x08, 0x82, 0x3e }; +static constexpr uint8_t gUntrustedCdVerifyingKeyBytes[] = { + 0x04, 0xbc, 0x87, 0x13, 0x3a, 0x19, 0x16, 0x87, 0x04, 0x34, 0x1b, 0x78, 0xc5, 0x70, 0x41, 0x21, 0x14, + 0xbb, 0xe5, 0x3f, 0x62, 0x45, 0x70, 0xe8, 0xf2, 0x37, 0x78, 0x77, 0x1a, 0xf3, 0x5c, 0xd8, 0x04, 0x21, + 0xc8, 0x2d, 0x40, 0x7f, 0xee, 0x37, 0xf5, 0xa5, 0x9f, 0x17, 0x26, 0x33, 0x00, 0x4d, 0xf7, 0x66, 0xa3, + 0x3a, 0x50, 0x75, 0x9f, 0xcf, 0xd2, 0xb2, 0x1b, 0x5e, 0x58, 0x75, 0x08, 0x82, 0x3e, +}; static const P256PublicKey gUntrustedCdVerifyingKey(gUntrustedCdVerifyingKeyBytes); -static constexpr uint8_t gUntrustedCdKid[20] = { 0x75, 0xE3, 0x06, 0x0E, 0x0F, 0xCE, 0x28, 0x69, 0x5D, 0x19, - 0x75, 0x43, 0x32, 0xBB, 0xC7, 0x9B, 0xEB, 0x3D, 0x60, 0x6C }; +static constexpr uint8_t gUntrustedCdKid[] = { + 0x75, 0xE3, 0x06, 0x0E, 0x0F, 0xCE, 0x28, 0x69, 0x5D, 0x19, 0x75, 0x43, 0x32, 0xBB, 0xC7, 0x9B, 0xEB, 0x3D, 0x60, 0x6C, +}; -static constexpr uint8_t gCdSigningCert001[524] = { +static constexpr uint8_t gCdSigningCert001[] = { 0x30, 0x82, 0x02, 0x08, 0x30, 0x82, 0x01, 0xad, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x07, 0x63, 0x73, 0x61, 0x63, 0x64, 0x73, 0x31, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x52, 0x31, 0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x03, 0x43, 0x53, 0x41, 0x31, 0x2c, 0x30, 0x2a, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x23, 0x4d, 0x61, diff --git a/src/credentials/tests/TestDeviceAttestationConstruction.cpp b/src/credentials/tests/TestDeviceAttestationConstruction.cpp index f9f285f35d9c81..8d1b0175f51920 100644 --- a/src/credentials/tests/TestDeviceAttestationConstruction.cpp +++ b/src/credentials/tests/TestDeviceAttestationConstruction.cpp @@ -44,16 +44,21 @@ static void TestAttestationElements_Roundtrip(nlTestSuite * inSuite, void * inCo 0xab, 0x66, 0x62, 0x2e, 0x9d, 0x26, 0x10, 0x41, 0xf8, 0x0e, 0x97, 0x49, 0xfe, 0xff, 0x78, 0x10, 0x02, 0x49, 0x67, 0xae, 0xdf, 0x41, 0x38, 0x36, 0x5b, 0x0a, 0x22, 0x57, 0x14, 0x9c, 0x9a, 0x12, 0x3e, 0x0d, 0x30, 0xaa }; - static constexpr uint8_t attestationNonce[] = { 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, - 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, - 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2 }; - static constexpr uint32_t timestamp = 677103357; - static constexpr uint8_t vendorReserved1[] = { 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, - 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31 }; - static constexpr uint8_t vendorReserved3[] = { 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65 }; - static constexpr uint16_t vendorId = 0xbeef; - static constexpr uint16_t profileNum = 0xdead; + static constexpr uint8_t attestationNonce[] = { + 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, + 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2, + }; + static constexpr uint32_t timestamp = 677103357; + static constexpr uint8_t vendorReserved1[] = { + 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, + 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31, + }; + static constexpr uint8_t vendorReserved3[] = { + 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + }; + static constexpr uint16_t vendorId = 0xbeef; + static constexpr uint16_t profileNum = 0xdead; VendorReservedElement vendorReservedArray[2]; DeviceAttestationVendorReservedConstructor vendorReservedConstructor(vendorReservedArray, 2); @@ -147,16 +152,21 @@ static void TestAttestationElements_Construction(nlTestSuite * inSuite, void * i 0xab, 0x66, 0x62, 0x2e, 0x9d, 0x26, 0x10, 0x41, 0xf8, 0x0e, 0x97, 0x49, 0xfe, 0xff, 0x78, 0x10, 0x02, 0x49, 0x67, 0xae, 0xdf, 0x41, 0x38, 0x36, 0x5b, 0x0a, 0x22, 0x57, 0x14, 0x9c, 0x9a, 0x12, 0x3e, 0x0d, 0x30, 0xaa }; - static constexpr uint8_t attestationNonce[] = { 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, - 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, - 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2 }; - static constexpr uint32_t timestamp = 677103357; - static constexpr uint8_t vendorReserved1[] = { 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, - 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31 }; - static constexpr uint8_t vendorReserved3[] = { 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65 }; - static constexpr uint16_t vendorId = 0xFFF1; - static constexpr uint16_t profileNum = 0x003E; + static constexpr uint8_t attestationNonce[] = { + 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, + 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2, + }; + static constexpr uint32_t timestamp = 677103357; + static constexpr uint8_t vendorReserved1[] = { + 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, + 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31, + }; + static constexpr uint8_t vendorReserved3[] = { + 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + }; + static constexpr uint16_t vendorId = 0xFFF1; + static constexpr uint16_t profileNum = 0x003E; VendorReservedElement vendorReservedArray[2]; DeviceAttestationVendorReservedConstructor vendorReserved(vendorReservedArray, 2); vendorReserved.addVendorReservedElement(vendorId, profileNum, 1, ByteSpan(vendorReserved1)); @@ -222,14 +232,19 @@ static void TestAttestationElements_Deconstruction(nlTestSuite * inSuite, void * 0xab, 0x66, 0x62, 0x2e, 0x9d, 0x26, 0x10, 0x41, 0xf8, 0x0e, 0x97, 0x49, 0xfe, 0xff, 0x78, 0x10, 0x02, 0x49, 0x67, 0xae, 0xdf, 0x41, 0x38, 0x36, 0x5b, 0x0a, 0x22, 0x57, 0x14, 0x9c, 0x9a, 0x12, 0x3e, 0x0d, 0x30, 0xaa }; - constexpr uint8_t attestationNonceTestVector[] = { 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, - 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, - 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2 }; - constexpr uint32_t timestampTestVector = 677103357; - constexpr uint8_t vendorReserved1TestVector[] = { 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, - 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31 }; - constexpr uint8_t vendorReserved3TestVector[] = { 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65 }; + constexpr uint8_t attestationNonceTestVector[] = { + 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, + 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2, + }; + constexpr uint32_t timestampTestVector = 677103357; + constexpr uint8_t vendorReserved1TestVector[] = { + 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, + 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31, + }; + constexpr uint8_t vendorReserved3TestVector[] = { + 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + }; const ByteSpan vendorReservedArrayTestVector[] = { ByteSpan{ vendorReserved1TestVector }, ByteSpan{ vendorReserved3TestVector } }; constexpr uint16_t vendorIdTestVector = 0xFFF1; @@ -302,10 +317,11 @@ static void TestAttestationElements_DeconstructionNoVendorReserved(nlTestSuite * 0xab, 0x66, 0x62, 0x2e, 0x9d, 0x26, 0x10, 0x41, 0xf8, 0x0e, 0x97, 0x49, 0xfe, 0xff, 0x78, 0x10, 0x02, 0x49, 0x67, 0xae, 0xdf, 0x41, 0x38, 0x36, 0x5b, 0x0a, 0x22, 0x57, 0x14, 0x9c, 0x9a, 0x12, 0x3e, 0x0d, 0x30, 0xaa }; - constexpr uint8_t attestationNonceTestVector[] = { 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, - 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, - 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2 }; - constexpr uint32_t timestampTestVector = 677103357; + constexpr uint8_t attestationNonceTestVector[] = { + 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, + 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2, + }; + constexpr uint32_t timestampTestVector = 677103357; CHIP_ERROR err = CHIP_NO_ERROR; ByteSpan certificationDeclarationDeconstructed; @@ -404,11 +420,12 @@ static void TestAttestationElements_DeconstructionWithFirmwareInfo(nlTestSuite * 0xab, 0x66, 0x62, 0x2e, 0x9d, 0x26, 0x10, 0x41, 0xf8, 0x0e, 0x97, 0x49, 0xfe, 0xff, 0x78, 0x10, 0x02, 0x49, 0x67, 0xae, 0xdf, 0x41, 0x38, 0x36, 0x5b, 0x0a, 0x22, 0x57, 0x14, 0x9c, 0x9a, 0x12, 0x3e, 0x0d, 0x30, 0xaa }; - static constexpr uint8_t attestationNonceTestVector[] = { 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, - 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, - 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2 }; - static constexpr uint32_t timestampTestVector = 677103357; - static constexpr uint8_t firmwareInfoTestVector[] = { + static constexpr uint8_t attestationNonceTestVector[] = { + 0xe0, 0x42, 0x1b, 0x91, 0xc6, 0xfd, 0xcd, 0xb4, 0x0e, 0x2a, 0x4d, 0x2c, 0xf3, 0x1d, 0xb2, 0xb4, + 0xe1, 0x8b, 0x41, 0x1b, 0x1d, 0x3a, 0xd4, 0xd1, 0x2a, 0x9d, 0x90, 0xaa, 0x8e, 0x52, 0xfa, 0xe2, + }; + static constexpr uint32_t timestampTestVector = 677103357; + static constexpr uint8_t firmwareInfoTestVector[] = { 0x30, 0x67, 0x80, 0x01, 0x05, 0xA1, 0x62, 0x30, 0x2F, 0xA0, 0x0B, 0x80, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x81, 0x20, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, @@ -416,8 +433,10 @@ static void TestAttestationElements_DeconstructionWithFirmwareInfo(nlTestSuite * 0x20, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F }; - static constexpr uint8_t vendorReserved1TestVector[] = { 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, - 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31 }; + static constexpr uint8_t vendorReserved1TestVector[] = { + 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, + 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31, + }; static constexpr uint8_t vendorReserved3TestVector[] = { 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65 @@ -527,12 +546,12 @@ static void TestAttestationElements_DeconstructionCorruptedTLV(nlTestSuite * inS static void TestNocsrElements_Construction(nlTestSuite * inSuite, void * inContext) { - static constexpr uint8_t kNocsrNonce[32] = { + static constexpr uint8_t kNocsrNonce[] = { 0x81, 0x4a, 0x4d, 0x4c, 0x1c, 0x4a, 0x8e, 0xbb, 0xea, 0xdb, 0x0a, 0xe2, 0x82, 0xf9, 0x91, 0xeb, 0x13, 0xac, 0x5f, 0x9f, 0xce, 0x94, 0x30, 0x93, 0x19, 0xaa, 0x94, 0x09, 0x6c, 0x8c, 0xd4, 0xb8, }; - static constexpr uint8_t kExampleCsr[221] = { + static constexpr uint8_t kExampleCsr[] = { 0x30, 0x81, 0xda, 0x30, 0x81, 0x81, 0x02, 0x01, 0x00, 0x30, 0x0e, 0x31, 0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x03, 0x43, 0x53, 0x41, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x5c, 0xa2, 0x79, 0xe3, 0x66, @@ -547,17 +566,17 @@ static void TestNocsrElements_Construction(nlTestSuite * inSuite, void * inConte 0x72, 0x1c, 0x58, 0x0b, 0x6e, 0xae, 0x21, 0xbe, 0x5e, 0x6d, 0x0c, 0x72, }; - const uint8_t kVendorReserved1[23] = { + const uint8_t kVendorReserved1[] = { 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31, }; - const uint8_t kVendorReserved3[24] = { + const uint8_t kVendorReserved3[] = { 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, }; - const uint8_t kNoCsrElementsVector[314] = { + const uint8_t kNoCsrElementsVector[] = { 0x15, 0x30, 0x01, 0xdd, 0x30, 0x81, 0xda, 0x30, 0x81, 0x81, 0x02, 0x01, 0x00, 0x30, 0x0e, 0x31, 0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x03, 0x43, 0x53, 0x41, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x5c, 0xa2, 0x79, 0xe3, @@ -594,12 +613,12 @@ static void TestNocsrElements_Construction(nlTestSuite * inSuite, void * inConte static void TestNocsrElements_Deconstruction(nlTestSuite * inSuite, void * inContext) { - static constexpr uint8_t kNocsrNonce[32] = { + static constexpr uint8_t kNocsrNonce[] = { 0x81, 0x4a, 0x4d, 0x4c, 0x1c, 0x4a, 0x8e, 0xbb, 0xea, 0xdb, 0x0a, 0xe2, 0x82, 0xf9, 0x91, 0xeb, 0x13, 0xac, 0x5f, 0x9f, 0xce, 0x94, 0x30, 0x93, 0x19, 0xaa, 0x94, 0x09, 0x6c, 0x8c, 0xd4, 0xb8, }; - static constexpr uint8_t kExampleCsr[221] = { + static constexpr uint8_t kExampleCsr[] = { 0x30, 0x81, 0xda, 0x30, 0x81, 0x81, 0x02, 0x01, 0x00, 0x30, 0x0e, 0x31, 0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x03, 0x43, 0x53, 0x41, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x5c, 0xa2, 0x79, 0xe3, 0x66, @@ -614,17 +633,17 @@ static void TestNocsrElements_Deconstruction(nlTestSuite * inSuite, void * inCon 0x72, 0x1c, 0x58, 0x0b, 0x6e, 0xae, 0x21, 0xbe, 0x5e, 0x6d, 0x0c, 0x72, }; - const uint8_t kVendorReserved1[23] = { + const uint8_t kVendorReserved1[] = { 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x31, }; - const uint8_t kVendorReserved3[24] = { + const uint8_t kVendorReserved3[] = { 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x33, 0x5f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, }; - const uint8_t kNoCsrElementsVector[314] = { + const uint8_t kNoCsrElementsVector[] = { 0x15, 0x30, 0x01, 0xdd, 0x30, 0x81, 0xda, 0x30, 0x81, 0x81, 0x02, 0x01, 0x00, 0x30, 0x0e, 0x31, 0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x03, 0x43, 0x53, 0x41, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x5c, 0xa2, 0x79, 0xe3, diff --git a/src/crypto/CHIPCryptoPAL.h b/src/crypto/CHIPCryptoPAL.h index c8da9f98a60415..a5e2c080f012a6 100644 --- a/src/crypto/CHIPCryptoPAL.h +++ b/src/crypto/CHIPCryptoPAL.h @@ -133,13 +133,13 @@ constexpr size_t kCompressedFabricIdentifierSize = 8; * Spake2+ parameters for P256 * Defined in https://www.ietf.org/id/draft-bar-cfrg-spake2plus-01.html#name-ciphersuites */ -const uint8_t spake2p_M_p256[65] = { +const uint8_t spake2p_M_p256[] = { 0x04, 0x88, 0x6e, 0x2f, 0x97, 0xac, 0xe4, 0x6e, 0x55, 0xba, 0x9d, 0xd7, 0x24, 0x25, 0x79, 0xf2, 0x99, 0x3b, 0x64, 0xe1, 0x6e, 0xf3, 0xdc, 0xab, 0x95, 0xaf, 0xd4, 0x97, 0x33, 0x3d, 0x8f, 0xa1, 0x2f, 0x5f, 0xf3, 0x55, 0x16, 0x3e, 0x43, 0xce, 0x22, 0x4e, 0x0b, 0x0e, 0x65, 0xff, 0x02, 0xac, 0x8e, 0x5c, 0x7b, 0xe0, 0x94, 0x19, 0xc7, 0x85, 0xe0, 0xca, 0x54, 0x7d, 0x55, 0xa1, 0x2e, 0x2d, 0x20, }; -const uint8_t spake2p_N_p256[65] = { +const uint8_t spake2p_N_p256[] = { 0x04, 0xd8, 0xbb, 0xd6, 0xc6, 0x39, 0xc6, 0x29, 0x37, 0xb0, 0x4d, 0x99, 0x7f, 0x38, 0xc3, 0x77, 0x07, 0x19, 0xc6, 0x29, 0xd7, 0x01, 0x4d, 0x49, 0xa2, 0x4b, 0x4f, 0x98, 0xba, 0xa1, 0x29, 0x2b, 0x49, 0x07, 0xd6, 0x0a, 0xa6, 0xbf, 0xad, 0xe4, 0x50, 0x08, 0xa6, 0x36, 0x33, 0x7f, 0x51, 0x68, 0xc6, 0x4d, 0x9b, diff --git a/src/crypto/CHIPCryptoPALOpenSSL.cpp b/src/crypto/CHIPCryptoPALOpenSSL.cpp index b997ceed404193..a3321aaf9e2828 100644 --- a/src/crypto/CHIPCryptoPALOpenSSL.cpp +++ b/src/crypto/CHIPCryptoPALOpenSSL.cpp @@ -940,7 +940,7 @@ CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_k out_buf_length = (out_secret.Length() == 0) ? out_secret.Capacity() : out_secret.Length(); result = EVP_PKEY_derive(context, out_secret.Bytes(), &out_buf_length); VerifyOrExit(result == 1, error = CHIP_ERROR_INTERNAL); - SuccessOrExit(out_secret.SetLength(out_buf_length)); + SuccessOrExit(error = out_secret.SetLength(out_buf_length)); exit: if (ec_key != nullptr) diff --git a/src/crypto/CHIPCryptoPALPSA.cpp b/src/crypto/CHIPCryptoPALPSA.cpp index b4dfdf96577012..1d4a4e267cf56a 100644 --- a/src/crypto/CHIPCryptoPALPSA.cpp +++ b/src/crypto/CHIPCryptoPALPSA.cpp @@ -589,7 +589,7 @@ CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_k status = psa_raw_key_agreement(PSA_ALG_ECDH, context.key_id, remote_public_key.ConstBytes(), remote_public_key.Length(), out_secret.Bytes(), outputSize, &outputLength); VerifyOrExit(status == PSA_SUCCESS, error = CHIP_ERROR_INTERNAL); - SuccessOrExit(out_secret.SetLength(outputLength)); + SuccessOrExit(error = out_secret.SetLength(outputLength)); exit: logPsaError(status); @@ -1420,7 +1420,9 @@ CHIP_ERROR ValidateCertificateChain(const uint8_t * rootCertificate, size_t root error = CHIP_ERROR_CERT_NOT_TRUSTED; break; default: - SuccessOrExit((result = CertificateChainValidationResult::kInternalFrameworkError, error = CHIP_ERROR_INTERNAL)); + result = CertificateChainValidationResult::kInternalFrameworkError; + error = CHIP_ERROR_INTERNAL; + break; } exit: diff --git a/src/crypto/CHIPCryptoPALmbedTLS.cpp b/src/crypto/CHIPCryptoPALmbedTLS.cpp index 0865d467448d07..26a00156725791 100644 --- a/src/crypto/CHIPCryptoPALmbedTLS.cpp +++ b/src/crypto/CHIPCryptoPALmbedTLS.cpp @@ -653,7 +653,7 @@ CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_k result = mbedtls_mpi_write_binary(&mpi_secret, out_secret.Bytes(), secret_length); VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - SuccessOrExit(out_secret.SetLength(secret_length)); + SuccessOrExit(error = out_secret.SetLength(secret_length)); exit: keypair = nullptr; @@ -1537,7 +1537,9 @@ CHIP_ERROR ValidateCertificateChain(const uint8_t * rootCertificate, size_t root error = CHIP_ERROR_CERT_NOT_TRUSTED; break; default: - SuccessOrExit((result = CertificateChainValidationResult::kInternalFrameworkError, error = CHIP_ERROR_INTERNAL)); + result = CertificateChainValidationResult::kInternalFrameworkError; + error = CHIP_ERROR_INTERNAL; + break; } exit: diff --git a/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_P256.cpp b/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_P256.cpp index bac1d261e5bff3..a467f61fd8ea7d 100644 --- a/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_P256.cpp +++ b/src/crypto/hsm/nxp/CHIPCryptoPALHsm_SE05X_P256.cpp @@ -190,7 +190,7 @@ CHIP_ERROR P256KeypairHSM::ECDSA_sign_msg(const uint8_t * msg, size_t msg_length error = EcdsaAsn1SignatureToRaw(kP256_FE_Length, ByteSpan{ signature_se05x, signature_se05x_len }, out_raw_sig_span); SuccessOrExit(error); - SuccessOrExit(out_signature.SetLength(2 * kP256_FE_Length)); + SuccessOrExit(error = out_signature.SetLength(2 * kP256_FE_Length)); error = CHIP_NO_ERROR; exit: diff --git a/src/crypto/tests/AES_CCM_128_test_vectors.h b/src/crypto/tests/AES_CCM_128_test_vectors.h index 98eb06e29d6492..52911f5f4ff502 100644 --- a/src/crypto/tests/AES_CCM_128_test_vectors.h +++ b/src/crypto/tests/AES_CCM_128_test_vectors.h @@ -956,25 +956,25 @@ static const struct ccm_128_test_vector chiptest_dac9e1195a0d_test_vector_266 = .tcId = 37, .result = CHIP_ERROR_INTERNAL }; -static const uint8_t test_vector_2ef53070ae20_key[16] = { +static const uint8_t test_vector_2ef53070ae20_key[] = { 0x09, 0x53, 0xfa, 0x93, 0xe7, 0xca, 0xac, 0x96, 0x38, 0xf5, 0x88, 0x20, 0x22, 0x0a, 0x39, 0x8e, }; -static const uint8_t test_vector_2ef53070ae20_nonce[13] = { +static const uint8_t test_vector_2ef53070ae20_nonce[] = { 0x00, 0x80, 0x00, 0x00, 0x01, 0x12, 0x01, 0x00, 0x00, 0x12, 0x34, 0x56, 0x78, }; -static const uint8_t test_vector_2ef53070ae20_in[13] = { +static const uint8_t test_vector_2ef53070ae20_in[] = { 0xff, 0xfd, 0x03, 0x4b, 0x50, 0x05, 0x7e, 0x40, 0x00, 0x00, 0x01, 0x00, 0x00, }; -static const uint8_t test_vector_2ef53070ae20_ad[0] = {}; +static const uint8_t test_vector_2ef53070ae20_ad[] = {}; -static const uint8_t test_vector_2ef53070ae20_ct[13] = { +static const uint8_t test_vector_2ef53070ae20_ct[] = { 0xb5, 0xe5, 0xbf, 0xda, 0xcb, 0xaf, 0x6c, 0xb7, 0xfb, 0x6b, 0xff, 0x87, 0x1f, }; -static const uint8_t test_vector_2ef53070ae20_tag[16] = { +static const uint8_t test_vector_2ef53070ae20_tag[] = { 0xb0, 0xd6, 0xdd, 0x82, 0x7d, 0x35, 0xbf, 0x37, 0x2f, 0xa6, 0x42, 0x5d, 0xcd, 0x17, 0xd3, 0x56, }; @@ -994,25 +994,25 @@ static const struct ccm_128_test_vector aesccm128_matter_2ef53070ae20_test_vecto .tcId = 0, .result = CHIP_NO_ERROR, }; -static const uint8_t test_vector_91c8d337cf46_key[16] = { +static const uint8_t test_vector_91c8d337cf46_key[] = { 0x09, 0x53, 0xfa, 0x93, 0xe7, 0xca, 0xac, 0x96, 0x38, 0xf5, 0x88, 0x20, 0x22, 0x0a, 0x39, 0x8e, }; -static const uint8_t test_vector_91c8d337cf46_nonce[13] = { +static const uint8_t test_vector_91c8d337cf46_nonce[] = { 0x00, 0x80, 0x01, 0x48, 0x20, 0x23, 0x45, 0x00, 0x00, 0x12, 0x34, 0x56, 0x78, }; -static const uint8_t test_vector_91c8d337cf46_in[9] = { +static const uint8_t test_vector_91c8d337cf46_in[] = { 0x12, 0x01, 0x04, 0x32, 0x03, 0x08, 0xba, 0x07, 0x2f, }; -static const uint8_t test_vector_91c8d337cf46_ad[0] = {}; +static const uint8_t test_vector_91c8d337cf46_ad[] = {}; -static const uint8_t test_vector_91c8d337cf46_ct[9] = { +static const uint8_t test_vector_91c8d337cf46_ct[] = { 0x79, 0xd7, 0xdb, 0xc0, 0xc9, 0xb4, 0xd4, 0x3e, 0xeb, }; -static const uint8_t test_vector_91c8d337cf46_tag[16] = { +static const uint8_t test_vector_91c8d337cf46_tag[] = { 0x28, 0x15, 0x08, 0xe5, 0x0d, 0x58, 0xdb, 0xbd, 0x27, 0xc3, 0x95, 0x97, 0x80, 0x0f, 0x47, 0x33, }; @@ -1032,25 +1032,25 @@ static const struct ccm_128_test_vector aesccm128_matter_91c8d337cf46_test_vecto .tcId = 1, .result = CHIP_NO_ERROR, }; -static const uint8_t test_vector_37fc295e3601_key[16] = { +static const uint8_t test_vector_37fc295e3601_key[] = { 0x09, 0x53, 0xfa, 0x93, 0xe7, 0xca, 0xac, 0x96, 0x38, 0xf5, 0x88, 0x20, 0x22, 0x0a, 0x39, 0x8e, }; -static const uint8_t test_vector_37fc295e3601_nonce[13] = { +static const uint8_t test_vector_37fc295e3601_nonce[] = { 0x00, 0x80, 0x2b, 0x38, 0x32, 0x2f, 0xe3, 0x00, 0x00, 0x12, 0x34, 0x56, 0x78, }; -static const uint8_t test_vector_37fc295e3601_in[9] = { +static const uint8_t test_vector_37fc295e3601_in[] = { 0x12, 0x01, 0x04, 0xfa, 0x02, 0x05, 0xa6, 0x00, 0x0a, }; -static const uint8_t test_vector_37fc295e3601_ad[0] = {}; +static const uint8_t test_vector_37fc295e3601_ad[] = {}; -static const uint8_t test_vector_37fc295e3601_ct[9] = { +static const uint8_t test_vector_37fc295e3601_ct[] = { 0x53, 0x27, 0x30, 0x86, 0xb8, 0xc5, 0xee, 0x00, 0xbd, }; -static const uint8_t test_vector_37fc295e3601_tag[16] = { +static const uint8_t test_vector_37fc295e3601_tag[] = { 0xd5, 0x2b, 0x87, 0xa8, 0xce, 0x62, 0x90, 0xa7, 0x72, 0xd4, 0x72, 0xb8, 0xc6, 0x2b, 0xdc, 0x13, }; @@ -1070,31 +1070,31 @@ static const struct ccm_128_test_vector aesccm128_matter_37fc295e3601_test_vecto .tcId = 2, .result = CHIP_NO_ERROR, }; -static const uint8_t test_vector_8bab3993e4d1_key[16] = { +static const uint8_t test_vector_8bab3993e4d1_key[] = { 0xbe, 0x63, 0x51, 0x05, 0x43, 0x48, 0x59, 0xf4, 0x84, 0xfc, 0x79, 0x8e, 0x04, 0x3c, 0xe4, 0x0e, }; -static const uint8_t test_vector_8bab3993e4d1_nonce[13] = { +static const uint8_t test_vector_8bab3993e4d1_nonce[] = { 0x00, 0x80, 0x00, 0x00, 0x02, 0x12, 0x01, 0x00, 0x00, 0x12, 0x34, 0x56, 0x78, }; -static const uint8_t test_vector_8bab3993e4d1_in[4] = { +static const uint8_t test_vector_8bab3993e4d1_in[] = { 0x23, 0x45, 0x01, 0x00, }; -static const uint8_t test_vector_8bab3993e4d1_ad[0] = {}; +static const uint8_t test_vector_8bab3993e4d1_ad[] = {}; -static const uint8_t test_vector_8bab3993e4d1_ct[4] = { +static const uint8_t test_vector_8bab3993e4d1_ct[] = { 0xb0, 0xe5, 0xd0, 0xad, }; -static const uint8_t test_vector_8bab3993e4d1_tag[16] = { +static const uint8_t test_vector_8bab3993e4d1_tag[] = { 0x60, 0x78, 0xe0, 0xdd, 0xbb, 0x7c, 0xd4, 0x3f, 0xae, 0xa5, 0x7c, 0x70, 0x51, 0xe5, 0xb4, 0xae, }; @@ -1114,25 +1114,25 @@ static const struct ccm_128_test_vector aesccm128_matter_8bab3993e4d1_test_vecto .tcId = 3, .result = CHIP_NO_ERROR, }; -static const uint8_t test_vector_76dbd8e42344_key[16] = { +static const uint8_t test_vector_76dbd8e42344_key[] = { 0xbe, 0x63, 0x51, 0x05, 0x43, 0x48, 0x59, 0xf4, 0x84, 0xfc, 0x79, 0x8e, 0x04, 0x3c, 0xe4, 0x0e, }; -static const uint8_t test_vector_76dbd8e42344_nonce[13] = { +static const uint8_t test_vector_76dbd8e42344_nonce[] = { 0x00, 0x80, 0x01, 0x48, 0x34, 0x23, 0x45, 0x00, 0x00, 0x12, 0x34, 0x56, 0x78, }; -static const uint8_t test_vector_76dbd8e42344_in[9] = { +static const uint8_t test_vector_76dbd8e42344_in[] = { 0x12, 0x01, 0x02, 0x00, 0x12, 0x34, 0x56, 0x78, 0x00, }; -static const uint8_t test_vector_76dbd8e42344_ad[0] = {}; +static const uint8_t test_vector_76dbd8e42344_ad[] = {}; -static const uint8_t test_vector_76dbd8e42344_ct[9] = { +static const uint8_t test_vector_76dbd8e42344_ct[] = { 0x5c, 0x39, 0xda, 0x17, 0x92, 0xb1, 0xfe, 0xe9, 0xec, }; -static const uint8_t test_vector_76dbd8e42344_tag[16] = { +static const uint8_t test_vector_76dbd8e42344_tag[] = { 0xa9, 0x23, 0x39, 0x58, 0xac, 0xed, 0x64, 0xf2, 0x34, 0x3b, 0x9d, 0x61, 0x0e, 0x87, 0x64, 0x40, }; @@ -1152,25 +1152,25 @@ static const struct ccm_128_test_vector aesccm128_matter_76dbd8e42344_test_vecto .tcId = 4, .result = CHIP_NO_ERROR, }; -static const uint8_t test_vector_ea145e3af464_key[16] = { +static const uint8_t test_vector_ea145e3af464_key[] = { 0x09, 0x53, 0xfa, 0x93, 0xe7, 0xca, 0xac, 0x96, 0x38, 0xf5, 0x88, 0x20, 0x22, 0x0a, 0x39, 0x8e, }; -static const uint8_t test_vector_ea145e3af464_nonce[13] = { +static const uint8_t test_vector_ea145e3af464_nonce[] = { 0x00, 0x8b, 0x01, 0x48, 0x35, 0x23, 0x45, 0x00, 0x00, 0x12, 0x34, 0x56, 0x78, }; -static const uint8_t test_vector_ea145e3af464_in[9] = { +static const uint8_t test_vector_ea145e3af464_in[] = { 0x00, 0x03, 0x00, 0xa6, 0xac, 0x00, 0x00, 0x00, 0x02, }; -static const uint8_t test_vector_ea145e3af464_ad[0] = {}; +static const uint8_t test_vector_ea145e3af464_ad[] = {}; -static const uint8_t test_vector_ea145e3af464_ct[9] = { +static const uint8_t test_vector_ea145e3af464_ct[] = { 0x0d, 0x0d, 0x73, 0x0f, 0x94, 0xd7, 0xf3, 0x50, 0x9d, }; -static const uint8_t test_vector_ea145e3af464_tag[16] = { +static const uint8_t test_vector_ea145e3af464_tag[] = { 0xdd, 0xa1, 0x69, 0x4a, 0xdb, 0x79, 0x16, 0x52, 0xfb, 0x6a, 0xe0, 0x46, 0x82, 0xf1, 0x9b, 0x29, }; @@ -1190,25 +1190,25 @@ static const struct ccm_128_test_vector aesccm128_matter_ea145e3af464_test_vecto .tcId = 5, .result = CHIP_NO_ERROR, }; -static const uint8_t test_vector_08f3cd0b35d1_key[16] = { +static const uint8_t test_vector_08f3cd0b35d1_key[] = { 0x09, 0x53, 0xfa, 0x93, 0xe7, 0xca, 0xac, 0x96, 0x38, 0xf5, 0x88, 0x20, 0x22, 0x0a, 0x39, 0x8e, }; -static const uint8_t test_vector_08f3cd0b35d1_nonce[13] = { +static const uint8_t test_vector_08f3cd0b35d1_nonce[] = { 0x00, 0x8b, 0x01, 0x48, 0x36, 0x23, 0x45, 0x00, 0x00, 0x12, 0x34, 0x56, 0x78, }; -static const uint8_t test_vector_08f3cd0b35d1_in[9] = { +static const uint8_t test_vector_08f3cd0b35d1_in[] = { 0x00, 0x03, 0x00, 0xa6, 0xac, 0x00, 0x00, 0x00, 0x03, }; -static const uint8_t test_vector_08f3cd0b35d1_ad[0] = {}; +static const uint8_t test_vector_08f3cd0b35d1_ad[] = {}; -static const uint8_t test_vector_08f3cd0b35d1_ct[9] = { +static const uint8_t test_vector_08f3cd0b35d1_ct[] = { 0xd8, 0x5d, 0x80, 0x6b, 0xbe, 0xd2, 0x48, 0x61, 0x4f, }; -static const uint8_t test_vector_08f3cd0b35d1_tag[16] = { +static const uint8_t test_vector_08f3cd0b35d1_tag[] = { 0xef, 0x7f, 0x4d, 0x55, 0xe4, 0x7d, 0x21, 0x52, 0x2e, 0xbe, 0x3d, 0x5b, 0xc7, 0x35, 0xa5, 0xc5, }; @@ -1228,31 +1228,31 @@ static const struct ccm_128_test_vector aesccm128_matter_08f3cd0b35d1_test_vecto .tcId = 6, .result = CHIP_NO_ERROR, }; -static const uint8_t test_vector_70d7d4a1f8ea_key[16] = { +static const uint8_t test_vector_70d7d4a1f8ea_key[] = { 0xbe, 0x63, 0x51, 0x05, 0x43, 0x48, 0x59, 0xf4, 0x84, 0xfc, 0x79, 0x8e, 0x04, 0x3c, 0xe4, 0x0e, }; -static const uint8_t test_vector_70d7d4a1f8ea_nonce[13] = { +static const uint8_t test_vector_70d7d4a1f8ea_nonce[] = { 0x00, 0x80, 0x00, 0x00, 0x03, 0x12, 0x01, 0x00, 0x00, 0x12, 0x34, 0x56, 0x78, }; -static const uint8_t test_vector_70d7d4a1f8ea_in[4] = { +static const uint8_t test_vector_70d7d4a1f8ea_in[] = { 0x23, 0x45, 0x01, 0x01, }; -static const uint8_t test_vector_70d7d4a1f8ea_ad[0] = {}; +static const uint8_t test_vector_70d7d4a1f8ea_ad[] = {}; -static const uint8_t test_vector_70d7d4a1f8ea_ct[4] = { +static const uint8_t test_vector_70d7d4a1f8ea_ct[] = { 0x77, 0x77, 0xed, 0x35, }; -static const uint8_t test_vector_70d7d4a1f8ea_tag[16] = { +static const uint8_t test_vector_70d7d4a1f8ea_tag[] = { 0x35, 0xd8, 0x4e, 0x18, 0x78, 0x4c, 0x4b, 0xf3, 0xcb, 0x1b, 0x4c, 0x19, 0x1d, 0xc5, 0x55, 0xcc, }; @@ -1272,31 +1272,31 @@ static const struct ccm_128_test_vector aesccm128_matter_70d7d4a1f8ea_test_vecto .tcId = 7, .result = CHIP_NO_ERROR, }; -static const uint8_t test_vector_56f7e4096627_key[16] = { +static const uint8_t test_vector_56f7e4096627_key[] = { 0xbe, 0x63, 0x51, 0x05, 0x43, 0x48, 0x59, 0xf4, 0x84, 0xfc, 0x79, 0x8e, 0x04, 0x3c, 0xe4, 0x0e, }; -static const uint8_t test_vector_56f7e4096627_nonce[13] = { +static const uint8_t test_vector_56f7e4096627_nonce[] = { 0x00, 0x80, 0x00, 0x00, 0x04, 0x12, 0x01, 0x00, 0x00, 0x12, 0x34, 0x56, 0x78, }; -static const uint8_t test_vector_56f7e4096627_in[4] = { +static const uint8_t test_vector_56f7e4096627_in[] = { 0x23, 0x45, 0x01, 0x01, }; -static const uint8_t test_vector_56f7e4096627_ad[0] = {}; +static const uint8_t test_vector_56f7e4096627_ad[] = {}; -static const uint8_t test_vector_56f7e4096627_ct[4] = { +static const uint8_t test_vector_56f7e4096627_ct[] = { 0xae, 0x21, 0x46, 0x60, }; -static const uint8_t test_vector_56f7e4096627_tag[16] = { +static const uint8_t test_vector_56f7e4096627_tag[] = { 0xd1, 0x46, 0xb2, 0x8b, 0xea, 0xfe, 0x7f, 0x98, 0x4f, 0x94, 0x30, 0x50, 0x2d, 0x07, 0xaa, 0xfe, }; @@ -1316,31 +1316,31 @@ static const struct ccm_128_test_vector aesccm128_matter_56f7e4096627_test_vecto .tcId = 8, .result = CHIP_NO_ERROR, }; -static const uint8_t test_vector_02112b4a46d8_key[16] = { +static const uint8_t test_vector_02112b4a46d8_key[] = { 0xbe, 0x63, 0x51, 0x05, 0x43, 0x48, 0x59, 0xf4, 0x84, 0xfc, 0x79, 0x8e, 0x04, 0x3c, 0xe4, 0x0e, }; -static const uint8_t test_vector_02112b4a46d8_nonce[13] = { +static const uint8_t test_vector_02112b4a46d8_nonce[] = { 0x00, 0x80, 0x00, 0x00, 0x05, 0x12, 0x01, 0x00, 0x00, 0x12, 0x34, 0x56, 0x78, }; -static const uint8_t test_vector_02112b4a46d8_in[4] = { +static const uint8_t test_vector_02112b4a46d8_in[] = { 0x23, 0x45, 0x01, 0x00, }; -static const uint8_t test_vector_02112b4a46d8_ad[0] = {}; +static const uint8_t test_vector_02112b4a46d8_ad[] = {}; -static const uint8_t test_vector_02112b4a46d8_ct[4] = { +static const uint8_t test_vector_02112b4a46d8_ct[] = { 0x7d, 0x3a, 0xe6, 0x2a, }; -static const uint8_t test_vector_02112b4a46d8_tag[16] = { +static const uint8_t test_vector_02112b4a46d8_tag[] = { 0x52, 0xee, 0x03, 0xab, 0x84, 0xe1, 0xa3, 0x33, 0x65, 0xe8, 0xa6, 0x12, 0x75, 0x66, 0x5f, 0x71, }; @@ -1360,27 +1360,27 @@ static const struct ccm_128_test_vector aesccm128_matter_02112b4a46d8_test_vecto .tcId = 9, .result = CHIP_NO_ERROR, }; -static const uint8_t test_vector_ac063659d220_key[16] = { +static const uint8_t test_vector_ac063659d220_key[] = { 0x63, 0x96, 0x47, 0x71, 0x73, 0x4f, 0xbd, 0x76, 0xe3, 0xb4, 0x05, 0x19, 0xd1, 0xd9, 0x4a, 0x48, }; -static const uint8_t test_vector_ac063659d220_nonce[13] = { +static const uint8_t test_vector_ac063659d220_nonce[] = { 0x01, 0x00, 0x07, 0x08, 0x0d, 0x12, 0x34, 0x97, 0x36, 0x12, 0x34, 0x56, 0x77, }; -static const uint8_t test_vector_ac063659d220_in[8] = { +static const uint8_t test_vector_ac063659d220_in[] = { 0xea, 0x0a, 0x00, 0x57, 0x6f, 0x72, 0x6c, 0x64, }; -static const uint8_t test_vector_ac063659d220_ad[16] = { +static const uint8_t test_vector_ac063659d220_ad[] = { 0xf4, 0xa0, 0x02, 0xc7, 0xfb, 0x1e, 0x4c, 0xa0, 0xa4, 0x69, 0xa0, 0x21, 0xde, 0x0d, 0xb8, 0x75, }; -static const uint8_t test_vector_ac063659d220_ct[8] = { +static const uint8_t test_vector_ac063659d220_ct[] = { 0xde, 0x15, 0x47, 0x11, 0x84, 0x63, 0x12, 0x3e, }; -static const uint8_t test_vector_ac063659d220_tag[16] = { +static const uint8_t test_vector_ac063659d220_tag[] = { 0x14, 0x60, 0x4c, 0x1d, 0xdb, 0x4f, 0x59, 0x87, 0x06, 0x4b, 0x17, 0x36, 0xf3, 0x92, 0x39, 0x62, }; diff --git a/src/crypto/tests/CHIPCryptoPALTest.cpp b/src/crypto/tests/CHIPCryptoPALTest.cpp index 117957bd091730..fae25912c2fe44 100644 --- a/src/crypto/tests/CHIPCryptoPALTest.cpp +++ b/src/crypto/tests/CHIPCryptoPALTest.cpp @@ -1200,7 +1200,7 @@ void TestCSR_Verify(nlTestSuite * inSuite, void * inContext) // Second case: correct CSR { - const uint8_t kGoodCsr[205] = { + const uint8_t kGoodCsr[] = { 0x30, 0x81, 0xca, 0x30, 0x70, 0x02, 0x01, 0x00, 0x30, 0x0e, 0x31, 0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x03, 0x43, 0x53, 0x52, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xa3, 0xbe, 0xa1, 0xf5, 0x42, 0x01, @@ -1213,7 +1213,7 @@ void TestCSR_Verify(nlTestSuite * inSuite, void * inContext) 0x21, 0x00, 0x8b, 0x6b, 0x49, 0xb6, 0x7d, 0x3e, 0x67, 0x9e, 0xb1, 0x22, 0xd3, 0x63, 0x82, 0x40, 0x4f, 0x49, 0xa4, 0xdc, 0x17, 0x35, 0xac, 0x4b, 0x7a, 0xbf, 0x52, 0x05, 0x58, 0x68, 0xe0, 0xaa, 0xd2, 0x8e, }; - const uint8_t kGoodCsrSubjectPublicKey[65] = { + const uint8_t kGoodCsrSubjectPublicKey[] = { 0x04, 0xa3, 0xbe, 0xa1, 0xf5, 0x42, 0x01, 0x07, 0x3c, 0x4b, 0x75, 0x85, 0xd8, 0xe2, 0x98, 0xac, 0x2f, 0xf6, 0x98, 0xdb, 0xd9, 0x5b, 0xe0, 0x7e, 0xc1, 0x04, 0xd5, 0x73, 0xc5, 0xb0, 0x90, 0x77, 0x27, 0x00, 0x1e, 0x22, 0xc7, 0x89, 0x5e, 0x4d, 0x75, 0x07, 0x89, 0x82, 0x0f, 0x49, 0xb6, 0x59, 0xd5, 0xc5, 0x15, @@ -1234,7 +1234,7 @@ void TestCSR_Verify(nlTestSuite * inSuite, void * inContext) // Third case: bad signature { - const uint8_t kBadSignatureSignatureCsr[205] = { + const uint8_t kBadSignatureSignatureCsr[] = { 0x30, 0x81, 0xca, 0x30, 0x70, 0x02, 0x01, 0x00, 0x30, 0x0e, 0x31, 0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x03, 0x43, 0x53, 0x52, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xa3, 0xbe, 0xa1, 0xf5, 0x42, 0x01, @@ -1259,7 +1259,7 @@ void TestCSR_Verify(nlTestSuite * inSuite, void * inContext) // Fourth case: CSR too big { - const uint8_t kBadTooBigCsr[256] = { + const uint8_t kBadTooBigCsr[] = { 0x30, 0x81, 0xda, 0x30, 0x81, 0x81, 0x02, 0x01, 0x00, 0x30, 0x0e, 0x31, 0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x03, 0x43, 0x53, 0x41, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x72, 0x48, 0xc0, 0x36, 0xf0, 0x12, 0x5f, 0xd1, @@ -1285,7 +1285,9 @@ void TestCSR_Verify(nlTestSuite * inSuite, void * inContext) // Fifth case: obviously invalid CSR (1/2) { - const uint8_t kTooSmallCsr[10] = { 0x30, 0x81, 0xda, 0x30, 0x81, 0x81, 0x02, 0x01, 0x00, 0x30 }; + const uint8_t kTooSmallCsr[] = { + 0x30, 0x81, 0xda, 0x30, 0x81, 0x81, 0x02, 0x01, 0x00, 0x30, + }; Crypto::ClearSecretData(pubKey.Bytes(), pubKey.Length()); @@ -1298,7 +1300,7 @@ void TestCSR_Verify(nlTestSuite * inSuite, void * inContext) // Sixth case: obviously invalid CSR (2/2) { - const uint8_t kNotSequenceCsr[205] = { + const uint8_t kNotSequenceCsr[] = { 0x31, 0x81, 0xca, 0x30, 0x70, 0x02, 0x01, 0x00, 0x30, 0x0e, 0x31, 0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x03, 0x43, 0x53, 0x52, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xa3, 0xbe, 0xa1, 0xf5, 0x42, 0x01, @@ -1838,7 +1840,7 @@ static void TestCompressedFabricIdentifier(nlTestSuite * inSuite, void * inConte { HeapChecker heapChecker(inSuite); // Data from spec test vector (see Operational Discovery section) - const uint8_t kRootPublicKey[65] = { + const uint8_t kRootPublicKey[] = { 0x04, 0x4a, 0x9f, 0x42, 0xb1, 0xca, 0x48, 0x40, 0xd3, 0x72, 0x92, 0xbb, 0xc7, 0xf6, 0xa7, 0xe1, 0x1e, 0x22, 0x20, 0x0c, 0x97, 0x6f, 0xc9, 0x00, 0xdb, 0xc9, 0x8a, 0x7a, 0x38, 0x3a, 0x64, 0x1c, 0xb8, 0x25, 0x4a, 0x2e, 0x56, 0xd4, 0xe2, 0x95, 0xa8, 0x47, 0x94, 0x3b, 0x4e, 0x38, 0x97, 0xc4, 0xa7, 0x73, 0xe9, @@ -1848,7 +1850,7 @@ static void TestCompressedFabricIdentifier(nlTestSuite * inSuite, void * inConte constexpr uint64_t kFabricId = 0x2906C908D115D362; - const uint8_t kExpectedCompressedFabricIdentifier[8] = { + const uint8_t kExpectedCompressedFabricIdentifier[] = { 0x87, 0xe1, 0xb0, 0x04, 0xe2, 0x35, 0xa1, 0x30, }; static_assert(sizeof(kExpectedCompressedFabricIdentifier) == kCompressedFabricIdentifierSize, @@ -1892,7 +1894,7 @@ static void TestCompressedFabricIdentifier(nlTestSuite * inSuite, void * inConte NL_TEST_ASSERT(inSuite, compressed_fabric_id_int == kExpectedCompressedFabricIdentifierInt); // Test invalid public key - const uint8_t kInvalidRootPublicKey[65] = { + const uint8_t kInvalidRootPublicKey[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, diff --git a/src/crypto/tests/DerSigConversion_test_vectors.h b/src/crypto/tests/DerSigConversion_test_vectors.h index 622019eda07819..533a1a25f1ccf9 100644 --- a/src/crypto/tests/DerSigConversion_test_vectors.h +++ b/src/crypto/tests/DerSigConversion_test_vectors.h @@ -41,24 +41,24 @@ typedef struct } der_sig_conv_vector; // CASE 1: MSB not set, all bytes non-zero -const uint8_t kDerSigConvRCase1[32] = { +const uint8_t kDerSigConvRCase1[] = { 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, }; -const uint8_t kDerSigConvSCase1[32] = { +const uint8_t kDerSigConvSCase1[] = { 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, }; -const uint8_t kDerSigConvRawCase1[64] = { +const uint8_t kDerSigConvRawCase1[] = { 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, }; -const uint8_t kDerSigConvDerCase1[70] = { +const uint8_t kDerSigConvDerCase1[] = { 0x30, 0x44, 0x02, 0x20, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x02, 0x20, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, @@ -76,24 +76,24 @@ static const der_sig_conv_vector kDerSigConvVect1 = { .fe_length_bytes = 32u, .raw_version_length = sizeof(kDerSigConvRawCase1) }; // CASE 2: MSB not set, first 16 bytes zero -const uint8_t kDerSigConvRCase2[32] = { +const uint8_t kDerSigConvRCase2[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, }; -const uint8_t kDerSigConvSCase2[32] = { +const uint8_t kDerSigConvSCase2[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, }; -const uint8_t kDerSigConvRawCase2[64] = { +const uint8_t kDerSigConvRawCase2[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, }; -const uint8_t kDerSigConvDerCase2[40] = { +const uint8_t kDerSigConvDerCase2[] = { 0x30, 0x26, 0x02, 0x11, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x02, 0x11, 0x00, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, }; @@ -109,24 +109,24 @@ static const der_sig_conv_vector kDerSigConvVect2 = { .fe_length_bytes = 32u, .raw_version_length = sizeof(kDerSigConvRawCase2) }; // CASE 3: MSB set, full width value (worst case for 256 bit ECDSA) -const uint8_t kDerSigConvRCase3[32] = { +const uint8_t kDerSigConvRCase3[] = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, }; -const uint8_t kDerSigConvSCase3[32] = { +const uint8_t kDerSigConvSCase3[] = { 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, }; -const uint8_t kDerSigConvRawCase3[64] = { +const uint8_t kDerSigConvRawCase3[] = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, }; -const uint8_t kDerSigConvDerCase3[72] = { +const uint8_t kDerSigConvDerCase3[] = { 0x30, 0x46, 0x02, 0x21, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x21, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -145,21 +145,21 @@ static const der_sig_conv_vector kDerSigConvVect3 = { .fe_length_bytes = 32u, // CASE 4: MSB set, full width value (worst case for 512 bit ECDSA, using 2 bytes length for sequence) // Overhead here is the max -const uint8_t kDerSigConvRCase4[64] = { +const uint8_t kDerSigConvRCase4[] = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, }; -const uint8_t kDerSigConvSCase4[64] = { +const uint8_t kDerSigConvSCase4[] = { 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, }; -const uint8_t kDerSigConvRawCase4[128] = { +const uint8_t kDerSigConvRawCase4[] = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -169,7 +169,7 @@ const uint8_t kDerSigConvRawCase4[128] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, }; -const uint8_t kDerSigConvDerCase4[137] = { +const uint8_t kDerSigConvDerCase4[] = { 0x30, 0x81, 0x86, 0x02, 0x41, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -190,21 +190,21 @@ static const der_sig_conv_vector kDerSigConvVect4 = { .fe_length_bytes = 64u, .raw_version_length = sizeof(kDerSigConvRawCase4) }; // CASE 5: All zeroes -const uint8_t kDerSigConvRCase5[64] = { +const uint8_t kDerSigConvRCase5[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -const uint8_t kDerSigConvSCase5[64] = { +const uint8_t kDerSigConvSCase5[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -const uint8_t kDerSigConvRawCase5[128] = { +const uint8_t kDerSigConvRawCase5[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -214,7 +214,7 @@ const uint8_t kDerSigConvRawCase5[128] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -const uint8_t kDerSigConvDerCase5[8] = { +const uint8_t kDerSigConvDerCase5[] = { 0x30, 0x06, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, }; diff --git a/src/crypto/tests/HMAC_SHA256_test_vectors.h b/src/crypto/tests/HMAC_SHA256_test_vectors.h index 4a8b5746ed7be8..ae6005ccf66cc9 100644 --- a/src/crypto/tests/HMAC_SHA256_test_vectors.h +++ b/src/crypto/tests/HMAC_SHA256_test_vectors.h @@ -37,7 +37,7 @@ typedef struct hmac_sha256_vector } hmac_sha256_vector; // Basic test case -const uint8_t kHmacTestCase1Key[131] = { +const uint8_t kHmacTestCase1Key[] = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, @@ -47,13 +47,13 @@ const uint8_t kHmacTestCase1Key[131] = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, }; -const uint8_t kHmacTestCase1Message[54] = { +const uint8_t kHmacTestCase1Message[] = { 0x54, 0x65, 0x73, 0x74, 0x20, 0x55, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x4c, 0x61, 0x72, 0x67, 0x65, 0x72, 0x20, 0x54, 0x68, 0x61, 0x6e, 0x20, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x2d, 0x53, 0x69, 0x7a, 0x65, 0x20, 0x4b, 0x65, 0x79, 0x20, 0x2d, 0x20, 0x48, 0x61, 0x73, 0x68, 0x20, 0x4b, 0x65, 0x79, 0x20, 0x46, 0x69, 0x72, 0x73, 0x74, }; -const uint8_t kHmacTestCase1Expected[32] = { +const uint8_t kHmacTestCase1Expected[] = { 0x60, 0xe4, 0x31, 0x59, 0x1e, 0xe0, 0xb6, 0x7f, 0x0d, 0x8a, 0x26, 0xaa, 0xcb, 0xf5, 0xb7, 0x7f, 0x8e, 0x0b, 0xc6, 0x21, 0x37, 0x28, 0xc5, 0x14, 0x05, 0x46, 0x04, 0x0f, 0x0e, 0xe3, 0x7f, 0x54, }; diff --git a/src/crypto/tests/RawIntegerToDer_test_vectors.h b/src/crypto/tests/RawIntegerToDer_test_vectors.h index ed496b88fc42fe..ebd05a57720a39 100644 --- a/src/crypto/tests/RawIntegerToDer_test_vectors.h +++ b/src/crypto/tests/RawIntegerToDer_test_vectors.h @@ -36,15 +36,15 @@ struct RawIntegerToDerVector }; // MSB set, no leading zeros -const uint8_t kRawToDerMsbSetNoLeadingZeroes_Candidate[5] = { +const uint8_t kRawToDerMsbSetNoLeadingZeroes_Candidate[] = { 0x80, 0x01, 0x02, 0x03, 0x04, }; -const uint8_t kRawToDerMsbSetNoLeadingZeroes_Expected[8] = { +const uint8_t kRawToDerMsbSetNoLeadingZeroes_Expected[] = { 0x02, 0x06, 0x00, 0x80, 0x01, 0x02, 0x03, 0x04, }; -const uint8_t kRawToDerMsbSetNoLeadingZeroes_Expected_WithoutTag[6] = { +const uint8_t kRawToDerMsbSetNoLeadingZeroes_Expected_WithoutTag[] = { 0x00, 0x80, 0x01, 0x02, 0x03, 0x04, }; @@ -58,15 +58,15 @@ const RawIntegerToDerVector kRawIntegerToDerVector1 = { }; // MSB clear, no leading zeros -const uint8_t kRawToDerMsbClearNoLeadingZeroes_Candidate[5] = { +const uint8_t kRawToDerMsbClearNoLeadingZeroes_Candidate[] = { 0x40, 0x01, 0x02, 0x03, 0x04, }; -const uint8_t kRawToDerMsbClearNoLeadingZeroes_Expected[7] = { +const uint8_t kRawToDerMsbClearNoLeadingZeroes_Expected[] = { 0x02, 0x05, 0x40, 0x01, 0x02, 0x03, 0x04, }; -const uint8_t kRawToDerMsbClearNoLeadingZeroes_Expected_WithoutTag[5] = { +const uint8_t kRawToDerMsbClearNoLeadingZeroes_Expected_WithoutTag[] = { 0x40, 0x01, 0x02, 0x03, 0x04, }; @@ -80,15 +80,15 @@ const RawIntegerToDerVector kRawIntegerToDerVector2 = { }; // Three leading zeroes -const uint8_t kRawToDerThreeLeadingZeroes_Candidate[7] = { +const uint8_t kRawToDerThreeLeadingZeroes_Candidate[] = { 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, }; -const uint8_t kRawToDerThreeLeadingZeroes_Expected[6] = { +const uint8_t kRawToDerThreeLeadingZeroes_Expected[] = { 0x02, 0x04, 0x01, 0x02, 0x03, 0x04, }; -const uint8_t kRawToDerThreeLeadingZeroes_Expected_WithoutTag[4] = { +const uint8_t kRawToDerThreeLeadingZeroes_Expected_WithoutTag[] = { 0x01, 0x02, 0x03, @@ -105,17 +105,17 @@ const RawIntegerToDerVector kRawIntegerToDerVector3 = { }; // Literal zero -const uint8_t kRawToDerLiteralZero_Candidate[1] = { +const uint8_t kRawToDerLiteralZero_Candidate[] = { 0x00, }; -const uint8_t kRawToDerLiteralZero_Expected[3] = { +const uint8_t kRawToDerLiteralZero_Expected[] = { 0x02, 0x01, 0x00, }; -const uint8_t kRawToDerLiteralZero_Expected_WithoutTag[1] = { +const uint8_t kRawToDerLiteralZero_Expected_WithoutTag[] = { 0x00, }; @@ -129,20 +129,20 @@ const RawIntegerToDerVector kRawIntegerToDerVector4 = { }; // Only leading zeroes -const uint8_t kRawToDerOnlyLeadingZeroes_Candidate[4] = { +const uint8_t kRawToDerOnlyLeadingZeroes_Candidate[] = { 0x00, 0x00, 0x00, 0x00, }; -const uint8_t kRawToDerOnlyLeadingZeroes_Expected[3] = { +const uint8_t kRawToDerOnlyLeadingZeroes_Expected[] = { 0x02, 0x01, 0x00, }; -const uint8_t kRawToDerOnlyLeadingZeroes_Expected_WithoutTag[1] = { +const uint8_t kRawToDerOnlyLeadingZeroes_Expected_WithoutTag[] = { 0x00, }; @@ -156,18 +156,18 @@ const RawIntegerToDerVector kRawIntegerToDerVector5 = { }; // Only one byte, non-zero, MSB set -const uint8_t kRawToDerMsbSetOneByte_Candidate[1] = { +const uint8_t kRawToDerMsbSetOneByte_Candidate[] = { 0xff, }; -const uint8_t kRawToDerMsbSetOneByte_Expected[4] = { +const uint8_t kRawToDerMsbSetOneByte_Expected[] = { 0x02, 0x02, 0x00, 0xff, }; -const uint8_t kRawToDerMsbSetOneByte_Expected_WithoutTag[2] = { +const uint8_t kRawToDerMsbSetOneByte_Expected_WithoutTag[] = { 0x00, 0xff, }; @@ -182,17 +182,17 @@ const RawIntegerToDerVector kRawIntegerToDerVector6 = { }; // Only one byte, non-zero, MSB clear -const uint8_t kRawToDerMsbClearOneByte_Candidate[1] = { +const uint8_t kRawToDerMsbClearOneByte_Candidate[] = { 0x7f, }; -const uint8_t kRawToDerMsbClearOneByte_Expected[3] = { +const uint8_t kRawToDerMsbClearOneByte_Expected[] = { 0x02, 0x01, 0x7f, }; -const uint8_t kRawToDerMsbClearOneByte_Expected_WithoutTag[1] = { +const uint8_t kRawToDerMsbClearOneByte_Expected_WithoutTag[] = { 0x7f, }; diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index 93f7abeb91a979..5bd050b0df028e 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -34,6 +34,8 @@ #import "MTRPersistentStorageDelegateBridge.h" #import "NSDataSpanConversion.h" +#import + #include #include #include @@ -88,6 +90,22 @@ @interface MTRDeviceControllerFactory () @property () chip::Credentials::DeviceAttestationVerifier * deviceAttestationVerifier; @property (readonly) BOOL advertiseOperational; @property (nonatomic, readonly) Credentials::IgnoreCertificateValidityPeriodPolicy * certificateValidityPolicy; +// Lock used to serialize access to the "controllers" array, since it needs to +// be touched from both whatever queue is starting controllers and from the +// Matter queue. The way this lock is used assumes that: +// +// 1) The only mutating accesses to the controllers array happen when the +// current queue is not the Matter queue. This is a good assumption, because +// the implementation of the fucntions that mutate the array do sync dispatch +// to the Matter queue, which would deadlock if they were called when that +// queue was the current queue. +// 2) It's our API consumer's responsibility to serialize access to us from +// outside. +// +// This means that we only take the lock around mutations of the array and +// accesses to the array that are from code running on the Matter queue. + +@property (nonatomic, readonly) os_unfair_lock controllersLock; - (BOOL)findMatchingFabric:(FabricTable &)fabricTable params:(MTRDeviceControllerStartupParams *)params @@ -123,6 +141,7 @@ - (instancetype)init _running = NO; _chipWorkQueue = DeviceLayer::PlatformMgrImpl().GetWorkQueue(); _controllerFactory = &DeviceControllerFactory::GetInstance(); + _controllersLock = OS_UNFAIR_LOCK_INIT; _sessionKeystore = new chip::Crypto::RawKeySessionKeystore(); if ([self checkForInitError:(_sessionKeystore != nullptr) logMsg:kErrorSessionKeystoreInit]) { @@ -166,8 +185,15 @@ - (void)dealloc [self cleanupInitObjects]; } +- (void)_assertCurrentQueueIsNotMatterQueue +{ + VerifyOrDie(!DeviceLayer::PlatformMgrImpl().IsWorkQueueCurrentQueue()); +} + - (BOOL)checkIsRunning:(NSError * __autoreleasing *)error { + [self _assertCurrentQueueIsNotMatterQueue]; + if ([self isRunning]) { return YES; } @@ -255,6 +281,8 @@ - (void)cleanupStartupObjects - (nullable NSArray *)knownFabrics { + [self _assertCurrentQueueIsNotMatterQueue]; + if (!self.isRunning) { return nil; } @@ -303,6 +331,8 @@ - (void)cleanupStartupObjects - (BOOL)startControllerFactory:(MTRDeviceControllerFactoryParams *)startupParams error:(NSError * __autoreleasing *)error; { + [self _assertCurrentQueueIsNotMatterQueue]; + if ([self isRunning]) { MTR_LOG_DEBUG("Ignoring duplicate call to startup, Matter controller factory already started..."); return YES; @@ -501,6 +531,8 @@ - (BOOL)startControllerFactory:(MTRDeviceControllerFactoryParams *)startupParams - (void)stopControllerFactory { + [self _assertCurrentQueueIsNotMatterQueue]; + if (![self isRunning]) { return; } @@ -524,6 +556,8 @@ - (void)stopControllerFactory - (MTRDeviceController * _Nullable)createControllerOnExistingFabric:(MTRDeviceControllerStartupParams *)startupParams error:(NSError * __autoreleasing *)error { + [self _assertCurrentQueueIsNotMatterQueue]; + if (![self checkIsRunning:error]) { MTR_LOG_ERROR("Trying to start controller while Matter controller factory is not running"); return nil; @@ -615,6 +649,8 @@ - (MTRDeviceController * _Nullable)createControllerOnExistingFabric:(MTRDeviceCo - (MTRDeviceController * _Nullable)createControllerOnNewFabric:(MTRDeviceControllerStartupParams *)startupParams error:(NSError * __autoreleasing *)error { + [self _assertCurrentQueueIsNotMatterQueue]; + if (![self isRunning]) { MTR_LOG_ERROR("Trying to start controller while Matter controller factory is not running"); return nil; @@ -699,6 +735,8 @@ - (MTRDeviceController * _Nullable)createControllerOnNewFabric:(MTRDeviceControl - (MTRDeviceController * _Nullable)createController { + [self _assertCurrentQueueIsNotMatterQueue]; + MTRDeviceController * controller = [[MTRDeviceController alloc] initWithFactory:self queue:_chipWorkQueue]; if (controller == nil) { MTR_LOG_ERROR("Failed to init controller"); @@ -716,7 +754,9 @@ - (MTRDeviceController * _Nullable)createController // Add the controller to _controllers now, so if we fail partway through its // startup we will still do the right cleanups. + os_unfair_lock_lock(&_controllersLock); [_controllers addObject:controller]; + os_unfair_lock_unlock(&_controllersLock); return controller; } @@ -733,6 +773,8 @@ - (BOOL)findMatchingFabric:(FabricTable &)fabricTable params:(MTRDeviceControllerStartupParams *)params fabric:(const FabricInfo * _Nullable * _Nonnull)fabric { + assertChipStackLockedByCurrentThread(); + CHIP_ERROR err = fabricTable.Init( { .storage = _persistentStorageDelegateBridge, .operationalKeystore = _keystore, .opCertStore = _opCertStore }); if (err != CHIP_NO_ERROR) { @@ -768,6 +810,8 @@ - (BOOL)findMatchingFabric:(FabricTable &)fabricTable // - (MTRDeviceController * _Nullable)maybeInitializeOTAProvider:(MTRDeviceController * _Nonnull)controller { + [self _assertCurrentQueueIsNotMatterQueue]; + VerifyOrReturnValue(_otaProviderDelegateBridge != nil, controller); VerifyOrReturnValue([_controllers count] == 1, controller); @@ -791,6 +835,8 @@ @implementation MTRDeviceControllerFactory (InternalMethods) - (void)controllerShuttingDown:(MTRDeviceController *)controller { + [self _assertCurrentQueueIsNotMatterQueue]; + if (![_controllers containsObject:controller]) { MTR_LOG_ERROR("Controller we don't know about shutting down"); return; @@ -808,7 +854,9 @@ - (void)controllerShuttingDown:(MTRDeviceController *)controller }); } + os_unfair_lock_lock(&_controllersLock); [_controllers removeObject:controller]; + os_unfair_lock_unlock(&_controllersLock); if ([_controllers count] == 0) { dispatch_sync(_chipWorkQueue, ^{ @@ -841,7 +889,13 @@ - (void)controllerShuttingDown:(MTRDeviceController *)controller - (nullable MTRDeviceController *)runningControllerForFabricIndex:(chip::FabricIndex)fabricIndex { - for (MTRDeviceController * existing in _controllers) { + assertChipStackLockedByCurrentThread(); + + os_unfair_lock_lock(&_controllersLock); + NSArray * controllersCopy = [_controllers copy]; + os_unfair_lock_unlock(&_controllersLock); + + for (MTRDeviceController * existing in controllersCopy) { if ([existing fabricIndex] == fabricIndex) { return existing; } @@ -852,7 +906,13 @@ - (nullable MTRDeviceController *)runningControllerForFabricIndex:(chip::FabricI - (void)operationalInstanceAdded:(chip::PeerId &)operationalID { - for (MTRDeviceController * controller in _controllers) { + assertChipStackLockedByCurrentThread(); + + os_unfair_lock_lock(&_controllersLock); + NSArray * controllersCopy = [_controllers copy]; + os_unfair_lock_unlock(&_controllersLock); + + for (MTRDeviceController * controller in controllersCopy) { auto * compressedFabricId = controller.compressedFabricID; if (compressedFabricId != nil && compressedFabricId.unsignedLongLongValue == operationalID.GetCompressedFabricId()) { ChipLogProgress(Controller, "Notifying controller at fabric index %u about new operational node 0x" ChipLogFormatX64, diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerXPCConnection.h b/src/darwin/Framework/CHIP/MTRDeviceControllerXPCConnection.h index 3c6a82c1235ec0..8660a4fbb07a10 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerXPCConnection.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerXPCConnection.h @@ -43,7 +43,7 @@ typedef void (^MTRGetProxyHandleHandler)(dispatch_queue_t queue, MTRDeviceContro @interface MTRDeviceControllerXPCConnection : NSObject /** - * This method is just for test purpsoe. + * This method is just for test purpose. */ + (MTRDeviceControllerXPCConnection *)connectionWithWorkQueue:(dispatch_queue_t)workQueue connectBlock:(MTRXPCConnectBlock)connectBlock; @@ -55,6 +55,7 @@ typedef void (^MTRGetProxyHandleHandler)(dispatch_queue_t queue, MTRDeviceContro - (void)deregisterReportHandlersWithController:(id)controller nodeID:(NSNumber *)nodeID completion:(dispatch_block_t)completion; +- (void)callSubscriptionEstablishedHandler:(dispatch_block_t)handler; @end diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerXPCConnection.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerXPCConnection.mm index 9620f4ba757339..e44308244cc00f 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerXPCConnection.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerXPCConnection.mm @@ -203,4 +203,11 @@ - (void)handleReportWithController:(id)controller }); } +- (void)callSubscriptionEstablishedHandler:(dispatch_block_t)handler +{ + // Call the handler from our _workQueue, so that we guarantee the same + // number of queue hops as for handleReportWithController. + dispatch_async(_workQueue, handler); +} + @end diff --git a/src/darwin/Framework/CHIP/MTRDeviceOverXPC.mm b/src/darwin/Framework/CHIP/MTRDeviceOverXPC.mm index 17cd039278d294..cdc2dacb20c37c 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceOverXPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceOverXPC.mm @@ -272,14 +272,16 @@ - (void)subscribeToAttributesWithEndpointID:(NSNumber * _Nullable)endpointID maxInterval:params.maxInterval params:[MTRDeviceController encodeXPCSubscribeParams:params] establishedHandler:^{ - dispatch_async(queue, ^{ - MTR_LOG_DEBUG("Subscription established"); - subscriptionEstablishedHandler(); - // The following captures the proxy handle in the closure so that the handle - // won't be released prior to block call. - __auto_type handleRetainer = handle; - (void) handleRetainer; - }); + [self.xpcConnection callSubscriptionEstablishedHandler:^{ + dispatch_async(queue, ^{ + MTR_LOG_DEBUG("Subscription established"); + subscriptionEstablishedHandler(); + // The following captures the proxy handle in the closure so that the handle + // won't be released prior to block call. + __auto_type handleRetainer = handle; + (void) handleRetainer; + }); + }]; }]; }; diff --git a/src/include/platform/internal/GenericPlatformManagerImpl_POSIX.ipp b/src/include/platform/internal/GenericPlatformManagerImpl_POSIX.ipp index 1b09d298eb2867..5c9061a901a3f2 100644 --- a/src/include/platform/internal/GenericPlatformManagerImpl_POSIX.ipp +++ b/src/include/platform/internal/GenericPlatformManagerImpl_POSIX.ipp @@ -163,6 +163,7 @@ void GenericPlatformManagerImpl_POSIX::_RunEventLoop() { mChipTask = pthread_self(); mState.store(State::kRunning, std::memory_order_relaxed); + mShouldRunEventLoop.store(true, std::memory_order_relaxed); } pthread_mutex_unlock(&mStateLock); diff --git a/src/platform/ASR/ASRFactoryDataProvider.cpp b/src/platform/ASR/ASRFactoryDataProvider.cpp index e6203980297af9..382b4abdd8c898 100644 --- a/src/platform/ASR/ASRFactoryDataProvider.cpp +++ b/src/platform/ASR/ASRFactoryDataProvider.cpp @@ -174,7 +174,7 @@ CHIP_ERROR ASRFactoryDataProvider::GetCertificationDeclaration(MutableByteSpan & //-> certification_type = 0 //-> dac_origin_vendor_id is not present //-> dac_origin_product_id is not present - const uint8_t kCdForAllExamples[541] = { + const uint8_t kCdForAllExamples[] = { 0x30, 0x82, 0x02, 0x19, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x02, 0x0a, 0x30, 0x82, 0x02, 0x06, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x82, 0x01, 0x71, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, 0x01, 0x62, @@ -228,7 +228,7 @@ CHIP_ERROR ASRFactoryDataProvider::GetDeviceAttestationCert(MutableByteSpan & ou size_t certSize; #if !CONFIG_ENABLE_ASR_FACTORY_DATA_PROVIDER #ifdef USE_EXAMPLES_DAC - const uint8_t kDacCert[491] = { + const uint8_t kDacCert[] = { 0x30, 0x82, 0x01, 0xe7, 0x30, 0x82, 0x01, 0x8e, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x69, 0xcd, 0xf1, 0x0d, 0xe9, 0xe5, 0x4e, 0xd1, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x3d, 0x31, 0x25, 0x30, 0x23, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x1c, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x44, 0x65, 0x76, 0x20, 0x50, @@ -271,7 +271,7 @@ CHIP_ERROR ASRFactoryDataProvider::GetProductAttestationIntermediateCert(Mutable size_t certSize; #if !CONFIG_ENABLE_ASR_FACTORY_DATA_PROVIDER #ifdef USE_EXAMPLES_DAC - const uint8_t kPaiCert[463] = { + const uint8_t kPaiCert[] = { 0x30, 0x82, 0x01, 0xcb, 0x30, 0x82, 0x01, 0x71, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x56, 0xad, 0x82, 0x22, 0xad, 0x94, 0x5b, 0x64, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x30, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0f, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, @@ -319,13 +319,13 @@ CHIP_ERROR ASRFactoryDataProvider::SignWithDeviceAttestationKey(const ByteSpan & #if !CONFIG_ENABLE_ASR_FACTORY_DATA_PROVIDER #ifdef USE_EXAMPLES_DAC - const uint8_t kDacPublicKey[65] = { + const uint8_t kDacPublicKey[] = { 0x04, 0x46, 0x3a, 0xc6, 0x93, 0x42, 0x91, 0x0a, 0x0e, 0x55, 0x88, 0xfc, 0x6f, 0xf5, 0x6b, 0xb6, 0x3e, 0x62, 0xec, 0xce, 0xcb, 0x14, 0x8f, 0x7d, 0x4e, 0xb0, 0x3e, 0xe5, 0x52, 0x60, 0x14, 0x15, 0x76, 0x7d, 0x16, 0xa5, 0xc6, 0x63, 0xf7, 0x93, 0xe4, 0x91, 0x23, 0x26, 0x0b, 0x82, 0x97, 0xa7, 0xcd, 0x7e, 0x7c, 0xfc, 0x7b, 0x31, 0x6b, 0x39, 0xd9, 0x8e, 0x90, 0xd2, 0x93, 0x77, 0x73, 0x8e, 0x82, }; - const uint8_t kDacPrivateKey[32] = { + const uint8_t kDacPrivateKey[] = { 0xaa, 0xb6, 0x00, 0xae, 0x8a, 0xe8, 0xaa, 0xb7, 0xd7, 0x36, 0x27, 0xc2, 0x17, 0xb7, 0xc2, 0x04, 0x70, 0x9c, 0xa6, 0x94, 0x6a, 0xf5, 0xf2, 0xf7, 0x53, 0x08, 0x33, 0xa5, 0x2b, 0x44, 0xfb, 0xff, }; diff --git a/src/platform/Ameba/FactoryDataProvider.cpp b/src/platform/Ameba/FactoryDataProvider.cpp index d545e0eeb3249d..ad1441b10593ba 100644 --- a/src/platform/Ameba/FactoryDataProvider.cpp +++ b/src/platform/Ameba/FactoryDataProvider.cpp @@ -117,14 +117,14 @@ const uint8_t kPaiCert[] = { 0x91, }; -const uint8_t kDacPublicKey[65] = { +const uint8_t kDacPublicKey[] = { 0x04, 0x46, 0x3a, 0xc6, 0x93, 0x42, 0x91, 0x0a, 0x0e, 0x55, 0x88, 0xfc, 0x6f, 0xf5, 0x6b, 0xb6, 0x3e, 0x62, 0xec, 0xce, 0xcb, 0x14, 0x8f, 0x7d, 0x4e, 0xb0, 0x3e, 0xe5, 0x52, 0x60, 0x14, 0x15, 0x76, 0x7d, 0x16, 0xa5, 0xc6, 0x63, 0xf7, 0x93, 0xe4, 0x91, 0x23, 0x26, 0x0b, 0x82, 0x97, 0xa7, 0xcd, 0x7e, 0x7c, 0xfc, 0x7b, 0x31, 0x6b, 0x39, 0xd9, 0x8e, 0x90, 0xd2, 0x93, 0x77, 0x73, 0x8e, 0x82, }; -const uint8_t kDacPrivateKey[32] = { +const uint8_t kDacPrivateKey[] = { 0xaa, 0xb6, 0x00, 0xae, 0x8a, 0xe8, 0xaa, 0xb7, 0xd7, 0x36, 0x27, 0xc2, 0x17, 0xb7, 0xc2, 0x04, 0x70, 0x9c, 0xa6, 0x94, 0x6a, 0xf5, 0xf2, 0xf7, 0x53, 0x08, 0x33, 0xa5, 0x2b, 0x44, 0xfb, 0xff, }; diff --git a/src/platform/Darwin/PlatformManagerImpl.cpp b/src/platform/Darwin/PlatformManagerImpl.cpp index 6e78a8195b004f..f1d5e4841e761b 100644 --- a/src/platform/Darwin/PlatformManagerImpl.cpp +++ b/src/platform/Darwin/PlatformManagerImpl.cpp @@ -88,7 +88,7 @@ CHIP_ERROR PlatformManagerImpl::_StopEventLoopTask() if (!mIsWorkQueueSuspended && !mIsWorkQueueSuspensionPending) { mIsWorkQueueSuspensionPending = true; - if (dispatch_get_current_queue() != mWorkQueue) + if (!IsWorkQueueCurrentQueue()) { // dispatch_sync is used in order to guarantee serialization of the caller with // respect to any tasks that might already be on the queue, or running. @@ -157,10 +157,15 @@ bool PlatformManagerImpl::_IsChipStackLockedByCurrentThread() const { // If we have no work queue, or it's suspended, then we assume our caller // knows what they are doing in terms of their own concurrency. - return !mWorkQueue || mIsWorkQueueSuspended || dispatch_get_current_queue() == mWorkQueue; + return !mWorkQueue || mIsWorkQueueSuspended || IsWorkQueueCurrentQueue(); }; #endif +bool PlatformManagerImpl::IsWorkQueueCurrentQueue() const +{ + return dispatch_get_current_queue() == mWorkQueue; +} + CHIP_ERROR PlatformManagerImpl::StartBleScan(BleScannerDelegate * delegate) { #if CONFIG_NETWORK_LAYER_BLE diff --git a/src/platform/Darwin/PlatformManagerImpl.h b/src/platform/Darwin/PlatformManagerImpl.h index a0aff2ab21e439..79da67a4991d2f 100644 --- a/src/platform/Darwin/PlatformManagerImpl.h +++ b/src/platform/Darwin/PlatformManagerImpl.h @@ -56,6 +56,8 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener return mWorkQueue; } + bool IsWorkQueueCurrentQueue() const; + CHIP_ERROR StartBleScan(BleScannerDelegate * delegate = nullptr); CHIP_ERROR StopBleScan(); CHIP_ERROR PrepareCommissioning(); diff --git a/src/platform/Infineon/CYW30739/FactoryDataProvider.cpp b/src/platform/Infineon/CYW30739/FactoryDataProvider.cpp index 8d12b16a4be04a..4b7e6ed9e9ae9a 100644 --- a/src/platform/Infineon/CYW30739/FactoryDataProvider.cpp +++ b/src/platform/Infineon/CYW30739/FactoryDataProvider.cpp @@ -111,8 +111,8 @@ CHIP_ERROR FactoryDataProvider::LoadKeypairFromDer(const ByteSpan & der_buffer, mbedtls_result = mbedtls_ecp_write_key(ecp, private_key.data(), private_key.size()); VerifyOrExit(mbedtls_result == 0, error = CHIP_ERROR_INTERNAL); - SuccessOrExit(serializedKeypair.SetLength(public_key.size() + private_key.size())); - SuccessOrExit(keypair.Deserialize(serializedKeypair)); + SuccessOrExit(error = serializedKeypair.SetLength(public_key.size() + private_key.size())); + SuccessOrExit(error = keypair.Deserialize(serializedKeypair)); exit: if (mbedtls_result != 0) diff --git a/src/platform/bouffalolab/common/FactoryDataProvider.cpp b/src/platform/bouffalolab/common/FactoryDataProvider.cpp index d659afc6257d1e..2bee53f6aa9829 100644 --- a/src/platform/bouffalolab/common/FactoryDataProvider.cpp +++ b/src/platform/bouffalolab/common/FactoryDataProvider.cpp @@ -76,7 +76,7 @@ CHIP_ERROR FactoryDataProvider::GetCertificationDeclaration(MutableByteSpan & ou return CHIP_ERROR_BUFFER_TOO_SMALL; #else - static const unsigned char Chip_Test_CD_130D_f001_der[539] = { + static const unsigned char Chip_Test_CD_130D_f001_der[] = { 0x30, 0x81, 0xe9, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x81, 0xdb, 0x30, 0x81, 0xd8, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x45, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x38, 0x04, 0x36, 0x15, 0x24, 0x00, 0x01, 0x25, diff --git a/src/platform/mbed/BLEManagerImpl.cpp b/src/platform/mbed/BLEManagerImpl.cpp index cf5914aa449078..ef6518d438fabf 100644 --- a/src/platform/mbed/BLEManagerImpl.cpp +++ b/src/platform/mbed/BLEManagerImpl.cpp @@ -770,7 +770,7 @@ CHIP_ERROR BLEManagerImpl::StartAdvertising(void) VerifyOrExit(mbed_err == BLE_ERROR_NONE, err = CHIP_ERROR(chip::ChipError::Range::kOS, mbed_err)); dev_id_info.Init(); - SuccessOrExit(ConfigurationMgr().GetBLEDeviceIdentificationInfo(dev_id_info)); + SuccessOrExit(err = ConfigurationMgr().GetBLEDeviceIdentificationInfo(dev_id_info)); mbed_err = adv_data_builder.setServiceData( ShortUUID_CHIPoBLEService, mbed::make_Span(reinterpret_cast(&dev_id_info), sizeof dev_id_info)); VerifyOrExit(mbed_err == BLE_ERROR_NONE, err = CHIP_ERROR(chip::ChipError::Range::kOS, mbed_err)); diff --git a/src/platform/nxp/common/crypto/CHIPCryptoPALTinyCrypt.cpp b/src/platform/nxp/common/crypto/CHIPCryptoPALTinyCrypt.cpp index b44916907cf1d5..4ad79d22463f5a 100644 --- a/src/platform/nxp/common/crypto/CHIPCryptoPALTinyCrypt.cpp +++ b/src/platform/nxp/common/crypto/CHIPCryptoPALTinyCrypt.cpp @@ -599,7 +599,7 @@ CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_k result = uECC_shared_secret(remote_public_key.ConstBytes() + 1, keypair->private_key, out_secret.Bytes()); VerifyOrExit(result == UECC_SUCCESS, error = CHIP_ERROR_INTERNAL); - SuccessOrExit(out_secret.SetLength(secret_length)); + SuccessOrExit(error = out_secret.SetLength(secret_length)); exit: keypair = nullptr; @@ -1377,7 +1377,9 @@ CHIP_ERROR ValidateCertificateChain(const uint8_t * rootCertificate, size_t root error = CHIP_ERROR_CERT_NOT_TRUSTED; break; default: - SuccessOrExit((result = CertificateChainValidationResult::kInternalFrameworkError, error = CHIP_ERROR_INTERNAL)); + result = CertificateChainValidationResult::kInternalFrameworkError; + error = CHIP_ERROR_INTERNAL; + break; } exit: diff --git a/src/platform/nxp/k32w/k32w0/crypto/CHIPCryptoPALNXPUltrafastP256.cpp b/src/platform/nxp/k32w/k32w0/crypto/CHIPCryptoPALNXPUltrafastP256.cpp index 6660105df48985..289296c25d6d4d 100644 --- a/src/platform/nxp/k32w/k32w0/crypto/CHIPCryptoPALNXPUltrafastP256.cpp +++ b/src/platform/nxp/k32w/k32w0/crypto/CHIPCryptoPALNXPUltrafastP256.cpp @@ -594,7 +594,7 @@ CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_k out_secret.Bytes()); VerifyOrExit(result == gSecEcdhSuccess_c, error = CHIP_ERROR_INTERNAL); - SuccessOrExit(out_secret.SetLength(secret_length)); + SuccessOrExit(error = out_secret.SetLength(secret_length)); exit: keypair = nullptr; _log_mbedTLS_error(result); @@ -1347,7 +1347,9 @@ CHIP_ERROR ValidateCertificateChain(const uint8_t * rootCertificate, size_t root error = CHIP_ERROR_CERT_NOT_TRUSTED; break; default: - SuccessOrExit((result = CertificateChainValidationResult::kInternalFrameworkError, error = CHIP_ERROR_INTERNAL)); + result = CertificateChainValidationResult::kInternalFrameworkError; + error = CHIP_ERROR_INTERNAL; + break; } exit: diff --git a/src/platform/silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp b/src/platform/silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp index 28224381971e2e..192f691b497cfe 100644 --- a/src/platform/silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp +++ b/src/platform/silabs/SiWx917/CHIPCryptoPALTinyCrypt.cpp @@ -569,7 +569,7 @@ CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_k result = uECC_shared_secret(remote_public_key.ConstBytes() + 1, keypair->private_key, out_secret.Bytes()); VerifyOrExit(result == UECC_SUCCESS, error = CHIP_ERROR_INTERNAL); - SuccessOrExit(out_secret.SetLength(secret_length)); + SuccessOrExit(error = out_secret.SetLength(secret_length)); exit: keypair = nullptr; @@ -1378,7 +1378,9 @@ CHIP_ERROR ValidateCertificateChain(const uint8_t * rootCertificate, size_t root error = CHIP_ERROR_CERT_NOT_TRUSTED; break; default: - SuccessOrExit((result = CertificateChainValidationResult::kInternalFrameworkError, error = CHIP_ERROR_INTERNAL)); + result = CertificateChainValidationResult::kInternalFrameworkError; + error = CHIP_ERROR_INTERNAL; + break; } exit: diff --git a/src/platform/silabs/efr32/CHIPCryptoPALPsaEfr32.cpp b/src/platform/silabs/efr32/CHIPCryptoPALPsaEfr32.cpp index f4acdbc76c3804..300348ef311e5a 100644 --- a/src/platform/silabs/efr32/CHIPCryptoPALPsaEfr32.cpp +++ b/src/platform/silabs/efr32/CHIPCryptoPALPsaEfr32.cpp @@ -773,7 +773,7 @@ CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_k &output_length); VerifyOrExit(status == PSA_SUCCESS, error = CHIP_ERROR_INTERNAL); - SuccessOrExit(out_secret.SetLength(output_length)); + SuccessOrExit(error = out_secret.SetLength(output_length)); exit: _log_PSA_error(status); @@ -1698,7 +1698,9 @@ CHIP_ERROR ValidateCertificateChain(const uint8_t * rootCertificate, size_t root error = CHIP_ERROR_CERT_NOT_TRUSTED; break; default: - SuccessOrExit((result = CertificateChainValidationResult::kInternalFrameworkError, error = CHIP_ERROR_INTERNAL)); + result = CertificateChainValidationResult::kInternalFrameworkError; + error = CHIP_ERROR_INTERNAL; + break; } exit: diff --git a/src/platform/silabs/efr32/Efr32PsaOpaqueKeypair.cpp b/src/platform/silabs/efr32/Efr32PsaOpaqueKeypair.cpp index 7c39026c510da9..5eb9f1f28a7ace 100644 --- a/src/platform/silabs/efr32/Efr32PsaOpaqueKeypair.cpp +++ b/src/platform/silabs/efr32/Efr32PsaOpaqueKeypair.cpp @@ -422,7 +422,7 @@ CHIP_ERROR EFR32OpaqueP256Keypair::ECDSA_sign_msg(const uint8_t * msg, size_t ms error = Sign(msg, msg_length, out_signature.Bytes(), out_signature.Capacity(), &output_length); SuccessOrExit(error); - SuccessOrExit(out_signature.SetLength(output_length)); + SuccessOrExit(error = out_signature.SetLength(output_length)); exit: return error; } @@ -437,7 +437,7 @@ CHIP_ERROR EFR32OpaqueP256Keypair::ECDH_derive_secret(const P256PublicKey & remo (out_secret.Length() == 0) ? out_secret.Capacity() : out_secret.Length(), &output_length); SuccessOrExit(error); - SuccessOrExit(out_secret.SetLength(output_length)); + SuccessOrExit(error = out_secret.SetLength(output_length)); exit: return error; } diff --git a/src/platform/tests/BUILD.gn b/src/platform/tests/BUILD.gn index 1de55b7be409ce..70d096556ed579 100644 --- a/src/platform/tests/BUILD.gn +++ b/src/platform/tests/BUILD.gn @@ -49,7 +49,10 @@ if (chip_device_platform != "none" && chip_device_platform != "fake") { if (chip_mdns != "none" && chip_enable_dnssd_tests && (chip_device_platform == "linux" || chip_device_platform == "darwin")) { test_sources += [ "TestDnssd.cpp" ] - public_deps += [ "${chip_root}/src/lib/dnssd" ] + public_deps += [ + "${chip_root}/src/lib/dnssd", + "${chip_root}/src/lib/dnssd/minimal_mdns", + ] } # These tests appear to be broken on Mac. diff --git a/src/platform/tests/TestDnssd.cpp b/src/platform/tests/TestDnssd.cpp index d7e4ed18554f74..21f46388ff5730 100644 --- a/src/platform/tests/TestDnssd.cpp +++ b/src/platform/tests/TestDnssd.cpp @@ -21,7 +21,18 @@ #include "lib/dnssd/platform/Dnssd.h" #include "platform/CHIPDeviceLayer.h" +#include "platform/ConnectivityManager.h" #include "platform/PlatformManager.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -44,6 +55,35 @@ struct DnssdContext bool mEndOfInput = false; }; +class TestDnssdResolveServerDelegate : public mdns::Minimal::ServerDelegate, public mdns::Minimal::ParserDelegate +{ +public: + TestDnssdResolveServerDelegate(mdns::Minimal::ResponseSender * responder) : mResponder(responder) {} + virtual ~TestDnssdResolveServerDelegate() = default; + + // Implementation of mdns::Minimal::ServerDelegate + + void OnResponse(const mdns::Minimal::BytesRange & data, const chip::Inet::IPPacketInfo * info) override {} + void OnQuery(const mdns::Minimal::BytesRange & data, const chip::Inet::IPPacketInfo * info) override + { + mCurSrc = info; + mdns::Minimal::ParsePacket(data, this); + mCurSrc = nullptr; + } + + // Implementation of mdns::Minimal::ParserDelegate + + void OnHeader(mdns::Minimal::ConstHeaderRef & header) override { mMsgId = header.GetMessageId(); } + void OnQuery(const mdns::Minimal::QueryData & data) override { mResponder->Respond(mMsgId, data, mCurSrc, mRespConfig); } + void OnResource(mdns::Minimal::ResourceType type, const mdns::Minimal::ResourceData & data) override {} + +private: + mdns::Minimal::ResponseSender * mResponder; + mdns::Minimal::ResponseConfiguration mRespConfig; + const chip::Inet::IPPacketInfo * mCurSrc = nullptr; + uint16_t mMsgId = 0; +}; + } // namespace static void Timeout(chip::System::Layer * systemLayer, void * context) @@ -64,6 +104,10 @@ static void HandleResolve(void * context, DnssdService * result, const chip::Spa NL_TEST_ASSERT(suite, result != nullptr); NL_TEST_ASSERT(suite, error == CHIP_NO_ERROR); + // The NL_TEST_ASSERT above will not abort the test, so we need to + // explicitly abort it here to avoid dereferencing a null pointer. + VerifyOrReturn(result != nullptr, ); + if (!addresses.empty()) { addresses.data()[0].ToString(addrBuf, sizeof(addrBuf)); @@ -122,13 +166,96 @@ static void DnssdErrorCallback(void * context, CHIP_ERROR error) NL_TEST_ASSERT(ctx->mTestSuite, error == CHIP_NO_ERROR); } +void TestDnssdBrowse_DnssdInitCallback(void * context, CHIP_ERROR error) +{ + auto * ctx = static_cast(context); + NL_TEST_ASSERT(ctx->mTestSuite, error == CHIP_NO_ERROR); + auto * suite = ctx->mTestSuite; + + NL_TEST_ASSERT(suite, + ChipDnssdBrowse("_mock", DnssdServiceProtocol::kDnssdProtocolUdp, chip::Inet::IPAddressType::kAny, + chip::Inet::InterfaceId::Null(), HandleBrowse, context, + &ctx->mBrowseIdentifier) == CHIP_NO_ERROR); +} + +// Verify that platform DNS-SD implementation can browse and resolve services. +// +// This test case uses platform-independent mDNS server implementation based on +// minimal mdns library. The server is configured to respond to PTR, SRV, TXT, +// A and AAAA queries without additional records. In order to pass this test, +// the platform DNS-SD client implementation must be able to browse and resolve +// services by querying for all of these records separately. +void TestDnssdBrowse(nlTestSuite * inSuite, void * inContext) +{ + DnssdContext context; + context.mTestSuite = inSuite; + + mdns::Minimal::SetDefaultAddressPolicy(); + + mdns::Minimal::Server<10> server; + mdns::Minimal::QNamePart serverName[] = { "resolve-tester", "_mock", chip::Dnssd::kCommissionProtocol, + chip::Dnssd::kLocalDomain }; + mdns::Minimal::ResponseSender responseSender(&server); + + mdns::Minimal::QueryResponder<16> queryResponder; + responseSender.AddQueryResponder(&queryResponder); + + // Respond to PTR queries for _mock._udp.local + mdns::Minimal::QNamePart serviceName[] = { "_mock", chip::Dnssd::kCommissionProtocol, chip::Dnssd::kLocalDomain }; + mdns::Minimal::QNamePart serverServiceName[] = { "INSTANCE", chip::Dnssd::kCommissionableServiceName, + chip::Dnssd::kCommissionProtocol, chip::Dnssd::kLocalDomain }; + mdns::Minimal::PtrResponder ptrUdpResponder(serviceName, serverServiceName); + queryResponder.AddResponder(&ptrUdpResponder); + + // Respond to SRV queries for INSTANCE._matterc._udp.local + mdns::Minimal::SrvResponder srvResponder(mdns::Minimal::SrvResourceRecord(serverServiceName, serverName, CHIP_PORT)); + queryResponder.AddResponder(&srvResponder); + + // Respond to TXT queries for INSTANCE._matterc._udp.local + const char * txtEntries[] = { "key=val" }; + mdns::Minimal::TxtResponder txtResponder(mdns::Minimal::TxtResourceRecord(serverServiceName, txtEntries)); + queryResponder.AddResponder(&txtResponder); + + // Respond to A queries + mdns::Minimal::IPv4Responder ipv4Responder(serverName); + queryResponder.AddResponder(&ipv4Responder); + + // Respond to AAAA queries + mdns::Minimal::IPv6Responder ipv6Responder(serverName); + queryResponder.AddResponder(&ipv6Responder); + + TestDnssdResolveServerDelegate delegate(&responseSender); + server.SetDelegate(&delegate); + + auto endpoints = mdns::Minimal::GetAddressPolicy()->GetListenEndpoints(); + NL_TEST_ASSERT(inSuite, server.Listen(chip::DeviceLayer::UDPEndPointManager(), endpoints.get(), 5353) == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, + chip::Dnssd::ChipDnssdInit(TestDnssdBrowse_DnssdInitCallback, DnssdErrorCallback, &context) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, + chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(5), Timeout, &context) == + CHIP_NO_ERROR); + + ChipLogProgress(DeviceLayer, "Start EventLoop"); + chip::DeviceLayer::PlatformMgr().RunEventLoop(); + ChipLogProgress(DeviceLayer, "End EventLoop"); + + NL_TEST_ASSERT(inSuite, context.mResolvedServicesCount > 0); + NL_TEST_ASSERT(inSuite, !context.mTimeoutExpired); + + // Stop browsing so we can safely shutdown DNS-SD + chip::Dnssd::ChipDnssdStopBrowse(context.mBrowseIdentifier); + + chip::Dnssd::ChipDnssdShutdown(); +} + static void HandlePublish(void * context, const char * type, const char * instanceName, CHIP_ERROR error) { auto * ctx = static_cast(context); NL_TEST_ASSERT(ctx->mTestSuite, error == CHIP_NO_ERROR); } -static void TestDnssdPubSub_DnssdInitCallback(void * context, CHIP_ERROR error) +static void TestDnssdPublishService_DnssdInitCallback(void * context, CHIP_ERROR error) { auto * ctx = static_cast(context); NL_TEST_ASSERT(ctx->mTestSuite, error == CHIP_NO_ERROR); @@ -157,13 +284,19 @@ static void TestDnssdPubSub_DnssdInitCallback(void * context, CHIP_ERROR error) &ctx->mBrowseIdentifier) == CHIP_NO_ERROR); } -void TestDnssdPubSub(nlTestSuite * inSuite, void * inContext) +// Verify that the platform DNS-SD implementation can publish services. +// +// This test uses platform implementation of DNS-SD server and client. Since +// client implementation should be verified by the TestDnssdBrowse test case, +// here we only verify that the server implementation can publish services. +void TestDnssdPublishService(nlTestSuite * inSuite, void * inContext) { DnssdContext context; context.mTestSuite = inSuite; NL_TEST_ASSERT(inSuite, - chip::Dnssd::ChipDnssdInit(TestDnssdPubSub_DnssdInitCallback, DnssdErrorCallback, &context) == CHIP_NO_ERROR); + chip::Dnssd::ChipDnssdInit(TestDnssdPublishService_DnssdInitCallback, DnssdErrorCallback, &context) == + CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(5), Timeout, &context) == CHIP_NO_ERROR); @@ -172,6 +305,7 @@ void TestDnssdPubSub(nlTestSuite * inSuite, void * inContext) chip::DeviceLayer::PlatformMgr().RunEventLoop(); ChipLogProgress(DeviceLayer, "End EventLoop"); + NL_TEST_ASSERT(inSuite, context.mResolvedServicesCount > 0); NL_TEST_ASSERT(inSuite, !context.mTimeoutExpired); // Stop browsing so we can safely shutdown DNS-SD @@ -180,7 +314,11 @@ void TestDnssdPubSub(nlTestSuite * inSuite, void * inContext) chip::Dnssd::ChipDnssdShutdown(); } -static const nlTest sTests[] = { NL_TEST_DEF("Test Dnssd::PubSub", TestDnssdPubSub), NL_TEST_SENTINEL() }; +static const nlTest sTests[] = { + NL_TEST_DEF("Test ChipDnssdBrowse", TestDnssdBrowse), + NL_TEST_DEF("Test ChipDnssdPublishService", TestDnssdPublishService), + NL_TEST_SENTINEL(), +}; int TestDnssd_Setup(void * inContext) { diff --git a/src/protocols/bdx/BdxMessages.cpp b/src/protocols/bdx/BdxMessages.cpp index 779f592a185be3..1db14be54ff3a9 100644 --- a/src/protocols/bdx/BdxMessages.cpp +++ b/src/protocols/bdx/BdxMessages.cpp @@ -94,13 +94,13 @@ BufferWriter & TransferInit::WriteToBuffer(BufferWriter & aBuffer) const CHIP_ERROR TransferInit::Parse(System::PacketBufferHandle aBuffer) { - CHIP_ERROR err = CHIP_NO_ERROR; uint8_t proposedTransferCtl; uint32_t tmpUint32Value = 0; // Used for reading non-wide length and offset fields uint8_t * bufStart = aBuffer->Start(); Reader bufReader(bufStart, aBuffer->DataLength()); - SuccessOrExit(bufReader.Read8(&proposedTransferCtl).Read8(mRangeCtlFlags.RawStorage()).Read16(&MaxBlockSize).StatusCode()); + ReturnErrorOnFailure( + bufReader.Read8(&proposedTransferCtl).Read8(mRangeCtlFlags.RawStorage()).Read16(&MaxBlockSize).StatusCode()); Version = proposedTransferCtl & kVersionMask; TransferCtlOptions.SetRaw(static_cast(proposedTransferCtl & ~kVersionMask)); @@ -110,11 +110,11 @@ CHIP_ERROR TransferInit::Parse(System::PacketBufferHandle aBuffer) { if (mRangeCtlFlags.Has(RangeControlFlags::kWiderange)) { - SuccessOrExit(bufReader.Read64(&StartOffset).StatusCode()); + ReturnErrorOnFailure(bufReader.Read64(&StartOffset).StatusCode()); } else { - SuccessOrExit(bufReader.Read32(&tmpUint32Value).StatusCode()); + ReturnErrorOnFailure(bufReader.Read32(&tmpUint32Value).StatusCode()); StartOffset = tmpUint32Value; } } @@ -124,18 +124,18 @@ CHIP_ERROR TransferInit::Parse(System::PacketBufferHandle aBuffer) { if (mRangeCtlFlags.Has(RangeControlFlags::kWiderange)) { - SuccessOrExit(bufReader.Read64(&MaxLength).StatusCode()); + ReturnErrorOnFailure(bufReader.Read64(&MaxLength).StatusCode()); } else { - SuccessOrExit(bufReader.Read32(&tmpUint32Value).StatusCode()); + ReturnErrorOnFailure(bufReader.Read32(&tmpUint32Value).StatusCode()); MaxLength = tmpUint32Value; } } - SuccessOrExit(bufReader.Read16(&FileDesLength).StatusCode()); + ReturnErrorOnFailure(bufReader.Read16(&FileDesLength).StatusCode()); - VerifyOrExit(bufReader.HasAtLeast(FileDesLength), err = CHIP_ERROR_MESSAGE_INCOMPLETE); + VerifyOrReturnError(bufReader.HasAtLeast(FileDesLength), CHIP_ERROR_MESSAGE_INCOMPLETE); FileDesignator = &bufStart[bufReader.OctetsRead()]; // Rest of message is metadata (could be empty) @@ -151,12 +151,7 @@ CHIP_ERROR TransferInit::Parse(System::PacketBufferHandle aBuffer) // Retain ownership of the packet buffer so that the FileDesignator and Metadata pointers remain valid. Buffer = std::move(aBuffer); -exit: - if (bufReader.StatusCode() != CHIP_NO_ERROR) - { - err = bufReader.StatusCode(); - } - return err; + return CHIP_NO_ERROR; } size_t TransferInit::MessageSize() const @@ -235,12 +230,11 @@ Encoding::LittleEndian::BufferWriter & SendAccept::WriteToBuffer(Encoding::Littl CHIP_ERROR SendAccept::Parse(System::PacketBufferHandle aBuffer) { - CHIP_ERROR err = CHIP_NO_ERROR; uint8_t transferCtl = 0; uint8_t * bufStart = aBuffer->Start(); Reader bufReader(bufStart, aBuffer->DataLength()); - SuccessOrExit(bufReader.Read8(&transferCtl).Read16(&MaxBlockSize).StatusCode()); + ReturnErrorOnFailure(bufReader.Read8(&transferCtl).Read16(&MaxBlockSize).StatusCode()); Version = transferCtl & kVersionMask; @@ -259,12 +253,7 @@ CHIP_ERROR SendAccept::Parse(System::PacketBufferHandle aBuffer) // Retain ownership of the packet buffer so that the Metadata pointer remains valid. Buffer = std::move(aBuffer); -exit: - if (bufReader.StatusCode() != CHIP_NO_ERROR) - { - err = bufReader.StatusCode(); - } - return err; + return CHIP_NO_ERROR; } size_t SendAccept::MessageSize() const @@ -349,13 +338,12 @@ Encoding::LittleEndian::BufferWriter & ReceiveAccept::WriteToBuffer(Encoding::Li CHIP_ERROR ReceiveAccept::Parse(System::PacketBufferHandle aBuffer) { - CHIP_ERROR err = CHIP_NO_ERROR; uint8_t transferCtl = 0; uint32_t tmpUint32Value = 0; // Used for reading non-wide length and offset fields uint8_t * bufStart = aBuffer->Start(); Reader bufReader(bufStart, aBuffer->DataLength()); - SuccessOrExit(bufReader.Read8(&transferCtl).Read8(mRangeCtlFlags.RawStorage()).Read16(&MaxBlockSize).StatusCode()); + ReturnErrorOnFailure(bufReader.Read8(&transferCtl).Read8(mRangeCtlFlags.RawStorage()).Read16(&MaxBlockSize).StatusCode()); Version = transferCtl & kVersionMask; @@ -367,11 +355,11 @@ CHIP_ERROR ReceiveAccept::Parse(System::PacketBufferHandle aBuffer) { if (mRangeCtlFlags.Has(RangeControlFlags::kWiderange)) { - SuccessOrExit(bufReader.Read64(&StartOffset).StatusCode()); + ReturnErrorOnFailure(bufReader.Read64(&StartOffset).StatusCode()); } else { - SuccessOrExit(bufReader.Read32(&tmpUint32Value).StatusCode()); + ReturnErrorOnFailure(bufReader.Read32(&tmpUint32Value).StatusCode()); StartOffset = tmpUint32Value; } } @@ -381,11 +369,11 @@ CHIP_ERROR ReceiveAccept::Parse(System::PacketBufferHandle aBuffer) { if (mRangeCtlFlags.Has(RangeControlFlags::kWiderange)) { - SuccessOrExit(bufReader.Read64(&Length).StatusCode()); + ReturnErrorOnFailure(bufReader.Read64(&Length).StatusCode()); } else { - SuccessOrExit(bufReader.Read32(&tmpUint32Value).StatusCode()); + ReturnErrorOnFailure(bufReader.Read32(&tmpUint32Value).StatusCode()); Length = tmpUint32Value; } } @@ -402,12 +390,7 @@ CHIP_ERROR ReceiveAccept::Parse(System::PacketBufferHandle aBuffer) // Retain ownership of the packet buffer so that the Metadata pointer remains valid. Buffer = std::move(aBuffer); -exit: - if (bufReader.StatusCode() != CHIP_NO_ERROR) - { - err = bufReader.StatusCode(); - } - return err; + return CHIP_NO_ERROR; } size_t ReceiveAccept::MessageSize() const @@ -507,11 +490,10 @@ Encoding::LittleEndian::BufferWriter & DataBlock::WriteToBuffer(Encoding::Little CHIP_ERROR DataBlock::Parse(System::PacketBufferHandle aBuffer) { - CHIP_ERROR err = CHIP_NO_ERROR; uint8_t * bufStart = aBuffer->Start(); Reader bufReader(bufStart, aBuffer->DataLength()); - SuccessOrExit(bufReader.Read32(&BlockCounter).StatusCode()); + ReturnErrorOnFailure(bufReader.Read32(&BlockCounter).StatusCode()); // Rest of message is data Data = nullptr; @@ -525,12 +507,7 @@ CHIP_ERROR DataBlock::Parse(System::PacketBufferHandle aBuffer) // Retain ownership of the packet buffer so that the Data pointer remains valid. Buffer = std::move(aBuffer); -exit: - if (bufReader.StatusCode() != CHIP_NO_ERROR) - { - err = bufReader.StatusCode(); - } - return err; + return CHIP_NO_ERROR; } size_t DataBlock::MessageSize() const @@ -586,18 +563,10 @@ Encoding::LittleEndian::BufferWriter & BlockQueryWithSkip::WriteToBuffer(Encodin CHIP_ERROR BlockQueryWithSkip::Parse(System::PacketBufferHandle aBuffer) { - CHIP_ERROR err = CHIP_NO_ERROR; uint8_t * bufStart = aBuffer->Start(); Reader bufReader(bufStart, aBuffer->DataLength()); - SuccessOrExit(bufReader.Read32(&BlockCounter).StatusCode()); - SuccessOrExit(bufReader.Read64(&BytesToSkip).StatusCode()); -exit: - if (bufReader.StatusCode() != CHIP_NO_ERROR) - { - err = bufReader.StatusCode(); - } - return err; + return bufReader.Read32(&BlockCounter).Read64(&BytesToSkip).StatusCode(); } size_t BlockQueryWithSkip::MessageSize() const diff --git a/src/protocols/secure_channel/CASESession.cpp b/src/protocols/secure_channel/CASESession.cpp index a8b0ac4e459a2f..b56076a9cd200e 100644 --- a/src/protocols/secure_channel/CASESession.cpp +++ b/src/protocols/secure_channel/CASESession.cpp @@ -2075,7 +2075,7 @@ CHIP_ERROR CASESession::OnMessageReceived(ExchangeContext * ec, const PayloadHea msgType == Protocols::SecureChannel::MsgType::CASE_Sigma2Resume || msgType == Protocols::SecureChannel::MsgType::CASE_Sigma3) { - SuccessOrExit(mExchangeCtxt->FlushAcks()); + SuccessOrExit(err = mExchangeCtxt->FlushAcks()); } #endif // CHIP_CONFIG_SLOW_CRYPTO diff --git a/src/protocols/secure_channel/PASESession.cpp b/src/protocols/secure_channel/PASESession.cpp index 603c7ac51d1fdc..ae81480d623c3b 100644 --- a/src/protocols/secure_channel/PASESession.cpp +++ b/src/protocols/secure_channel/PASESession.cpp @@ -829,7 +829,7 @@ CHIP_ERROR PASESession::OnMessageReceived(ExchangeContext * exchange, const Payl if (msgType == MsgType::PBKDFParamRequest || msgType == MsgType::PBKDFParamResponse || msgType == MsgType::PASE_Pake1 || msgType == MsgType::PASE_Pake2 || msgType == MsgType::PASE_Pake3) { - SuccessOrExit(mExchangeCtxt->FlushAcks()); + SuccessOrExit(err = mExchangeCtxt->FlushAcks()); } #endif // CHIP_CONFIG_SLOW_CRYPTO diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 50ff8f1b0e4729..e5cd38f0e6018a 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -543,6 +543,7 @@ class ManualTestList : public Command printf("Test_TC_BRBINFO_2_2\n"); printf("Test_TC_BRBINFO_2_3\n"); printf("Test_TC_ACE_1_2\n"); + printf("Test_TC_ACE_1_6\n"); return CHIP_NO_ERROR; } @@ -8905,7 +8906,7 @@ class Test_TC_ACE_1_1Suite : public TestCommand class Test_TC_ACE_1_5Suite : public TestCommand { public: - Test_TC_ACE_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACE_1_5", 18, credsIssuerConfig) + Test_TC_ACE_1_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACE_1_5", 23, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -8991,6 +8992,10 @@ class Test_TC_ACE_1_5Suite : public TestCommand } break; case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; @@ -8999,10 +9004,10 @@ class Test_TC_ACE_1_5Suite : public TestCommand } shouldContinue = true; break; - case 9: + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 10: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; @@ -9011,10 +9016,14 @@ class Test_TC_ACE_1_5Suite : public TestCommand } shouldContinue = true; break; - case 11: + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 12: + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList @@ -9022,29 +9031,41 @@ class Test_TC_ACE_1_5Suite : public TestCommand VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); } break; - case 13: + case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); break; - case 14: + case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); break; - case 15: + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::VendorId value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); } break; - case 16: + case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; - case 17: + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); } break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -9073,7 +9094,7 @@ class Test_TC_ACE_1_5Suite : public TestCommand OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); } case 2: { - LogStep(2, "Step 3 & 4: TH1 puts DUT into commissioning mode, TH2 commissions DUT using admin node ID N2"); + LogStep(2, "Step 2 & 3: TH1 puts DUT into commissioning mode, TH2 commissions DUT using admin node ID N2"); VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; @@ -9133,17 +9154,28 @@ class Test_TC_ACE_1_5Suite : public TestCommand } case 7: { LogStep(7, "TH2 reads the fabric index"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityBeta, GetEndpoint(0), OperationalCredentials::Id, OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); } case 8: { - LogStep(8, "Read the commissioner node ID from the alpha fabric"); + LogStep(8, "TH2 reads the fabric index"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Read the commissioner node ID from the alpha fabric"); ListFreer listFreer; chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; return GetCommissionerNodeId(kIdentityAlpha, value); } - case 9: { - LogStep(9, "TH1 writes ACL giving view privilege for descriptor cluster"); + case 10: { + LogStep(10, "TH1 writes ACL giving view privilege for descriptor cluster"); ListFreer listFreer; chip::app::DataModel::List value; @@ -9213,14 +9245,16 @@ class Test_TC_ACE_1_5Suite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, chip::NullOptional, chip::NullOptional); } - case 10: { - LogStep(10, "Read the commissioner node ID from the beta fabric"); + case 11: { + LogStep(11, "Read the commissioner node ID from the beta fabric"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; return GetCommissionerNodeId(kIdentityBeta, value); } - case 11: { - LogStep(11, "TH2 writes ACL giving view privilge for basic cluster"); + case 12: { + LogStep(12, "TH2 writes ACL giving view privilge for basic cluster"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::DataModel::List value; @@ -9290,28 +9324,60 @@ class Test_TC_ACE_1_5Suite : public TestCommand return WriteAttribute(kIdentityBeta, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, chip::NullOptional, chip::NullOptional); } - case 12: { - LogStep(12, "TH1 reads descriptor cluster - expect SUCCESS"); + case 13: { + LogStep(13, "TH2 writes ACL giving view privilge for basic cluster"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "TH1 reads descriptor cluster - expect SUCCESS"); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::DeviceTypeList::Id, true, chip::NullOptional); } - case 13: { - LogStep(13, "TH1 reads basic cluster - expect UNSUPPORTED_ACCESS"); + case 15: { + LogStep(15, "TH1 reads basic cluster - expect UNSUPPORTED_ACCESS"); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::VendorID::Id, true, chip::NullOptional); } - case 14: { - LogStep(14, "TH2 reads descriptor cluster - expect UNSUPPORTED_ACCESS"); + case 16: { + LogStep(16, "TH2 reads descriptor cluster - expect UNSUPPORTED_ACCESS"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityBeta, GetEndpoint(0), Descriptor::Id, Descriptor::Attributes::DeviceTypeList::Id, true, chip::NullOptional); } - case 15: { - LogStep(15, "TH2 reads basic cluster - expect SUCCESS"); + case 17: { + LogStep(17, "TH2 reads descriptor cluster - expect UNSUPPORTED_ACCESS"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 18: { + LogStep(18, "TH2 reads basic cluster - expect SUCCESS"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityBeta, GetEndpoint(0), BasicInformation::Id, BasicInformation::Attributes::VendorID::Id, true, chip::NullOptional); } - case 16: { - LogStep(16, "TH1 resets ACL to default"); + case 19: { + LogStep(19, "TH2 writes Extension attribute value as empty list"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "TH1 resets ACL to default"); ListFreer listFreer; chip::app::DataModel::List value; @@ -9341,8 +9407,9 @@ class Test_TC_ACE_1_5Suite : public TestCommand return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, chip::NullOptional, chip::NullOptional); } - case 17: { - LogStep(17, "TH1 sends RemoveFabric command for TH2"); + case 21: { + LogStep(21, "TH1 sends RemoveFabric command for TH2"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::OperationalCredentials::Commands::RemoveFabric::Type value; value.fabricIndex = th2FabricIndex; @@ -9351,6 +9418,16 @@ class Test_TC_ACE_1_5Suite : public TestCommand ); } + case 22: { + LogStep(22, "TH1 sends RemoveFabric command for TH2"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } } return CHIP_NO_ERROR; } @@ -118444,6 +118521,61 @@ class Test_TC_ACE_1_2Suite : public TestCommand } }; +class Test_TC_ACE_1_6Suite : public TestCommand +{ +public: + Test_TC_ACE_1_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACE_1_6", 0, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ACE_1_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + {} + return CHIP_NO_ERROR; + } +}; + #endif // CONFIG_ENABLE_YAML_TESTS void registerCommandsTests(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) @@ -118951,6 +119083,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), #endif // CONFIG_ENABLE_YAML_TESTS }; diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 0c5f225c2dd691..bd85d91e2db8fb 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -5696,13 +5696,13 @@ class Test_TC_ACE_1_5 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, - " ***** Test Step 2 : Step 3 & 4: TH1 puts DUT into commissioning mode, TH2 commissions DUT using admin node ID " + " ***** Test Step 2 : Step 2 & 3: TH1 puts DUT into commissioning mode, TH2 commissions DUT using admin node ID " "N2\n"); if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } - err = TestStep34Th1PutsDutIntoCommissioningModeTh2CommissionsDutUsingAdminNodeIdN2_2(); + err = TestStep23Th1PutsDutIntoCommissioningModeTh2CommissionsDutUsingAdminNodeIdN2_2(); break; case 3: ChipLogProgress(chipTool, " ***** Test Step 3 : Open Commissioning Window from alpha\n"); @@ -5738,47 +5738,111 @@ class Test_TC_ACE_1_5 : public TestCommandBridge { break; case 7: ChipLogProgress(chipTool, " ***** Test Step 7 : TH2 reads the fabric index\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { + NextTest(); + return; + } err = TestTh2ReadsTheFabricIndex_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the commissioner node ID from the alpha fabric\n"); - err = TestReadTheCommissionerNodeIdFromTheAlphaFabric_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : TH2 reads the fabric index\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTh2ReadsTheFabricIndex_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH1 writes ACL giving view privilege for descriptor cluster\n"); - err = TestTh1WritesAclGivingViewPrivilegeForDescriptorCluster_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the commissioner node ID from the alpha fabric\n"); + err = TestReadTheCommissionerNodeIdFromTheAlphaFabric_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read the commissioner node ID from the beta fabric\n"); - err = TestReadTheCommissionerNodeIdFromTheBetaFabric_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : TH1 writes ACL giving view privilege for descriptor cluster\n"); + err = TestTh1WritesAclGivingViewPrivilegeForDescriptorCluster_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : TH2 writes ACL giving view privilge for basic cluster\n"); - err = TestTh2WritesAclGivingViewPrivilgeForBasicCluster_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Read the commissioner node ID from the beta fabric\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { + NextTest(); + return; + } + err = TestReadTheCommissionerNodeIdFromTheBetaFabric_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : TH1 reads descriptor cluster - expect SUCCESS\n"); - err = TestTh1ReadsDescriptorClusterExpectSuccess_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : TH2 writes ACL giving view privilge for basic cluster\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { + NextTest(); + return; + } + err = TestTh2WritesAclGivingViewPrivilgeForBasicCluster_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : TH1 reads basic cluster - expect UNSUPPORTED_ACCESS\n"); - err = TestTh1ReadsBasicClusterExpectUnsupportedAccess_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : TH2 writes ACL giving view privilge for basic cluster\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTh2WritesAclGivingViewPrivilgeForBasicCluster_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : TH2 reads descriptor cluster - expect UNSUPPORTED_ACCESS\n"); - err = TestTh2ReadsDescriptorClusterExpectUnsupportedAccess_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : TH1 reads descriptor cluster - expect SUCCESS\n"); + err = TestTh1ReadsDescriptorClusterExpectSuccess_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : TH2 reads basic cluster - expect SUCCESS\n"); - err = TestTh2ReadsBasicClusterExpectSuccess_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : TH1 reads basic cluster - expect UNSUPPORTED_ACCESS\n"); + err = TestTh1ReadsBasicClusterExpectUnsupportedAccess_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : TH1 resets ACL to default\n"); - err = TestTh1ResetsAclToDefault_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : TH2 reads descriptor cluster - expect UNSUPPORTED_ACCESS\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { + NextTest(); + return; + } + err = TestTh2ReadsDescriptorClusterExpectUnsupportedAccess_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : TH1 sends RemoveFabric command for TH2\n"); - err = TestTh1SendsRemoveFabricCommandForTh2_17(); + ChipLogProgress(chipTool, " ***** Test Step 17 : TH2 reads descriptor cluster - expect UNSUPPORTED_ACCESS\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTh2ReadsDescriptorClusterExpectUnsupportedAccess_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : TH2 reads basic cluster - expect SUCCESS\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { + NextTest(); + return; + } + err = TestTh2ReadsBasicClusterExpectSuccess_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : TH2 writes Extension attribute value as empty list\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTh2WritesExtensionAttributeValueAsEmptyList_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : TH1 resets ACL to default\n"); + err = TestTh1ResetsAclToDefault_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : TH1 sends RemoveFabric command for TH2\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { + NextTest(); + return; + } + err = TestTh1SendsRemoveFabricCommandForTh2_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : TH1 sends RemoveFabric command for TH2\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTh1SendsRemoveFabricCommandForTh2_22(); break; } @@ -5831,20 +5895,35 @@ class Test_TC_ACE_1_5 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 13: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 14: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); break; case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_ACCESS)); break; case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -5858,7 +5937,7 @@ class Test_TC_ACE_1_5 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 18; + const uint16_t mTestCount = 23; chip::Optional mNodeId; chip::Optional mCluster; @@ -5902,7 +5981,7 @@ class Test_TC_ACE_1_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep34Th1PutsDutIntoCommissioningModeTh2CommissionsDutUsingAdminNodeIdN2_2() + CHIP_ERROR TestStep23Th1PutsDutIntoCommissioningModeTh2CommissionsDutUsingAdminNodeIdN2_2() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; @@ -5996,9 +6075,19 @@ class Test_TC_ACE_1_5 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestTh2ReadsTheFabricIndex_8() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } NSNumber * _Nonnull commissionerNodeIdAlpha; - CHIP_ERROR TestReadTheCommissionerNodeIdFromTheAlphaFabric_8() + CHIP_ERROR TestReadTheCommissionerNodeIdFromTheAlphaFabric_9() { chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; @@ -6010,7 +6099,7 @@ class Test_TC_ACE_1_5 : public TestCommandBridge { }); } - CHIP_ERROR TestTh1WritesAclGivingViewPrivilegeForDescriptorCluster_9() + CHIP_ERROR TestTh1WritesAclGivingViewPrivilegeForDescriptorCluster_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -6069,7 +6158,7 @@ class Test_TC_ACE_1_5 : public TestCommandBridge { } NSNumber * _Nonnull commissionerNodeIdBeta; - CHIP_ERROR TestReadTheCommissionerNodeIdFromTheBetaFabric_10() + CHIP_ERROR TestReadTheCommissionerNodeIdFromTheBetaFabric_11() { chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; @@ -6081,7 +6170,7 @@ class Test_TC_ACE_1_5 : public TestCommandBridge { }); } - CHIP_ERROR TestTh2WritesAclGivingViewPrivilgeForBasicCluster_11() + CHIP_ERROR TestTh2WritesAclGivingViewPrivilgeForBasicCluster_12() { MTRBaseDevice * device = GetDevice("beta"); @@ -6139,7 +6228,17 @@ class Test_TC_ACE_1_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTh1ReadsDescriptorClusterExpectSuccess_12() + CHIP_ERROR TestTh2WritesAclGivingViewPrivilgeForBasicCluster_13() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestTh1ReadsDescriptorClusterExpectSuccess_14() { MTRBaseDevice * device = GetDevice("alpha"); @@ -6157,7 +6256,7 @@ class Test_TC_ACE_1_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTh1ReadsBasicClusterExpectUnsupportedAccess_13() + CHIP_ERROR TestTh1ReadsBasicClusterExpectUnsupportedAccess_15() { MTRBaseDevice * device = GetDevice("alpha"); @@ -6176,7 +6275,7 @@ class Test_TC_ACE_1_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTh2ReadsDescriptorClusterExpectUnsupportedAccess_14() + CHIP_ERROR TestTh2ReadsDescriptorClusterExpectUnsupportedAccess_16() { MTRBaseDevice * device = GetDevice("beta"); @@ -6195,7 +6294,17 @@ class Test_TC_ACE_1_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTh2ReadsBasicClusterExpectSuccess_15() + CHIP_ERROR TestTh2ReadsDescriptorClusterExpectUnsupportedAccess_17() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestTh2ReadsBasicClusterExpectSuccess_18() { MTRBaseDevice * device = GetDevice("beta"); @@ -6213,7 +6322,17 @@ class Test_TC_ACE_1_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTh1ResetsAclToDefault_16() + CHIP_ERROR TestTh2WritesExtensionAttributeValueAsEmptyList_19() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestTh1ResetsAclToDefault_20() { MTRBaseDevice * device = GetDevice("alpha"); @@ -6248,7 +6367,7 @@ class Test_TC_ACE_1_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTh1SendsRemoveFabricCommandForTh2_17() + CHIP_ERROR TestTh1SendsRemoveFabricCommandForTh2_21() { MTRBaseDevice * device = GetDevice("alpha"); @@ -6271,6 +6390,16 @@ class Test_TC_ACE_1_5 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestTh1SendsRemoveFabricCommandForTh2_22() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } }; class Test_TC_BOOL_1_1 : public TestCommandBridge {