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

[EFR32] Lock-app updates, adding multiple users and credentials #19229

Merged
merged 6 commits into from
Jun 9, 2022
Merged

[EFR32] Lock-app updates, adding multiple users and credentials #19229

merged 6 commits into from
Jun 9, 2022

Conversation

mykrupp
Copy link
Contributor

@mykrupp mykrupp commented Jun 6, 2022

Problem

Door-lock-server was updated to accommodate multiple users and credentials

Change overview

EFR32 platform now accommodates multiple users and credentials.
Added logic for RequirePINForRemoteOperation
Read maxNumberOfCredentials per user
Store new users and credentials in nvm flash
Fix non-happy path cases(i.e. lock command sent door is already locked)

Testing

This was tested by sending relevant commands affected by the recent door-lock-server changes

./out/chip-tool doorlock set-user 0 1 mike 5 1 0 0 1 1 --timedInteractionTimeoutMs 1000

./out/chip-tool doorlock set-user 0 2 matt 6 1 0 0 1 1 --timedInteractionTimeoutMs 1000

./out/chip-tool doorlock set-user 0 3 nick 7 1 0 0 1 1 --timedInteractionTimeoutMs 1000

// set credential
./out/chip-tool doorlock set-credential 0 '{ "credentialType": 1, "credentialIndex": 1 }' "123456" 1 null null 1 1 --timedInteractionTimeoutMs 1000

./out/chip-tool doorlock set-credential 0 '{ "credentialType": 1, "credentialIndex": 2 }' "123457” 1 null null 1 1 --timedInteractionTimeoutMs 1000

// get user
./out/chip-tool doorlock get-user 1 1 1 --timedInteractionTimeoutMs 1000

Reset EFR32

./out/chip-tool doorlock get-user 1 1 1 --timedInteractionTimeoutMs 1000

See that users and credentials are still available after reset

@github-actions
Copy link

github-actions bot commented Jun 6, 2022

PR #19229: Size comparison from 9c1660c to 97d2504

Increases above 0.2%:

