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

ACL/Transport: Add structured subject #15418

Closed
wants to merge 4 commits into from
Closed

Conversation

kghost
Copy link
Contributor

@kghost kghost commented Feb 22, 2022

Problem

SubjectDescriptor is not easy to use. Prepare to fix #13397

Change overview

  • Add a new class Subject contains information about SubjectDescriptor
  • Add a new class OperationalNodeId contains tuple <FabricIndex, NodeId>
  • Add a new API GetSubject in session interface which returns a structured SubjectDescriptor object
  • Introduce log maco ChipLogFormatSubject and ChipLogValueSubject to help print Subject structure

Testing

Passed unit-tests

@github-actions
Copy link

github-actions bot commented Feb 22, 2022

PR #15418: Size comparison from cbdecce to c39ca5d

Increases (31 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section cbdecce c39ca5d change % change
cyw30739 light cyw930739m2evb_01 (read/write) 598130 598246 116 0.0
.app_xip_area 502968 503084 116 0.0
lock cyw930739m2evb_01 (read/write) 556166 556282 116 0.0
.app_xip_area 462548 462664 116 0.0
ota-requestor cyw930739m2evb_01 (read/write) 577402 577526 124 0.0
.app_xip_area 474360 474484 124 0.0
efr32 lighting-app BRD4161A (read only) 915156 915284 128 0.0
.text 915148 915276 128 0.0
BRD4161A+rpc (read only) 943856 943976 120 0.0
.text 943848 943968 120 0.0
window-app BRD4161A (read only) 848976 849112 136 0.0
.text 848968 849104 136 0.0
esp32 all-clusters-app c3devkit (read only) 950796 950920 124 0.0
(read/write) 1399506 1399530 24 0.0
.flash.rodata 199768 199792 24 0.0
.flash.text 950796 950920 124 0.0
m5stack (read only) 1000827 1000947 120 0.0
(read/write) 464912 464928 16 0.0
.flash.rodata 226896 226912 16 0.0
.flash.text 995443 995563 120 0.0
k32w light k32w061+release (read/write) 691092 691204 112 0.0
.text 605888 606000 112 0.0
lock k32w061+release (read/write) 693636 693748 112 0.0
.text 608184 608296 112 0.0
linux chip-tool-ipv6only arm64 (read only) 8864028 8865580 1552 0.0
(read/write) 434705 434737 32 0.0
.data.rel.ro 319024 319056 32 0.0
.text 7489236 7490692 1456 0.0
thermostat-no-ble arm64 (read only) 2159644 2161180 1536 0.1
(read/write) 149841 149873 32 0.0
.data.rel.ro 75216 75248 32 0.0
.text 1808352 1809792 1440 0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2439644 2439788 144 0.0
.text 1402216 1402360 144 0.0
lighting-app CY8CPROTO_062_4343W+release (read/write) 2400828 2400908 80 0.0
.text 1363400 1363480 80 0.0
lock-app CY8CPROTO_062_4343W+release (read/write) 2336264 2336408 144 0.0
.text 1298864 1299008 144 0.0
shell CY8CPROTO_062_4343W+release (read/write) 2327164 2327308 144 0.0
.text 1289736 1289880 144 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 1021787 1021915 128 0.0
rodata 120760 120776 16 0.0
text 699492 699616 124 0.0
nrf52840dk_nrf52840+rpc (read/write) 991175 991319 144 0.0
rodata 112284 112300 16 0.0
text 679368 679492 124 0.0
nrf52840dongle_nrf52840 (read/write) 1036607 1036751 144 0.0
rodata 119608 119624 16 0.0
text 703236 703360 124 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 928510 928654 144 0.0
rodata 114016 114032 16 0.0
text 614520 614644 124 0.0
lock-app nrf52840dk_nrf52840 (read/write) 950651 950795 144 0.0
rodata 109600 109616 16 0.0
text 641588 641712 124 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 858126 858270 144 0.0
rodata 102768 102784 16 0.0
text 557392 557516 124 0.0
pump-app nrf52840dk_nrf52840 (read/write) 949099 949243 144 0.0
rodata 108552 108568 16 0.0
text 641408 641532 124 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 945059 945203 144 0.0
rodata 108248 108264 16 0.0
text 637648 637772 124 0.0
shell nrf52840dk_nrf52840 (read/write) 811587 811731 144 0.0
rodata 79752 79768 16 0.0
text 540852 540976 124 0.0
p6 all-clusters-app default (read/write) 2489568 2489696 128 0.0
.text 1447832 1447960 128 0.0
light-app default (read/write) 2393560 2393696 136 0.0
.text 1351824 1351960 136 0.0
lock-app default (read/write) 2357120 2357248 128 0.0
.text 1315384 1315512 128 0.0
qpg lighting-app qpg6105+debug (read only) 599972 600084 112 0.0
.text 594652 594764 112 0.0
lock-app qpg6105+debug (read only) 565732 565844 112 0.0
.text 560412 560524 112 0.0
telink lighting-app tlsr9518adk80d (read/write) 880954 881106 152 0.0
text 622274 622408 134 0.0
Full report (34 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section cbdecce c39ca5d change % change
cyw30739 light cyw930739m2evb_01 (read/write) 598130 598246 116 0.0
.app_xip_area 502968 503084 116 0.0
.bss 77860 77860 0 0.0
.data 644 644 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 556166 556282 116 0.0
.app_xip_area 462548 462664 116 0.0
.bss 76356 76356 0 0.0
.data 608 608 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 577402 577526 124 0.0
.app_xip_area 474360 474484 124 0.0
.bss 85452 85452 0 0.0
.data 552 552 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 915156 915284 128 0.0
(read/write) 128600 128600 0 0.0
.bss 126560 126560 0 0.0
.data 2040 2040 0 0.0
.text 915148 915276 128 0.0
BRD4161A+rpc (read only) 943856 943976 120 0.0
(read/write) 145520 145520 0 0.0
.bss 143336 143336 0 0.0
.data 2180 2180 0 0.0
.text 943848 943968 120 0.0
window-app BRD4161A (read only) 848976 849112 136 0.0
(read/write) 126520 126520 0 0.0
.bss 124608 124608 0 0.0
.data 1908 1908 0 0.0
.text 848968 849104 136 0.0
esp32 all-clusters-app c3devkit (read only) 950796 950920 124 0.0
(read/write) 1399506 1399530 24 0.0
.dram0.bss 66672 66672 0 0.0
.dram0.data 14164 14164 0 0.0
.flash.rodata 199768 199792 24 0.0
.flash.text 950796 950920 124 0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 1000827 1000947 120 0.0
(read/write) 464912 464928 16 0.0
.dram0.bss 71824 71824 0 0.0
.dram0.data 34064 34064 0 0.0
.flash.rodata 226896 226912 16 0.0
.flash.text 995443 995563 120 0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 691092 691204 112 0.0
.bss 77488 77488 0 0.0
.data 1916 1916 0 0.0
.text 605888 606000 112 0.0
lock k32w061+release (read/write) 693636 693748 112 0.0
.bss 77696 77696 0 0.0
.data 1956 1956 0 0.0
.text 608184 608296 112 0.0
linux chip-tool-ipv6only arm64 (read only) 8864028 8865580 1552 0.0
(read/write) 434705 434737 32 0.0
.bss 59265 59265 0 0.0
.data 1216 1216 0 0.0
.data.rel.ro 319024 319056 32 0.0
.dynamic 560 560 0 0.0
.got 51392 51392 0 0.0
.init 24 24 0 0.0
.init_array 208 208 0 0.0
.rodata 456468 456468 0 0.0
.text 7489236 7490692 1456 0.0
thermostat-no-ble arm64 (read only) 2159644 2161180 1536 0.1
(read/write) 149841 149873 32 0.0
.bss 66433 66433 0 0.0
.data 1032 1032 0 0.0
.data.rel.ro 75216 75248 32 0.0
.dynamic 560 560 0 0.0
.got 4208 4208 0 0.0
.init 24 24 0 0.0
.init_array 352 352 0 0.0
.rodata 132604 132604 0 0.0
.text 1808352 1809792 1440 0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2439644 2439788 144 0.0
.bss 194508 194508 0 0.0
.data 5352 5352 0 0.0
.text 1402216 1402360 144 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2400828 2400908 80 0.0
.bss 188608 188608 0 0.0
.data 5648 5648 0 0.0
.text 1363400 1363480 80 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2336264 2336408 144 0.0
.bss 187608 187608 0 0.0
.data 5624 5624 0 0.0
.text 1298864 1299008 144 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139840 1139840 0 0.0
.bss 11796 11796 0 0.0
.data 4368 4368 0 0.0
.text 103224 103224 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2327164 2327308 144 0.0
.bss 186140 186140 0 0.0
.data 5456 5456 0 0.0
.text 1289736 1289880 144 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 1021787 1021915 128 0.0
bss 122624 122624 0 0.0
rodata 120760 120776 16 0.0
text 699492 699616 124 0.0
nrf52840dk_nrf52840+rpc (read/write) 991175 991319 144 0.0
bss 119812 119812 0 0.0
rodata 112284 112300 16 0.0
text 679368 679492 124 0.0
nrf52840dongle_nrf52840 (read/write) 1036607 1036751 144 0.0
bss 123844 123844 0 0.0
rodata 119608 119624 16 0.0
text 703236 703360 124 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 928510 928654 144 0.0
bss 119184 119184 0 0.0
rodata 114016 114032 16 0.0
text 614520 614644 124 0.0
lock-app nrf52840dk_nrf52840 (read/write) 950651 950795 144 0.0
bss 120852 120852 0 0.0
rodata 109600 109616 16 0.0
text 641588 641712 124 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 858126 858270 144 0.0
bss 117444 117444 0 0.0
rodata 102768 102784 16 0.0
text 557392 557516 124 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 527567 527567 0 0.0
bss 53632 53632 0 0.0
rodata 49948 49948 0 0.0
text 361016 361016 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 949099 949243 144 0.0
bss 120572 120572 0 0.0
rodata 108552 108568 16 0.0
text 641408 641532 124 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 945059 945203 144 0.0
bss 120576 120576 0 0.0
rodata 108248 108264 16 0.0
text 637648 637772 124 0.0
shell nrf52840dk_nrf52840 (read/write) 811587 811731 144 0.0
bss 113324 113324 0 0.0
rodata 79752 79768 16 0.0
text 540852 540976 124 0.0
p6 all-clusters-app default (read/write) 2489568 2489696 128 0.0
.bss 122400 122400 0 0.0
.data 2680 2680 0 0.0
.text 1447832 1447960 128 0.0
light-app default (read/write) 2393560 2393696 136 0.0
.bss 113648 113648 0 0.0
.data 2528 2528 0 0.0
.text 1351824 1351960 136 0.0
lock-app default (read/write) 2357120 2357248 128 0.0
.bss 113400 113400 0 0.0
.data 2488 2488 0 0.0
.text 1315384 1315512 128 0.0
qpg lighting-app qpg6105+debug (read only) 599972 600084 112 0.0
(read/write) 146936 146936 0 0.0
.bss 90904 90904 0 0.0
.data 1116 1116 0 0.0
.text 594652 594764 112 0.0
lock-app qpg6105+debug (read only) 565732 565844 112 0.0
(read/write) 146936 146936 0 0.0
.bss 90912 90912 0 0.0
.data 1068 1068 0 0.0
.text 560412 560524 112 0.0
persistent-storage-app qpg6105+debug (read only) 99536 99536 0 0.0
(read/write) 146941 146941 0 0.0
.bss 24001 24001 0 0.0
.data 180 180 0 0.0
.text 94216 94216 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 880954 881106 152 0.0
bss 86372 86372 0 0.0
noinit 37160 37160 0 0.0
text 622274 622408 134 0.0

src/access/Subjects.h Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Feb 23, 2022

PR #15418: Size comparison from 1fc5eed to 1d75d6b

Increases (40 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 1fc5eed 1d75d6b change % change
cyw30739 light cyw930739m2evb_01 (read/write) 598686 598794 108 0.0
.app_xip_area 503492 503600 108 0.0
lock cyw930739m2evb_01 (read/write) 556722 556830 108 0.0
.app_xip_area 463072 463180 108 0.0
ota-requestor cyw930739m2evb_01 (read/write) 577778 577878 100 0.0
.app_xip_area 474696 474796 100 0.0
efr32 lighting-app BRD4161A (read only) 915732 915844 112 0.0
.text 915724 915836 112 0.0
BRD4161A+rpc (read only) 944432 944552 120 0.0
.text 944424 944544 120 0.0
window-app BRD4161A (read only) 850024 850144 120 0.0
.text 850016 850136 120 0.0
esp32 all-clusters-app c3devkit (read only) 951272 951386 114 0.0
(read/write) 1399506 1399530 24 0.0
.flash.rodata 199768 199792 24 0.0
.flash.text 951272 951386 114 0.0
m5stack (read only) 1001235 1001347 112 0.0
(read/write) 464912 464928 16 0.0
.flash.rodata 226888 226904 16 0.0
.flash.text 995851 995963 112 0.0
k32w light k32w061+release (read/write) 691420 691516 96 0.0
.text 606176 606272 96 0.0
lock k32w061+release (read/write) 694180 694276 96 0.0
.text 608696 608792 96 0.0
linux all-clusters-app debug (read only) 2393137 2394497 1360 0.1
(read/write) 148560 148592 32 0.0
.data.rel.ro 78552 78584 32 0.0
.text 2023314 2024578 1264 0.1
bridge-app debug+rpc (read only) 1716293 1717653 1360 0.1
(read/write) 93824 93856 32 0.0
.data.rel.ro 38232 38256 24 0.1
.text 1459653 1460917 1264 0.1
chip-tool debug (read only) 9153661 9155037 1376 0.0
(read/write) 321592 321624 32 0.0
.data.rel.ro 273352 273392 40 0.0
.text 8011669 8012949 1280 0.0
chip-tool-ipv6only arm64 (read only) 8864436 8865796 1360 0.0
(read/write) 434705 434737 32 0.0
.data.rel.ro 319024 319056 32 0.0
.text 7489556 7490820 1264 0.0
door-lock-app debug (read only) 1931633 1932993 1360 0.1
(read/write) 119928 119960 32 0.0
.data.rel.ro 62352 62384 32 0.1
.text 1610610 1611874 1264 0.1
lighting-app debug+rpc (read only) 2061017 2062377 1360 0.1
(read/write) 124840 124872 32 0.0
.data.rel.ro 65856 65872 16 0.0
.text 1741394 1742658 1264 0.1
ota-provider-app debug (read only) 1864961 1866321 1360 0.1
(read/write) 115592 115624 32 0.0
.data.rel.ro 57672 57704 32 0.1
.text 1557042 1558306 1264 0.1
ota-requestor-app debug (read only) 1877441 1878801 1360 0.1
(read/write) 117392 117456 64 0.1
.data.rel.ro 58936 58984 48 0.1
.text 1577010 1578274 1264 0.1
shell debug (read only) 2361593 2362969 1376 0.1
(read/write) 151072 151104 32 0.0
.data.rel.ro 73280 73312 32 0.0
.text 1997714 1998994 1280 0.1
thermostat-no-ble arm64 (read only) 2160188 2161548 1360 0.1
(read/write) 149873 149905 32 0.0
.data.rel.ro 75216 75248 32 0.0
.text 1808800 1810064 1264 0.1
tv-app debug (read only) 2586969 2588345 1376 0.1
(read/write) 152176 152208 32 0.0
.data.rel.ro 73864 73904 40 0.1
.text 2212770 2214050 1280 0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2439804 2439948 144 0.0
.text 1402376 1402520 144 0.0
lighting-app CY8CPROTO_062_4343W+release (read/write) 2400996 2401076 80 0.0
.text 1363568 1363648 80 0.0
lock-app CY8CPROTO_062_4343W+release (read/write) 2336688 2336768 80 0.0
.text 1299288 1299368 80 0.0
shell CY8CPROTO_062_4343W+release (read/write) 2327396 2327476 80 0.0
.text 1289968 1290048 80 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 1022211 1022323 112 0.0
rodata 120760 120776 16 0.0
text 699784 699888 104 0.0
nrf52840dk_nrf52840+rpc (read/write) 991471 991599 128 0.0
rodata 112284 112300 16 0.0
text 679664 679768 104 0.0
nrf52840dongle_nrf52840 (read/write) 1037159 1037271 112 0.0
rodata 119608 119624 16 0.0
text 703776 703880 104 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 928854 928966 112 0.0
rodata 114016 114032 16 0.0
text 614816 614920 104 0.0
lock-app nrf52840dk_nrf52840 (read/write) 951203 951315 112 0.0
rodata 109600 109616 16 0.0
text 642124 642228 104 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 858678 858790 112 0.0
rodata 102768 102784 16 0.0
text 557932 558036 104 0.0
pump-app nrf52840dk_nrf52840 (read/write) 949347 949459 112 0.0
rodata 108552 108568 16 0.0
text 641512 641616 104 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 945291 945419 128 0.0
rodata 108248 108264 16 0.0
text 637752 637856 104 0.0
shell nrf52840dk_nrf52840 (read/write) 811667 811779 112 0.0
rodata 79752 79768 16 0.0
text 540932 541036 104 0.0
p6 all-clusters-app default (read/write) 2490336 2490464 128 0.0
.text 1448600 1448728 128 0.0
light-app default (read/write) 2394312 2394448 136 0.0
.text 1352576 1352712 136 0.0
lock-app default (read/write) 2357888 2358000 112 0.0
.text 1316152 1316264 112 0.0
qpg lighting-app qpg6105+debug (read only) 600300 600404 104 0.0
.text 594980 595084 104 0.0
lock-app qpg6105+debug (read only) 566068 566172 104 0.0
.text 560748 560852 104 0.0
telink lighting-app tlsr9518adk80d (read/write) 881386 881530 144 0.0
text 622700 622822 122 0.0
Full report (43 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 1fc5eed 1d75d6b change % change
cyw30739 light cyw930739m2evb_01 (read/write) 598686 598794 108 0.0
.app_xip_area 503492 503600 108 0.0
.bss 77884 77884 0 0.0
.data 652 652 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 556722 556830 108 0.0
.app_xip_area 463072 463180 108 0.0
.bss 76380 76380 0 0.0
.data 616 616 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 577778 577878 100 0.0
.app_xip_area 474696 474796 100 0.0
.bss 85484 85484 0 0.0
.data 560 560 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 915732 915844 112 0.0
(read/write) 128648 128648 0 0.0
.bss 126600 126600 0 0.0
.data 2048 2048 0 0.0
.text 915724 915836 112 0.0
BRD4161A+rpc (read only) 944432 944552 120 0.0
(read/write) 145568 145568 0 0.0
.bss 143376 143376 0 0.0
.data 2188 2188 0 0.0
.text 944424 944544 120 0.0
window-app BRD4161A (read only) 850024 850144 120 0.0
(read/write) 126552 126552 0 0.0
.bss 124632 124632 0 0.0
.data 1916 1916 0 0.0
.text 850016 850136 120 0.0
esp32 all-clusters-app c3devkit (read only) 951272 951386 114 0.0
(read/write) 1399506 1399530 24 0.0
.dram0.bss 66672 66672 0 0.0
.dram0.data 14172 14172 0 0.0
.flash.rodata 199768 199792 24 0.0
.flash.text 951272 951386 114 0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 1001235 1001347 112 0.0
(read/write) 464912 464928 16 0.0
.dram0.bss 71824 71824 0 0.0
.dram0.data 34072 34072 0 0.0
.flash.rodata 226888 226904 16 0.0
.flash.text 995851 995963 112 0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 691420 691516 96 0.0
.bss 77520 77520 0 0.0
.data 1924 1924 0 0.0
.text 606176 606272 96 0.0
lock k32w061+release (read/write) 694180 694276 96 0.0
.bss 77720 77720 0 0.0
.data 1964 1964 0 0.0
.text 608696 608792 96 0.0
linux all-clusters-app debug (read only) 2393137 2394497 1360 0.1
(read/write) 148560 148592 32 0.0
.bss 62944 62944 0 0.0
.data 1360 1360 0 0.0
.data.rel.ro 78552 78584 32 0.0
.dynamic 592 592 0 0.0
.got 4160 4160 0 0.0
.init 27 27 0 0.0
.init_array 904 904 0 0.0
.rodata 206501 206501 0 0.0
.text 2023314 2024578 1264 0.1
bridge-app debug+rpc (read only) 1716293 1717653 1360 0.1
(read/write) 93824 93856 32 0.0
.bss 48480 48480 0 0.0
.data 2042 2042 0 0.0
.data.rel.ro 38232 38256 24 0.1
.dynamic 592 592 0 0.0
.got 3912 3912 0 0.0
.init 27 27 0 0.0
.init_array 536 536 0 0.0
.rodata 140596 140596 0 0.0
.text 1459653 1460917 1264 0.1
chip-tool debug (read only) 9153661 9155037 1376 0.0
(read/write) 321592 321624 32 0.0
.bss 41024 41024 0 0.0
.data 1164 1164 0 0.0
.data.rel.ro 273352 273392 40 0.0
.dynamic 608 608 0 0.0
.got 4784 4784 0 0.0
.init 27 27 0 0.0
.init_array 624 624 0 0.0
.rodata 479829 479829 0 0.0
.text 8011669 8012949 1280 0.0
chip-tool-ipv6only arm64 (read only) 8864436 8865796 1360 0.0
(read/write) 434705 434737 32 0.0
.bss 59265 59265 0 0.0
.data 1216 1216 0 0.0
.data.rel.ro 319024 319056 32 0.0
.dynamic 560 560 0 0.0
.got 51392 51392 0 0.0
.init 24 24 0 0.0
.init_array 208 208 0 0.0
.rodata 456556 456556 0 0.0
.text 7489556 7490820 1264 0.0
door-lock-app debug (read only) 1931633 1932993 1360 0.1
(read/write) 119928 119960 32 0.0
.bss 51168 51168 0 0.0
.data 1050 1050 0 0.0
.data.rel.ro 62352 62384 32 0.1
.dynamic 592 592 0 0.0
.got 4096 4096 0 0.0
.init 27 27 0 0.0
.init_array 656 656 0 0.0
.rodata 172252 172252 0 0.0
.text 1610610 1611874 1264 0.1
lighting-app debug+rpc (read only) 2061017 2062377 1360 0.1
(read/write) 124840 124872 32 0.0
.bss 52128 52128 0 0.0
.data 1408 1408 0 0.0
.data.rel.ro 65856 65872 16 0.0
.dynamic 608 608 0 0.0
.got 4128 4128 0 0.0
.init 27 27 0 0.0
.init_array 704 704 0 0.0
.rodata 164721 164721 0 0.0
.text 1741394 1742658 1264 0.1
ota-provider-app debug (read only) 1864961 1866321 1360 0.1
(read/write) 115592 115624 32 0.0
.bss 51008 51008 0 0.0
.data 1288 1288 0 0.0
.data.rel.ro 57672 57704 32 0.1
.dynamic 608 608 0 0.0
.got 4352 4352 0 0.0
.init 27 27 0 0.0
.init_array 608 608 0 0.0
.rodata 157043 157043 0 0.0
.text 1557042 1558306 1264 0.1
ota-requestor-app debug (read only) 1877441 1878801 1360 0.1
(read/write) 117392 117456 64 0.1
.bss 51872 51872 0 0.0
.data 1192 1192 0 0.0
.data.rel.ro 58936 58984 48 0.1
.dynamic 592 592 0 0.0
.got 4152 4152 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 151236 151236 0 0.0
.text 1577010 1578274 1264 0.1
shell debug (read only) 2361593 2362969 1376 0.1
(read/write) 151072 151104 32 0.0
.bss 71296 71296 0 0.0
.data 864 864 0 0.0
.data.rel.ro 73280 73312 32 0.0
.dynamic 592 592 0 0.0
.got 4144 4144 0 0.0
.init 27 27 0 0.0
.init_array 888 888 0 0.0
.rodata 206770 206770 0 0.0
.text 1997714 1998994 1280 0.1
thermostat-no-ble arm64 (read only) 2160188 2161548 1360 0.1
(read/write) 149873 149905 32 0.0
.bss 66433 66433 0 0.0
.data 1056 1056 0 0.0
.data.rel.ro 75216 75248 32 0.0
.dynamic 560 560 0 0.0
.got 4208 4208 0 0.0
.init 24 24 0 0.0
.init_array 352 352 0 0.0
.rodata 132684 132684 0 0.0
.text 1808800 1810064 1264 0.1
tv-app debug (read only) 2586969 2588345 1376 0.1
(read/write) 152176 152208 32 0.0
.bss 69120 69120 0 0.0
.data 3168 3168 0 0.0
.data.rel.ro 73864 73904 40 0.1
.dynamic 592 592 0 0.0
.got 4528 4528 0 0.0
.init 27 27 0 0.0
.init_array 872 872 0 0.0
.rodata 199741 199741 0 0.0
.text 2212770 2214050 1280 0.1
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2439804 2439948 144 0.0
.bss 194612 194612 0 0.0
.data 5360 5360 0 0.0
.text 1402376 1402520 144 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2400996 2401076 80 0.0
.bss 188712 188712 0 0.0
.data 5656 5656 0 0.0
.text 1363568 1363648 80 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2336688 2336768 80 0.0
.bss 187608 187608 0 0.0
.data 5632 5632 0 0.0
.text 1299288 1299368 80 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1139840 1139840 0 0.0
.bss 11796 11796 0 0.0
.data 4368 4368 0 0.0
.text 103224 103224 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2327396 2327476 80 0.0
.bss 186244 186244 0 0.0
.data 5464 5464 0 0.0
.text 1289968 1290048 80 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 1022211 1022323 112 0.0
bss 122664 122664 0 0.0
rodata 120760 120776 16 0.0
text 699784 699888 104 0.0
nrf52840dk_nrf52840+rpc (read/write) 991471 991599 128 0.0
bss 119852 119852 0 0.0
rodata 112284 112300 16 0.0
text 679664 679768 104 0.0
nrf52840dongle_nrf52840 (read/write) 1037159 1037271 112 0.0
bss 123868 123868 0 0.0
rodata 119608 119624 16 0.0
text 703776 703880 104 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 928854 928966 112 0.0
bss 119224 119224 0 0.0
rodata 114016 114032 16 0.0
text 614816 614920 104 0.0
lock-app nrf52840dk_nrf52840 (read/write) 951203 951315 112 0.0
bss 120876 120876 0 0.0
rodata 109600 109616 16 0.0
text 642124 642228 104 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 858678 858790 112 0.0
bss 117468 117468 0 0.0
rodata 102768 102784 16 0.0
text 557932 558036 104 0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 527567 527567 0 0.0
bss 53632 53632 0 0.0
rodata 49948 49948 0 0.0
text 361016 361016 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 949347 949459 112 0.0
bss 120596 120596 0 0.0
rodata 108552 108568 16 0.0
text 641512 641616 104 0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 945291 945419 128 0.0
bss 120600 120600 0 0.0
rodata 108248 108264 16 0.0
text 637752 637856 104 0.0
shell nrf52840dk_nrf52840 (read/write) 811667 811779 112 0.0
bss 113348 113348 0 0.0
rodata 79752 79768 16 0.0
text 540932 541036 104 0.0
p6 all-clusters-app default (read/write) 2490336 2490464 128 0.0
.bss 122400 122400 0 0.0
.data 2688 2688 0 0.0
.text 1448600 1448728 128 0.0
light-app default (read/write) 2394312 2394448 136 0.0
.bss 113648 113648 0 0.0
.data 2536 2536 0 0.0
.text 1352576 1352712 136 0.0
lock-app default (read/write) 2357888 2358000 112 0.0
.bss 113400 113400 0 0.0
.data 2496 2496 0 0.0
.text 1316152 1316264 112 0.0
qpg lighting-app qpg6105+debug (read only) 600300 600404 104 0.0
(read/write) 146936 146936 0 0.0
.bss 90936 90936 0 0.0
.data 1124 1124 0 0.0
.text 594980 595084 104 0.0
lock-app qpg6105+debug (read only) 566068 566172 104 0.0
(read/write) 146936 146936 0 0.0
.bss 90944 90944 0 0.0
.data 1076 1076 0 0.0
.text 560748 560852 104 0.0
persistent-storage-app qpg6105+debug (read only) 99536 99536 0 0.0
(read/write) 146941 146941 0 0.0
.bss 24001 24001 0 0.0
.data 180 180 0 0.0
.text 94216 94216 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 881386 881530 144 0.0
bss 86372 86372 0 0.0
noinit 37160 37160 0 0.0
text 622700 622822 122 0.0

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.

What problems does this actually solve that GetSubjectDescriptor does not solve? The PR rationale claims these exist, but does not say what they are.


struct PaseSubject
{
static constexpr uint16_t kPasscodeId = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not used except in logging, right? Why do we need this at all?

Copy link
Contributor Author

@kghost kghost Feb 24, 2022

Choose a reason for hiding this comment

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

This field follows chip spec.

Subject ID SHALL be of type uint64 with semantics depending on the entry’s AuthMode as follows:

PASE: Lower 16-bits → Passcode ID Upper 48-bits → all bits clear

And also in spec:

Note that any Passcode ID other than 0, which is the default commissioning passcode, is reserved for future use.

So kPasscodeId is a const of 0 now.

Copy link
Contributor

Choose a reason for hiding this comment

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

This does not answer my question. What is this field actually used for? If it's not used for anything, why is it there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is used to construct the SubjectId, which is well defined in the spec.

The SubjectId is not only used for logging, it can be used to fill CaseAdminNode field in AddNOC commands (maybe in the future PR).

Although SubjectId for PASE subject is not being used to encode messages, it doesn't prevent us from building a SubjectId for PASE subject. The GetSubjectId function is fully aligned with spec.

Copy link
Contributor

Choose a reason for hiding this comment

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

Used to construct the SubjectId from what?

The SubjectId is not only used for logging, it can be used to fill CaseAdminNode field in AddNOC commands

That value is just a NodeId. It does not need any of the Subject machinery, and I can't see any situation where it would.

The GetSubjectId function is fully aligned with spec.

No, it's just not. But if you think it is, please walk me through step by step exactly how it's aligned.

src/access/Subjects.h Outdated Show resolved Hide resolved
src/access/Subjects.h Outdated Show resolved Hide resolved
src/access/Subjects.h Outdated Show resolved Hide resolved
src/access/Subjects.h Outdated Show resolved Hide resolved
Comment on lines 178 to 179
* OperationalNodeId identifies an individual Node on a Fabric. It is a special type of Subject targeting to NodeSubject. It is
* interchangeable with the generic Subject type but uses less memory.
Copy link
Contributor

Choose a reason for hiding this comment

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

A few comments:

  • This identifies an individual node on a fabric from the point of view of some specific node, not in general.
  • "targeting to NodeSubject" does not make sense. What is that trying to say?
  • In what sense is this interchangeable with the generic Subject type? Is the idea that you can compare these to Subject and can create a Subject from one of these? So you can store this instead of a Subject if you happen to have a Subject representing a node?

Copy link
Contributor Author

@kghost kghost Feb 24, 2022

Choose a reason for hiding this comment

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

Yes, the idea is that:

  1. you can compare these to Subject
  2. you can create a Subject from OperationalNodeId or vice-versa.
  3. you can store this instead of a Subject if you happen to have a Subject representing a node.

* OperationalNodeId identifies an individual Node on a Fabric. It is a special type of Subject targeting to NodeSubject. It is
* interchangeable with the generic Subject type but uses less memory.
*/
class OperationalNodeId
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, I am not convinced by the use of "Operational" here. It does not match any of the spec's uses of "Operational". This is a ScopedNodeId.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we can find a better name for it. But ScopedNodeId is also not proper. Because NodeId is too broad, it also contains CASE Authenticated Tag or Group Node ID.

Here, it can only contain an Operational Node ID .

Copy link
Contributor

Choose a reason for hiding this comment

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

The fact that we can have those things stuck into a NodeId is so broken.... :( It leads to really poor naming all around. The vast majority of places that talk about NodeId really mean "in the operational range".

I would rather we stuck to that convention and if we really want a type that represents "any of these things" we had a different name for it than "NodeId".

src/access/Subjects.h Outdated Show resolved Hide resolved
src/access/Subjects.h Outdated Show resolved Hide resolved
* A subject is a global unique identifier. It suite 2 purpose:
*
* 1. Identify an entity. operator== can be used to check if 2 subjects are identical.
* 2. Associate to ACL entries to grant privileges
Copy link
Contributor

Choose a reason for hiding this comment

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

But it can't actually do that, because it does not carry the information that ACL needs (e.g. CATs, for CASE).

Copy link
Contributor Author

@kghost kghost Feb 24, 2022

Choose a reason for hiding this comment

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

CATs are another type of subjects, I'll add it in the PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

This brings us back to the question of "what is this thing trying to represent and why?". For ACL purposes a "subject" in the sense of an ACL entry can be one of a variety of things, but a "subject" in the sense of "what gets matched against an ACL entry" can be a list of things.

We don't have a singular concept of "subject" around.

Copy link
Contributor

@mlepage-google mlepage-google Feb 25, 2022

Choose a reason for hiding this comment

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

Like Boris, I'd like to understand what problem these new classes are trying to solve. Currently (and not judging whether it's ideal), a NodeId is a 64-bit value that, via spec, has its range partitioned into a few "kinds" of NodeId. We have some headers (NodeId.h and friends) with constants and functions for manipulating these NodeIds.

A subject is similar, but not exactly the same thing. ACL entries have subjects, and the SubjectDescriptor is provided by the messaging layer (those session objects and so on) through the IM to the Access Control system module, for performing checks during actions. Part of performing those checks is comparing ACL entry subjects against the SubjectDescriptor.

The other place subjects appear is in cluster operations (read/write entries), where they are just numbers, and the auth mode serves as a discriminant. There's no need for more type richness there, because we're not trying to protect naive users from writing a wrong subject, we expect admins to know what they are doing, and the values are validated regardless.

Looking at the linked issue, it seems the desire is to ensure all the info in those various sessions (in the messaging layer) is correct. This is good, but I think (for the subject parts of that task, aside from other things that may also need to be audited) we only need to check all the places where a SubjectDescriptor is created, to ensure it is being fed appropriate messaging layer data.

The key thing to remember from a design perspective is this: subject is an access control construct, not a messaging construct. It is derived from messaging constructs, but is not the same thing. That's why it's defined in the access module, but created in the messaging module. It's an input API to the access control system module.

@kghost
Copy link
Contributor Author

kghost commented Feb 24, 2022

The potential of this PR is providing a better, easy to use API interface GetSubjectDescriptor for session class.

It also defines some foundational classed for ACL to use.

@bzbarsky-apple
Copy link
Contributor

The potential of this PR is providing a better, easy to use API interface GetSubjectDescriptor for session class.

Better in what specific way?

Easy to use in what ways?

It also defines some foundational classed for ACL to use.

Does ACL plan to use them? Have you talked to @mlepage-google about these?

@github-actions
Copy link

github-actions bot commented Feb 24, 2022

PR #15418: Size comparison from f2c450c to 9086755

Increases above 0.2%:

platform target config section f2c450c 9086755 change % change
linux all-clusters-app debug (read only) 2395457 2400449 4992 0.2
.rodata 206629 207237 608 0.3
.text 2025794 2029890 4096 0.2
bridge-app debug+rpc (read only) 1718237 1723213 4976 0.3
.data.rel.ro 38088 38192 104 0.3
.rodata 140660 141236 576 0.4
.text 1461749 1465861 4112 0.3
chip-tool debug .rodata 480373 481429 1056 0.2
door-lock-app debug (read only) 1933649 1938657 5008 0.3
.rodata 172412 173020 608 0.4
.text 1612754 1616866 4112 0.3
lighting-app debug+rpc (read only) 2063305 2068569 5264 0.3
.rodata 164945 165809 864 0.5
.text 1743746 1747858 4112 0.2
ota-provider-app debug (read only) 1865777 1870769 4992 0.3
.rodata 157331 157939 608 0.4
.text 1557906 1562002 4096 0.3
ota-requestor-app debug (read only) 1876985 1882281 5296 0.3
.rodata 151364 152276 912 0.6
.text 1576786 1580882 4096 0.3
shell debug (read only) 2363705 2368665 4960 0.2
.rodata 206674 207250 576 0.3
.text 2000210 2004306 4096 0.2
thermostat-no-ble arm64 .text 1810512 1815104 4592 0.3
tv-app debug (read only) 2589617 2594825 5208 0.2
.rodata 200221 201045 824 0.4
Increases (41 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section f2c450c 9086755 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 599062 599406 344 0.1
.app_xip_area 503876 504220 344 0.1
lock cyw930739m2evb_01 (read/write) 557114 557458 344 0.1
.app_xip_area 463472 463816 344 0.1
ota-requestor cyw930739m2evb_01 (read/write) 577838 578182 344 0.1
.app_xip_area 474764 475108 344 0.1
efr32 lighting-app BRD4161A (read only) 916024 916896 872 0.1
.text 916016 916888 872 0.1
BRD4161A+rpc (read only) 944716 945580 864 0.1
.text 944708 945572 864 0.1
lock-app BRD4161A+wf200 (read only) 985968 986856 888 0.1
.text 985960 986848 888 0.1
window-app BRD4161A (read only) 850288 851160 872 0.1
.text 850280 851152 872 0.1
esp32 all-clusters-app c3devkit (read only) 952148 952516 368 0.0
(read/write) 1399602 1399642 40 0.0
.flash.rodata 199864 199904 40 0.0
.flash.text 952148 952516 368 0.0
m5stack (read only) 1002271 1002667 396 0.0
(read/write) 465104 465152 48 0.0
.flash.rodata 227080 227128 48 0.0
.flash.text 996887 997283 396 0.0
k32w light k32w061+release (read/write) 691628 691964 336 0.0
.text 606392 606728 336 0.1
lock k32w061+release (read/write) 694716 695052 336 0.0
.text 609240 609576 336 0.1
linux all-clusters-app debug (read only) 2395457 2400449 4992 0.2
(read/write) 148400 148496 96 0.1
.data.rel.ro 78392 78488 96 0.1
.rodata 206629 207237 608 0.3
.text 2025794 2029890 4096 0.2
bridge-app debug+rpc (read only) 1718237 1723213 4976 0.3
(read/write) 93664 93792 128 0.1
.data.rel.ro 38088 38192 104 0.3
.rodata 140660 141236 576 0.4
.text 1461749 1465861 4112 0.3
chip-tool debug (read only) 8993757 8999197 5440 0.1
(read/write) 299128 299224 96 0.0
.data.rel.ro 250872 250976 104 0.0
.rodata 480373 481429 1056 0.2
.text 7904933 7909029 4096 0.1
chip-tool-ipv6only arm64 (read only) 8748292 8753284 4992 0.1
(read/write) 412241 412337 96 0.0
.data.rel.ro 296568 296664 96 0.0
.rodata 456668 456780 112 0.0
.text 7427220 7431812 4592 0.1
door-lock-app debug (read only) 1933649 1938657 5008 0.3
(read/write) 119800 119864 64 0.1
.data.rel.ro 62200 62280 80 0.1
.rodata 172412 173020 608 0.4
.text 1612754 1616866 4112 0.3
lighting-app debug+rpc (read only) 2063305 2068569 5264 0.3
(read/write) 124680 124776 96 0.1
.data.rel.ro 65696 65792 96 0.1
.rodata 164945 165809 864 0.5
.text 1743746 1747858 4112 0.2
ota-provider-app debug (read only) 1865777 1870769 4992 0.3
(read/write) 115464 115528 64 0.1
.data.rel.ro 57480 57560 80 0.1
.rodata 157331 157939 608 0.4
.text 1557906 1562002 4096 0.3
ota-requestor-app debug (read only) 1876985 1882281 5296 0.3
(read/write) 117200 117296 96 0.1
.data.rel.ro 58744 58840 96 0.2
.rodata 151364 152276 912 0.6
.text 1576786 1580882 4096 0.3
shell debug (read only) 2363705 2368665 4960 0.2
(read/write) 150912 151008 96 0.1
.data.rel.ro 73096 73192 96 0.1
.rodata 206674 207250 576 0.3
.text 2000210 2004306 4096 0.2
thermostat-no-ble arm64 (read only) 2161588 2166740 5152 0.2
(read/write) 149745 149841 96 0.1
.data.rel.ro 75080 75176 96 0.1
.rodata 132708 132980 272 0.2
.text 1810512 1815104 4592 0.3
tv-app debug (read only) 2589617 2594825 5208 0.2
(read/write) 151920 152016 96 0.1
.data.rel.ro 73624 73728 104 0.1
.rodata 200221 201045 824 0.4
.text 2215346 2219442 4096 0.2
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2452552 2452920 368 0.0
.text 1415124 1415492 368 0.0
lighting-app CY8CPROTO_062_4343W+release (read/write) 2413864 2414232 368 0.0
.text 1376436 1376804 368 0.0
lock-app CY8CPROTO_062_4343W+release (read/write) 2349620 2349988 368 0.0
.text 1312220 1312588 368 0.0
shell CY8CPROTO_062_4343W+release (read/write) 2339992 2340296 304 0.0
.text 1302564 1302868 304 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 1001503 1001951 448 0.0
rodata 115752 115800 48 0.0
text 686156 686560 404 0.1
nrf52840dk_nrf52840+rpc (read/write) 967031 967479 448 0.0
rodata 106856 106904 48 0.0
text 662872 663272 400 0.1
nrf52840dongle_nrf52840 (read/write) 1017503 1017951 448 0.0
rodata 115396 115444 48 0.0
text 690808 691212 404 0.1
nrf5340dk_nrf5340_cpuapp (read/write) 904318 904782 464 0.1
rodata 107868 107916 48 0.0
text 595868 596272 404 0.1
lock-app nrf52840dk_nrf52840 (read/write) 930499 930947 448 0.0
rodata 104540 104588 48 0.0
text 628588 628992 404 0.1
nrf5340dk_nrf5340_cpuapp (read/write) 834126 834574 448 0.1
rodata 96572 96620 48 0.0
text 539064 539468 404 0.1
pump-app nrf52840dk_nrf52840 (read/write) 928759 929207 448 0.0
rodata 103520 103568 48 0.0
text 628016 628420 404 0.1
pump-controller-app nrf52840dk_nrf52840 (read/write) 924719 925167 448 0.0
rodata 103216 103264 48 0.0
text 624272 624676 404 0.1
shell nrf52840dk_nrf52840 (read/write) 788643 789091 448 0.1
rodata 74716 74764 48 0.1
text 525452 525852 400 0.1
p6 all-clusters-app default (read/write) 2490728 2491608 880 0.0
.text 1448992 1449872 880 0.1
light-app default (read/write) 2394856 2395712 856 0.0
.text 1353120 1353976 856 0.1
lock-app default (read/write) 2358392 2359272 880 0.0
.text 1316656 1317536 880 0.1
qpg lighting-app qpg6105+debug (read only) 600752 601088 336 0.1
.text 595432 595768 336 0.1
lock-app qpg6105+debug (read only) 566536 566872 336 0.1
.text 561216 561552 336 0.1
telink lighting-app tlsr9518adk80d (read/write) 882206 882734 528 0.1
text 623528 624008 480 0.1
Full report (44 builds for cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section f2c450c 9086755 change % change
cyw30739 light cyw930739m2evb_01 (read/write) 599062 599406 344 0.1
.app_xip_area 503876 504220 344 0.1
.bss 77876 77876 0 0.0
.data 652 652 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 557114 557458 344 0.1
.app_xip_area 463472 463816 344 0.1
.bss 76372 76372 0 0.0
.data 616 616 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor cyw930739m2evb_01 (read/write) 577838 578182 344 0.1
.app_xip_area 474764 475108 344 0.1
.bss 85476 85476 0 0.0
.data 560 560 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 916024 916896 872 0.1
(read/write) 128640 128640 0 0.0
.bss 126592 126592 0 0.0
.data 2048 2048 0 0.0
.text 916016 916888 872 0.1
BRD4161A+rpc (read only) 944716 945580 864 0.1
(read/write) 145556 145556 0 0.0
.bss 143368 143368 0 0.0
.data 2188 2188 0 0.0
.text 944708 945572 864 0.1
lock-app BRD4161A+wf200 (read only) 985968 986856 888 0.1
(read/write) 121020 121020 0 0.0
.bss 119092 119092 0 0.0
.data 1924 1924 0 0.0
.text 985960 986848 888 0.1
window-app BRD4161A (read only) 850288 851160 872 0.1
(read/write) 126544 126544 0 0.0
.bss 124624 124624 0 0.0
.data 1916 1916 0 0.0
.text 850280 851152 872 0.1
esp32 all-clusters-app c3devkit (read only) 952148 952516 368 0.0
(read/write) 1399602 1399642 40 0.0
.dram0.bss 66672 66672 0 0.0
.dram0.data 14172 14172 0 0.0
.flash.rodata 199864 199904 40 0.0
.flash.text 952148 952516 368 0.0
.iram0.text 62056 62056 0 0.0
m5stack (read only) 1002271 1002667 396 0.0
(read/write) 465104 465152 48 0.0
.dram0.bss 71824 71824 0 0.0
.dram0.data 34072 34072 0 0.0
.flash.rodata 227080 227128 48 0.0
.flash.text 996887 997283 396 0.0
.iram0.text 123399 123399 0 0.0
k32w light k32w061+release (read/write) 691628 691964 336 0.0
.bss 77512 77512 0 0.0
.data 1924 1924 0 0.0
.text 606392 606728 336 0.1
lock k32w061+release (read/write) 694716 695052 336 0.0
.bss 77712 77712 0 0.0
.data 1964 1964 0 0.0
.text 609240 609576 336 0.1
linux all-clusters-app debug (read only) 2395457 2400449 4992 0.2
(read/write) 148400 148496 96 0.1
.bss 62944 62944 0 0.0
.data 1360 1360 0 0.0
.data.rel.ro 78392 78488 96 0.1
.dynamic 592 592 0 0.0
.got 4160 4160 0 0.0
.init 27 27 0 0.0
.init_array 904 904 0 0.0
.rodata 206629 207237 608 0.3
.text 2025794 2029890 4096 0.2
bridge-app debug+rpc (read only) 1718237 1723213 4976 0.3
(read/write) 93664 93792 128 0.1
.bss 48480 48480 0 0.0
.data 2042 2042 0 0.0
.data.rel.ro 38088 38192 104 0.3
.dynamic 592 592 0 0.0
.got 3912 3912 0 0.0
.init 27 27 0 0.0
.init_array 536 536 0 0.0
.rodata 140660 141236 576 0.4
.text 1461749 1465861 4112 0.3
chip-tool debug (read only) 8993757 8999197 5440 0.1
(read/write) 299128 299224 96 0.0
.bss 41024 41024 0 0.0
.data 1164 1164 0 0.0
.data.rel.ro 250872 250976 104 0.0
.dynamic 608 608 0 0.0
.got 4784 4784 0 0.0
.init 27 27 0 0.0
.init_array 624 624 0 0.0
.rodata 480373 481429 1056 0.2
.text 7904933 7909029 4096 0.1
chip-tool-ipv6only arm64 (read only) 8748292 8753284 4992 0.1
(read/write) 412241 412337 96 0.0
.bss 59265 59265 0 0.0
.data 1216 1216 0 0.0
.data.rel.ro 296568 296664 96 0.0
.dynamic 560 560 0 0.0
.got 51392 51392 0 0.0
.init 24 24 0 0.0
.init_array 208 208 0 0.0
.rodata 456668 456780 112 0.0
.text 7427220 7431812 4592 0.1
door-lock-app debug (read only) 1933649 1938657 5008 0.3
(read/write) 119800 119864 64 0.1
.bss 51168 51168 0 0.0
.data 1050 1050 0 0.0
.data.rel.ro 62200 62280 80 0.1
.dynamic 592 592 0 0.0
.got 4096 4096 0 0.0
.init 27 27 0 0.0
.init_array 656 656 0 0.0
.rodata 172412 173020 608 0.4
.text 1612754 1616866 4112 0.3
lighting-app debug+rpc (read only) 2063305 2068569 5264 0.3
(read/write) 124680 124776 96 0.1
.bss 52128 52128 0 0.0
.data 1408 1408 0 0.0
.data.rel.ro 65696 65792 96 0.1
.dynamic 608 608 0 0.0
.got 4128 4128 0 0.0
.init 27 27 0 0.0
.init_array 704 704 0 0.0
.rodata 164945 165809 864 0.5
.text 1743746 1747858 4112 0.2
ota-provider-app debug (read only) 1865777 1870769 4992 0.3
(read/write) 115464 115528 64 0.1
.bss 51040 51040 0 0.0
.data 1320 1320 0 0.0
.data.rel.ro 57480 57560 80 0.1
.dynamic 608 608 0 0.0
.got 4352 4352 0 0.0
.init 27 27 0 0.0
.init_array 608 608 0 0.0
.rodata 157331 157939 608 0.4
.text 1557906 1562002 4096 0.3
ota-requestor-app debug (read only) 1876985 1882281 5296 0.3
(read/write) 117200 117296 96 0.1
.bss 51872 51872 0 0.0
.data 1192 1192 0 0.0
.data.rel.ro 58744 58840 96 0.2
.dynamic 592 592 0 0.0
.got 4152 4152 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 151364 152276 912 0.6
.text 1576786 1580882 4096 0.3
shell debug (read only) 2363705 2368665 4960 0.2
(read/write) 150912 151008 96 0.1
.bss 71296 71296 0 0.0
.data 864 864 0 0.0
.data.rel.ro 73096 73192 96 0.1
.dynamic 592 592 0 0.0
.got 4144 4144 0 0.0
.init 27 27 0 0.0
.init_array 888 888 0 0.0
.rodata 206674 207250 576 0.3
.text 2000210 2004306 4096 0.2
thermostat-no-ble arm64 (read only) 2161588 2166740 5152 0.2
(read/write) 149745 149841 96 0.1
.bss 66433 66433 0 0.0
.data 1056 1056 0 0.0
.data.rel.ro 75080 75176 96 0.1
.dynamic 560 560 0 0.0
.got 4216 4216 0 0.0
.init 24 24 0 0.0
.init_array 352 352 0 0.0
.rodata 132708 132980 272 0.2
.text 1810512 1815104 4592 0.3
tv-app debug (read only) 2589617 2594825 5208 0.2
(read/write) 151920 152016 96 0.1
.bss 69120 69120 0 0.0
.data 3168 3168 0 0.0
.data.rel.ro 73624 73728 104 0.1
.dynamic 592 592 0 0.0
.got 4528 4528 0 0.0
.init 27 27 0 0.0
.init_array 872 872 0 0.0
.rodata 200221 201045 824 0.4
.text 2215346 2219442 4096 0.2
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2452552 2452920 368 0.0
.bss 194752 194752 0 0.0
.data 5512 5512 0 0.0
.text 1415124 1415492 368 0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2413864 2414232 368 0.0
.bss 188852 188852 0 0.0
.data 5800 5800 0 0.0
.text 1376436 1376804 368 0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2349620 2349988 368 0.0
.bss 187756 187756 0 0.0
.data 5776 5776 0 0.0
.text 1312220 1312588 368 0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1155428 1155428 0 0.0
.bss 11952 11952 0 0.0
.data 4512 4512 0 0.0
.text 118812 118812 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2339992 2340296 304 0.0
.bss 186392 186392 0 0.0
.data 5608 5608 0 0.0
.text 1302564 1302868 304 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 1001503 1001951 448 0.0
bss 122092 122092 0 0.0
rodata 115752 115800 48 0.0
text 686156 686560 404 0.1
nrf52840dk_nrf52840+rpc (read/write) 967031 967479 448 0.0
bss 119176 119176 0 0.0
rodata 106856 106904 48 0.0
text 662872 663272 400 0.1
nrf52840dongle_nrf52840 (read/write) 1017503 1017951 448 0.0
bss 123140 123140 0 0.0
rodata 115396 115444 48 0.0
text 690808 691212 404 0.1
nrf5340dk_nrf5340_cpuapp (read/write) 904318 904782 464 0.1
bss 119380 119380 0 0.0
rodata 107868 107916 48 0.0
text 595868 596272 404 0.1
lock-app nrf52840dk_nrf52840 (read/write) 930499 930947 448 0.0
bss 120308 120308 0 0.0
rodata 104540 104588 48 0.0
text 628588 628992 404 0.1
nrf5340dk_nrf5340_cpuapp (read/write) 834126 834574 448 0.1
bss 117628 117628 0 0.0
rodata 96572 96620 48 0.0
text 539064 539468 404 0.1
pigweed-app nrf52840dk_nrf52840 (read/write) 501603 501603 0 0.0
bss 52584 52584 0 0.0
rodata 44500 44500 0 0.0
text 342712 342712 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 928759 929207 448 0.0
bss 120040 120040 0 0.0
rodata 103520 103568 48 0.0
text 628016 628420 404 0.1
pump-controller-app nrf52840dk_nrf52840 (read/write) 924719 925167 448 0.0
bss 120044 120044 0 0.0
rodata 103216 103264 48 0.0
text 624272 624676 404 0.1
shell nrf52840dk_nrf52840 (read/write) 788643 789091 448 0.1
bss 112360 112360 0 0.0
rodata 74716 74764 48 0.1
text 525452 525852 400 0.1
p6 all-clusters-app default (read/write) 2490728 2491608 880 0.0
.bss 122392 122392 0 0.0
.data 2688 2688 0 0.0
.text 1448992 1449872 880 0.1
light-app default (read/write) 2394856 2395712 856 0.0
.bss 113640 113640 0 0.0
.data 2536 2536 0 0.0
.text 1353120 1353976 856 0.1
lock-app default (read/write) 2358392 2359272 880 0.0
.bss 113392 113392 0 0.0
.data 2496 2496 0 0.0
.text 1316656 1317536 880 0.1
qpg lighting-app qpg6105+debug (read only) 600752 601088 336 0.1
(read/write) 146936 146936 0 0.0
.bss 90928 90928 0 0.0
.data 1124 1124 0 0.0
.text 595432 595768 336 0.1
lock-app qpg6105+debug (read only) 566536 566872 336 0.1
(read/write) 146936 146936 0 0.0
.bss 90936 90936 0 0.0
.data 1076 1076 0 0.0
.text 561216 561552 336 0.1
persistent-storage-app qpg6105+debug (read only) 99536 99536 0 0.0
(read/write) 146941 146941 0 0.0
.bss 24001 24001 0 0.0
.data 180 180 0 0.0
.text 94216 94216 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 882206 882734 528 0.1
bss 86364 86364 0 0.0
noinit 37160 37160 0 0.0
text 623528 624008 480 0.1

class PaseSubject
{
public:
static constexpr uint16_t kPasscodeId = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a PasscodeId typedef.

* A subject is a global unique identifier. It suite 2 purpose:
*
* 1. Identify an entity. operator== can be used to check if 2 subjects are identical.
* 2. Associate to ACL entries to grant privileges
Copy link
Contributor

@mlepage-google mlepage-google Feb 25, 2022

Choose a reason for hiding this comment

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

Like Boris, I'd like to understand what problem these new classes are trying to solve. Currently (and not judging whether it's ideal), a NodeId is a 64-bit value that, via spec, has its range partitioned into a few "kinds" of NodeId. We have some headers (NodeId.h and friends) with constants and functions for manipulating these NodeIds.

A subject is similar, but not exactly the same thing. ACL entries have subjects, and the SubjectDescriptor is provided by the messaging layer (those session objects and so on) through the IM to the Access Control system module, for performing checks during actions. Part of performing those checks is comparing ACL entry subjects against the SubjectDescriptor.

The other place subjects appear is in cluster operations (read/write entries), where they are just numbers, and the auth mode serves as a discriminant. There's no need for more type richness there, because we're not trying to protect naive users from writing a wrong subject, we expect admins to know what they are doing, and the values are validated regardless.

Looking at the linked issue, it seems the desire is to ensure all the info in those various sessions (in the messaging layer) is correct. This is good, but I think (for the subject parts of that task, aside from other things that may also need to be audited) we only need to check all the places where a SubjectDescriptor is created, to ensure it is being fed appropriate messaging layer data.

The key thing to remember from a design perspective is this: subject is an access control construct, not a messaging construct. It is derived from messaging constructs, but is not the same thing. That's why it's defined in the access module, but created in the messaging module. It's an input API to the access control system module.

@stale
Copy link

stale bot commented Mar 5, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale Stale issue or PR label Mar 5, 2022
@stale
Copy link

stale bot commented Mar 17, 2022

This stale pull request has been automatically closed. Thank you for your contributions.

@stale stale bot closed this Mar 17, 2022
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.

Audit all consumers of AsSecureSession
5 participants