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 QR code parsing error out if the padding bits are not all 0. #18809

Merged

Conversation

bzbarsky-apple
Copy link
Contributor

Right now we accept invalid QR codes with nonzero padding.

Problem

A QR code that has nonzero padding bits is accepted.

Change overview

Make that log and fail.

Testing

Modified an existing all-clusters-app QR code (MT:-24J029Q00KA0648G00) to have a single bit set in the padding (so MT:-24J029Q00KA0640A30) and then ran the chip-tool parse-setup-payload command.

Right now we accept invalid QR codes with nonzero padding.
@bzbarsky-apple bzbarsky-apple force-pushed the nonzero-payload-padding branch from 212ce70 to e06a278 Compare May 25, 2022 15:41
@github-actions
Copy link

github-actions bot commented May 25, 2022

PR #18809: Size comparison from 054d820 to e06a278

Increases (2 builds for linux)
platform target config section 054d820 e06a278 change % change
linux chip-tool debug (read only) 9601429 9601573 144 0.0
.rodata 492317 492381 64 0.0
.text 7731061 7731141 80 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 9341508 9341620 112 0.0
.rodata 456316 456348 32 0.0
.text 7372116 7372196 80 0.0
Full report (37 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 054d820 e06a278 change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 667311 667311 0 0.0
(read/write) 184536 184536 0 0.0
.bss 74828 74828 0 0.0
.data 3400 3400 0 0.0
.rodata 100103 100103 0 0.0
.text 566980 566980 0 0.0
lock-ftd LP_CC2652R7 (read only) 676343 676343 0 0.0
(read/write) 166496 166496 0 0.0
.bss 72876 72876 0 0.0
.data 3236 3236 0 0.0
.rodata 94551 94551 0 0.0
.text 581308 581308 0 0.0
lock-mtd LP_CC2652R7 (read only) 625751 625751 0 0.0
(read/write) 145708 145708 0 0.0
.bss 68612 68612 0 0.0
.data 3236 3236 0 0.0
.rodata 94431 94431 0 0.0
.text 530828 530828 0 0.0
pump-app LP_CC2652R7 (read only) 676139 676139 0 0.0
(read/write) 168124 168124 0 0.0
.bss 73276 73276 0 0.0
.data 3272 3272 0 0.0
.rodata 88715 88715 0 0.0
.text 586940 586940 0 0.0
pump-controller-app LP_CC2652R7 (read only) 654123 654123 0 0.0
(read/write) 189740 189740 0 0.0
.bss 73132 73132 0 0.0
.data 3232 3232 0 0.0
.rodata 83499 83499 0 0.0
.text 570144 570144 0 0.0
shell LP_CC2652R7 (read only) 660326 660326 0 0.0
(read/write) 187080 187080 0 0.0
.bss 77188 77188 0 0.0
.data 3404 3404 0 0.0
.rodata 97070 97070 0 0.0
.text 563032 563032 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 621966 621966 0 0.0
.app_xip_area 525244 525244 0 0.0
.bss 79364 79364 0 0.0
.data 704 704 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 627282 627282 0 0.0
.app_xip_area 532032 532032 0 0.0
.bss 77924 77924 0 0.0
.data 672 672 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 571026 571026 0 0.0
.app_xip_area 466100 466100 0 0.0
.bss 87304 87304 0 0.0
.data 584 584 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 911884 911884 0 0.0
(read/write) 133436 133436 0 0.0
.bss 131384 131384 0 0.0
.data 2052 2052 0 0.0
.text 911876 911876 0 0.0
BRD4161A+rpc (read only) 946024 946024 0 0.0
(read/write) 150128 150128 0 0.0
.bss 147872 147872 0 0.0
.data 2256 2256 0 0.0
.text 946016 946016 0 0.0
BRD4161A+rs911x (read only) 786468 786468 0 0.0
(read/write) 129704 129704 0 0.0
.bss 127644 127644 0 0.0
.data 2060 2060 0 0.0
.text 786460 786460 0 0.0
lock-app BRD4161A+wf200 (read only) 946880 946880 0 0.0
(read/write) 124180 124180 0 0.0
.bss 122156 122156 0 0.0
.data 2024 2024 0 0.0
.text 946872 946872 0 0.0
window-app BRD4161A (read only) 896804 896804 0 0.0
(read/write) 133496 133496 0 0.0
.bss 131448 131448 0 0.0
.data 2048 2048 0 0.0
.text 896796 896796 0 0.0
esp32 all-clusters-app c3devkit (read only) 1000858 1000858 0 0.0
(read/write) 1479114 1479114 0 0.0
.dram0.bss 69392 69392 0 0.0
.dram0.data 14616 14616 0 0.0
.flash.rodata 209672 209672 0 0.0
.flash.text 1000858 1000858 0 0.0
.iram0.text 62954 62954 0 0.0
m5stack (read only) 1055935 1055935 0 0.0
(read/write) 481144 481144 0 0.0
.dram0.bss 74904 74904 0 0.0
.dram0.data 34200 34200 0 0.0
.flash.rodata 240044 240044 0 0.0
.flash.text 1050551 1050551 0 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w061+release (read/write) 681040 681040 0 0.0
.bss 80424 80424 0 0.0
.data 2008 2008 0 0.0
.text 596904 596904 0 0.0
lock k32w061+release (read/write) 729140 729140 0 0.0
.bss 80856 80856 0 0.0
.data 1976 1976 0 0.0
.text 644604 644604 0 0.0
linux all-clusters-app debug (read only) 2747289 2747289 0 0.0
(read/write) 178240 178240 0 0.0
.bss 86496 86496 0 0.0
.data 2032 2032 0 0.0
.data.rel.ro 83560 83560 0 0.0
.dynamic 608 608 0 0.0
.got 4496 4496 0 0.0
.init 27 27 0 0.0
.init_array 1016 1016 0 0.0
.rodata 240317 240317 0 0.0
.text 2333330 2333330 0 0.0
bridge-app debug+rpc (read only) 2022401 2022401 0 0.0
(read/write) 147896 147896 0 0.0
.bss 73120 73120 0 0.0
.data 3936 3936 0 0.0
.data.rel.ro 65272 65272 0 0.0
.dynamic 592 592 0 0.0
.got 4272 4272 0 0.0
.init 27 27 0 0.0
.init_array 688 688 0 0.0
.rodata 167968 167968 0 0.0
.text 1698274 1698274 0 0.0
chip-tool debug (read only) 9601429 9601573 144 0.0
(read/write) 596176 596176 0 0.0
.bss 23936 23936 0 0.0
.data 1120 1120 0 0.0
.data.rel.ro 564832 564832 0 0.0
.dynamic 624 624 0 0.0
.got 5008 5008 0 0.0
.init 27 27 0 0.0
.init_array 648 648 0 0.0
.rodata 492317 492381 64 0.0
.text 7731061 7731141 80 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 9341508 9341620 112 0.0
(read/write) 662369 662369 0 0.0
.bss 42225 42225 0 0.0
.data 1176 1176 0 0.0
.data.rel.ro 600184 600184 0 0.0
.dynamic 560 560 0 0.0
.got 14944 14944 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 456316 456348 32 0.0
.text 7372116 7372196 80 0.0
lighting-app debug+rpc (read only) 2314761 2314761 0 0.0
(read/write) 153536 153536 0 0.0
.bss 74944 74944 0 0.0
.data 2048 2048 0 0.0
.data.rel.ro 70776 70776 0 0.0
.dynamic 608 608 0 0.0
.got 4344 4344 0 0.0
.init 27 27 0 0.0
.init_array 792 792 0 0.0
.rodata 187016 187016 0 0.0
.text 1962354 1962354 0 0.0
lock-app debug (read only) 2239761 2239761 0 0.0
(read/write) 148600 148600 0 0.0
.bss 73632 73632 0 0.0
.data 1568 1568 0 0.0
.data.rel.ro 67704 67704 0 0.0
.dynamic 592 592 0 0.0
.got 4336 4336 0 0.0
.init 27 27 0 0.0
.init_array 752 752 0 0.0
.rodata 198504 198504 0 0.0
.text 1881298 1881298 0 0.0
ota-provider-app debug (read only) 2064993 2064993 0 0.0
(read/write) 141360 141360 0 0.0
.bss 73024 73024 0 0.0
.data 1768 1768 0 0.0
.data.rel.ro 60776 60776 0 0.0
.dynamic 608 608 0 0.0
.got 4504 4504 0 0.0
.init 27 27 0 0.0
.init_array 648 648 0 0.0
.rodata 179672 179672 0 0.0
.text 1726754 1726754 0 0.0
ota-requestor-app debug (read only) 2093953 2093953 0 0.0
(read/write) 144200 144200 0 0.0
.bss 73728 73728 0 0.0
.data 1960 1960 0 0.0
.data.rel.ro 62872 62872 0 0.0
.dynamic 592 592 0 0.0
.got 4344 4344 0 0.0
.init 27 27 0 0.0
.init_array 672 672 0 0.0
.rodata 175648 175648 0 0.0
.text 1758274 1758274 0 0.0
shell debug (read only) 2554689 2554689 0 0.0
(read/write) 201744 201744 0 0.0
.bss 117416 117416 0 0.0
.data 1376 1376 0 0.0
.data.rel.ro 77208 77208 0 0.0
.dynamic 608 608 0 0.0
.got 4192 4192 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 220882 220882 0 0.0
.text 2174674 2174674 0 0.0
thermostat-no-ble arm64 (read only) 2360428 2360428 0 0.0
(read/write) 177441 177441 0 0.0
.bss 88177 88177 0 0.0
.data 1520 1520 0 0.0
.data.rel.ro 79944 79944 0 0.0
.dynamic 560 560 0 0.0
.got 4768 4768 0 0.0
.init 24 24 0 0.0
.init_array 376 376 0 0.0
.rodata 147708 147708 0 0.0
.text 1983648 1983648 0 0.0
tv-app debug (read only) 2873641 2873641 0 0.0
(read/write) 280368 280368 0 0.0
.bss 191304 191304 0 0.0
.data 4672 4672 0 0.0
.data.rel.ro 78120 78120 0 0.0
.dynamic 592 592 0 0.0
.got 4728 4728 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 221632 221632 0 0.0
.text 2469522 2469522 0 0.0
tv-casting-app debug (read only) 5438817 5438817 0 0.0
(read/write) 226416 226416 0 0.0
.bss 78888 78888 0 0.0
.data 2400 2400 0 0.0
.data.rel.ro 138896 138896 0 0.0
.dynamic 608 608 0 0.0
.got 4728 4728 0 0.0
.init 27 27 0 0.0
.init_array 864 864 0 0.0
.rodata 339840 339840 0 0.0
.text 4739218 4739218 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2418960 2418960 0 0.0
.bss 202852 202852 0 0.0
.data 5872 5872 0 0.0
.text 1381604 1381604 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1181715 1181715 0 0.0
bss 139552 139552 0 0.0
rodata 152844 152844 0 0.0
text 810472 810472 0 0.0
p6 all-clusters-app default (read/write) 2537144 2537144 0 0.0
.bss 137352 137352 0 0.0
.data 2800 2800 0 0.0
.text 1495408 1495408 0 0.0
light-app default (read/write) 2420456 2420456 0 0.0
.bss 129688 129688 0 0.0
.data 2600 2600 0 0.0
.text 1378720 1378720 0 0.0
lock-app default (read/write) 2434736 2434736 0 0.0
.bss 129496 129496 0 0.0
.data 2568 2568 0 0.0
.text 1393000 1393000 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 779896 779896 0 0.0
bss 70824 70824 0 0.0
noinit 40416 40416 0 0.0
text 551388 551388 0 0.0
lighting-app tlsr9518adk80d (read/write) 799920 799920 0 0.0
bss 71076 71076 0 0.0
noinit 40416 40416 0 0.0
text 568122 568122 0 0.0

@isiu-apple isiu-apple merged commit 613ad19 into project-chip:master May 25, 2022
@bzbarsky-apple bzbarsky-apple deleted the nonzero-payload-padding branch May 25, 2022 18:53
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