platform target config section 9c1660c 97d2504 change % change
efr32 lock-app BRD4161A+wf200 (read/write) 128252 128636 384 0.3
.bss 126180 126564 384 0.3
Increases (1 build for efr32)
platform target config section 9c1660c 97d2504 change % change
efr32 lock-app BRD4161A+wf200 (read only) 958092 958428 336 0.0
(read/write) 128252 128636 384 0.3
.bss 126180 126564 384 0.3
.text 958084 958420 336 0.0
Full report (41 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 9c1660c 97d2504 change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 651579 651579 0 0.0
(read/write) 158924 158924 0 0.0
.bss 74604 74604 0 0.0
.data 3404 3404 0 0.0
.rodata 85523 85523 0 0.0
.text 565824 565824 0 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 617595 617595 0 0.0
(read/write) 158080 158080 0 0.0
.bss 73820 73820 0 0.0
.data 3344 3344 0 0.0
.rodata 74955 74955 0 0.0
.text 542408 542408 0 0.0
lock-ftd LP_CC2652R7 (read only) 682967 682967 0 0.0
(read/write) 159864 159864 0 0.0
.bss 72612 72612 0 0.0
.data 3268 3268 0 0.0
.rodata 97671 97671 0 0.0
.text 584816 584816 0 0.0
lock-mtd LP_CC2652R7 (read only) 632367 632367 0 0.0
(read/write) 145732 145732 0 0.0
.bss 68348 68348 0 0.0
.data 3268 3268 0 0.0
.rodata 97551 97551 0 0.0
.text 534328 534328 0 0.0
pump-app LP_CC2652R7 (read only) 664079 664079 0 0.0
(read/write) 179656 179656 0 0.0
.bss 72748 72748 0 0.0
.data 3300 3300 0 0.0
.rodata 85847 85847 0 0.0
.text 577752 577752 0 0.0
pump-controller-app LP_CC2652R7 (read only) 655151 655151 0 0.0
(read/write) 188696 188696 0 0.0
.bss 72860 72860 0 0.0
.data 3264 3264 0 0.0
.rodata 83895 83895 0 0.0
.text 570776 570776 0 0.0
shell LP_CC2652R7 (read only) 644602 644602 0 0.0
(read/write) 154480 154480 0 0.0
.bss 76956 76956 0 0.0
.data 3408 3408 0 0.0
.rodata 82506 82506 0 0.0
.text 561860 561860 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 602110 602110 0 0.0
.app_xip_area 461136 461136 0 0.0
.bss 83912 83912 0 0.0
.data 744 744 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 599218 599218 0 0.0
.app_xip_area 458108 458108 0 0.0
.bss 84080 84080 0 0.0
.data 712 712 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 596890 596890 0 0.0
.app_xip_area 456912 456912 0 0.0
.bss 83044 83044 0 0.0
.data 620 620 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 916016 916016 0 0.0
(read/write) 133184 133184 0 0.0
.bss 131088 131088 0 0.0
.data 2096 2096 0 0.0
.text 916008 916008 0 0.0
BRD4161A+rpc (read only) 950244 950244 0 0.0
(read/write) 149876 149876 0 0.0
.bss 147576 147576 0 0.0
.data 2300 2300 0 0.0
.text 950236 950236 0 0.0
BRD4161A+rs911x (read only) 791228 791228 0 0.0
(read/write) 129460 129460 0 0.0
.bss 127356 127356 0 0.0
.data 2104 2104 0 0.0
.text 791220 791220 0 0.0
lock-app BRD4161A+wf200 (read only) 958092 958428 336 0.0
(read/write) 128252 128636 384 0.3
.bss 126180 126564 384 0.3
.data 2072 2072 0 0.0
.text 958084 958420 336 0.0
window-app BRD4161A (read only) 901056 901056 0 0.0
(read/write) 133272 133272 0 0.0
.bss 131176 131176 0 0.0
.data 2092 2092 0 0.0
.text 901048 901048 0 0.0
esp32 all-clusters-app c3devkit (read only) 1007688 1007688 0 0.0
(read/write) 1481482 1481482 0 0.0
.dram0.bss 69168 69168 0 0.0
.dram0.data 14656 14656 0 0.0
.flash.rodata 212232 212232 0 0.0
.flash.text 1007688 1007688 0 0.0
.iram0.text 62954 62954 0 0.0
m5stack (read only) 1062651 1062651 0 0.0
(read/write) 483652 483652 0 0.0
.dram0.bss 74680 74680 0 0.0
.dram0.data 34208 34208 0 0.0
.flash.rodata 242768 242768 0 0.0
.flash.text 1057267 1057267 0 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w061+release (read/write) 653284 653284 0 0.0
.bss 69964 69964 0 0.0
.data 2012 2012 0 0.0
.text 575508 575508 0 0.0
lock k32w061+release (read/write) 714304 714304 0 0.0
.bss 70404 70404 0 0.0
.data 1984 1984 0 0.0
.text 636116 636116 0 0.0
linux all-clusters-app debug (read only) 2778041 2778041 0 0.0
(read/write) 178568 178568 0 0.0
.bss 86368 86368 0 0.0
.data 2032 2032 0 0.0
.data.rel.ro 83992 83992 0 0.0
.dynamic 608 608 0 0.0
.got 4496 4496 0 0.0
.init 27 27 0 0.0
.init_array 1024 1024 0 0.0
.rodata 246205 246205 0 0.0
.text 2357954 2357954 0 0.0
all-clusters-minimal-app debug (read only) 2653601 2653601 0 0.0
(read/write) 170408 170408 0 0.0
.bss 85536 85536 0 0.0
.data 1904 1904 0 0.0
.data.rel.ro 76792 76792 0 0.0
.dynamic 608 608 0 0.0
.got 4496 4496 0 0.0
.init 27 27 0 0.0
.init_array 1024 1024 0 0.0
.rodata 247837 247837 0 0.0
.text 2233058 2233058 0 0.0
bridge-app debug+rpc (read only) 2031129 2031129 0 0.0
(read/write) 147928 147928 0 0.0
.bss 72896 72896 0 0.0
.data 3936 3936 0 0.0
.data.rel.ro 65528 65528 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 169824 169824 0 0.0
.text 1704786 1704786 0 0.0
chip-tool debug (read only) 9670269 9670269 0 0.0
(read/write) 611152 611152 0 0.0
.bss 23968 23968 0 0.0
.data 1120 1120 0 0.0
.data.rel.ro 579760 579760 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 497021 497021 0 0.0
.text 7760613 7760613 0 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 9421684 9421684 0 0.0
(read/write) 677153 677153 0 0.0
.bss 42257 42257 0 0.0
.data 1176 1176 0 0.0
.data.rel.ro 614968 614968 0 0.0
.dynamic 528 528 0 0.0
.got 14936 14936 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 460900 460900 0 0.0
.text 7413172 7413172 0 0.0
lighting-app debug+rpc (read only) 2321385 2321385 0 0.0
(read/write) 153568 153568 0 0.0
.bss 74752 74752 0 0.0
.data 2048 2048 0 0.0
.data.rel.ro 71016 71016 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 188744 188744 0 0.0
.text 1966866 1966866 0 0.0
lock-app debug (read only) 2264753 2264753 0 0.0
(read/write) 148768 148768 0 0.0
.bss 73472 73472 0 0.0
.data 1568 1568 0 0.0
.data.rel.ro 68008 68008 0 0.0
.dynamic 592 592 0 0.0
.got 4336 4336 0 0.0
.init 27 27 0 0.0
.init_array 760 760 0 0.0
.rodata 202920 202920 0 0.0
.text 1901346 1901346 0 0.0
ota-provider-app debug (read only) 2066897 2066897 0 0.0
(read/write) 141584 141584 0 0.0
.bss 73024 73024 0 0.0
.data 1768 1768 0 0.0
.data.rel.ro 61000 61000 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 181240 181240 0 0.0
.text 1726562 1726562 0 0.0
ota-requestor-app debug (read only) 2094705 2094705 0 0.0
(read/write) 144424 144424 0 0.0
.bss 73728 73728 0 0.0
.data 1960 1960 0 0.0
.data.rel.ro 63096 63096 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 177152 177152 0 0.0
.text 1756994 1756994 0 0.0
shell debug (read only) 2582881 2582881 0 0.0
(read/write) 201976 201976 0 0.0
.bss 117224 117224 0 0.0
.data 1376 1376 0 0.0
.data.rel.ro 77624 77624 0 0.0
.dynamic 608 608 0 0.0
.got 4192 4192 0 0.0
.init 27 27 0 0.0
.init_array 936 936 0 0.0
.rodata 226258 226258 0 0.0
.text 2197250 2197250 0 0.0
thermostat-no-ble arm64 (read only) 2367844 2367844 0 0.0
(read/write) 177505 177505 0 0.0
.bss 87921 87921 0 0.0
.data 1528 1528 0 0.0
.data.rel.ro 80264 80264 0 0.0
.dynamic 528 528 0 0.0
.got 4792 4792 0 0.0
.init 24 24 0 0.0
.init_array 376 376 0 0.0
.rodata 148820 148820 0 0.0
.text 1989344 1989344 0 0.0
tv-app debug (read only) 2879649 2879649 0 0.0
(read/write) 280208 280208 0 0.0
.bss 191048 191048 0 0.0
.data 4672 4672 0 0.0
.data.rel.ro 78224 78224 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 223136 223136 0 0.0
.text 2473906 2473906 0 0.0
tv-casting-app debug (read only) 5329161 5329161 0 0.0
(read/write) 222672 222672 0 0.0
.bss 78632 78632 0 0.0
.data 2400 2400 0 0.0
.data.rel.ro 135432 135432 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 337536 337536 0 0.0
.text 4640434 4640434 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2427200 2427200 0 0.0
.bss 202628 202628 0 0.0
.data 5880 5880 0 0.0
.text 1389844 1389844 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1191407 1191407 0 0.0
bss 141297 141297 0 0.0
rodata 154232 154232 0 0.0
text 817008 817008 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1139127 1139127 0 0.0
bss 140514 140514 0 0.0
rodata 130744 130744 0 0.0
text 789056 789056 0 0.0
p6 all-clusters-app default (read/write) 2545624 2545624 0 0.0
.bss 137120 137120 0 0.0
.data 2808 2808 0 0.0
.text 1503888 1503888 0 0.0
all-clusters-minimal-app default (read/write) 2490488 2490488 0 0.0
.bss 136336 136336 0 0.0
.data 2752 2752 0 0.0
.text 1448752 1448752 0 0.0
light-app default (read/write) 2422368 2422368 0 0.0
.bss 129432 129432 0 0.0
.data 2600 2600 0 0.0
.text 1380632 1380632 0 0.0
lock-app default (read/write) 2442728 2442728 0 0.0
.bss 129256 129256 0 0.0
.data 2576 2576 0 0.0
.text 1400992 1400992 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 780916 780916 0 0.0
bss 70564 70564 0 0.0
noinit 40416 40416 0 0.0
text 552312 552312 0 0.0
lighting-app tlsr9518adk80d (read/write) 800960 800960 0 0.0
bss 70824 70824 0 0.0
noinit 40416 40416 0 0.0
text 569054 569054 0 0.0

examples/lock-app/efr32/include/LockManager.h Outdated Show resolved Hide resolved
examples/lock-app/efr32/include/LockManager.h Outdated Show resolved Hide resolved
examples/lock-app/efr32/include/LockManager.h Outdated Show resolved Hide resolved
examples/lock-app/efr32/src/LockManager.cpp Outdated Show resolved Hide resolved
examples/lock-app/efr32/src/LockManager.cpp Outdated Show resolved Hide resolved
examples/lock-app/efr32/src/LockManager.cpp Outdated Show resolved Hide resolved
examples/lock-app/efr32/src/LockManager.cpp Outdated Show resolved Hide resolved
examples/lock-app/efr32/src/LockManager.cpp Show resolved Hide resolved
examples/lock-app/efr32/src/LockManager.cpp Outdated Show resolved Hide resolved
examples/lock-app/efr32/src/LockManager.cpp Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Jun 8, 2022

PR #19229: Size comparison from c868f81 to 3fa0780

Increases (6 builds for cc13x2_26x2, nrfconnect)
platform target config section c868f81 3fa0780 change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read/write) 161520 161552 32 0.0
lock-ftd LP_CC2652R7 (read/write) 159072 159104 32 0.0
pump-app LP_CC2652R7 (read/write) 178532 178572 40 0.0
pump-controller-app LP_CC2652R7 (read/write) 188060 188092 32 0.0
shell LP_CC2652R7 (read/write) 164736 164768 32 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 text 817260 817264 4 0.0
Decreases (20 builds for cc13x2_26x2, cyw30739, esp32, k32w, p6, telink)
platform target config section c868f81 3fa0780 change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 690335 690303 -32 -0.0
.text 577712 577680 -32 -0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 640951 640919 -32 -0.0
.text 551280 551248 -32 -0.0
lock-ftd LP_CC2652R7 (read only) 683847 683815 -32 -0.0
.text 585196 585164 -32 -0.0
lock-mtd LP_CC2652R7 (read only) 633263 633231 -32 -0.0
.text 534716 534684 -32 -0.0
pump-app LP_CC2652R7 (read only) 665299 665259 -40 -0.0
.text 578468 578428 -40 -0.0
pump-controller-app LP_CC2652R7 (read only) 655875 655843 -32 -0.0
.text 571156 571124 -32 -0.0
shell LP_CC2652R7 (read only) 682614 682582 -32 -0.0
.text 573392 573360 -32 -0.0
cyw30739 light cyw930739m2evb_01 (read/write) 602578 602546 -32 -0.0
.app_xip_area 461524 461492 -32 -0.0
lock cyw930739m2evb_01 (read/write) 599662 599630 -32 -0.0
.app_xip_area 458472 458440 -32 -0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 599398 599366 -32 -0.0
.app_xip_area 459324 459292 -32 -0.0
esp32 all-clusters-app c3devkit (read only) 1008102 1008064 -38 -0.0
.flash.text 1008102 1008064 -38 -0.0
m5stack (read only) 1062899 1062859 -40 -0.0
.flash.text 1057515 1057475 -40 -0.0
k32w light k32w061+release (read/write) 653976 653944 -32 -0.0
.text 576120 576088 -32 -0.0
lock k32w061+release (read/write) 715068 715036 -32 -0.0
.text 636800 636768 -32 -0.0
p6 all-clusters-app default (read/write) 2544928 2544880 -48 -0.0
.text 1503192 1503144 -48 -0.0
all-clusters-minimal-app default (read/write) 2489792 2489744 -48 -0.0
.text 1448056 1448008 -48 -0.0
light-app default (read/write) 2421704 2421656 -48 -0.0
.text 1379968 1379920 -48 -0.0
lock-app default (read/write) 2442040 2441992 -48 -0.0
.text 1400304 1400256 -48 -0.0
telink light-switch-app tlsr9518adk80d (read/write) 781940 781932 -8 -0.0
text 552810 552808 -2 -0.0
lighting-app tlsr9518adk80d (read/write) 801952 801944 -8 -0.0
text 569530 569528 -2 -0.0
Full report (36 builds for cc13x2_26x2, cyw30739, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section c868f81 3fa0780 change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 690335 690303 -32 -0.0
(read/write) 161520 161552 32 0.0
.bss 74748 74748 0 0.0
.data 3392 3392 0 0.0
.rodata 112311 112311 0 0.0
.text 577712 577680 -32 -0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 640951 640919 -32 -0.0
(read/write) 158220 158220 0 0.0
.bss 73972 73972 0 0.0
.data 3332 3332 0 0.0
.rodata 89351 89351 0 0.0
.text 551280 551248 -32 -0.0
lock-ftd LP_CC2652R7 (read only) 683847 683815 -32 -0.0
(read/write) 159072 159104 32 0.0
.bss 72700 72700 0 0.0
.data 3256 3256 0 0.0
.rodata 98167 98167 0 0.0
.text 585196 585164 -32 -0.0
lock-mtd LP_CC2652R7 (read only) 633263 633231 -32 -0.0
(read/write) 145808 145808 0 0.0
.bss 68436 68436 0 0.0
.data 3256 3256 0 0.0
.rodata 98055 98055 0 0.0
.text 534716 534684 -32 -0.0
pump-app LP_CC2652R7 (read only) 665299 665259 -40 -0.0
(read/write) 178532 178572 40 0.0
.bss 72844 72844 0 0.0
.data 3292 3292 0 0.0
.rodata 86347 86347 0 0.0
.text 578468 578428 -40 -0.0
pump-controller-app LP_CC2652R7 (read only) 655875 655843 -32 -0.0
(read/write) 188060 188092 32 0.0
.bss 72948 72948 0 0.0
.data 3252 3252 0 0.0
.rodata 84235 84235 0 0.0
.text 571156 571124 -32 -0.0
shell LP_CC2652R7 (read only) 682614 682582 -32 -0.0
(read/write) 164736 164768 32 0.0
.bss 77044 77044 0 0.0
.data 3396 3396 0 0.0
.rodata 108910 108910 0 0.0
.text 573392 573360 -32 -0.0
cyw30739 light cyw930739m2evb_01 (read/write) 602578 602546 -32 -0.0
.app_xip_area 461524 461492 -32 -0.0
.bss 84008 84008 0 0.0
.data 732 732 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 599662 599630 -32 -0.0
.app_xip_area 458472 458440 -32 -0.0
.bss 84176 84176 0 0.0
.data 700 700 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 599398 599366 -32 -0.0
.app_xip_area 459324 459292 -32 -0.0
.bss 83140 83140 0 0.0
.data 616 616 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
esp32 all-clusters-app c3devkit (read only) 1008102 1008064 -38 -0.0
(read/write) 1481914 1481914 0 0.0
.dram0.bss 69256 69256 0 0.0
.dram0.data 14656 14656 0 0.0
.flash.rodata 212568 212568 0 0.0
.flash.text 1008102 1008064 -38 -0.0
.iram0.text 62954 62954 0 0.0
m5stack (read only) 1062899 1062859 -40 -0.0
(read/write) 484048 484048 0 0.0
.dram0.bss 74776 74776 0 0.0
.dram0.data 34200 34200 0 0.0
.flash.rodata 243076 243076 0 0.0
.flash.text 1057515 1057475 -40 -0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w061+release (read/write) 653976 653944 -32 -0.0
.bss 70052 70052 0 0.0
.data 2004 2004 0 0.0
.text 576120 576088 -32 -0.0
lock k32w061+release (read/write) 715068 715036 -32 -0.0
.bss 70492 70492 0 0.0
.data 1976 1976 0 0.0
.text 636800 636768 -32 -0.0
linux all-clusters-app debug (read only) 2893417 2893417 0 0.0
(read/write) 180056 180056 0 0.0
.bss 87872 87872 0 0.0
.data 2016 2016 0 0.0
.data.rel.ro 83960 83960 0 0.0
.dynamic 608 608 0 0.0
.got 4544 4544 0 0.0
.init 27 27 0 0.0
.init_array 1040 1040 0 0.0
.rodata 255549 255549 0 0.0
.text 2463346 2463346 0 0.0
all-clusters-minimal-app debug (read only) 2754929 2754929 0 0.0
(read/write) 171672 171672 0 0.0
.bss 87040 87040 0 0.0
.data 1888 1888 0 0.0
.data.rel.ro 76584 76584 0 0.0
.dynamic 608 608 0 0.0
.got 4496 4496 0 0.0
.init 27 27 0 0.0
.init_array 1040 1040 0 0.0
.rodata 256861 256861 0 0.0
.text 2325554 2325554 0 0.0
bridge-app debug+rpc (read only) 2198961 2198961 0 0.0
(read/write) 149560 149560 0 0.0
.bss 74528 74528 0 0.0
.data 3888 3888 0 0.0
.data.rel.ro 65400 65400 0 0.0
.dynamic 608 608 0 0.0
.got 4392 4392 0 0.0
.init 27 27 0 0.0
.init_array 720 720 0 0.0
.rodata 187904 187904 0 0.0
.text 1852146 1852146 0 0.0
chip-tool debug (read only) 9737285 9737285 0 0.0
(read/write) 608064 608064 0 0.0
.bss 25440 25440 0 0.0
.data 1088 1088 0 0.0
.data.rel.ro 575240 575240 0 0.0
.dynamic 624 624 0 0.0
.got 5000 5000 0 0.0
.init 27 27 0 0.0
.init_array 664 664 0 0.0
.rodata 505405 505405 0 0.0
.text 7829877 7829877 0 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 9474988 9474988 0 0.0
(read/write) 674321 674321 0 0.0
.bss 43729 43729 0 0.0
.data 1152 1152 0 0.0
.data.rel.ro 610696 610696 0 0.0
.dynamic 528 528 0 0.0
.got 14936 14936 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 467548 467548 0 0.0
.text 7470420 7470420 0 0.0
lighting-app debug+rpc (read only) 2483377 2483377 0 0.0
(read/write) 155168 155168 0 0.0
.bss 76352 76352 0 0.0
.data 2032 2032 0 0.0
.data.rel.ro 70888 70888 0 0.0
.dynamic 608 608 0 0.0
.got 4432 4432 0 0.0
.init 27 27 0 0.0
.init_array 824 824 0 0.0
.rodata 205480 205480 0 0.0
.text 2110306 2110306 0 0.0
lock-app debug (read only) 2429329 2429329 0 0.0
(read/write) 150304 150304 0 0.0
.bss 75072 75072 0 0.0
.data 1520 1520 0 0.0
.data.rel.ro 67848 67848 0 0.0
.dynamic 608 608 0 0.0
.got 4432 4432 0 0.0
.init 27 27 0 0.0
.init_array 792 792 0 0.0
.rodata 219496 219496 0 0.0
.text 2047234 2047234 0 0.0
ota-provider-app debug (read only) 2204761 2204761 0 0.0
(read/write) 143296 143296 0 0.0
.bss 74528 74528 0 0.0
.data 1752 1752 0 0.0
.data.rel.ro 61208 61208 0 0.0
.dynamic 608 608 0 0.0
.got 4496 4496 0 0.0
.init 27 27 0 0.0
.init_array 664 664 0 0.0
.rodata 192024 192024 0 0.0
.text 1853058 1853058 0 0.0
ota-requestor-app debug (read only) 2266409 2266409 0 0.0
(read/write) 146344 146344 0 0.0
.bss 75296 75296 0 0.0
.data 1944 1944 0 0.0
.data.rel.ro 63320 63320 0 0.0
.dynamic 608 608 0 0.0
.got 4456 4456 0 0.0
.init 27 27 0 0.0
.init_array 704 704 0 0.0
.rodata 195392 195392 0 0.0
.text 1907282 1907282 0 0.0
shell debug (read only) 2585089 2585089 0 0.0
(read/write) 203232 203232 0 0.0
.bss 118760 118760 0 0.0
.data 1328 1328 0 0.0
.data.rel.ro 77392 77392 0 0.0
.dynamic 608 608 0 0.0
.got 4176 4176 0 0.0
.init 27 27 0 0.0
.init_array 944 944 0 0.0
.rodata 228146 228146 0 0.0
.text 2198322 2198322 0 0.0
thermostat-no-ble arm64 (read only) 2544956 2544956 0 0.0
(read/write) 183153 183153 0 0.0
.bss 91457 91457 0 0.0
.data 1512 1512 0 0.0
.data.rel.ro 82168 82168 0 0.0
.dynamic 528 528 0 0.0
.got 5000 5000 0 0.0
.init 24 24 0 0.0
.init_array 400 400 0 0.0
.rodata 160196 160196 0 0.0
.text 2147776 2147776 0 0.0
tv-app debug (read only) 3031449 3031449 0 0.0
(read/write) 281936 281936 0 0.0
.bss 192648 192648 0 0.0
.data 4656 4656 0 0.0
.data.rel.ro 78184 78184 0 0.0
.dynamic 608 608 0 0.0
.got 4848 4848 0 0.0
.init 27 27 0 0.0
.init_array 960 960 0 0.0
.rodata 240736 240736 0 0.0
.text 2605650 2605650 0 0.0
tv-casting-app debug (read only) 5335041 5335041 0 0.0
(read/write) 224000 224000 0 0.0
.bss 80168 80168 0 0.0
.data 2416 2416 0 0.0
.data.rel.ro 135168 135168 0 0.0
.dynamic 608 608 0 0.0
.got 4712 4712 0 0.0
.init 27 27 0 0.0
.init_array 880 880 0 0.0
.rodata 340576 340576 0 0.0
.text 4643986 4643986 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2429848 2429848 0 0.0
.bss 202724 202724 0 0.0
.data 5872 5872 0 0.0
.text 1392492 1392492 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1192179 1192179 0 0.0
bss 141378 141378 0 0.0
rodata 154628 154628 0 0.0
text 817260 817264 4 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1139891 1139891 0 0.0
bss 140595 140595 0 0.0
rodata 131124 131124 0 0.0
text 789312 789312 0 0.0
p6 all-clusters-app default (read/write) 2544928 2544880 -48 -0.0
.bss 137208 137208 0 0.0
.data 2808 2808 0 0.0
.text 1503192 1503144 -48 -0.0
all-clusters-minimal-app default (read/write) 2489792 2489744 -48 -0.0
.bss 136416 136416 0 0.0
.data 2752 2752 0 0.0
.text 1448056 1448008 -48 -0.0
light-app default (read/write) 2421704 2421656 -48 -0.0
.bss 129520 129520 0 0.0
.data 2600 2600 0 0.0
.text 1379968 1379920 -48 -0.0
lock-app default (read/write) 2442040 2441992 -48 -0.0
.bss 129344 129344 0 0.0
.data 2576 2576 0 0.0
.text 1400304 1400256 -48 -0.0
telink light-switch-app tlsr9518adk80d (read/write) 781940 781932 -8 -0.0
bss 70652 70652 0 0.0
noinit 40416 40416 0 0.0
text 552810 552808 -2 -0.0
lighting-app tlsr9518adk80d (read/write) 801952 801944 -8 -0.0
bss 70904 70904 0 0.0
noinit 40416 40416 0 0.0
text 569530 569528 -2 -0.0

Copy link
Contributor

@woody-apple woody-apple left a comment

Choose a reason for hiding this comment

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

Fast tracking platform changes.

@woody-apple woody-apple merged commit d9cfd7e into project-chip:master Jun 9, 2022
Copy link
Contributor

@bzbarsky-apple bzbarsky-apple left a comment

Choose a reason for hiding this comment

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

@mykrupp I think the credentials bits here are still broken, in a way that is an exploitable security hole.

Comment on lines +83 to +84
EFR32Config::ReadConfigValueBin(EFR32Config::kConfigKey_LockUser, reinterpret_cast<uint8_t *>(&mLockUsers),
sizeof(EmberAfPluginDoorLockUserInfo) * ArraySize(mLockUsers), outLen);
Copy link
Contributor

Choose a reason for hiding this comment

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

This can still leave part of mLockUsers un-initialized if the size increased, or fail to read if the size decreased.....

Comment on lines +95 to +96
EFR32Config::ReadConfigValueBin(EFR32Config::kConfigKey_UserCredentials, reinterpret_cast<uint8_t *>(mCredentials[0].Get()),
sizeof(DlCredential) * mMaxUsers * mMaxCredentialsPerUser, outLen);
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes no sense. There are mMaxUsers buffers, each of size mMaxCredentialsPerUser, right? But this is going to read mMaxUsers * mMaxCredentialsPerUser credentials into the first buffer, writing outside its bounds, trashing the heap, and not necessarily filling the other buffers at all. Unless I am missing something? What am I missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess I didn't test thoroughly enough here. The members in mCredentials(credentialType and credentialIndex) are only accessed by the getUser command. I was testing this by sending a lock/unlock command after reset.

Since there's no way to pass a memory offset to the ReadConfigValueBin function, I guess each user will need it's own config key.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in this PR - b7677b1

}

// Check the PIN code
for (uint8_t i; i < 10; i++)
for (uint8_t i = 0; i < mMaxCredentialsPerUser; i++)
Copy link
Contributor

Choose a reason for hiding this comment

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

This loop needs to go to MAX_CREDENTIALS, no? If MAX_CREDENTIALS is 20 and mMaxCredentialsPerUser is 5, say, this loop does not do the right thing...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in this PR - b7677b1

mkardous-silabs pushed a commit to mkardous-silabs/connectedhomeip that referenced this pull request Jun 10, 2022
…ect-chip#19229)

* code review comments. Fix mCredentials, fix NVM flash saving

* restyle

* cleanup

* remove unused array

* remove TotalCredentials key

* Check mMaxUsers against DOOR_LOCK_MAX_USERS
rochaferraz pushed a commit to rochaferraz/connectedhomeip that referenced this pull request Jun 15, 2022
…ect-chip#19229)

* code review comments. Fix mCredentials, fix NVM flash saving

* restyle

* cleanup

* remove unused array

* remove TotalCredentials key

* Check mMaxUsers against DOOR_LOCK_MAX_USERS
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.

4 participants