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

[chip-cert] Updated Tool To Generate Invalid Operational Certificates. #19629

Conversation

emargolis
Copy link
Contributor

Problem

Need APIs to generate invalid conditions when sending AddTrusted, AddNOC, UpdateNOC commands.

Ticket: #19068

Change overview

  • Updated current code to inject errors into operational certs in DER/PEM format.
  • New code to generate CHIP TLV encoded certificates with injected errors.
  • It can generate invalid NOC, ICAC, and RCAC.

Testing

Verified manually that the tool generates normal/valid operational certificates as before.
Verified manually that invalid certificates can be properly generated.

@github-actions
Copy link

github-actions bot commented Jun 15, 2022

PR #19629: Size comparison from a99bed0 to 92b80ed

Increases (2 builds for cc13x2_26x2)
platform target config section a99bed0 92b80ed change % change
cc13x2_26x2 lock-ftd LP_CC2652R7 (read only) 688487 688495 8 0.0
.text 589092 589100 8 0.0
pump-app LP_CC2652R7 (read only) 669711 669719 8 0.0
.text 582220 582228 8 0.0
Decreases (3 builds for cc13x2_26x2, telink)
platform target config section a99bed0 92b80ed change % change
cc13x2_26x2 lock-ftd LP_CC2652R7 (read/write) 152432 152424 -8 -0.0
pump-app LP_CC2652R7 (read/write) 172096 172088 -8 -0.0
telink lighting-app tlsr9518adk80d (read/write) 806720 806712 -8 -0.0
text 574322 574320 -2 -0.0
Full report (30 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section a99bed0 92b80ed change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 657643 657643 0 0.0
(read/write) 193172 193172 0 0.0
.bss 73708 73708 0 0.0
.data 3380 3380 0 0.0
.rodata 86883 86883 0 0.0
.text 570448 570448 0 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 646159 646159 0 0.0
(read/write) 157260 157260 0 0.0
.bss 72988 72988 0 0.0
.data 3356 3356 0 0.0
.rodata 90159 90159 0 0.0
.text 555680 555680 0 0.0
lock-ftd LP_CC2652R7 (read only) 688487 688495 8 0.0
(read/write) 152432 152424 -8 -0.0
.bss 70700 70700 0 0.0
.data 3280 3280 0 0.0
.rodata 98911 98911 0 0.0
.text 589092 589100 8 0.0
lock-mtd LP_CC2652R7 (read only) 637903 637903 0 0.0
(read/write) 143832 143832 0 0.0
.bss 66436 66436 0 0.0
.data 3280 3280 0 0.0
.rodata 98791 98791 0 0.0
.text 538620 538620 0 0.0
pump-app LP_CC2652R7 (read only) 669711 669719 8 0.0
(read/write) 172096 172088 -8 -0.0
.bss 70820 70820 0 0.0
.data 3316 3316 0 0.0
.rodata 87007 87007 0 0.0
.text 582220 582228 8 0.0
pump-controller-app LP_CC2652R7 (read only) 660443 660443 0 0.0
(read/write) 181492 181492 0 0.0
.bss 70948 70948 0 0.0
.data 3276 3276 0 0.0
.rodata 84931 84931 0 0.0
.text 575028 575028 0 0.0
shell LP_CC2652R7 (read only) 686986 686986 0 0.0
(read/write) 159324 159324 0 0.0
.bss 76004 76004 0 0.0
.data 3384 3384 0 0.0
.rodata 109410 109410 0 0.0
.text 577264 577264 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 610994 610994 0 0.0
.app_xip_area 467684 467684 0 0.0
.bss 86232 86232 0 0.0
.data 764 764 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 608094 608094 0 0.0
.app_xip_area 464640 464640 0 0.0
.bss 86408 86408 0 0.0
.data 732 732 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 614098 614098 0 0.0
.app_xip_area 471708 471708 0 0.0
.bss 85400 85400 0 0.0
.data 672 672 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 920548 920548 0 0.0
(read/write) 132396 132396 0 0.0
.bss 130280 130280 0 0.0
.data 2116 2116 0 0.0
.text 920540 920540 0 0.0
BRD4161A+rpc (read only) 956204 956204 0 0.0
(read/write) 149272 149272 0 0.0
.bss 146952 146952 0 0.0
.data 2320 2320 0 0.0
.text 956196 956196 0 0.0
BRD4161A+rs911x (read only) 795648 795648 0 0.0
(read/write) 128676 128676 0 0.0
.bss 126548 126548 0 0.0
.data 2124 2124 0 0.0
.text 795640 795640 0 0.0
lock-app BRD4161A+wf200 (read only) 963576 963576 0 0.0
(read/write) 129012 129012 0 0.0
.bss 126924 126924 0 0.0
.data 2088 2088 0 0.0
.text 963568 963568 0 0.0
window-app BRD4161A (read only) 905420 905420 0 0.0
(read/write) 132460 132460 0 0.0
.bss 130352 130352 0 0.0
.data 2108 2108 0 0.0
.text 905412 905412 0 0.0
esp32 all-clusters-app c3devkit (read only) 1010584 1010584 0 0.0
(read/write) 1482626 1482626 0 0.0
.dram0.bss 69344 69344 0 0.0
.dram0.data 14656 14656 0 0.0
.flash.rodata 213200 213200 0 0.0
.flash.text 1010584 1010584 0 0.0
.iram0.text 62902 62902 0 0.0
m5stack (read only) 1064883 1064883 0 0.0
(read/write) 484744 484744 0 0.0
.dram0.bss 74864 74864 0 0.0
.dram0.data 34176 34176 0 0.0
.flash.rodata 243708 243708 0 0.0
.flash.text 1059499 1059499 0 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w061+release (read/write) 657192 657192 0 0.0
.bss 68708 68708 0 0.0
.data 2028 2028 0 0.0
.text 580656 580656 0 0.0
lock k32w061+release (read/write) 718848 718848 0 0.0
.bss 69140 69140 0 0.0
.data 2000 2000 0 0.0
.text 641908 641908 0 0.0
linux chip-tool-no-interactive-ipv6only arm64 (read only) 9690140 9690140 0 0.0
(read/write) 646001 646001 0 0.0
.bss 42625 42625 0 0.0
.data 1152 1152 0 0.0
.data.rel.ro 585264 585264 0 0.0
.dynamic 528 528 0 0.0
.got 13152 13152 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 466252 466252 0 0.0
.text 7753748 7753748 0 0.0
thermostat-no-ble arm64 (read only) 2561300 2561300 0 0.0
(read/write) 191697 191697 0 0.0
.bss 99393 99393 0 0.0
.data 1688 1688 0 0.0
.data.rel.ro 82536 82536 0 0.0
.dynamic 528 528 0 0.0
.got 5056 5056 0 0.0
.init 24 24 0 0.0
.init_array 400 400 0 0.0
.rodata 162996 162996 0 0.0
.text 2160064 2160064 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2434912 2434912 0 0.0
.bss 208148 208148 0 0.0
.data 5864 5864 0 0.0
.text 1397556 1397556 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1196643 1196643 0 0.0
bss 141554 141554 0 0.0
rodata 155420 155420 0 0.0
text 820812 820812 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1144691 1144691 0 0.0
bss 140794 140794 0 0.0
rodata 131948 131948 0 0.0
text 793128 793128 0 0.0
p6 all-clusters-app default (read/write) 2549952 2549952 0 0.0
.bss 143344 143344 0 0.0
.data 2800 2800 0 0.0
.text 1508216 1508216 0 0.0
all-clusters-minimal-app default (read/write) 2495896 2495896 0 0.0
.bss 142608 142608 0 0.0
.data 2776 2776 0 0.0
.text 1454160 1454160 0 0.0
light-app default (read/write) 2426776 2426776 0 0.0
.bss 134688 134688 0 0.0
.data 2624 2624 0 0.0
.text 1385040 1385040 0 0.0
lock-app default (read/write) 2447192 2447192 0 0.0
.bss 134512 134512 0 0.0
.data 2600 2600 0 0.0
.text 1405456 1405456 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 786732 786732 0 0.0
bss 69836 69836 0 0.0
noinit 40416 40416 0 0.0
text 557632 557632 0 0.0
lighting-app tlsr9518adk80d (read/write) 806720 806712 -8 -0.0
bss 70088 70088 0 0.0
noinit 40416 40416 0 0.0
text 574322 574320 -2 -0.0

- Updated current code to inject errors into operational certs in DER/PEM format.
- New code to generate CHIP TLV encoded certificates with injected errors.
@emargolis emargolis force-pushed the emargolis/feature/chip-cert-gen-wrong-op-cert branch from 92b80ed to 33adafa Compare June 16, 2022 19:54
@github-actions
Copy link

github-actions bot commented Jun 16, 2022

PR #19629: Size comparison from 0a90632 to 33adafa

Increases (4 builds for cyw30739, efr32, esp32, telink)
platform target config section 0a90632 33adafa change % change
cyw30739 ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 616046 616054 8 0.0
.app_xip_area 473600 473608 8 0.0
efr32 lock-app BRD4161A+wf200 (read only) 965508 965524 16 0.0
.text 965500 965516 16 0.0
esp32 all-clusters-app c3devkit (read only) 1012634 1012636 2 0.0
.flash.text 1012634 1012636 2 0.0
telink light-switch-app tlsr9518adk80d (read/write) 789008 789016 8 0.0
text 559600 559602 2 0.0
Decreases (2 builds for k32w, nrfconnect)
platform target config section 0a90632 33adafa change % change
k32w lock k32w061+release (read/write) 720848 720832 -16 -0.0
.text 643852 643836 -16 -0.0
nrfconnect all-clusters-minimal-app nrf52840dk_nrf52840 text 794724 794720 -4 -0.0
Full report (41 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 0a90632 33adafa change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 659531 659531 0 0.0
(read/write) 191332 191332 0 0.0
.bss 73756 73756 0 0.0
.data 3356 3356 0 0.0
.rodata 87083 87083 0 0.0
.text 572136 572136 0 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 647999 647999 0 0.0
(read/write) 157316 157316 0 0.0
.bss 73044 73044 0 0.0
.data 3356 3356 0 0.0
.rodata 90407 90407 0 0.0
.text 557272 557272 0 0.0
lock-ftd LP_CC2652R7 (read only) 690451 690451 0 0.0
(read/write) 150524 150524 0 0.0
.bss 70756 70756 0 0.0
.data 3280 3280 0 0.0
.rodata 99163 99163 0 0.0
.text 590804 590804 0 0.0
lock-mtd LP_CC2652R7 (read only) 639859 639859 0 0.0
(read/write) 143888 143888 0 0.0
.bss 66492 66492 0 0.0
.data 3280 3280 0 0.0
.rodata 99043 99043 0 0.0
.text 540324 540324 0 0.0
pump-app LP_CC2652R7 (read only) 671403 671403 0 0.0
(read/write) 170460 170460 0 0.0
.bss 70876 70876 0 0.0
.data 3280 3280 0 0.0
.rodata 87259 87259 0 0.0
.text 583660 583660 0 0.0
pump-controller-app LP_CC2652R7 (read only) 662399 662399 0 0.0
(read/write) 179592 179592 0 0.0
.bss 71004 71004 0 0.0
.data 3276 3276 0 0.0
.rodata 85183 85183 0 0.0
.text 576732 576732 0 0.0
shell LP_CC2652R7 (read only) 688946 688946 0 0.0
(read/write) 157412 157412 0 0.0
.bss 76052 76052 0 0.0
.data 3360 3360 0 0.0
.rodata 109658 109658 0 0.0
.text 578976 578976 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 612738 612738 0 0.0
.app_xip_area 469404 469404 0 0.0
.bss 86288 86288 0 0.0
.data 728 728 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
lock cyw930739m2evb_01 (read/write) 610046 610046 0 0.0
.app_xip_area 466536 466536 0 0.0
.bss 86464 86464 0 0.0
.data 732 732 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 616046 616054 8 0.0
.app_xip_area 473600 473608 8 0.0
.bss 85456 85456 0 0.0
.data 672 672 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 924008 924008 0 0.0
(read/write) 132416 132416 0 0.0
.bss 130336 130336 0 0.0
.data 2080 2080 0 0.0
.text 924000 924000 0 0.0
BRD4161A+rpc (read only) 959712 959712 0 0.0
(read/write) 149296 149296 0 0.0
.bss 147008 147008 0 0.0
.data 2284 2284 0 0.0
.text 959704 959704 0 0.0
BRD4161A+rs911x (read only) 799092 799092 0 0.0
(read/write) 128692 128692 0 0.0
.bss 126604 126604 0 0.0
.data 2088 2088 0 0.0
.text 799084 799084 0 0.0
lock-app BRD4161A+wf200 (read only) 965508 965524 16 0.0
(read/write) 129068 129068 0 0.0
.bss 126980 126980 0 0.0
.data 2088 2088 0 0.0
.text 965500 965516 16 0.0
window-app BRD4161A (read only) 909104 909104 0 0.0
(read/write) 132520 132520 0 0.0
.bss 130408 130408 0 0.0
.data 2108 2108 0 0.0
.text 909096 909096 0 0.0
esp32 all-clusters-app c3devkit (read only) 1012634 1012636 2 0.0
(read/write) 1482898 1482898 0 0.0
.dram0.bss 69392 69392 0 0.0
.dram0.data 14632 14632 0 0.0
.flash.rodata 213440 213440 0 0.0
.flash.text 1012634 1012636 2 0.0
.iram0.text 62902 62902 0 0.0
m5stack (read only) 1067171 1067171 0 0.0
(read/write) 485016 485016 0 0.0
.dram0.bss 74912 74912 0 0.0
.dram0.data 34144 34144 0 0.0
.flash.rodata 243964 243964 0 0.0
.flash.text 1061787 1061787 0 0.0
.iram0.text 123267 123267 0 0.0
k32w light k32w061+release (read/write) 658876 658876 0 0.0
.bss 68756 68756 0 0.0
.data 1992 1992 0 0.0
.text 582328 582328 0 0.0
lock k32w061+release (read/write) 720848 720832 -16 -0.0
.bss 69196 69196 0 0.0
.data 2000 2000 0 0.0
.text 643852 643836 -16 -0.0
linux all-clusters-app debug (read only) 2929593 2929593 0 0.0
(read/write) 188656 188656 0 0.0
.bss 95744 95744 0 0.0
.data 2048 2048 0 0.0
.data.rel.ro 84664 84664 0 0.0
.dynamic 608 608 0 0.0
.got 4536 4536 0 0.0
.init 27 27 0 0.0
.init_array 1032 1032 0 0.0
.rodata 259421 259421 0 0.0
.text 2493730 2493730 0 0.0
all-clusters-minimal-app debug (read only) 2783305 2783305 0 0.0
(read/write) 180560 180560 0 0.0
.bss 95072 95072 0 0.0
.data 2048 2048 0 0.0
.data.rel.ro 77304 77304 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 1032 1032 0 0.0
.rodata 260957 260957 0 0.0
.text 2348082 2348082 0 0.0
bridge-app debug+rpc (read only) 2285921 2285921 0 0.0
(read/write) 159424 159424 0 0.0
.bss 83136 83136 0 0.0
.data 3792 3792 0 0.0
.data.rel.ro 66728 66728 0 0.0
.dynamic 608 608 0 0.0
.got 4392 4392 0 0.0
.init 27 27 0 0.0
.init_array 728 728 0 0.0
.rodata 194304 194304 0 0.0
.text 1930530 1930530 0 0.0
chip-tool debug (read only) 10140045 10140045 0 0.0
(read/write) 609544 609544 0 0.0
.bss 24352 24352 0 0.0
.data 1088 1088 0 0.0
.data.rel.ro 577808 577808 0 0.0
.dynamic 624 624 0 0.0
.got 5008 5008 0 0.0
.init 27 27 0 0.0
.init_array 640 640 0 0.0
.rodata 508725 508725 0 0.0
.text 8225589 8225589 0 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 9881788 9881788 0 0.0
(read/write) 674225 674225 0 0.0
.bss 42641 42641 0 0.0
.data 1152 1152 0 0.0
.data.rel.ro 613208 613208 0 0.0
.dynamic 528 528 0 0.0
.got 13416 13416 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 472300 472300 0 0.0
.text 7873060 7873060 0 0.0
lighting-app debug+rpc (read only) 2518673 2518673 0 0.0
(read/write) 163448 163448 0 0.0
.bss 83616 83616 0 0.0
.data 2064 2064 0 0.0
.data.rel.ro 71896 71896 0 0.0
.dynamic 608 608 0 0.0
.got 4424 4424 0 0.0
.init 27 27 0 0.0
.init_array 816 816 0 0.0
.rodata 210056 210056 0 0.0
.text 2138914 2138914 0 0.0
lock-app debug (read only) 2457401 2457401 0 0.0
(read/write) 158096 158096 0 0.0
.bss 82016 82016 0 0.0
.data 1680 1680 0 0.0
.data.rel.ro 68568 68568 0 0.0
.dynamic 608 608 0 0.0
.got 4424 4424 0 0.0
.init 27 27 0 0.0
.init_array 776 776 0 0.0
.rodata 223752 223752 0 0.0
.text 2069346 2069346 0 0.0
ota-provider-app debug (read only) 2295281 2295281 0 0.0
(read/write) 152232 152232 0 0.0
.bss 81696 81696 0 0.0
.data 1912 1912 0 0.0
.data.rel.ro 62840 62840 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 672 672 0 0.0
.rodata 199928 199928 0 0.0
.text 1933202 1933202 0 0.0
ota-requestor-app debug (read only) 2411009 2411009 0 0.0
(read/write) 158976 158976 0 0.0
.bss 84000 84000 0 0.0
.data 2200 2200 0 0.0
.data.rel.ro 66936 66936 0 0.0
.dynamic 608 608 0 0.0
.got 4480 4480 0 0.0
.init 27 27 0 0.0
.init_array 728 728 0 0.0
.rodata 203616 203616 0 0.0
.text 2037010 2037010 0 0.0
shell debug (read only) 2603137 2603137 0 0.0
(read/write) 219288 219288 0 0.0
.bss 134504 134504 0 0.0
.data 1232 1232 0 0.0
.data.rel.ro 77808 77808 0 0.0
.dynamic 608 608 0 0.0
.got 4168 4168 0 0.0
.init 27 27 0 0.0
.init_array 936 936 0 0.0
.rodata 229746 229746 0 0.0
.text 2213634 2213634 0 0.0
thermostat-no-ble arm64 (read only) 2570668 2570668 0 0.0
(read/write) 192193 192193 0 0.0
.bss 99489 99489 0 0.0
.data 1688 1688 0 0.0
.data.rel.ro 82928 82928 0 0.0
.dynamic 528 528 0 0.0
.got 5072 5072 0 0.0
.init 24 24 0 0.0
.init_array 400 400 0 0.0
.rodata 163324 163324 0 0.0
.text 2168224 2168224 0 0.0
tv-app debug (read only) 3067137 3067137 0 0.0
(read/write) 289352 289352 0 0.0
.bss 199240 199240 0 0.0
.data 4656 4656 0 0.0
.data.rel.ro 79016 79016 0 0.0
.dynamic 608 608 0 0.0
.got 4840 4840 0 0.0
.init 27 27 0 0.0
.init_array 952 952 0 0.0
.rodata 245664 245664 0 0.0
.text 2634610 2634610 0 0.0
tv-casting-app debug (read only) 5549993 5549993 0 0.0
(read/write) 199960 199960 0 0.0
.bss 88072 88072 0 0.0
.data 2480 2480 0 0.0
.data.rel.ro 103184 103184 0 0.0
.dynamic 608 608 0 0.0
.got 4712 4712 0 0.0
.init 27 27 0 0.0
.init_array 872 872 0 0.0
.rodata 341193 341193 0 0.0
.text 4932354 4932354 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2437720 2437720 0 0.0
.bss 208204 208204 0 0.0
.data 5864 5864 0 0.0
.text 1400364 1400364 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1198699 1198699 0 0.0
bss 141598 141598 0 0.0
rodata 155676 155676 0 0.0
text 822504 822504 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1146655 1146655 0 0.0
bss 140850 140850 0 0.0
rodata 132200 132200 0 0.0
text 794724 794720 -4 -0.0
p6 all-clusters-app default (read/write) 2553568 2553568 0 0.0
.bss 143384 143384 0 0.0
.data 2776 2776 0 0.0
.text 1511832 1511832 0 0.0
all-clusters-minimal-app default (read/write) 2499416 2499416 0 0.0
.bss 142664 142664 0 0.0
.data 2776 2776 0 0.0
.text 1457680 1457680 0 0.0
light-app default (read/write) 2430160 2430160 0 0.0
.bss 134744 134744 0 0.0
.data 2592 2592 0 0.0
.text 1388424 1388424 0 0.0
lock-app default (read/write) 2450784 2450784 0 0.0
.bss 134568 134568 0 0.0
.data 2600 2600 0 0.0
.text 1409048 1409048 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 789008 789016 8 0.0
bss 69892 69892 0 0.0
noinit 40416 40416 0 0.0
text 559600 559602 2 0.0
lighting-app tlsr9518adk80d (read/write) 808728 808728 0 0.0
bss 70140 70140 0 0.0
noinit 40416 40416 0 0.0
text 576066 576066 0 0.0

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