Skip to content
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

Make setupPayloadWithOnboardingPayload return error on invalid input. #23357

Conversation

bzbarsky-apple
Copy link
Contributor

We shouldn't create MTRSetupPayload from invalid input strings via this API.

@github-actions
Copy link

github-actions bot commented Oct 26, 2022

PR #23357: Size comparison from 5c97559 to 475a9ba

Increases (2 builds for esp32)
platform target config section 5c97559 475a9ba change % change
esp32 all-clusters-app c3devkit (read only) 1223864 1223868 4 0.0
(read/write) 1788406 1788414 8 0.0
.flash.rodata 257960 257968 8 0.0
.flash.text 1223864 1223868 4 0.0
m5stack (read/write) 564324 564332 8 0.0
.flash.rodata 315024 315032 8 0.0
Decreases (8 builds for bl602, bl702, cyw30739, psoc6, telink)
platform target config section 5c97559 475a9ba change % change
bl602 lighting-app bl602 .text 1069918 1069916 -2 -0.0
bl602+rpc .text 1101268 1101266 -2 -0.0
bl702 lighting-app bl702 .debug_info 37926233 37926232 -1 -0.0
.text 958000 957998 -2 -0.0
bl702+rpc .debug_info 41833210 41833209 -1 -0.0
.text 1031192 1031190 -2 -0.0
cyw30739 light cyw930739m2evb_01 (read/write) 588242 588234 -8 -0.0
.app_xip_area 464828 464820 -8 -0.0
psoc6 lock cy8ckit_062s2_43012 .debug_info 22290569 22290568 -1 -0.0
telink lighting-app tlsr9518adk80d (read/write) 805844 805836 -8 -0.0
text 566214 566212 -2 -0.0
ota-requestor-app tlsr9518adk80d text 565084 565082 -2 -0.0
Full report (38 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
platform target config section 5c97559 475a9ba change % change
bl602 lighting-app bl602 (read/write) 1390598 1390598 0 0.0
.bss 90745 90745 0 0.0
.data 9928 9928 0 0.0
.text 1069918 1069916 -2 -0.0
bl602+rpc (read/write) 1435822 1435822 0 0.0
.bss 98177 98177 0 0.0
.data 10312 10312 0 0.0
.text 1101268 1101266 -2 -0.0
bl702 lighting-app bl702 (read only) 3262 3262 0 0.0
(read/write) 1189507 1189507 0 0.0
.bleromro 6296 6296 0 0.0
.bleromrw 124 124 0 0.0
.boot2 688 688 0 0.0
.bss 67134 67134 0 0.0
.bss_psram 29696 29696 0 0.0
.comment 48 48 0 0.0
.data 4272 4272 0 0.0
.debug_abbrev 1507974 1507974 0 0.0
.debug_aranges 132000 132000 0 0.0
.debug_frame 484268 484268 0 0.0
.debug_info 37926233 37926232 -1 -0.0
.debug_line 5256837 5256837 0 0.0
.debug_loc 3367293 3367293 0 0.0
.debug_ranges 358552 358552 0 0.0
.debug_str 3450962 3450962 0 0.0
.hbn 509 509 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 144 144 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 116600 116600 0 0.0
.rsvd 3188 3188 0 0.0
.shstrtab 293 293 0 0.0
.stack 2048 2048 0 0.0
.strtab 565413 565413 0 0.0
.symtab 171840 171840 0 0.0
.tcm_data 36 36 0 0.0
.tcmcode 3262 3262 0 0.0
.text 0 0 0 0.0
958000 957998 -2 -0.0
bl702+rpc (read only) 3262 3262 0 0.0
(read/write) 1284931 1284931 0 0.0
.bleromro 6296 6296 0 0.0
.bleromrw 124 124 0 0.0
.boot2 688 688 0 0.0
.bss 75166 75166 0 0.0
.bss_psram 29936 29936 0 0.0
.comment 48 48 0 0.0
.data 4800 4800 0 0.0
.debug_abbrev 1645361 1645361 0 0.0
.debug_aranges 139504 139504 0 0.0
.debug_frame 509640 509640 0 0.0
.debug_info 41833210 41833209 -1 -0.0
.debug_line 5631555 5631555 0 0.0
.debug_loc 3559912 3559912 0 0.0
.debug_ranges 381008 381008 0 0.0
.debug_str 3846939 3846939 0 0.0
.hbn 509 509 0 0.0
.hbn_noinit 260 260 0 0.0
.init 342 342 0 0.0
.init_array 160 160 0 0.0
.psram 0 0 0 0.0
.riscv.attributes 47 47 0 0.0
.rodata 130008 130008 0 0.0
.rsvd 3188 3188 0 0.0
.shstrtab 293 293 0 0.0
.stack 2048 2048 0 0.0
.strtab 624586 624586 0 0.0
.symtab 189648 189648 0 0.0
.tcm_data 36 36 0 0.0
.tcmcode 3262 3262 0 0.0
.text 0 0 0 0.0
1031192 1031190 -2 -0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 677567 677567 0 0.0
(read/write) 173992 173992 0 0.0
.bss 81252 81252 0 0.0
.data 3380 3380 0 0.0
.rodata 89863 89863 0 0.0
.text 587392 587392 0 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 641815 641815 0 0.0
(read/write) 158020 158020 0 0.0
.bss 80524 80524 0 0.0
.data 3380 3380 0 0.0
.rodata 78999 78999 0 0.0
.text 562496 562496 0 0.0
lock-ftd LP_CC2652R7 (read only) 676083 676083 0 0.0
(read/write) 172612 172612 0 0.0
.bss 78476 78476 0 0.0
.data 3304 3304 0 0.0
.rodata 77387 77387 0 0.0
.text 598216 598216 0 0.0
lock-mtd LP_CC2652R7 (read only) 659807 659807 0 0.0
(read/write) 184576 184576 0 0.0
.bss 74164 74164 0 0.0
.data 3304 3304 0 0.0
.rodata 103199 103199 0 0.0
.text 556128 556128 0 0.0
pump-app LP_CC2652R7 (read only) 688339 688339 0 0.0
(read/write) 161092 161092 0 0.0
.bss 78444 78444 0 0.0
.data 3296 3296 0 0.0
.rodata 90835 90835 0 0.0
.text 597020 597020 0 0.0
pump-controller-app LP_CC2652R7 (read only) 672623 672623 0 0.0
(read/write) 176904 176904 0 0.0
.bss 78540 78540 0 0.0
.data 3292 3292 0 0.0
.rodata 86383 86383 0 0.0
.text 585760 585760 0 0.0
shell LP_CC2652R7 (read only) 668582 668582 0 0.0
(read/write) 185296 185296 0 0.0
.bss 83572 83572 0 0.0
.data 3376 3376 0 0.0
.rodata 86566 86566 0 0.0
.text 581700 581700 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 588242 588234 -8 -0.0
.app_xip_area 464828 464820 -8 -0.0
.bss 65832 65832 0 0.0
.data 760 760 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 592290 592290 0 0.0
.app_xip_area 463580 463580 0 0.0
.bss 71120 71120 0 0.0
.data 768 768 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 544198 544198 0 0.0
.app_xip_area 425864 425864 0 0.0
.bss 60800 60800 0 0.0
.data 716 716 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A+rpc (read/write) 974292 974292 0 0.0
.bss 152276 152276 0 0.0
.data 2248 2248 0 0.0
.text 819748 819748 0 0.0
BRD4161A+rs911x (read/write) 1031920 1031920 0 0.0
.bss 186680 186680 0 0.0
.data 2092 2092 0 0.0
.text 843128 843128 0 0.0
BRD4187C (read/write) 1146628 1146628 0 0.0
.bss 138664 138664 0 0.0
.data 2596 2596 0 0.0
.text 980772 980772 0 0.0
lock-app BRD4161A+wf200 (read/write) 1157464 1157464 0 0.0
.bss 158208 158208 0 0.0
.data 2100 2100 0 0.0
.text 997136 997136 0 0.0
window-app BRD4187C (read/write) 1139848 1139848 0 0.0
.bss 140080 140080 0 0.0
.data 2620 2620 0 0.0
.text 972552 972552 0 0.0
esp32 all-clusters-app c3devkit (read only) 1223864 1223868 4 0.0
(read/write) 1788406 1788414 8 0.0
.dram0.bss 76960 76960 0 0.0
.dram0.data 13840 13840 0 0.0
.flash.rodata 257960 257968 8 0.0
.flash.text 1223864 1223868 4 0.0
.iram0.text 65204 65204 0 0.0
m5stack (read only) 1233823 1233823 0 0.0
(read/write) 564324 564332 8 0.0
.dram0.bss 82336 82336 0 0.0
.dram0.data 34296 34296 0 0.0
.flash.rodata 315024 315032 8 0.0
.flash.text 1228439 1228439 0 0.0
.iram0.text 123939 123939 0 0.0
k32w contact k32w0+release (read/write) 661380 661380 0 0.0
.bss 77040 77040 0 0.0
.data 2104 2104 0 0.0
.text 563124 563124 0 0.0
light k32w0+release (read/write) 671712 671712 0 0.0
.bss 74840 74840 0 0.0
.data 2060 2060 0 0.0
.text 592084 592084 0 0.0
lock k32w0+release (read/write) 633188 633188 0 0.0
.bss 75600 75600 0 0.0
.data 2080 2080 0 0.0
.text 552780 552780 0 0.0
linux chip-tool-ipv6only arm64 (read only) 10431188 10431188 0 0.0
(read/write) 706353 706353 0 0.0
.bss 33953 33953 0 0.0
.data 2768 2768 0 0.0
.data.rel.ro 650632 650632 0 0.0
.dynamic 560 560 0 0.0
.got 13896 13896 0 0.0
.init 24 24 0 0.0
.init_array 208 208 0 0.0
.rodata 518228 518228 0 0.0
.text 8257396 8257396 0 0.0
thermostat-no-ble arm64 (read only) 2391660 2391660 0 0.0
(read/write) 143633 143633 0 0.0
.bss 55377 55377 0 0.0
.data 1816 1816 0 0.0
.data.rel.ro 77256 77256 0 0.0
.dynamic 560 560 0 0.0
.got 5176 5176 0 0.0
.init 24 24 0 0.0
.init_array 440 440 0 0.0
.rodata 144548 144548 0 0.0
.text 2004208 2004208 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2452400 2452400 0 0.0
.bss 215028 215028 0 0.0
.data 5872 5872 0 0.0
.text 1415044 1415044 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1183871 1183871 0 0.0
bss 144457 144457 0 0.0
rodata 144496 144496 0 0.0
text 816028 816028 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1162543 1162543 0 0.0
bss 143684 143684 0 0.0
rodata 136072 136072 0 0.0
text 803920 803920 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 (read only) 841952 841952 0 0.0
(read/write) 1745924 1745924 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 188728 188728 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2664 2664 0 0.0
.debug_abbrev 1229891 1229891 0 0.0
.debug_aranges 110680 110680 0 0.0
.debug_frame 371092 371092 0 0.0
.debug_info 26859255 26859255 0 0.0
.debug_line 3673060 3673060 0 0.0
.debug_loc 3590923 3590923 0 0.0
.debug_ranges 338736 338736 0 0.0
.debug_str 3434833 3434833 0 0.0
.heap 841952 841952 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 570130 570130 0 0.0
.symtab 421456 421456 0 0.0
.text 0 0 0 0.0
1546144 1546144 0 0.0
.zero.table 8 8 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 (read only) 842688 842688 0 0.0
(read/write) 1688524 1688524 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 187992 187992 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2664 2664 0 0.0
.debug_abbrev 1221734 1221734 0 0.0
.debug_aranges 110152 110152 0 0.0
.debug_frame 374172 374172 0 0.0
.debug_info 26595885 26595885 0 0.0
.debug_line 3693804 3693804 0 0.0
.debug_loc 3578560 3578560 0 0.0
.debug_ranges 337352 337352 0 0.0
.debug_str 3423854 3423854 0 0.0
.heap 842688 842688 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 534219 534219 0 0.0
.symtab 407888 407888 0 0.0
.text 1489480 1489480 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
light cy8ckit_062s2_43012 (read only) 850872 850872 0 0.0
(read/write) 1607052 1607052 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 180016 180016 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2456 2456 0 0.0
.debug_abbrev 1056242 1056242 0 0.0
.debug_aranges 102360 102360 0 0.0
.debug_frame 344504 344504 0 0.0
.debug_info 22057378 22057378 0 0.0
.debug_line 3263439 3263439 0 0.0
.debug_loc 3276259 3276259 0 0.0
.debug_ranges 302656 302656 0 0.0
.debug_str 3229374 3229374 0 0.0
.heap 850872 850872 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 470596 470596 0 0.0
.symtab 376336 376336 0 0.0
.text 1416192 1416192 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
lock cy8ckit_062s2_43012 (read only) 845880 845880 0 0.0
(read/write) 1640740 1640740 0 0.0
.ARM.attributes 46 46 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 184992 184992 0 0.0
.comment 204 204 0 0.0
.copy.table 24 24 0 0.0
.cy_m0p_image 6216 6216 0 0.0
.cy_sharedmem 8 8 0 0.0
.data 2472 2472 0 0.0
.debug_abbrev 1058226 1058226 0 0.0
.debug_aranges 102752 102752 0 0.0
.debug_frame 346360 346360 0 0.0
.debug_info 22290569 22290568 -1 -0.0
.debug_line 3260420 3260420 0 0.0
.debug_loc 3303837 3303837 0 0.0
.debug_ranges 304592 304592 0 0.0
.debug_str 3248768 3248768 0 0.0
.heap 845880 845880 0 0.0
.noinit 148 148 0 0.0
.ramVectors 736 736 0 0.0
.shstrtab 288 288 0 0.0
.stab 156 156 0 0.0
.stabstr 335 335 0 0.0
.stack_dummy 4096 4096 0 0.0
.strtab 472947 472947 0 0.0
.symtab 377952 377952 0 0.0
.text 1444888 1444888 0 0.0
.zero.table 0 0 0 0.0
8 8 0 0.0
qpg lighting-app qpg6105+debug (read/write) 1149008 1149008 0 0.0
.bss 110580 110580 0 0.0
.data 832 832 0 0.0
.text 596108 596108 0 0.0
lock-app qpg6105+debug (read/write) 1113888 1113888 0 0.0
.bss 106372 106372 0 0.0
.data 836 836 0 0.0
.text 560984 560984 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 790588 790588 0 0.0
bss 72480 72480 0 0.0
noinit 43520 43520 0 0.0
text 554060 554060 0 0.0
lighting-app tlsr9518adk80d (read/write) 805844 805836 -8 -0.0
bss 73240 73240 0 0.0
noinit 43520 43520 0 0.0
text 566214 566212 -2 -0.0
ota-requestor-app tlsr9518adk80d (read/write) 804728 804728 0 0.0
bss 74052 74052 0 0.0
noinit 43520 43520 0 0.0
text 565084 565082 -2 -0.0

@woody-apple woody-apple merged commit f323cab into project-chip:master Oct 26, 2022
@bzbarsky-apple bzbarsky-apple deleted the disallow-parsing-invalid-payload branch October 26, 2022 16:11
adbridge pushed a commit to ARM-software/connectedhomeip that referenced this pull request Nov 18, 2022
adbridge pushed a commit to ARM-software/connectedhomeip that referenced this pull request Nov 18, 2022
ksperling-apple added a commit to ksperling-apple/connectedhomeip that referenced this pull request Apr 29, 2024
ksperling-apple added a commit to ksperling-apple/connectedhomeip that referenced this pull request Apr 29, 2024
mergify bot pushed a commit that referenced this pull request Apr 30, 2024
* Darwin Tests: Make MTRSetupPayload initialization test reliable

Also rename the tests to more conventional names.

* Add regression test for #31129

* Add regression test for #23357

* Add test for NSSecureCoding support

* Darwin: Tidy up MTRSetupPayload headers / includes

* Darwin: return nil on error in MTRSetupPayload getAllOptionalVendorData
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.

3 participants