From a39e88a2dd1186cd8358485bc26a21059c72b44f Mon Sep 17 00:00:00 2001 From: cbucht200 <100870495+cbucht200@users.noreply.github.com> Date: Thu, 29 Jun 2023 14:59:11 -0400 Subject: [PATCH 1/3] Server should store the pointer to the session keystore, so that the GetSessionKeystore API works as expected (#27552) --- src/app/server/Server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index 0793832d17271c..5eff5ea0be7344 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -127,6 +127,7 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams) mSubscriptionResumptionStorage = initParams.subscriptionResumptionStorage; mOperationalKeystore = initParams.operationalKeystore; mOpCertStore = initParams.opCertStore; + mSessionKeystore = initParams.sessionKeystore; if (initParams.certificateValidityPolicy) { @@ -205,7 +206,7 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams) SuccessOrExit(err); err = mSessions.Init(&DeviceLayer::SystemLayer(), &mTransports, &mMessageCounterManager, mDeviceStorage, &GetFabricTable(), - *initParams.sessionKeystore); + *mSessionKeystore); SuccessOrExit(err); err = mFabricDelegate.Init(this); From 111bc80957f6f83f31770cbb65fcda3cc8657db6 Mon Sep 17 00:00:00 2001 From: Wang Qixiang <43193572+wqx6@users.noreply.github.com> Date: Fri, 30 Jun 2023 05:45:10 +0800 Subject: [PATCH 2/3] ESP32: Add option to enable controller building (#27544) --- config/esp32/components/chip/CMakeLists.txt | 4 ++++ config/esp32/components/chip/Kconfig | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index 8b46be6b092e89..d279ce37dc4535 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -158,6 +158,10 @@ if (CONFIG_ENABLE_CHIP_SHELL) chip_gn_arg_append("chip_build_libshell" "true") endif() +if (CONFIG_ENABLE_CHIP_CONTROLLER_BUILD) + chip_gn_arg_append("chip_build_controller" "true") +endif() + if (CONFIG_ENABLE_WIFI_STATION OR CONFIG_ENABLE_WIFI_AP) chip_gn_arg_append("chip_enable_wifi" "true") else() diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index 7bd4b0bf924de5..99de12afa97e6e 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -96,6 +96,12 @@ menu "CHIP Core" help Link the application against CHIP interactive shell. + config ENABLE_CHIP_CONTROLLER_BUILD + bool "Enable chip-controller build" + default n + help + This option enables chip-controller building. + config DISABLE_IPV4 bool "Disable IPv4 functionality in the CHIP stack" default "n" From def0efa87547eed7cf1498fa37da31aafca5e2e0 Mon Sep 17 00:00:00 2001 From: Tennessee Carmel-Veilleux Date: Thu, 29 Jun 2023 17:50:12 -0400 Subject: [PATCH 3/3] Fix manual code processing in python_testing_support (#27558) Problem: - Leading zeroes in manual pairing code were lost due to a conversion bug, which prevented proper usage - Found during plugfest This PR: - Avoids a round trip that removed leading zeroes and fixes the conversion to be lossless while retaining structural validation. - Allows spaces in passcode. Testing done: - Executed TC_DeviceBasicComposition with a --manual-code having leading zeroes, against chip-lighting-app. - Regression tests of TC_*.py Co-authored-by: tennessee.carmelveilleux@gmail.com --- src/python_testing/matter_testing_support.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/python_testing/matter_testing_support.py b/src/python_testing/matter_testing_support.py index d3e768c806e84e..8688504b6c090d 100644 --- a/src/python_testing/matter_testing_support.py +++ b/src/python_testing/matter_testing_support.py @@ -574,14 +574,15 @@ def byte_string_from_hex(s: str) -> bytes: return unhexlify(s.replace(":", "").replace(" ", "").replace("0x", "")) -def int_from_manual_code(s: str) -> int: - s = s.replace('-', '') +def str_from_manual_code(s: str) -> str: + """Enforces legal format for manual codes and removes spaces/dashes.""" + s = s.replace("-", "").replace(" ", "") regex = r"^([0-9]{11}|[0-9]{21})$" match = re.match(regex, s) if not match: raise ValueError("Invalid manual code format, does not match %s" % regex) - return int(s, 10) + return s def int_named_arg(s: str) -> Tuple[str, int]: @@ -701,7 +702,7 @@ def populate_commissioning_args(args: argparse.Namespace, config: MatterTestConf # TODO: this should also allow multiple once QR and manual codes are supported. config.qr_code_content = args.qr_code if args.manual_code: - config.manual_code = "%d" % args.manual_code + config.manual_code = args.manual_code else: config.manual_code = None @@ -885,7 +886,7 @@ def parse_matter_test_args(argv: List[str]) -> MatterTestConfig: code_group.add_argument('-q', '--qr-code', type=str, metavar="QR_CODE", help="QR setup code content (overrides passcode and discriminator)") - code_group.add_argument('--manual-code', type=int_from_manual_code, + code_group.add_argument('--manual-code', type=str_from_manual_code, metavar="MANUAL_CODE", help="Manual setup code content (overrides passcode and discriminator)") fabric_group = parser.add_argument_group(