8000 Linux / Darwin: Enable passcode / verifier config from PosixConfig by ksperling-apple · Pull Request #39765 · project-chip/connectedhomeip · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Linux / Darwin: Enable passcode / verifier config from PosixConfig #39765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ksperling-apple
Copy link
Contributor

Summary

  • If discriminator, passcode, verifier and related options are not specified on the command line, look up the relevant keys in PosixConfig if present before falling back to hard-coded test values.
  • Guard using test config behind CHIP_DEVICE_CONFIG_ENABLE_TEST_SETUP_PARAMS=1
  • Make the LinuxDeviceOptions parameters to the CommissionableInit functions const (and don't update the passed in options.payload anymore as this is not necessary or documented behavior).

Testing

Existing CI tests verify that passing commissionable parameters via command line still works as before. Manually verified that pre-populating the PosixConfig file (kvs on Darwin or chip-factory.ini on Linux) works for configuring these settings as well, and that example apps refuse to start without configuration when compiling with CHIP_DEVICE_CONFIG_ENABLE_TEST_SETUP_PARAMS=0.

Copy link
Contributor
@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request effectively implements the stated objectives, enabling the configuration of passcode, verifier, and discriminator settings from PosixConfig while maintaining command-line precedence and providing a guarded fallback to test parameters. The changes improve code correctness and maintainability by introducing const correctness for LinuxDeviceOptions parameters and refactoring the initialization logic into smaller, more focused helper functions. The updated documentation in the header file is also a valuable addition. The overall quality of the changes is high, and no critical, high, or medium severity issues were identified.

Copy link

PR #39765: Size comparison from 18ec87c to e05846d

Full report (1 build for stm32)
platform target config section 18ec87c e05846d change % change
stm32 light STM32WB5MM-DK FLASH 466252 466252 0 0.0
RAM 141376 141376 0 0.0

@ksperling-apple ksperling-apple force-pushed the linux-pincode-from-config branch from e05846d to 977ae4e Compare June 30, 2025 09:39
Copy link
github-actions bot commented Jun 30, 2025

PR #39765: Size comparison from 18ec87c to 977ae4e

Increases above 0.2%:

platform target config section 18ec87c 977ae4e change % change
linux thermostat-no-ble arm64 unknown 9800 9832 32 0.3
Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section 18ec87c 977ae4e change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1103302 1103302 0 0.0
RAM 179026 179026 0 0.0
bl702 lighting-app bl702+eth FLASH 656454 656454 0 0.0
RAM 134977 134977 0 0.0
bl702+wifi FLASH 833892 833892 0 0.0
RAM 124541 124541 0 0.0
bl706+mfd+rpc+littlefs FLASH 1066262 1066262 0 0.0
RAM 117397 117397 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 895808 895808 0 0.0
RAM 105676 105676 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 979526 979526 0 0.0
RAM 109876 109876 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 764080 764080 0 0.0
RAM 103368 103368 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 775772 775772 0 0.0
RAM 108536 108536 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 721880 721880 0 0.0
RAM 96940 96940 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 706180 706180 0 0.0
RAM 97148 97148 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 549470 549470 0 0.0
RAM 205144 205144 0 0.0
lock CC3235SF_LAUNCHXL FLASH 582590 582590 0 0.0
RAM 205344 205344 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 663541 663541 0 0.0
RAM 77472 77472 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 683385 683385 0 0.0
RAM 80112 80112 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 683385 683385 0 0.0
RAM 80112 80112 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 640325 640325 0 0.0
RAM 72540 72540 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 624917 624917 0 0.0
RAM 73784 73784 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 644545 644545 0 0.0
RAM 76336 76336 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 644545 644545 0 0.0
RAM 76336 76336 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 645853 645853 0 0.0
RAM 76784 76784 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 665561 665561 0 0.0
RAM 79336 79336 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 665561 665561 0 0.0
RAM 79336 79336 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 620529 620529 0 0.0
RAM 70888 70888 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 640381 640381 0 0.0
RAM 73520 73520 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 640381 640381 0 0.0
RAM 73520 73520 0 0.0
efr32 lock-app BRD4187C FLASH 948164 948164 0 0.0
RAM 131528 131528 0 0.0
BRD4338a FLASH 745484 745476 -8 -0.0
RAM 206896 206896 0 0.0
window-app BRD4187C FLASH 1041520 1041512 -8 -0.0
RAM 127656 127656 0 0.0
esp32 all-clusters-app c3devkit DRAM 102272 102272 0 0.0
FLASH 1781472 1781472 0 0.0
IRAM 83862 83862 0 0.0
m5stack DRAM 121156 121156 0 0.0
FLASH 1748706 1748706 0 0.0
IRAM 117071 117071 0 0.0
linux air-purifier-app debug unknown 4848 4848 0 0.0
FLASH 2798086 2799174 1088 0.0
RAM 117384 117384 0 0.0
all-clusters-app debug unknown 5664 5664 0 0.0
FLASH 6201300 6202316 1016 0.0
RAM 530336 530352 16 0.0
all-clusters-minimal-app debug unknown 5528 5528 0 0.0
FLASH 5475456 5476472 1016 0.0
RAM 228088 228072 -16 -0.0
bridge-app debug unknown 5560 5560 0 0.0
FLASH 4808736 4809754 1018 0.0
RAM 207776 207776 0 0.0
camera-app debug unknown 8968 8968 0 0.0
FLASH 6935003 6936011 1008 0.0
RAM 230088 230088 0 0.0
camera-controller debug unknown 9184 9184 0 0.0
FLASH 14333979 14333979 0 0.0
RAM 659096 659096 0 0.0
chip-tool debug unknown 6240 6240 0 0.0
FLASH 14673651 14673651 0 0.0
RAM 652648 652648 0 0.0
chip-tool-ipv6only arm64 unknown 40536 40536 0 0.0
FLASH 12657807 12657807 0 0.0
RAM 698888 698888 0 0.0
fabric-admin debug unknown 5920 5920 0 0.0
FLASH 12745093 12745093 0 0.0
RAM 651640 651640 0 0.0
fabric-bridge-app debug unknown 4808 4808 0 0.0
FLASH 4594998 4596084 1086 0.0
RAM 193536 193520 -16 -0.0
fabric-sync debug unknown 5056 5056 0 0.0
FLASH 5744029 5745117 1088 0.0
RAM 490800 490784 -16 -0.0
lighting-app debug+rpc+ui unknown 6272 6272 0 0.0
FLASH 5657649 5658737 1088 0.0
RAM 209928 209912 -16 -0.0
lock-app debug unknown 5488 5488 0 0.0
FLASH 4838930 4840018 1088 0.0
RAM 197160 197160 0 0.0
ota-provider-app debug unknown 4848 4848 0 0.0
FLASH 4447664 4448682 1018 0.0
RAM 186224 186208 -16 -0.0
ota-requestor-app debug unknown 4728 4728 0 0.0
FLASH 4519822 4520840 1018 0.0
RAM 189064 189064 0 0.0
shell debug unknown 4248 4248 0 0.0
FLASH 3080748 3080748 0 0.0
RAM 147328 147328 0 0.0
thermostat-no-ble arm64 unknown 9800 9832 32 0.3
FLASH 4236247 4236911 664 0.0
RAM 233392 233384 -8 -0.0
tv-app debug unknown 5824 5824 0 0.0
FLASH 6108269 6109277 1008 0.0
RAM 615032 615032 0 0.0
tv-casting-app debug unknown 5336 5336 0 0.0
FLASH 12823501 12825213 1712 0.0
RAM 768800 768880 80 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 889212 889212 0 0.0
RAM 166162 166162 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 897256 897256 0 0.0
RAM 145100 145100 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 859740 859740 0 0.0
RAM 141049 141049 0 0.0
nxp contact mcxw71+release FLASH 625824 625824 0 0.0
RAM 63164 63164 0 0.0
lock mcxw71+release FLASH 777056 777056 0 0.0
RAM 67820 67820 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1632916 1632916 0 0.0
RAM 211104 211104 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1577108 1577108 0 0.0
RAM 208472 208472 0 0.0
light cy8ckit_062s2_43012 FLASH 1449708 1449708 0 0.0
RAM 197184 197184 0 0.0
lock cy8ckit_062s2_43012 FLASH 1482076 1482076 0 0.0
RAM 224904 224904 0 0.0
qpg lighting-app qpg6200+debug FLASH 744800 744800 0 0.0
RAM 94220 94220 0 0.0
lock-app qpg6200+debug FLASH 754572 754572 0 0.0
RAM 94248 94248 0 0.0
stm32 light STM32WB5MM-DK FLASH 466252 466252 0 0.0
RAM 141376 141376 0 0.0
telink bridge-app tl7218x FLASH 703352 703352 0 0.0
RAM 93600 93600 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 795066 795066 0 0.0
RAM 44016 44016 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 783472 783472 0 0.0
RAM 100912 100912 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 710778 710778 0 0.0
RAM 54240 54240 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 747352 747352 0 0.0
RAM 77404 77404 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 724098 724098 0 0.0
RAM 36996 36996 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 603650 603650 0 0.0
RAM 112532 112532 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 819046 819050 4 0.0
RAM 99164 99164 0 0.0
tizen all-clusters-app arm unknown 5128 5124 -4 -0.1
FLASH 1698240 1698808 568 0.0
RAM 91464 91420 -44 -0.0
chip-tool-ubsan arm unknown 20696 20696 0 0.0
FLASH 20965098 20965098 0 0.0
RAM 9121420 9121420 0 0.0

- If discriminator, passcode, verifier and related options are not specified on
  the command line, look up the relevant keys in PosixConfig if present before
  falling back to hard-coded test values.
- Guard using test config behind CHIP_DEVICE_CONFIG_ENABLE_TEST_SETUP_PARAMS=1
- Make the LinuxDeviceOptions parameters to the CommissionableInit functions
  const (and don't update the passed in options.payload anymore as this is not
  necessary or documented behavior).
@ksperling-apple ksperling-apple force-pushed the linux-pincode-from-config branch from 977ae4e to 1db91a1 Compare July 3, 2025 22:27
Copy link
github-actions bot commented Jul 3, 2025

PR #39765: Size comparison from c4c6bea to 1db91a1

Increases above 0.2%:

platform target config section c4c6bea 1db91a1 change % change
linux thermostat-no-ble arm64 unknown 9800 9832 32 0.3
Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section c4c6bea 1db91a1 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1103302 1103302 0 0.0
RAM 179026 179026 0 0.0
bl702 lighting-app bl702+eth FLASH 656454 656454 0 0.0
RAM 134977 134977 0 0.0
bl702+wifi FLASH 833892 833892 0 0.0
RAM 124541 124541 0 0.0
bl706+mfd+rpc+littlefs FLASH 1066262 1066262 0 0.0
RAM 117397 117397 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 895808 895808 0 0.0
RAM 105676 105676 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 979526 979526 0 0.0
RAM 109876 109876 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 764080 764080 0 0.0
RAM 103368 103368 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 775772 775772 0 0.0
RAM 108536 108536 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 721880 721880 0 0.0
RAM 96940 96940 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 706180 706180 0 0.0
RAM 97148 97148 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 549470 549470 0 0.0
RAM 205144 205144 0 0.0
lock CC3235SF_LAUNCHXL FLASH 582590 582590 0 0.0
RAM 205344 205344 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 663541 663541 0 0.0
RAM 77472 77472 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 683385 683385 0 0.0
RAM 80112 80112 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 683385 683385 0 0.0
RAM 80112 80112 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 640325 640325 0 0.0
RAM 72540 72540 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 624917 624917 0 0.0
RAM 73784 73784 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 644545 644545 0 0.0
RAM 76336 76336 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 644545 644545 0 0.0
RAM 76336 76336 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 645853 645853 0 0.0
RAM 76784 76784 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 665561 665561 0 0.0
RAM 79336 79336 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 665561 665561 0 0.0
RAM 79336 79336 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 620529 620529 0 0.0
RAM 70888 70888 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 640381 640381 0 0.0
RAM 73520 73520 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 640381 640381 0 0.0
RAM 73520 73520 0 0.0
efr32 lock-app BRD4187C FLASH 948148 948148 0 0.0
RAM 131528 131528 0 0.0
BRD4338a FLASH 745604 745596 -8 -0.0
RAM 206896 206896 0 0.0
window-app BRD4187C FLASH 1041512 1041504 -8 -0.0
RAM 127656 127656 0 0.0
esp32 all-clusters-app c3devkit DRAM 102272 102272 0 0.0
FLASH 1781456 1781456 0 0.0
IRAM 83862 83862 0 0.0
m5stack DRAM 121156 121156 0 0.0
FLASH 1748690 1748690 0 0.0
IRAM 117071 117071 0 0.0
linux air-purifier-app debug unknown 4848 4848 0 0.0
FLASH 2798168 2799308 1140 0.0
RAM 117384 117384 0 0.0
all-clusters-app debug unknown 5664 5664 0 0.0
FLASH 6201702 6202770 1068 0.0
RAM 531264 531280 16 0.0
all-clusters-minimal-app debug unknown 5528 5528 0 0.0
FLASH 5475538 5476606 1068 0.0
RAM 228088 228072 -16 -0.0
bridge-app debug unknown 5560 5560 0 0.0
FLASH 4808818 4809888 1070 0.0
RAM 207776 207776 0 0.0
camera-app debug unknown 8968 8968 0 0.0
FLASH 6935563 6936619 1056 0.0
RAM 230088 230088 0 0.0
camera-controller debug unknown 9184 9184 0 0.0
FLASH 14373755 14373755 0 0.0
RAM 661336 661336 0 0.0
chip-tool debug unknown 6240 6240 0 0.0
FLASH 14721407 14721407 0 0.0
RAM 654856 654856 0 0.0
chip-tool-ipv6only arm64 unknown 40648 40648 0 0.0
FLASH 12698415 12698415 0 0.0
RAM 701152 701152 0 0.0
fabric-admin debug unknown 5920 5920 0 0.0
FLASH 12784861 12784861 0 0.0
RAM 653848 653848 0 0.0
fabric-bridge-app debug unknown 4808 4808 0 0.0
FLASH 4594998 4596136 1138 0.0
RAM 193536 193520 -16 -0.0
fabric-sync debug unknown 5056 5056 0 0.0
FLASH 5744381 5745533 1152 0.0
RAM 491728 491712 -16 -0.0
lighting-app debug+rpc+ui unknown 6272 6272 0 0.0
FLASH 5657729 5658865 1136 0.0
RAM 209928 209912 -16 -0.0
lock-app debug unknown 5488 5488 0 0.0
FLASH 4839012 4840154 1142 0.0
RAM 197160 197160 0 0.0
ota-provider-app debug unknown 4848 4848 0 0.0
FLASH 4447664 4448734 1070 0.0
RAM 186224 186208 -16 -0.0
ota-requestor-app debug unknown 4728 4728 0 0.0
FLASH 4519822 4520892 1070 0.0
RAM 189064 189064 0 0.0
shell debug unknown 4256 4256 0 0.0
FLASH 3081004 3081004 0 0.0
RAM 147328 147328 0 0.0
thermostat-no-ble arm64 unknown 9800 9832 32 0.3
FLASH 4236247 4236975 728 0.0
RAM 233392 233384 -8 -0.0
tv-app debug unknown 5824 5824 0 0.0
FLASH 6108701 6109773 1072 0.0
RAM 615960 615960 0 0.0
tv-casting-app debug unknown 5336 5336 0 0.0
FLASH 12872445 12874205 1760 0.0
RAM 771360 771440 80 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 889212 889212 0 0.0
RAM 166162 166162 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 897256 897256 0 0.0
RAM 145100 145100 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 859740 859740 0 0.0
RAM 141049 141049 0 0.0
nxp contact mcxw71+release FLASH 625824 625824 0 0.0
RAM 63164 63164 0 0.0
lock mcxw71+release FLASH 777056 777056 0 0.0
RAM 67820 67820 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1632916 1632916 0 0.0
RAM 211104 211104 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1577108 1577108 0 0.0
RAM 208472 208472 0 0.0
light cy8ckit_062s2_43012 FLASH 1449708 1449708 0 0.0
RAM 197184 197184 0 0.0
lock cy8ckit_062s2_43012 FLASH 1482076 1482076 0 0.0
RAM 224904 224904 0 0.0
qpg lighting-app qpg6200+debug FLASH 744800 744800 0 0.0
RAM 94220 94220 0 0.0
lock-app qpg6200+debug FLASH 754572 754572 0 0.0
RAM 94248 94248 0 0.0
stm32 light STM32WB5MM-DK FLASH 466252 466252 0 0.0
RAM 141376 141376 0 0.0
telink bridge-app tl7218x FLASH 703352 703352 0 0.0
RAM 93600 93600 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 795066 795066 0 0.0
RAM 44016 44016 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 783472 783472 0 0.0
RAM 100912 100912 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 710778 710778 0 0.0
RAM 54240 54240 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 747352 747352 0 0.0
RAM 77404 77404 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 724098 724098 0 0.0
RAM 36996 36996 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 603650 603650 0 0.0
RAM 112532 112532 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 819046 819050 4 0.0
RAM 99164 99164 0 0.0
tizen all-clusters-app arm unknown 5100 5096 -4 -0.1
FLASH 1698072 1698672 600 0.0
RAM 91472 91428 -44 -0.0
chip-tool-ubsan arm unknown 20752 20752 0 0.0
FLASH 21031098 21031098 0 0.0
RAM 9154436 9154436 0 0.0

@ksperling-apple ksperling-apple marked this pull request as ready for review July 3, 2025 22:51
@kiel-apple kiel-apple requested a review from Copilot July 3, 2025 23:41
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the Linux platform commissioning setup by reading passcode, verifier, salt, iteration count, and discriminator from PosixConfig before falling back to test parameters, and updates function signatures to use const LinuxDeviceOptions&.

  • Add helper functions in CommissionableInit.cpp to read optional values from PosixConfig and handle fallbacks.
  • Remove TestOnlyCommissionableDataProvider and guard test parameters behind CHIP_DEVICE_CONFIG_ENABLE_TEST_SETUP_PARAMS.
  • Change InitCommissionableDataProvider and InitConfigurationManager to accept const LinuxDeviceOptions & and no longer modify options.payload.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
examples/platform/linux/CommissionableInit.h Updated doc comments; changed signatures to take const LinuxDeviceOptions &.
examples/platform/linux/CommissionableInit.cpp Refactored commissioning init to use PosixConfig, added helper functions, removed test-only provider include.
Comments suppressed due to low confidence (3)

examples/platform/linux/CommissionableInit.h:36

  • [nitpick] The doc comment should note that options is now passed as const and is not modified by this function to avoid confusion about payload-side effects.
 * @param options - LinuxDeviceOptions instance configured via command-line parsing

examples/platform/linux/CommissionableInit.cpp:33

  • [nitpick] The helper name IsNotFound is quite generic—consider renaming it to IsConfigNotFound or similar to clarify its purpose.
bool IsNotFound(CHIP_ERROR err)

examples/platform/linux/CommissionableInit.cpp:101

  • New logic for reading/falling back salt from PosixConfig and behind test flags isn’t covered by existing CI tests; consider adding unit tests for GetSpake2pSalt, GetIterationCount, and GetDiscriminator.
CHIP_ERROR GetSpake2pSalt(const LinuxDeviceOptions & options, chip::Optional<std::vector<uint8_t>> & outSalt)

Copy link
github-actions bot commented Jul 6, 2025

PR #39765: Size comparison from c4c6bea to e591584

Increases above 0.2%:

platform target config section c4c6bea e591584 change % change
linux thermostat-no-ble arm64 unknown 9800 9832 32 0.3
Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section c4c6bea e591584 change % change
bl602 lighting-app bl602+mfd+littlefs+rpc FLASH 1103302 1103302 0 0.0
RAM 179026 179026 0 0.0
bl702 lighting-app bl702+eth FLASH 656454 656454 0 0.0
RAM 134977 134977 0 0.0
bl702+wifi FLASH 833892 833892 0 0.0
RAM 124541 124541 0 0.0
bl706+mfd+rpc+littlefs FLASH 1066262 1066262 0 0.0
RAM 117397 117397 0 0.0
bl702l contact-sensor-app bl702l+mfd+littlefs FLASH 895808 895808 0 0.0
RAM 105676 105676 0 0.0
lighting-app bl702l+mfd+littlefs FLASH 979526 979526 0 0.0
RAM 109876 109876 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 764080 764080 0 0.0
RAM 103368 103368 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 775772 775772 0 0.0
RAM 108536 108536 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 721880 721880 0 0.0
RAM 96940 96940 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 706180 706180 0 0.0
RAM 97148 97148 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 549470 549470 0 0.0
RAM 205144 205144 0 0.0
lock CC3235SF_LAUNCHXL FLASH 582590 582590 0 0.0
RAM 205344 205344 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 663541 663541 0 0.0
RAM 77472 77472 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 683385 683385 0 0.0
RAM 80112 80112 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 683385 683385 0 0.0
RAM 80112 80112 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 640325 640325 0 0.0
RAM 72540 72540 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 624917 624917 0 0.0
RAM 73784 73784 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 644545 644545 0 0.0
RAM 76336 76336 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 644545 644545 0 0.0
RAM 76336 76336 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 645853 645853 0 0.0
RAM 76784 76784 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 665561 665561 0 0.0
RAM 79336 79336 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 665561 665561 0 0.0
RAM 79336 79336 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 620529 620529 0 0.0
RAM 70888 70888 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 640381 640381 0 0.0
RAM 73520 73520 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 640381 640381 0 0.0
RAM 73520 73520 0 0.0
efr32 lock-app BRD4187C FLASH 948148 948148 0 0.0
RAM 131528 131528 0 0.0
BRD4338a FLASH 745604 745596 -8 -0.0
RAM 206896 206896 0 0.0
window-app BRD4187C FLASH 1041512 1041504 -8 -0.0
RAM 127656 127656 0 0.0
esp32 all-clusters-app c3devkit DRAM 102272 102272 0 0.0
FLASH 1781456 1781456 0 0.0
IRAM 83862 83862 0 0.0
m5stack DRAM 121156 121156 0 0.0
FLASH 1748690 1748690 0 0.0
IRAM 117071 117071 0 0.0
linux air-purifier-app debug unknown 4848 4848 0 0.0
FLASH 2798168 2799334 1166 0.0
RAM 117384 117384 0 0.0
all-clusters-app debug unknown 5664 5664 0 0.0
FLASH 6201702 6202796 1094 0.0
RAM 531264 531280 16 0.0
all-clusters-minimal-app debug unknown 5528 5528 0 0.0
FLASH 5475538 5476632 1094 0.0
RAM 228088 228072 -16 -0.0
bridge-app debug unknown 5560 5560 0 0.0
FLASH 4808818 4809914 1096 0.0
RAM 207776 207776 0 0.0
camera-app debug unknown 8968 8968 0 0.0
FLASH 6935563 6936651 1088 0.0
RAM 230088 230088 0 0.0
camera-controller debug unknown 9184 9184 0 0.0
FLASH 14373755 14373755 0 0.0
RAM 661336 661336 0 0.0
chip-tool debug unknown 6240 6240 0 0.0
FLASH 14721407 14721407 0 0.0
RAM 654856 654856 0 0.0
chip-tool-ipv6only arm64 unknown 40648 40648 0 0.0
FLASH 12698415 12698415 0 0.0
RAM 701152 701152 0 0.0
fabric-admin debug unknown 5920 5920 0 0.0
FLASH 12784861 12784861 0 0.0
RAM 653848 653848 0 0.0
fabric-bridge-app debug unknown 4808 4808 0 0.0
FLASH 4594998 4596162 1164 0.0
RAM 193536 193520 -16 -0.0
fabric-sync debug unknown 5056 5056 0 0.0
FLASH 5744381 5745549 1168 0.0
RAM 491728 491712 -16 -0.0
lighting-app debug+rpc+ui unknown 6272 6272 0 0.0
FLASH 5657729 5658897 1168 0.0
RAM 209928 209912 -16 -0.0
lock-app debug unknown 5488 5488 0 0.0
FLASH 4839012 4840180 1168 0.0
RAM 197160 197160 0 0.0
ota-provider-app debug unknown 4848 4848 0 0.0
FLASH 4447664 4448760 1096 0.0
RAM 186224 186208 -16 -0.0
ota-requestor-app debug unknown 4728 4728 0 0.0
FLASH 4519822 4520918 1096 0.0
RAM 189064 189064 0 0.0
shell debug unknown 4256 4256 0 0.0
FLASH 3081004 3081004 0 0.0
RAM 147328 147328 0 0.0
thermostat-no-ble arm64 unknown 9800 9832 32 0.3
FLASH 4236247 4237007 760 0.0
RAM 233392 233384 -8 -0.0
tv-app debug unknown 5824 5824 0 0.0
FLASH 6108701 6109789 1088 0.0
RAM 615960 615960 0 0.0
tv-casting-app debug unknown 5336 5336 0 0.0
FLASH 12872445 12874237 1792 0.0
RAM 771360 771440 80 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 889212 889212 0 0.0
RAM 166162 166162 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 897256 897256 0 0.0
RAM 145100 145100 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 859740 859740 0 0.0
RAM 141049 141049 0 0.0
nxp contact mcxw71+release FLASH 625824 625824 0 0.0
RAM 63164 63164 0 0.0
lock mcxw71+release FLASH 777056 777056 0 0.0
RAM 67820 67820 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1632916 1632916 0 0.0
RAM 211104 211104 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1577108 1577108 0 0.0
RAM 208472 208472 0 0.0
light cy8ckit_062s2_43012 FLASH 1449708 1449708 0 0.0
RAM 197184 197184 0 0.0
lock cy8ckit_062s2_43012 FLASH 1482076 1482076 0 0.0
RAM 224904 224904 0 0.0
qpg lighting-app qpg6200+debug FLASH 744800 744800 0 0.0
RAM 94220 94220 0 0.0
lock-app qpg6200+debug FLASH 754572 754572 0 0.0
RAM 94248 94248 0 0.0
stm32 light STM32WB5MM-DK FLASH 466252 466252 0 0.0
RAM 141376 141376 0 0.0
telink bridge-app tl7218x FLASH 703352 703352 0 0.0
RAM 93600 93600 0 0.0
light-app-ota-compress-lzma-shell-factory-data tl3218x FLASH 795066 795066 0 0.0
RAM 44016 44016 0 0.0
light-app-ota-shell-factory-data tl7218x FLASH 783472 783472 0 0.0
RAM 100912 100912 0 0.0
light-switch-app-ota-compress-lzma-factory-data tl7218x_retention FLASH 710778 710778 0 0.0
RAM 54240 54240 0 0.0
light-switch-app-ota-compress-lzma-shell-factory-data tlsr9528a FLASH 747352 747352 0 0.0
RAM 77404 77404 0 0.0
light-switch-app-ota-factory-data tl3218x_retention FLASH 724098 724098 0 0.0
RAM 36996 36996 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 603650 603650 0 0.0
RAM 112532 112532 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 819046 819050 4 0.0
RAM 99164 99164 0 0.0
tizen all-clusters-app arm unknown 5100 5096 -4 -0.1
FLASH 1698072 1698696 624 0.0
RAM 91472 91428 -44 -0.0
chip-tool-ubsan arm unknown 20752 20752 0 0.0
FLASH 21031098 21031098 0 0.0
RAM 9154436 9154436 0 0.0

@mergify mergify bot merged commit a26503f into project-chip:master Jul 7, 2025
70 checks passed
@ksperling-apple ksperling-apple deleted the linux-pincode-from-config branch July 7, 2025 07:32
dsavitsky-dsr pushed a commit to dsavitsky-dsr/connectedhomeip that referenced this pull request Jul 7, 2025
…roject-chip#39765)

* Linux / Darwin: Enable passcode / verifier config from PosixConfig

- If discriminator, passcode, verifier and related options are not specified on
  the command line, look up the relevant keys in PosixConfig if present before
  falling back to hard-coded test values.
- Guard using test config behind CHIP_DEVICE_CONFIG_ENABLE_TEST_SETUP_PARAMS=1
- Make the LinuxDeviceOptions parameters to the CommissionableInit functions
  const (and don't update the passed in options.payload anymore as this is not
  necessary or documented behavior).

* Make error handling logic clearer as per review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

35E3
3 participants
0