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 Support Command Line Key/Cert Inputs #22436

Conversation

emargolis
Copy link
Contributor

cherry-pick PR #22142

@emargolis emargolis force-pushed the emargolis/sve-2/cherry-pick-chip-cert-updates branch from a14f7f2 to a63c0a9 Compare September 6, 2022 23:18
@github-actions
Copy link

github-actions bot commented Sep 8, 2022

PR #22436: Size comparison from 9f4d680 to 7a90dd1

Increases (3 builds for cc13x2_26x2, nrfconnect)
platform target config section 9f4d680 7a90dd1 change % change
cc13x2_26x2 lock-mtd LP_CC2652R7 (read/write) 180592 180600 8 0.0
shell LP_CC2652R7 (read only) 665078 665086 8 0.0
.text 579068 579076 8 0.0
nrfconnect all-clusters-minimal-app nrf52840dk_nrf52840 text 803112 803116 4 0.0
Decreases (3 builds for cc13x2_26x2)
platform target config section 9f4d680 7a90dd1 change % change
cc13x2_26x2 all-clusters-minimal-app LP_CC2652R7 (read only) 637763 637755 -8 -0.0
.text 559460 559452 -8 -0.0
lock-mtd LP_CC2652R7 (read only) 656823 656815 -8 -0.0
.text 554584 554576 -8 -0.0
shell LP_CC2652R7 (read/write) 181952 181944 -8 -0.0
Full report (41 builds for bl602, cc13x2_26x2, cyw30739, efr32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 9f4d680 7a90dd1 change % change
bl602 lighting-app bl602 (read/write) 1383938 1383938 0 0.0
.bss 120290 120290 0 0.0
.data 4480 4480 0 0.0
.text 1051092 1051092 0 0.0
bl602+rpc (read/write) 1429450 1429450 0 0.0
.bss 127730 127730 0 0.0
.data 4600 4600 0 0.0
.text 1082852 1082852 0 0.0
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 672379 672379 0 0.0
(read/write) 179132 179132 0 0.0
.bss 74404 74404 0 0.0
.data 3372 3372 0 0.0
.rodata 88747 88747 0 0.0
.text 583316 583316 0 0.0
all-clusters-minimal-app LP_CC2652R7 (read only) 637763 637755 -8 -0.0
(read/write) 157980 157980 0 0.0
.bss 73692 73692 0 0.0
.data 3372 3372 0 0.0
.rodata 77979 77979 0 0.0
.text 559460 559452 -8 -0.0
lock-ftd LP_CC2652R7 (read only) 674079 674079 0 0.0
(read/write) 167648 167648 0 0.0
.bss 71508 71508 0 0.0
.data 3296 3296 0 0.0
.rodata 76671 76671 0 0.0
.text 596928 596928 0 0.0
lock-mtd LP_CC2652R7 (read only) 656823 656815 -8 -0.0
(read/write) 180592 180600 8 0.0
.bss 67196 67196 0 0.0
.data 3296 3296 0 0.0
.rodata 101759 101759 0 0.0
.text 554584 554576 -8 -0.0
pump-app LP_CC2652R7 (read only) 684751 684751 0 0.0
(read/write) 157784 157784 0 0.0
.bss 71548 71548 0 0.0
.data 3296 3296 0 0.0
.rodata 89959 89959 0 0.0
.text 594308 594308 0 0.0
pump-controller-app LP_CC2652R7 (read only) 669243 669243 0 0.0
(read/write) 173412 173412 0 0.0
.bss 71668 71668 0 0.0
.data 3292 3292 0 0.0
.rodata 85515 85515 0 0.0
.text 583248 583248 0 0.0
shell LP_CC2652R7 (read only) 665078 665086 8 0.0
(read/write) 181952 181944 -8 -0.0
.bss 76724 76724 0 0.0
.data 3376 3376 0 0.0
.rodata 85694 85694 0 0.0
.text 579068 579076 8 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 586118 586118 0 0.0
.app_xip_area 462752 462752 0 0.0
.bss 65800 65800 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) 591902 591902 0 0.0
.app_xip_area 463752 463752 0 0.0
.bss 70584 70584 0 0.0
.data 748 748 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 599034 599034 0 0.0
.app_xip_area 476388 476388 0 0.0
.bss 65112 65112 0 0.0
.data 716 716 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read/write) 1104012 1104012 0 0.0
.bss 136148 136148 0 0.0
.data 2068 2068 0 0.0
.text 965772 965772 0 0.0
BRD4161A+rpc (read/write) 1158264 1158264 0 0.0
.bss 152836 152836 0 0.0
.data 2280 2280 0 0.0
.text 1003128 1003128 0 0.0
BRD4161A+rs911x (read/write) 996672 996672 0 0.0
.bss 168912 168912 0 0.0
.data 2056 2056 0 0.0
.text 825684 825684 0 0.0
lock-app BRD4161A+wf200 (read/write) 1145916 1145916 0 0.0
.bss 151992 151992 0 0.0
.data 2064 2064 0 0.0
.text 991840 991840 0 0.0
window-app BRD4161A (read/write) 1095420 1095420 0 0.0
.bss 137588 137588 0 0.0
.data 2096 2096 0 0.0
.text 955716 955716 0 0.0
k32w light k32w0+release (read/write) 645524 645524 0 0.0
.bss 70232 70232 0 0.0
.data 2044 2044 0 0.0
.text 570520 570520 0 0.0
lock k32w0+release (read/write) 703044 703044 0 0.0
.bss 70704 70704 0 0.0
.data 2052 2052 0 0.0
.text 627560 627560 0 0.0
linux all-clusters-app debug (read only) 3034257 3034257 0 0.0
(read/write) 155920 155920 0 0.0
.bss 61888 61888 0 0.0
.data 2096 2096 0 0.0
.data.rel.ro 85560 85560 0 0.0
.dynamic 608 608 0 0.0
.got 4568 4568 0 0.0
.init 27 27 0 0.0
.init_array 1160 1160 0 0.0
.rodata 274443 274443 0 0.0
.text 2580738 2580738 0 0.0
all-clusters-minimal-app debug (read only) 2874113 2874113 0 0.0
(read/write) 147624 147624 0 0.0
.bss 61152 61152 0 0.0
.data 2064 2064 0 0.0
.data.rel.ro 78120 78120 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 1152 1152 0 0.0
.rodata 274635 274635 0 0.0
.text 2423106 2423106 0 0.0
bridge-app debug+rpc (read only) 2372841 2372841 0 0.0
(read/write) 127584 127584 0 0.0
.bss 50656 50656 0 0.0
.data 3600 3600 0 0.0
.data.rel.ro 67464 67464 0 0.0
.dynamic 608 608 0 0.0
.got 4392 4392 0 0.0
.init 27 27 0 0.0
.init_array 824 824 0 0.0
.rodata 203432 203432 0 0.0
.text 2006786 2006786 0 0.0
chip-tool debug (read only) 10917001 10917001 0 0.0
(read/write) 656736 656736 0 0.0
.bss 25240 25240 0 0.0
.data 3266 3266 0 0.0
.data.rel.ro 621720 621720 0 0.0
.dynamic 608 608 0 0.0
.got 5096 5096 0 0.0
.init 27 27 0 0.0
.init_array 768 768 0 0.0
.rodata 567573 567573 0 0.0
.text 8829860 8829860 0 0.0
chip-tool-ipv6only arm64 (read only) 10299772 10299772 0 0.0
(read/write) 704593 704593 0 0.0
.bss 33297 33297 0 0.0
.data 3272 3272 0 0.0
.data.rel.ro 649248 649248 0 0.0
.dynamic 560 560 0 0.0
.got 13816 13816 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 498076 498076 0 0.0
.text 8150628 8150628 0 0.0
lighting-app debug+rpc (read only) 2596953 2596953 0 0.0
(read/write) 130176 130176 0 0.0
.bss 49760 49760 0 0.0
.data 2096 2096 0 0.0
.data.rel.ro 72360 72360 0 0.0
.dynamic 608 608 0 0.0
.got 4392 4392 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 220208 220208 0 0.0
.text 2206034 2206034 0 0.0
lock-app debug (read only) 2580737 2580737 0 0.0
(read/write) 125512 125512 0 0.0
.bss 48288 48288 0 0.0
.data 1712 1712 0 0.0
.data.rel.ro 69512 69512 0 0.0
.dynamic 608 608 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 896 896 0 0.0
.rodata 237264 237264 0 0.0
.text 2176818 2176818 0 0.0
ota-provider-app debug (read only) 2357897 2357897 0 0.0
(read/write) 118976 118976 0 0.0
.bss 47808 47808 0 0.0
.data 1936 1936 0 0.0
.data.rel.ro 63336 63336 0 0.0
.dynamic 608 608 0 0.0
.got 4488 4488 0 0.0
.init 27 27 0 0.0
.init_array 760 760 0 0.0
.rodata 209240 209240 0 0.0
.text 1985186 1985186 0 0.0
ota-requestor-app debug (read only) 2523033 2523033 0 0.0
(read/write) 127320 127320 0 0.0
.bss 50336 50336 0 0.0
.data 2304 2304 0 0.0
.data.rel.ro 68728 68728 0 0.0
.dynamic 608 608 0 0.0
.got 4480 4480 0 0.0
.init 27 27 0 0.0
.init_array 848 848 0 0.0
.rodata 216000 216000 0 0.0
.text 2134466 2134466 0 0.0
shell debug (read only) 2602561 2602561 0 0.0
(read/write) 142040 142040 0 0.0
.bss 57800 57800 0 0.0
.data 1264 1264 0 0.0
.data.rel.ro 77160 77160 0 0.0
.dynamic 608 608 0 0.0
.got 4136 4136 0 0.0
.init 27 27 0 0.0
.init_array 1032 1032 0 0.0
.rodata 234546 234546 0 0.0
.text 2209666 2209666 0 0.0
thermostat-no-ble arm64 (read only) 2357076 2357076 0 0.0
(read/write) 141825 141825 0 0.0
.bss 55345 55345 0 0.0
.data 1672 1672 0 0.0
.data.rel.ro 75984 75984 0 0.0
.dynamic 560 560 0 0.0
.got 5048 5048 0 0.0
.init 24 24 0 0.0
.init_array 408 408 0 0.0
.rodata 140524 140524 0 0.0
.text 1978832 1978832 0 0.0
tv-app debug (read only) 3175241 3175241 0 0.0
(read/write) 257968 257968 0 0.0
.bss 167480 167480 0 0.0
.data 4736 4736 0 0.0
.data.rel.ro 79184 79184 0 0.0
.dynamic 608 608 0 0.0
.got 4856 4856 0 0.0
.init 27 27 0 0.0
.init_array 1072 1072 0 0.0
.rodata 258952 258952 0 0.0
.text 2726546 2726546 0 0.0
tv-casting-app debug (read only) 5455233 5455233 0 0.0
(read/write) 160048 160048 0 0.0
.bss 51448 51448 0 0.0
.data 2432 2432 0 0.0
.data.rel.ro 99736 99736 0 0.0
.dynamic 608 608 0 0.0
.got 4776 4776 0 0.0
.init 27 27 0 0.0
.init_array 1040 1040 0 0.0
.rodata 343217 343217 0 0.0
.text 4841362 4841362 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2454328 2454328 0 0.0
.bss 215076 215076 0 0.0
.data 5872 5872 0 0.0
.text 1416972 1416972 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1180099 1180099 0 0.0
bss 143759 143759 0 0.0
rodata 143268 143268 0 0.0
text 814128 814128 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 (read/write) 1159975 1159975 0 0.0
bss 142996 142996 0 0.0
rodata 134944 134944 0 0.0
text 803112 803116 4 0.0
p6 all-clusters-app default (read only) 842104 842104 0 0.0
(read/write) 1739044 1739044 0 0.0
.bss 188584 188584 0 0.0
.data 2656 2656 0 0.0
.text 1539416 1539416 0 0.0
all-clusters-minimal-app default (read only) 842824 842824 0 0.0
(read/write) 1683052 1683052 0 0.0
.bss 187864 187864 0 0.0
.data 2656 2656 0 0.0
.text 1484144 1484144 0 0.0
light-app default (read only) 851168 851168 0 0.0
(read/write) 1600340 1600340 0 0.0
.bss 179728 179728 0 0.0
.data 2448 2448 0 0.0
.text 1409776 1409776 0 0.0
lock-app default (read only) 846136 846136 0 0.0
(read/write) 1638060 1638060 0 0.0
.bss 184744 184744 0 0.0
.data 2464 2464 0 0.0
.text 1442464 1442464 0 0.0
telink light-switch-app tlsr9518adk80d (read/write) 808824 808824 0 0.0
bss 71480 71480 0 0.0
noinit 43488 43488 0 0.0
text 571366 571366 0 0.0
lighting-app tlsr9518adk80d (read/write) 830792 830792 0 0.0
bss 72336 72336 0 0.0
noinit 43488 43488 0 0.0
text 589490 589490 0 0.0

Copy link
Contributor

@turon turon left a comment

Choose a reason for hiding this comment

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

Adding optionality for file or direct string input really improves the user experience of the tool. Thanks! 👍

res = OpenFile(fileName, file);
VerifyTrueOrExit(res);

if (PEM_read_X509(file, &cert, nullptr, nullptr) == nullptr)
Copy link
Contributor

Choose a reason for hiding this comment

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

How is PEM support preserved with this update?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All various certificate formats are handled by the ReadCert() call. I believe there was some historical redundancy in this code...

@turon turon added the chip-cert Related to `src/tools/chip-cert` tool and generating / printing certificates. label Sep 9, 2022
@andy31415 andy31415 merged commit 97e0e07 into project-chip:sve-2 Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chip-cert Related to `src/tools/chip-cert` tool and generating / printing certificates. sve cherry pick tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants