diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..81672ab --- /dev/null +++ b/.dockerignore @@ -0,0 +1,28 @@ +### Rust template +# Generated by Cargo +# will have compiled files and executables +bt2x/target +tuf-no-std/target +bt2x-embassy-std/target +bt2x-pi-pico/target +bt2x-pi-pico-w/target +bt2x-embedded-ffi/target + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + +### OTHERS +.env +dockerfiles +benchmark-output +__pycache__ +builds + +**/target/ \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a5874fb --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +.env +.direnv +*.log +.DS_Store + +bt2x/out +*.pem +bt2x-pi-pico-w/target/ + +.idea + +builds +bt2x/bt2x-embedded/dhat-heap.json + +out/* +build/* +bt2x-embassy-std/flash-test +bt2x-embassy-std/target/** +benchmark-output/old +benchmark-output/big-bin +benchmark-output/small-bin + +__pycache__ + +# drawio +**/*.bkp + +**/bundle.json +**/*cdx.json +**/*cdx.xml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..91019be --- /dev/null +++ b/.gitmodules @@ -0,0 +1,2 @@ +[submodule "sigstore-rs/"] + branch = development diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..4052ad4 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2024 Fraunhofer AISEC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:35:36.205608.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:35:36.205608.json new file mode 100644 index 0000000..5889b0a --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:35:36.205608.json @@ -0,0 +1 @@ +{"start_time":4465966,"end_time":20834022,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":102425000},"update_repo":{"secs":4,"nanos":523183000},"fetch_signature":{"secs":0,"nanos":22865000},"fetch_binary":{"secs":3,"nanos":164874000},"verify_binary":{"secs":2,"nanos":917344000},"verify_binary_naive":{"secs":0,"nanos":959270000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:36:34.252069.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:36:34.252069.json new file mode 100644 index 0000000..2151401 --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:36:34.252069.json @@ -0,0 +1 @@ +{"start_time":4444768,"end_time":20806117,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":84317000},"update_repo":{"secs":3,"nanos":807983000},"fetch_signature":{"secs":0,"nanos":22856000},"fetch_binary":{"secs":3,"nanos":917526000},"verify_binary":{"secs":2,"nanos":917303000},"verify_binary_naive":{"secs":0,"nanos":959269000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:37:32.228433.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:37:32.228433.json new file mode 100644 index 0000000..d48560e --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:37:32.228433.json @@ -0,0 +1 @@ +{"start_time":4402070,"end_time":20845265,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":83086000},"update_repo":{"secs":3,"nanos":807324000},"fetch_signature":{"secs":0,"nanos":21826000},"fetch_binary":{"secs":3,"nanos":982387000},"verify_binary":{"secs":2,"nanos":917252000},"verify_binary_naive":{"secs":0,"nanos":959313000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:38:31.502479.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:38:31.502479.json new file mode 100644 index 0000000..d537860 --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:38:31.502479.json @@ -0,0 +1 @@ +{"start_time":4390670,"end_time":22059284,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":88121000},"update_repo":{"secs":5,"nanos":37039000},"fetch_signature":{"secs":0,"nanos":24942000},"fetch_binary":{"secs":3,"nanos":970556000},"verify_binary":{"secs":2,"nanos":917266000},"verify_binary_naive":{"secs":0,"nanos":959299000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:39:29.665462.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:39:29.665462.json new file mode 100644 index 0000000..0d60f70 --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:39:29.665462.json @@ -0,0 +1 @@ +{"start_time":4427670,"end_time":20984372,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":84520000},"update_repo":{"secs":3,"nanos":807121000},"fetch_signature":{"secs":0,"nanos":24121000},"fetch_binary":{"secs":4,"nanos":101730000},"verify_binary":{"secs":2,"nanos":917237000},"verify_binary_naive":{"secs":0,"nanos":959305000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:40:27.522857.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:40:27.522857.json new file mode 100644 index 0000000..cdf84a5 --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:40:27.522857.json @@ -0,0 +1 @@ +{"start_time":4456773,"end_time":20714163,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":91508000},"update_repo":{"secs":3,"nanos":807737000},"fetch_signature":{"secs":0,"nanos":26469000},"fetch_binary":{"secs":3,"nanos":815230000},"verify_binary":{"secs":2,"nanos":917236000},"verify_binary_naive":{"secs":0,"nanos":959288000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:41:24.866985.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:41:24.866985.json new file mode 100644 index 0000000..a8651fb --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:41:24.866985.json @@ -0,0 +1 @@ +{"start_time":4426389,"end_time":20160179,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":80266000},"update_repo":{"secs":3,"nanos":810441000},"fetch_signature":{"secs":0,"nanos":24482000},"fetch_binary":{"secs":3,"nanos":296001000},"verify_binary":{"secs":2,"nanos":917296000},"verify_binary_naive":{"secs":0,"nanos":959284000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:42:22.826663.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:42:22.826663.json new file mode 100644 index 0000000..9a30d2e --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:42:22.826663.json @@ -0,0 +1 @@ +{"start_time":4412553,"end_time":20839687,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":119372000},"update_repo":{"secs":3,"nanos":776809000},"fetch_signature":{"secs":0,"nanos":25394000},"fetch_binary":{"secs":3,"nanos":985124000},"verify_binary":{"secs":2,"nanos":917301000},"verify_binary_naive":{"secs":0,"nanos":959282000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:43:21.808797.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:43:21.808797.json new file mode 100644 index 0000000..a208bc6 --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:43:21.808797.json @@ -0,0 +1 @@ +{"start_time":4397345,"end_time":21762577,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":82187000},"update_repo":{"secs":4,"nanos":833429000},"fetch_signature":{"secs":0,"nanos":23958000},"fetch_binary":{"secs":3,"nanos":886587000},"verify_binary":{"secs":2,"nanos":917324000},"verify_binary_naive":{"secs":0,"nanos":959327000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:44:19.972532.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:44:19.972532.json new file mode 100644 index 0000000..b5f6071 --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:44:19.972532.json @@ -0,0 +1 @@ +{"start_time":4481476,"end_time":20918107,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":80303000},"update_repo":{"secs":3,"nanos":811410000},"fetch_signature":{"secs":0,"nanos":22018000},"fetch_binary":{"secs":3,"nanos":988224000},"verify_binary":{"secs":2,"nanos":917281000},"verify_binary_naive":{"secs":0,"nanos":959305000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:45:18.033419.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:45:18.033419.json new file mode 100644 index 0000000..a398e0d --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:45:18.033419.json @@ -0,0 +1 @@ +{"start_time":4424461,"end_time":20883436,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":91739000},"update_repo":{"secs":3,"nanos":810141000},"fetch_signature":{"secs":0,"nanos":24881000},"fetch_binary":{"secs":3,"nanos":970374000},"verify_binary":{"secs":2,"nanos":917278000},"verify_binary_naive":{"secs":0,"nanos":959295000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:46:16.094788.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:46:16.094788.json new file mode 100644 index 0000000..3c47c21 --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:46:16.094788.json @@ -0,0 +1 @@ +{"start_time":4475068,"end_time":20821419,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":119647000},"update_repo":{"secs":3,"nanos":776583000},"fetch_signature":{"secs":0,"nanos":24454000},"fetch_binary":{"secs":3,"nanos":891913000},"verify_binary":{"secs":2,"nanos":917278000},"verify_binary_naive":{"secs":0,"nanos":959254000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:47:14.155796.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:47:14.155796.json new file mode 100644 index 0000000..d425ce9 --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:47:14.155796.json @@ -0,0 +1 @@ +{"start_time":4451024,"end_time":20859574,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":83227000},"update_repo":{"secs":3,"nanos":808541000},"fetch_signature":{"secs":0,"nanos":23603000},"fetch_binary":{"secs":3,"nanos":955470000},"verify_binary":{"secs":2,"nanos":917308000},"verify_binary_naive":{"secs":0,"nanos":959277000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:48:12.217400.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:48:12.217400.json new file mode 100644 index 0000000..6c58492 --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:48:12.217400.json @@ -0,0 +1 @@ +{"start_time":4451544,"end_time":20857826,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":88728000},"update_repo":{"secs":3,"nanos":811129000},"fetch_signature":{"secs":0,"nanos":26185000},"fetch_binary":{"secs":3,"nanos":933758000},"verify_binary":{"secs":2,"nanos":917359000},"verify_binary_naive":{"secs":0,"nanos":959273000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:49:10.278672.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:49:10.278672.json new file mode 100644 index 0000000..f957523 --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:49:10.278672.json @@ -0,0 +1 @@ +{"start_time":4486655,"end_time":20859733,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":73763000},"update_repo":{"secs":3,"nanos":818224000},"fetch_signature":{"secs":0,"nanos":22330000},"fetch_binary":{"secs":3,"nanos":906519000},"verify_binary":{"secs":2,"nanos":917177000},"verify_binary_naive":{"secs":0,"nanos":959329000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:50:08.440536.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:50:08.440536.json new file mode 100644 index 0000000..ce12fbc --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:50:08.440536.json @@ -0,0 +1 @@ +{"start_time":4429037,"end_time":20864129,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":83634000},"update_repo":{"secs":3,"nanos":813296000},"fetch_signature":{"secs":0,"nanos":24058000},"fetch_binary":{"secs":3,"nanos":948885000},"verify_binary":{"secs":2,"nanos":917345000},"verify_binary_naive":{"secs":0,"nanos":959325000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:51:06.503707.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:51:06.503707.json new file mode 100644 index 0000000..af9deb3 --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:51:06.503707.json @@ -0,0 +1 @@ +{"start_time":4455417,"end_time":20783324,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":50558000},"update_repo":{"secs":3,"nanos":810884000},"fetch_signature":{"secs":0,"nanos":23444000},"fetch_binary":{"secs":3,"nanos":890586000},"verify_binary":{"secs":2,"nanos":917240000},"verify_binary_naive":{"secs":0,"nanos":959335000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:52:04.667937.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:52:04.667937.json new file mode 100644 index 0000000..bbe7dab --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:52:04.667937.json @@ -0,0 +1 @@ +{"start_time":4439676,"end_time":20904479,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":104842000},"update_repo":{"secs":3,"nanos":791111000},"fetch_signature":{"secs":0,"nanos":32545000},"fetch_binary":{"secs":3,"nanos":971766000},"verify_binary":{"secs":2,"nanos":917343000},"verify_binary_naive":{"secs":0,"nanos":959246000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:53:02.554193.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:53:02.554193.json new file mode 100644 index 0000000..1ac19d1 --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:53:02.554193.json @@ -0,0 +1 @@ +{"start_time":4450672,"end_time":20714495,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":84104000},"update_repo":{"secs":3,"nanos":812654000},"fetch_signature":{"secs":0,"nanos":27560000},"fetch_binary":{"secs":3,"nanos":777314000},"verify_binary":{"secs":2,"nanos":917326000},"verify_binary_naive":{"secs":0,"nanos":959237000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:53:59.971332.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:53:59.971332.json new file mode 100644 index 0000000..8e51fef --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:53:59.971332.json @@ -0,0 +1 @@ +{"start_time":4446863,"end_time":20186328,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":84252000},"update_repo":{"secs":3,"nanos":811797000},"fetch_signature":{"secs":0,"nanos":23274000},"fetch_binary":{"secs":3,"nanos":279902000},"verify_binary":{"secs":2,"nanos":917262000},"verify_binary_naive":{"secs":0,"nanos":959300000}} \ No newline at end of file diff --git a/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:54:58.135862.json b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:54:58.135862.json new file mode 100644 index 0000000..7e11828 --- /dev/null +++ b/benchmark-output/benchmark-levels/performance-benchmark-2024-08-23 11:54:58.135862.json @@ -0,0 +1 @@ +{"start_time":4478266,"end_time":20936361,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":53450000},"update_repo":{"secs":3,"nanos":812247000},"fetch_signature":{"secs":0,"nanos":22467000},"fetch_binary":{"secs":4,"nanos":12975000},"verify_binary":{"secs":2,"nanos":917343000},"verify_binary_naive":{"secs":0,"nanos":959267000}} \ No newline at end of file diff --git a/benchmark-output/benchmarks-size.json b/benchmark-output/benchmarks-size.json new file mode 100644 index 0000000..33f24ef --- /dev/null +++ b/benchmark-output/benchmarks-size.json @@ -0,0 +1 @@ +{"benchmark-code-size-full": {"raw_size": 266928, "cargo_bloat": {"file-size": 2393100, "text-section-size": 238104, "functions": [{"crate": "benchmark_code_size_full", "name": "benchmark_code_size_full::____embassy_main_task::{{closure}}", "size": 37328}, {"crate": "bt4ot_embedded", "name": "der::reader::Reader::read_nested", "size": 13240}, {"crate": "tuf_no_std", "name": "der::decode::Decode::from_der", "size": 9836}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::ethernet::::process_ethernet", "size": 9676}, {"crate": "tuf_no_std", "name": "::decode_role", "size": 9136}, {"crate": "tuf_no_std", "name": "::decode_role", "size": 7860}, {"crate": "tuf_no_std", "name": " as tuf_no_std::role::root::TufRoot>::role_keys", "size": 5868}, {"crate": "p256", "name": "::mul", "size": 5526}, {"crate": "embassy_executor", "name": "embassy_executor::raw::TaskStorage::poll", "size": 5452}, {"crate": "tuf_no_std", "name": "::decode_role", "size": 4424}, {"crate": "cyw43", "name": "cyw43::runner::Runner::check_status::{{closure}}", "size": 4320}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::dispatch_ip", "size": 4264}, {"crate": "bt4ot_embedded", "name": "der::reader::Reader::decode", "size": 3884}, {"crate": "sha2", "name": "sha2::sha256::compress256", "size": 3440}, {"crate": "embassy_executor", "name": "embassy_executor::raw::TaskStorage::poll", "size": 2528}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::fe_mul", "size": 2422}, {"crate": "pem_rfc7468", "name": "pem_rfc7468::decoder::decode", "size": 1996}, {"crate": "bt4ot_embedded", "name": "bt4ot_embedded::verify_signature", "size": 1792}, {"crate": "tuf_no_std", "name": " as tuf_no_std::role::root::TufRoot>::verify_signature", "size": 1712}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::montgomery_reduce", "size": 1670}, {"crate": "pem_rfc7468", "name": "::decode", "size": 1596}, {"crate": "pem_rfc7468", "name": "base64ct::decoder::Decoder::perform_decode", "size": 1556}, {"crate": "std", "name": "core::fmt::Formatter::pad", "size": 1536}, {"crate": "bt4ot_embedded", "name": "der::reader::Reader::decode", "size": 1488}, {"crate": "spki", "name": "spki::algorithm::AlgorithmIdentifier::assert_oids", "size": 1294}, {"crate": "tuf_no_std", "name": "tuf_no_std::fetch_and_verify_target_file_async::{{closure}}", "size": 1244}, {"crate": "pkcs8", "name": "der::reader::Reader::decode", "size": 1184}, {"crate": "bt4ot_ota_common", "name": "bt4ot_ota_common::fetch_file::{{closure}}", "size": 1148}, {"crate": "tuf_no_std", "name": "tuf_no_std::role::root::::encode_canonically", "size": 1090}, {"crate": "std", "name": "core::char::methods::::escape_debug_ext", "size": 1020}, {"crate": "tuf_no_std_der", "name": " as core::convert::TryFrom>>::try_from", "size": 1016}, {"crate": "tuf_no_std", "name": "der::reader::Reader::decode", "size": 960}, {"crate": "std", "name": "compiler_builtins::int::specialized_div_rem::u64_div_rem", "size": 938}, {"crate": "embassy_embedded_hal?", "name": " as embedded_storage::nor_flash::NorFlash>::write", "size": 828}, {"crate": "der", "name": "der::datetime::DateTime::from_unix_duration", "size": 820}, {"crate": "std", "name": "compiler_builtins::mem::memmove", "size": 788}, {"crate": "bt4ot_embedded", "name": "der::asn1::optional::>::der_cmp", "size": 778}, {"crate": "bt4ot_ota_common", "name": "bt4ot_ota_common::net::Transport::fetch_role::{{closure}}", "size": 776}, {"crate": "smoltcp", "name": "smoltcp::socket::dhcpv4::Socket::parse_ack", "size": 728}, {"crate": "std", "name": "core::str::slice_error_fail_rt", "size": 668}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::Interface::poll_at::{{closure}}", "size": 650}, {"crate": "der", "name": "der::datetime::DateTime::new", "size": 648}, {"crate": "bt4ot_embedded", "name": "bt4ot_embedded::parse_cert", "size": 632}, {"crate": "der?", "name": "::fmt", "size": 612}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 608}, {"crate": "std", "name": "::write_str", "size": 604}, {"crate": "embassy_net", "name": "embassy_net::tcp::embedded_io_impls::::write::{{closure}}", "size": 584}, {"crate": "tuf_no_std_common", "name": ">::add", "size": 560}, {"crate": "std", "name": "core::str::converts::from_utf8", "size": 552}, {"crate": "embassy_net", "name": "embassy_net::tcp::TcpSocket::connect::{{closure}}", "size": 552}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Repr::emit", "size": 544}, {"crate": "embassy_net", "name": "embassy_net::tcp::embedded_io_impls::::read::{{closure}}", "size": 532}, {"crate": "tuf_no_std", "name": "tuf_no_std_common::crypto::verify_sha256_impl", "size": 528}, {"crate": "tuf_no_std", "name": "der::reader::Reader::decode", "size": 524}, {"crate": "tuf_no_std_common", "name": " as core::ops::arith::Mul>::mul", "size": 512}, {"crate": "bt4ot_embedded", "name": "primeorder::projective::ProjectivePoint::mul", "size": 512}, {"crate": "smoltcp", "name": "smoltcp::wire::arp::Repr::emit", "size": 500}, {"crate": "p256", "name": "p256::arithmetic::scalar::scalar_impl::subtract_n_if_necessary", "size": 488}, {"crate": "der", "name": "::decode", "size": 484}, {"crate": "std", "name": "core::fmt::Formatter::pad_integral", "size": 478}, {"crate": "bt4ot_embedded", "name": "der::asn1::context_specific::ContextSpecific::decode_implicit", "size": 476}, {"crate": "der", "name": "<&T as core::fmt::Display>::fmt", "size": 472}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::sub_inner", "size": 464}, {"crate": "x509_cert", "name": "::decode", "size": 456}, {"crate": "x509_cert", "name": "::decode", "size": 456}, {"crate": "x509_cert", "name": "::decode", "size": 456}, {"crate": "tuf_no_std", "name": "::decode", "size": 456}, {"crate": "tuf_no_std", "name": "::decode", "size": 456}, {"crate": "tuf_no_std", "name": "::decode", "size": 456}, {"crate": "tuf_no_std", "name": "::decode", "size": 456}, {"crate": "tuf_no_std", "name": "::decode", "size": 456}, {"crate": "tuf_no_std", "name": "::decode", "size": 456}, {"crate": "pkcs8", "name": "::decode", "size": 456}, {"crate": "pkcs8", "name": "::decode", "size": 456}, {"crate": "bt4ot_embedded", "name": "::encode", "size": 456}, {"crate": "bt4ot_embedded", "name": ">::double", "size": 448}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 440}, {"crate": "std", "name": "core::fmt::num::::fmt", "size": 440}, {"crate": "serde_json_core?", "name": "<&mut serde_json_core::de::Deserializer as serde::de::Deserializer>::deserialize_ignored_any", "size": 438}, {"crate": "bt4ot_embedded", "name": "::encode", "size": 436}, {"crate": "cyw43", "name": "cyw43::runner::Runner::core_reset::{{closure}}", "size": 428}, {"crate": "embassy_net", "name": "embassy_net::Inner::apply_static_config", "size": 428}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::TcpOption::emit", "size": 412}, {"crate": "cyw43_pio?", "name": " as cyw43::bus::SpiBusCyw43>::cmd_read::{{closure}}", "size": 408}, {"crate": "cyw43", "name": "cyw43::runner::Runner::core_disable::{{closure}}", "size": 400}, {"crate": "embassy_executor", "name": "embassy_executor::arch::thread::Executor::run", "size": 400}, {"crate": "cyw43", "name": "cyw43::control::Control::set_iovar::{{closure}}", "size": 396}, {"crate": "std", "name": "compiler_builtins::int::specialized_div_rem::u32_div_rem", "size": 392}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_write::{{closure}}", "size": 384}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_read::{{closure}}", "size": 376}, {"crate": "embassy_net", "name": "embassy_net::tcp::TcpSocket::new", "size": 360}, {"crate": "cyw43_pio?", "name": " as cyw43::bus::SpiBusCyw43>::cmd_write::{{closure}}", "size": 352}, {"crate": "cyw43", "name": "cyw43::runner::Runner::handle_irq::{{closure}}", "size": 344}, {"crate": "p256", "name": "::invert", "size": 340}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::fe_add", "size": 340}, {"crate": "std", "name": "compiler_builtins::mem::memcpy", "size": 334}, {"crate": "const_oid", "name": "const_oid::arcs::Arcs::try_next", "size": 332}, {"crate": "std", "name": "core::fmt::write", "size": 330}, {"crate": "der", "name": ">::try_from", "size": 324}, {"crate": "std", "name": "core::fmt::builders::DebugStruct::field", "size": 324}, {"crate": "bt4ot_embedded", "name": " as der::encode::EncodeValue>::encode_value", "size": 320}, {"crate": "tuf_no_std", "name": "der::reader::Reader::decode", "size": 318}, {"crate": "ecdsa", "name": "::decode", "size": 312}, {"crate": "tuf_no_std", "name": "::encode", "size": 308}, {"crate": "x509_cert", "name": "der::reader::Reader::decode", "size": 304}, {"crate": "p256", "name": "::invert_vartime", "size": 304}, {"crate": "x509_cert", "name": " as der::reader::Reader>::read_into", "size": 298}, {"crate": "cyw43", "name": "cyw43::control::Control::get_iovar::{{closure}}", "size": 292}, {"crate": "cyw43", "name": "cyw43::bus::Bus::backplane_set_window::{{closure}}", "size": 288}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::ack_reply", "size": 280}, {"crate": "tuf_no_std", "name": "::decode", "size": 276}, {"crate": "pkcs8", "name": "<[T] as core::fmt::Debug>::fmt", "size": 276}, {"crate": "cyw43", "name": "cyw43::control::Control::ioctl::{{closure}}", "size": 272}, {"crate": "tuf_no_std", "name": "der::reader::Reader::decode", "size": 264}, {"crate": "tuf_no_std_der", "name": "::value_len", "size": 260}, {"crate": "tuf_no_std", "name": "heapless::indexmap::IndexMap::swap_remove", "size": 260}, {"crate": "std", "name": "core::unicode::printable::check", "size": 260}, {"crate": "tuf_no_std_der", "name": " as elliptic_curve::point::DecompressPoint>::decompress", "size": 256}, {"crate": "smoltcp", "name": "<&T as core::fmt::Display>::fmt", "size": 256}, {"crate": "bt4ot_embedded", "name": "der::asn1::optional::>::encode", "size": 254}, {"crate": "std", "name": "core::fmt::builders::DebugTuple::field", "size": 252}, {"crate": "std", "name": "core::ptr::drop_in_place>", "size": 248}, {"crate": "pio", "name": "pio::InstructionOperands::encode", "size": 244}, {"crate": "p256", "name": "::sqrt", "size": 244}, {"crate": "std", "name": "core::fmt::num::imp::::fmt", "size": 244}, {"crate": "tuf_no_std_der", "name": "::value_len", "size": 238}, {"crate": "tuf_no_std", "name": "der::reader::Reader::decode", "size": 238}, {"crate": "sha2", "name": "sha2::sha256::soft::schedule", "size": 238}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 236}, {"crate": "tuf_no_std", "name": "::encode", "size": 232}, {"crate": "der", "name": "::der_cmp", "size": 232}, {"crate": "cyw43", "name": "cyw43::bus::Bus::wlan_write::{{closure}}", "size": 232}, {"crate": "sha2", "name": "sha2::sha256::soft::sha256_digest_round_x2", "size": 230}, {"crate": "cyw43", "name": "cyw43::bus::Bus::wait_for_event::{{closure}}", "size": 224}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::reset", "size": 222}, {"crate": "tuf_no_std_common", "name": "::encode", "size": 220}, {"crate": "spki", "name": "::write", "size": 220}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::is_broadcast_v4", "size": 220}, {"crate": "smoltcp", "name": "smoltcp::iface::route::Routes::lookup", "size": 220}, {"crate": "tuf_no_std_der", "name": "::value_len", "size": 218}, {"crate": "tuf_no_std", "name": "::decode", "size": 218}, {"crate": "embassy_embedded_hal?", "name": " as embedded_storage::nor_flash::NorFlash>::erase", "size": 216}, {"crate": "smoltcp", "name": "smoltcp::iface::route::Routes::remove_default_ipv4_route", "size": 204}, {"crate": "der", "name": "der::asn1::utc_time::UtcTime::from_unix_duration", "size": 204}, {"crate": "const_oid?", "name": "::fmt", "size": 204}, {"crate": "cyw43", "name": "cyw43::control::Control::set_iovar_u32x2::{{closure}}", "size": 204}, {"crate": "smoltcp", "name": "heapless::linear_map::LinearMap::insert", "size": 196}, {"crate": "cyw43", "name": "cyw43::bus::Bus::readn::{{closure}}", "size": 196}, {"crate": "embassy_net", "name": "embassy_net::tcp::embedded_io_impls::::flush::{{closure}}", "size": 196}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::rst_reply", "size": 190}, {"crate": "p256", "name": "::add_assign", "size": 188}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::ipv4::::icmpv4_reply", "size": 186}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Repr::parse", "size": 184}, {"crate": "serde_json_core", "name": "serde_json_core::de::Deserializer::parse_str", "size": 184}, {"crate": "cyw43", "name": "cyw43::bus::Bus::backplane_writen::{{closure}}", "size": 184}, {"crate": "base64ct", "name": "::next", "size": 182}, {"crate": "tuf_no_std", "name": "<&T as core::fmt::Debug>::fmt", "size": 180}, {"crate": "tuf_no_std", "name": " as der::encode::EncodeValue>::value_len", "size": 180}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::seq_to_transmit", "size": 180}, {"crate": "bt4ot_embedded", "name": " as der::encode::EncodeValue>::value_len", "size": 180}, {"crate": "tuf_no_std_der", "name": " as der::encode::EncodeValue>::value_len", "size": 176}, {"crate": "bt4ot_embedded", "name": " as der::encode::EncodeValue>::value_len", "size": 176}, {"crate": "bt4ot_embedded", "name": " as der::encode::EncodeValue>::value_len", "size": 176}, {"crate": "embassy_rp", "name": "embassy_rp::pio::Common::try_load_program_at", "size": 176}, {"crate": "tuf_no_std_der", "name": " as der::encode::EncodeValue>::value_len", "size": 174}, {"crate": "std", "name": "core::cmp::PartialEq::ne", "size": 172}, {"crate": "bt4ot_embedded", "name": "::value_len", "size": 172}, {"crate": "tuf_no_std_der", "name": "::value_len", "size": 168}, {"crate": "std", "name": "core::cmp::impls:: for &A>::lt", "size": 168}, {"crate": "tuf_no_std", "name": "<(U,T) as core::fmt::Debug>::fmt", "size": 168}, {"crate": "const_oid", "name": "<&T as core::fmt::Display>::fmt", "size": 168}, {"crate": "cyw43", "name": "cyw43::bus::Bus::backplane_readn::{{closure}}", "size": 168}, {"crate": "der", "name": "::read_slice", "size": 166}, {"crate": "std", "name": "compiler_builtins::mem::memset", "size": 160}, {"crate": "smoltcp", "name": "smoltcp::iface::socket_set::SocketSet::add::put", "size": 158}, {"crate": "tuf_no_std_der", "name": " as der::encode::EncodeValue>::value_len", "size": 156}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::enqueue_many", "size": 156}, {"crate": "tuf_no_std_der", "name": " as der::encode::EncodeValue>::value_len", "size": 152}, {"crate": "smoltcp", "name": "smoltcp::wire::ip::checksum::data", "size": 152}, {"crate": "panic_probe", "name": "<&T as core::fmt::Display>::fmt", "size": 152}, {"crate": "der", "name": "der::tag::Tag::octet", "size": 152}, {"crate": "std", "name": "core::panicking::assert_failed_inner", "size": 152}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::Interface::socket_egress::{{closure}}", "size": 152}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 152}, {"crate": "tuf_no_std_der", "name": " as der::encode::EncodeValue>::value_len", "size": 150}, {"crate": "tuf_no_std_der", "name": " as der::encode::EncodeValue>::value_len", "size": 148}, {"crate": "smoltcp", "name": "smoltcp::iface::neighbor::Cache::lookup", "size": 148}, {"crate": "pkcs8", "name": "::encode", "size": 148}, {"crate": "embassy_net", "name": "::drop", "size": 148}, {"crate": "der", "name": "::encode", "size": 148}, {"crate": "cyw43", "name": "cyw43::bus::Bus::writen::{{closure}}", "size": 148}, {"crate": "tuf_no_std_der", "name": "::value_len", "size": 146}, {"crate": "tuf_no_std", "name": "heapless::indexmap::IndexMap::find", "size": 146}, {"crate": "tuf_no_std", "name": "der::reader::Reader::decode", "size": 146}, {"crate": "tuf_no_std_der", "name": "::value_len", "size": 144}, {"crate": "tuf_no_std_common", "name": "<&T as core::fmt::Debug>::fmt", "size": 144}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::next_header", "size": 144}, {"crate": "std", "name": "core::fmt::Formatter::debug_tuple_field1_finish", "size": 144}, {"crate": "const_oid", "name": "const_oid::ObjectIdentifier::from_bytes", "size": 144}, {"crate": "bt4ot_embedded", "name": "::value_len", "size": 144}, {"crate": "bt4ot_embedded", "name": "<&T as core::fmt::Debug>::fmt", "size": 144}, {"crate": "spki?", "name": "::fmt", "size": 140}, {"crate": "defmt_rtt", "name": "_defmt_write", "size": 140}, {"crate": "sec1?", "name": "::fmt", "size": 136}, {"crate": "p256", "name": ">::sub_assign", "size": 136}, {"crate": "der", "name": "::fmt", "size": 136}, {"crate": "sec1?", "name": "::fmt", "size": 136}, {"crate": "cyw43", "name": "cyw43::bus::Bus::write32_swapped::{{closure}}", "size": 136}, {"crate": "tuf_no_std", "name": "::encode", "size": 134}, {"crate": "pkcs8", "name": "::decode_value", "size": 132}, {"crate": "pkcs8", "name": "::decode_value", "size": 132}, {"crate": "embassy_rp", "name": "_embassy_time_set_alarm", "size": 132}, {"crate": "cyw43", "name": "cyw43::bus::Bus::read32_swapped::{{closure}}", "size": 132}, {"crate": "embedded_io_async", "name": "embedded_io_async::Read::read_exact::{{closure}}", "size": 132}, {"crate": "embassy_rp", "name": "embassy_rp::flash::ram_helpers::flash_function_pointers_with_boot2", "size": 128}, {"crate": "std", "name": "core::fmt::Formatter::debug_struct_field2_finish", "size": 128}, {"crate": "defmt", "name": "core::fmt::Write::write_char", "size": 126}, {"crate": "tuf_no_std_common", "name": ">::eq", "size": 124}, {"crate": "panic_probe", "name": "rust_begin_unwind", "size": 124}, {"crate": "cyw43", "name": "cyw43::control::Control::gpio_set::{{closure}}", "size": 124}, {"crate": "std", "name": "__divmoddi4", "size": 122}, {"crate": "tuf_no_std", "name": "::decode", "size": 122}, {"crate": "pkcs8", "name": "::decode", "size": 122}, {"crate": "smoltcp", "name": "smoltcp::wire::dhcpv4::Repr::buffer_len", "size": 120}, {"crate": "embassy_net", "name": "smoltcp::iface::socket_set::SocketSet::get_mut", "size": 120}, {"crate": "std", "name": "core::fmt::num::::fmt", "size": 120}, {"crate": "std", "name": "core::fmt::num::::fmt", "size": 120}, {"crate": "std", "name": "core::fmt::num::imp::::fmt", "size": 120}, {"crate": "smoltcp", "name": "smoltcp::iface::socket_set::SocketSet::get_mut", "size": 120}, {"crate": "x509_cert", "name": "::value_len", "size": 118}, {"crate": "heapless?", "name": " as core::iter::traits::iterator::Iterator>::next", "size": 118}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::fill_checksum", "size": 116}, {"crate": "embassy_rp", "name": "IO_IRQ_BANK0", "size": 116}, {"crate": "std", "name": "core::fmt::Formatter::debug_struct_field1_finish", "size": 116}, {"crate": "tuf_no_std", "name": "::encode", "size": 114}, {"crate": "tuf_no_std_common", "name": "<&T as core::fmt::Debug>::fmt", "size": 112}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::fe_sub", "size": 112}, {"crate": "der", "name": "::write", "size": 112}, {"crate": "der", "name": "der::asn1::integer::uint::decode_to_array", "size": 112}, {"crate": "der", "name": "der::asn1::integer::uint::decode_to_array", "size": 112}, {"crate": "bt4ot_embedded", "name": "<&T as core::fmt::Debug>::fmt", "size": 112}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memcpy4", "size": 110}, {"crate": "tuf_no_std", "name": "der::reader::nested::NestedReader::advance_position", "size": 110}, {"crate": "pkcs8", "name": "::encode", "size": 110}, {"crate": "bt4ot_embedded", "name": "der::datetime::encode_decimal", "size": 110}, {"crate": "tuf_no_std", "name": "der::reader::nested::NestedReader::advance_position", "size": 108}, {"crate": "pkcs8", "name": "::encode", "size": 108}, {"crate": "embassy_executor", "name": "_embassy_time_schedule_wake", "size": 108}, {"crate": "der", "name": "der::asn1::integer::uint::decode_to_array", "size": 108}, {"crate": "cyw43", "name": "cyw43::control::Control::ioctl_set_u32::{{closure}}", "size": 108}, {"crate": "tuf_no_std", "name": "der::reader::nested::NestedReader::advance_position", "size": 106}, {"crate": "tuf_no_std", "name": "::encode", "size": 106}, {"crate": "tuf_no_std", "name": "der::datetime::encode_decimal", "size": 104}, {"crate": "tuf_no_std", "name": "der::reader::nested::NestedReader::advance_position", "size": 104}, {"crate": "smoltcp", "name": "smoltcp::iface::socket_set::SocketSet::remove", "size": 104}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::get_unallocated", "size": 104}, {"crate": "pkcs8", "name": "::encode", "size": 104}, {"crate": "embassy_rp", "name": "embassy_rp::time_driver::TimerDriver::check_alarm", "size": 104}, {"crate": "der", "name": "der::writer::slice::SliceWriter::encode", "size": 104}, {"crate": "embassy_boot?", "name": "::fmt", "size": 104}, {"crate": "x509_cert", "name": "der::reader::nested::NestedReader::advance_position", "size": 102}, {"crate": "std", "name": "::fmt", "size": 102}, {"crate": "tuf_no_std", "name": "der::reader::nested::NestedReader::advance_position", "size": 100}, {"crate": "embassy_rp", "name": "DMA_IRQ_0", "size": 100}, {"crate": "der", "name": "der::reader::Reader::read_into", "size": 100}, {"crate": "std", "name": "core::fmt::num::::fmt", "size": 100}, {"crate": "cyw43", "name": "cyw43::control::Control::set_iovar_u32::{{closure}}", "size": 100}, {"crate": "pkcs8", "name": "der::reader::nested::NestedReader::advance_position", "size": 98}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memset4", "size": 96}, {"crate": "tuf_no_std", "name": "der::reader::nested::NestedReader::new", "size": 96}, {"crate": "smoltcp", "name": "::fmt", "size": 96}, {"crate": "pkcs8", "name": " as der::encode::EncodeValue>::value_len", "size": 96}, {"crate": "pkcs8", "name": "der::reader::nested::NestedReader::advance_position", "size": 96}, {"crate": "pem_rfc7468", "name": "base64ct::alphabet::Alphabet::decode_6bits", "size": 96}, {"crate": "cyw43", "name": "cyw43::structs::BdcHeader::parse", "size": 96}, {"crate": "std", "name": "core::ptr::drop_in_place>>", "size": 96}, {"crate": "embassy_embedded_hal", "name": "embassy_embedded_hal::flash::partition::blocking::BlockingPartition::new", "size": 96}, {"crate": "tuf_no_std", "name": "der::reader::nested::NestedReader::new", "size": 94}, {"crate": "embassy_boot", "name": "embassy_boot::firmware_updater::blocking::BlockingFirmwareState::get_state", "size": 94}, {"crate": "tuf_no_std", "name": "der::reader::nested::NestedReader::new", "size": 92}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::reply", "size": 92}, {"crate": "cyw43", "name": "cyw43::bus::Bus::write16::{{closure}}", "size": 92}, {"crate": "embassy_embedded_hal?", "name": " as embedded_storage::nor_flash::ReadNorFlash>::read", "size": 92}, {"crate": "x509_cert", "name": "der::reader::nested::NestedReader::new", "size": 90}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::route", "size": 90}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::has_neighbor", "size": 90}, {"crate": "der", "name": "der::asn1::bit_string::BitStringRef::new", "size": 90}, {"crate": "generic_array", "name": "generic_array::GenericArray::clone_from_slice", "size": 88}, {"crate": "tuf_no_std", "name": "der::reader::nested::NestedReader::new", "size": 88}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 88}, {"crate": "smoltcp", "name": "smoltcp::iface::route::Routes::lookup::{{closure}}", "size": 88}, {"crate": "p256", "name": ">>::reduce_bytes", "size": 88}, {"crate": "der", "name": "der::tag::Tag::assert_eq", "size": 88}, {"crate": "std", "name": "core::fmt::num::::fmt", "size": 88}, {"crate": "serde", "name": "serde::de::MapAccess::next_value", "size": 88}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_read8::{{closure}}", "size": 88}, {"crate": "cyw43", "name": "cyw43::bus::Bus::write8::{{closure}}", "size": 88}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_write32::{{closure}}", "size": 88}, {"crate": "pkcs8", "name": "der::reader::nested::NestedReader::new", "size": 86}, {"crate": "der", "name": "der::asn1::integer::uint::encode_bytes", "size": 86}, {"crate": "tuf_no_std", "name": " as core::iter::traits::collect::FromIterator>::from_iter", "size": 84}, {"crate": "smoltcp", "name": "smoltcp::wire::ip::checksum::pseudo_header", "size": 84}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::challenge_ack_reply", "size": 84}, {"crate": "pkcs8", "name": "der::reader::nested::NestedReader::new", "size": 84}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::atomic_waker::AtomicWaker::register", "size": 84}, {"crate": "embassy_net", "name": "defmt::export::fmt", "size": 84}, {"crate": "defmt_rtt", "name": "_defmt_acquire", "size": 84}, {"crate": "defmt_rtt", "name": "defmt_rtt::channel::Channel::write_impl", "size": 84}, {"crate": "std", "name": "core::ops::function::FnMut::call_mut", "size": 84}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_write8::{{closure}}", "size": 84}, {"crate": "cyw43", "name": "cyw43::bus::Bus::read32::{{closure}}", "size": 84}, {"crate": "cyw43", "name": "cyw43::bus::Bus::read8::{{closure}}", "size": 84}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 84}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::Receiver::receive_done", "size": 84}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::Sender::send_done", "size": 84}, {"crate": "tuf_no_std_common", "name": " as der::encode::EncodeValue>::value_len", "size": 80}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::new_checked", "size": 80}, {"crate": "smoltcp", "name": "::next", "size": 80}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::to_canonical", "size": 80}, {"crate": "embassy_rp", "name": "embassy_rp::flash::ram_helpers::flash_range_program", "size": 80}, {"crate": "std?", "name": " as serde::de::DeserializeSeed>::deserialize", "size": 80}, {"crate": "std?", "name": " as serde::de::DeserializeSeed>::deserialize", "size": 80}, {"crate": "std?", "name": " as serde::de::DeserializeSeed>::deserialize", "size": 80}, {"crate": "der", "name": "der::asn1::integer::uint::decode_to_slice", "size": 78}, {"crate": "x509_cert", "name": " as der::reader::Reader>::read_into", "size": 76}, {"crate": "x509_cert", "name": " as der::reader::Reader>::read_into", "size": 76}, {"crate": "spki?", "name": " as core::fmt::Debug>::fmt", "size": 76}, {"crate": "tuf_no_std", "name": "<&T as core::fmt::Debug>::fmt", "size": 76}, {"crate": "tuf_no_std", "name": " as der::reader::Reader>::read_into", "size": 76}, {"crate": "tuf_no_std", "name": " as der::reader::Reader>::read_into", "size": 76}, {"crate": "tuf_no_std", "name": " as der::reader::Reader>::read_into", "size": 76}, {"crate": "tuf_no_std", "name": " as der::reader::Reader>::read_into", "size": 76}, {"crate": "tuf_no_std", "name": " as der::reader::Reader>::read_into", "size": 76}, {"crate": "tuf_no_std", "name": " as der::reader::Reader>::read_into", "size": 76}, {"crate": "smoltcp", "name": "smoltcp::wire::dhcpv4::DhcpOptionWriter::emit", "size": 76}, {"crate": "smoltcp", "name": "::fmt", "size": 76}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Repr::header_len", "size": 76}, {"crate": "pkcs8", "name": "<&T as core::fmt::Debug>::fmt", "size": 76}, {"crate": "pkcs8", "name": "<&T as core::fmt::Debug>::fmt", "size": 76}, {"crate": "pkcs8", "name": " as der::reader::Reader>::read_into", "size": 76}, {"crate": "pkcs8", "name": " as der::reader::Reader>::read_into", "size": 76}, {"crate": "crypto_bigint", "name": "crypto_bigint::uint::array::>::from_be_byte_array", "size": 76}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 76}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 76}, {"crate": "der?", "name": "::fmt", "size": 76}, {"name": "__aeabi_lmul", "size": 74}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::to_bytes", "size": 74}, {"crate": "heapless", "name": "heapless::vec::Vec::from_slice", "size": 72}, {"crate": "smoltcp", "name": "heapless::vec::Vec::clone", "size": 72}, {"crate": "embassy_rp", "name": "::acquire", "size": 72}, {"crate": "embassy_net", "name": "embassy_net::tcp::TcpSocket::set_timeout", "size": 72}, {"crate": "der", "name": "der::length::Length::initial_octet", "size": 72}, {"crate": "der", "name": "der::reader::slice::SliceReader::remaining", "size": 72}, {"crate": "defmt_rtt", "name": "_defmt_release", "size": 72}, {"crate": "hex", "name": "hex::val", "size": 72}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::Sender::poll_send", "size": 72}, {"crate": "std", "name": "__clzsi2", "size": 70}, {"crate": "der", "name": "der::length::Length::for_tlv", "size": 70}, {"crate": "tuf_no_std", "name": " as tuf_no_std::role::root::TufRoot>::role_threshold", "size": 68}, {"crate": "std", "name": ">::into", "size": 68}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::in_same_network", "size": 68}, {"crate": "p256", "name": "crypto_bigint::uint::add::>::wrapping_add", "size": 68}, {"crate": "std", "name": "core::result::unwrap_failed", "size": 68}, {"crate": "std", "name": "::write_char", "size": 68}, {"crate": "bt4ot_embedded", "name": "sec1::point::EncodedPoint::tag", "size": 68}, {"crate": "x509_cert", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "x509_cert", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "x509_cert", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "tuf_no_std", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "tuf_no_std", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "tuf_no_std", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "tuf_no_std", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "tuf_no_std", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "tuf_no_std", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "pkcs8", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "pkcs8", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "der", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "tuf_no_std", "name": "tuf_no_std::signature::::keyid", "size": 64}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 64}, {"crate": "pkcs8", "name": "::encode", "size": 64}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::from_bytes", "size": 64}, {"crate": "p256", "name": ">::shr_assign", "size": 64}, {"crate": "p256", "name": " as subtle::ConditionallySelectable>::conditional_select", "size": 64}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 64}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 64}, {"crate": "defmt_rtt", "name": "defmt_rtt::channel::Channel::blocking_write", "size": 64}, {"crate": "const_oid", "name": "::next", "size": 64}, {"crate": "bt4ot_embedded", "name": "::decode_value", "size": 64}, {"crate": "bt4ot_embedded", "name": " as der::encode::EncodeValue>::value_len", "size": 64}, {"crate": "x509_cert", "name": " as der::encode::EncodeValue>::value_len", "size": 62}, {"crate": "serde_json_core", "name": "serde_json_core::de::Deserializer::parse_ident", "size": 62}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::sqn", "size": 62}, {"crate": "std", "name": "core::fmt::Formatter::pad_integral::write_prefix", "size": 62}, {"crate": "bt4ot_embedded", "name": " as der::encode::EncodeValue>::value_len", "size": 62}, {"crate": "std", "name": " as core::fmt::Debug>::fmt", "size": 60}, {"crate": "tuf_no_std", "name": "::decode_role", "size": 60}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::enqueue_one", "size": 60}, {"crate": "smoltcp", "name": "<&T as core::fmt::Display>::fmt", "size": 60}, {"crate": "pkcs8", "name": "<&T as core::fmt::Debug>::fmt", "size": 60}, {"crate": "pkcs8", "name": "::encode_value", "size": 60}, {"crate": "std", "name": " as core::iter::traits::iterator::Iterator>::next", "size": 60}, {"crate": "der?", "name": "::eq", "size": 60}, {"crate": "std", "name": "core::slice::::copy_from_slice::len_mismatch_fail", "size": 60}, {"crate": "std", "name": " as core::fmt::Debug>::fmt", "size": 60}, {"crate": "std", "name": "core::slice::index::slice_index_order_fail", "size": 60}, {"crate": "std", "name": "core::slice::index::slice_end_index_len_fail", "size": 60}, {"crate": "std", "name": "core::panicking::panic_bounds_check", "size": 60}, {"crate": "std", "name": "core::slice::index::slice_start_index_len_fail", "size": 60}, {"crate": "const_oid", "name": "::fmt", "size": 60}, {"crate": "std", "name": "core::ptr::drop_in_place>::init::{{closure}}>", "size": 60}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::atomic_waker::AtomicWaker::wake", "size": 58}, {"crate": "bt4ot_embedded", "name": "der::asn1::optional::>::encoded_len", "size": 58}, {"crate": "serde_json_core?", "name": "<&mut serde_json_core::de::Deserializer as serde::de::Deserializer>::deserialize_str", "size": 58}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::Interface::socket_egress::{{closure}}", "size": 58}, {"crate": "tuf_no_std_common", "name": "der::encode::EncodeValue::header", "size": 56}, {"crate": "tuf_no_std_common", "name": "elliptic_curve::scalar::primitive::ScalarPrimitive::from_slice", "size": 56}, {"crate": "tuf_no_std", "name": "heapless::vec::Vec::extend_from_slice", "size": 56}, {"crate": "tuf_no_std", "name": " as der::reader::Reader>::read_slice", "size": 56}, {"crate": "tuf_no_std", "name": " as der::reader::Reader>::read_slice", "size": 56}, {"crate": "tuf_no_std", "name": " as der::reader::Reader>::read_slice", "size": 56}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::has_ip_addr", "size": 56}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 56}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 56}, {"crate": "pkcs8", "name": "der::encode::EncodeValue::header", "size": 56}, {"crate": "pkcs8", "name": " as der::reader::Reader>::read_slice", "size": 56}, {"crate": "pkcs8", "name": " as der::reader::Reader>::read_slice", "size": 56}, {"crate": "embassy_executor", "name": "__pender", "size": 56}, {"crate": "std", "name": "core::panicking::panic_explicit", "size": 56}, {"crate": "bt4ot_embedded", "name": " as der::reader::Reader>::read_slice", "size": 56}, {"crate": "bt4ot_embedded", "name": " as der::reader::Reader>::read_slice", "size": 56}, {"crate": "bt4ot_embedded", "name": "der::encode::EncodeValue::header", "size": 56}, {"name": "PIO0_IRQ_0", "size": 56}, {"crate": "heapless", "name": "heapless::deque::Deque::pop_front", "size": 56}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 56}, {"crate": "embassy_executor", "name": "embassy_executor::raw::util::UninitCell::write_in_place", "size": 56}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::Sender::try_send", "size": 56}, {"crate": "tuf_no_std", "name": "der::reader::Reader::decode", "size": 54}, {"crate": "pkcs8", "name": "der::encode::EncodeValue::header", "size": 54}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::waker_registration::WakerRegistration::register", "size": 54}, {"crate": "der", "name": "der::error::Error::nested", "size": 54}, {"crate": "subtle", "name": "subtle::CtOption::unwrap", "size": 52}, {"crate": "tuf_no_std_common", "name": "sec1::point::EncodedPoint::tag", "size": 52}, {"crate": "tuf_no_std", "name": "der::arrayvec::ArrayVec::new", "size": 52}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet<&T>::payload", "size": 52}, {"crate": "serde_json_core", "name": "serde_json_core::de::Deserializer::parse_whitespace", "size": 52}, {"crate": "embassy_time", "name": "::poll", "size": 52}, {"crate": "embassy_rp", "name": "__pre_init", "size": 52}, {"crate": "embassy_rp", "name": "_embassy_time_set_alarm_callback", "size": 52}, {"crate": "embassy_net", "name": "embassy_net::to_smoltcp_hardware_address", "size": 52}, {"crate": "embassy_executor", "name": "embassy_executor::arch::thread::Executor::new", "size": 52}, {"crate": "der", "name": "::fmt", "size": 52}, {"crate": "std", "name": "core::slice::::split_at_mut", "size": 52}, {"crate": "std", "name": "core::option::expect_failed", "size": 52}, {"crate": "std", "name": "core::slice::::split_at", "size": 52}, {"crate": "std", "name": "core::ptr::drop_in_place>::core_reset::{{closure}}>", "size": 52}, {"crate": "smoltcp", "name": "smoltcp::socket::waker::WakerRegistration::register", "size": 50}, {"crate": "pem_rfc7468", "name": "pem_rfc7468::grammar::strip_trailing_eol", "size": 50}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Address::from_bytes", "size": 48}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 48}, {"crate": "smoltcp", "name": "defmt::traits::Format::_format_data", "size": 48}, {"crate": "smoltcp", "name": "::sub", "size": 48}, {"crate": "smoltcp", "name": ">::add", "size": 48}, {"crate": "serde_json_core", "name": "::unit_variant", "size": 48}, {"crate": "pem_rfc7468", "name": "base64ct::decoder::Decoder::advance_line", "size": 48}, {"crate": "crypto_bigint", "name": "crypto_bigint::uint::Uint<_>::from_words", "size": 48}, {"crate": "embassy_hal_internal", "name": "embassy_hal_internal::interrupt::InterruptExt::set_priority", "size": 48}, {"crate": "der", "name": "der::asn1::integer::uint::encoded_len", "size": 48}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 48}, {"crate": "std", "name": "core::cell::panic_already_mutably_borrowed", "size": 48}, {"crate": "std", "name": "core::cell::panic_already_borrowed", "size": 48}, {"crate": "bt4ot_ota_common", "name": "defmt::export::fmt", "size": 48}, {"crate": "bt4ot_embedded", "name": "ecdsa::der::Signature::s", "size": 48}, {"crate": "bt4ot_embedded", "name": "ecdsa::der::Signature::r", "size": 48}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::set_src_addr", "size": 48}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::set_dst_addr", "size": 48}, {"crate": "tuf_no_std_common?", "name": "::fmt", "size": 48}, {"crate": "embassy_sync?", "name": "::fmt", "size": 48}, {"crate": "std", "name": "compiler_builtins::mem::memcmp", "size": 46}, {"crate": "x509_cert", "name": " as der::reader::Reader>::peek_byte", "size": 46}, {"crate": "tuf_no_std", "name": " as der::reader::Reader>::peek_byte", "size": 46}, {"crate": "serde_json_core", "name": "serde_json_core::de::Deserializer::end_map", "size": 46}, {"crate": "base64ct", "name": "base64ct::decoder::Line::trim_end", "size": 46}, {"name": "__aeabi_llsl", "size": 44}, {"crate": "tuf_no_std_der", "name": "::encoded_len", "size": 44}, {"crate": "tuf_no_std_der", "name": "::encoded_len", "size": 44}, {"crate": "tuf_no_std_der", "name": "::encoded_len", "size": 44}, {"crate": "tuf_no_std_der", "name": "::encoded_len", "size": 44}, {"crate": "std", "name": "core::result::Result::expect", "size": 44}, {"crate": "tuf_no_std", "name": "heapless::indexmap::hash_with", "size": 44}, {"crate": "byteorder", "name": "::write_u32", "size": 44}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::msg_type", "size": 44}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 44}, {"crate": "defmt", "name": "defmt::impls::primitives::::_format_data", "size": 44}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::ack_to_transmit", "size": 44}, {"crate": "pkcs8", "name": "::encoded_len", "size": 44}, {"crate": "pkcs8", "name": "::encoded_len", "size": 44}, {"crate": "std", "name": "core::result::Result::and_then", "size": 44}, {"crate": "embassy_rp", "name": "_embassy_time_allocate_alarm", "size": 44}, {"crate": "bt4ot_embedded", "name": "::encoded_len", "size": 44}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::set_ethertype", "size": 44}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 44}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::new_checked", "size": 42}, {"crate": "der", "name": "der::length:: for core::result::Result>::add", "size": 42}, {"crate": "der", "name": "core::slice::cmp::::cmp", "size": 42}, {"crate": "heapless?", "name": " as core::iter::traits::iterator::Iterator>::next", "size": 42}, {"crate": "std", "name": "core::ptr::drop_in_place>::core_disable::{{closure}}>", "size": 42}, {"crate": "std", "name": "core::ptr::drop_in_place>::handle_irq::{{closure}}>", "size": 42}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet<&mut T>::data_mut", "size": 40}, {"crate": "pem_rfc7468", "name": "pem_rfc7468::decoder::check_for_headers", "size": 40}, {"crate": "crypto_bigint", "name": "crypto_bigint::uint::cmp::>::ct_lt", "size": 40}, {"crate": "p256", "name": "elliptic_curve::scalar::primitive::ScalarPrimitive::new", "size": 40}, {"crate": "embassy_executor", "name": "embassy_executor::raw::state::State::update", "size": 40}, {"crate": "der", "name": "::peek_byte", "size": 40}, {"crate": "der", "name": "der::asn1::integer::uint::strip_leading_zeroes", "size": 40}, {"crate": "std", "name": "core::panicking::panic_const::panic_const_rem_by_zero", "size": 40}, {"crate": "const_oid", "name": ">::try_from", "size": 40}, {"crate": "std", "name": ">::into", "size": 40}, {"crate": "byteorder", "name": "::write_u16", "size": 40}, {"crate": "std", "name": "<&T as core::fmt::Debug>::fmt", "size": 40}, {"crate": "cortex_m_rt", "name": "Reset", "size": 40}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Timer::should_keep_alive", "size": 38}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::contiguous_window", "size": 38}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::is_unicast_v4", "size": 38}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::window_to_update", "size": 38}, {"crate": "serde_json_core", "name": "serde_json_core::de::Deserializer::parse_object_colon", "size": 38}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::fe32_to_fe64", "size": 38}, {"crate": "crypto_bigint", "name": "crypto_bigint::uint::cmp::>::ct_eq", "size": 38}, {"crate": "embassy_executor", "name": "embassy_executor::raw::waker::wake", "size": 38}, {"crate": "const_oid", "name": "<&T as core::fmt::Debug>::fmt", "size": 38}, {"crate": "embassy_net?", "name": "::clone", "size": 38}, {"name": "__aeabi_idiv", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::set_checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_echo_seq_no", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_echo_ident", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_msg_type", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::set_checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::payload_mut", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::set_len", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::set_dst_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::set_src_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Packet::set_checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::len", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::echo_seq_no", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::echo_ident", "size": 36}, {"crate": "byteorder", "name": "::read_u16", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Packet::dst_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Packet::src_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::socket::dhcpv4::Socket::reset", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::dst_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::src_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::total_len", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::scaled_window", "size": 36}, {"crate": "serde_json_core", "name": "serde_json_core::de::Deserializer::end", "size": 36}, {"crate": "pkcs8", "name": " as der::reader::Reader>::peek_byte", "size": 36}, {"crate": "pem_rfc7468", "name": "core::slice::::starts_with", "size": 36}, {"crate": "fixed", "name": "<&T as core::fmt::Debug>::fmt", "size": 36}, {"crate": "embassy_time", "name": ">::add", "size": 36}, {"crate": "embassy_rp", "name": "::release", "size": 36}, {"crate": "embassy_net_driver", "name": "defmt::export::fmt_array", "size": 36}, {"crate": "der", "name": "::add", "size": 36}, {"crate": "std", "name": "core::fmt::num::::fmt", "size": 36}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 36}, {"crate": "std", "name": "::fmt", "size": 36}, {"crate": "std", "name": "core::panicking::panic_const::panic_const_async_fn_resumed", "size": 36}, {"crate": "std", "name": "core::panicking::panic_const::panic_const_div_by_zero", "size": 36}, {"crate": "std", "name": "core::panicking::panic", "size": 36}, {"crate": "bt4ot_ota_common", "name": "defmt::export::fmt", "size": 36}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 36}, {"crate": "embassy_net_driver_channel?", "name": " as embassy_net_driver::Driver>::hardware_address", "size": 36}, {"crate": "cortex_m", "name": "cortex_m::peripheral::scb::::sys_reset", "size": 36}, {"crate": "embassy_rp?", "name": " as core::future::future::Future>::poll", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::header_len", "size": 36}, {"crate": "tuf_no_std_common?", "name": "::fmt", "size": 36}, {"crate": "der?", "name": "::fmt", "size": 36}, {"crate": "std", "name": "core::ptr::drop_in_place>", "size": 36}, {"crate": "embassy_rp", "name": "embassy_rp::pio::instr::set_pindir", "size": 36}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 36}, {"crate": "tuf_no_std_common", "name": "elliptic_curve::scalar::primitive::ScalarPrimitive::is_zero", "size": 34}, {"crate": "std", "name": "core::fmt::num::::fmt", "size": 34}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::set_state", "size": 34}, {"crate": "ecdsa", "name": "ecdsa::der::find_scalar_range", "size": 34}, {"crate": "bt4ot_embedded", "name": "crypto_bigint::traits::Zero::is_zero", "size": 34}, {"crate": "std", "name": "core::iter::traits::iterator::Iterator::nth", "size": 34}, {"crate": "embassy_executor", "name": "embassy_executor::raw::state::State::update", "size": 34}, {"crate": "der?", "name": "::eq", "size": 32}, {"crate": "hash32", "name": "::write", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Address::from_bytes", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::dst_addr", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::src_addr", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet<&T>::data", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Packet::header_len", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::header_len", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::dst_addr", "size": 32}, {"crate": "std", "name": "core::ops::range::RangeInclusive::contains", "size": 32}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 32}, {"crate": "const_oid", "name": "const_oid::ObjectIdentifier::as_bytes", "size": 32}, {"crate": "sec1", "name": "sec1::point::Tag::from_u8", "size": 32}, {"crate": "heapless", "name": "heapless::deque::Deque::len", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::set_checksum", "size": 32}, {"crate": "std", "name": "core::cell::RefCell::borrow_mut", "size": 32}, {"crate": "std", "name": "core::ptr::drop_in_place>::backplane_writen::{{closure}}>", "size": 32}, {"crate": "std", "name": "core::ptr::drop_in_place>::wlan_write::{{closure}}>", "size": 32}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_write::{{closure}}>", "size": 32}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_read::{{closure}}>", "size": 32}, {"crate": "portable_atomic", "name": "portable_atomic::AtomicBool::compare_exchange", "size": 32}, {"crate": "embassy_time", "name": "embassy_time::timer::Timer::after_millis", "size": 32}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::multi_waker::MultiWakerRegistration<_>::wake", "size": 32}, {"crate": "embassy_rp", "name": "embassy_rp::pio::instr::exec_jmp", "size": 32}, {"crate": "der?", "name": "::eq", "size": 30}, {"crate": "smoltcp", "name": "smoltcp::wire::ip::checksum::combine", "size": 30}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Cidr::contains_addr", "size": 30}, {"crate": "p256", "name": "::double", "size": 30}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::square", "size": 30}, {"crate": "no_std_net", "name": "core::slice::::copy_from_slice", "size": 30}, {"crate": "std", "name": "core::cell::RefCell::borrow_mut", "size": 30}, {"crate": "std", "name": "core::panicking::panic_fmt", "size": 30}, {"crate": "const_oid", "name": "<[A] as core::slice::cmp::SlicePartialEq>::equal", "size": 30}, {"crate": "bt4ot_embedded", "name": "elliptic_curve::scalar::nonzero::NonZeroScalar::new", "size": 30}, {"crate": "std", "name": "core::ptr::drop_in_place>::backplane_readn::{{closure}}>", "size": 30}, {"crate": "std", "name": "core::ptr::drop_in_place>::log_init::{{closure}}>", "size": 30}, {"crate": "tuf_no_std", "name": " as tuf_no_std::role::SignedFile>::get_signatures", "size": 28}, {"crate": "tuf_no_std", "name": "tuf_no_std::signature::::raw_sig", "size": 28}, {"crate": "tuf_no_std", "name": "::decode_value", "size": 28}, {"crate": "tuf_no_std", "name": "::decode_value", "size": 28}, {"crate": "tuf_no_std", "name": "::decode_value", "size": 28}, {"crate": "smoltcp", "name": "smoltcp::parsers::Parser::advance", "size": 28}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 28}, {"crate": "pkcs8", "name": "::decode_value", "size": 28}, {"crate": "pkcs8", "name": "::decode_value", "size": 28}, {"crate": "std", "name": "core::array:: for [T; N]>::index", "size": 28}, {"crate": "p256", "name": "core::panicking::assert_failed", "size": 28}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::multiply", "size": 28}, {"crate": "p256", "name": "core::panicking::assert_failed", "size": 28}, {"crate": "critical_section", "name": "critical_section::with", "size": 28}, {"crate": "cyw43", "name": "defmt::export::fmt", "size": 28}, {"crate": "bt4ot_embedded", "name": "::decode_value", "size": 28}, {"crate": "p256?", "name": "::sub", "size": 28}, {"crate": "p256?", "name": ">::add", "size": 28}, {"crate": "p256?", "name": ">::mul", "size": 28}, {"crate": "p256?", "name": "::neg", "size": 28}, {"crate": "atomic_polyfill", "name": "atomic_polyfill::polyfill::AtomicU32::fetch_or", "size": 28}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 28}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 28}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 28}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 28}, {"crate": "std?", "name": "core::ptr::drop_in_place<> as tuf_no_std_common::remote::TufTransportAsync>::fetch_target_file::{{closure}}>", "size": 28}, {"crate": "std?", "name": "core::ptr::drop_in_place< as cyw43::bus::SpiBusCyw43>::wait_for_event::{{closure}}>", "size": 28}, {"crate": "std", "name": "core::ptr::drop_in_place>::fetch_role::{{closure}}>", "size": 28}, {"crate": "std", "name": "core::ptr::drop_in_place::{{closure}}>", "size": 28}, {"crate": "std", "name": "core::result::Result::and_then", "size": 26}, {"crate": "digest", "name": " as digest::Update>::update::{{closure}}", "size": 26}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::get_idx_unchecked", "size": 26}, {"crate": "smoltcp", "name": "smoltcp::parsers::Parser::accept_digit", "size": 26}, {"crate": "pkcs8", "name": "der::encode::EncodeValue::header", "size": 26}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 26}, {"crate": "const_oid?", "name": "::eq", "size": 26}, {"crate": "serde_json_core?", "name": "::next_value_seed", "size": 26}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 26}, {"crate": "x509_cert", "name": " as der::reader::Reader>::peek_byte", "size": 24}, {"crate": "x509_cert", "name": " as core::iter::traits::iterator::Iterator>::next", "size": 24}, {"crate": "tuf_no_std_der", "name": " as core::iter::traits::iterator::Iterator>::next", "size": 24}, {"crate": "tuf_no_std_der", "name": " as core::iter::traits::iterator::Iterator>::next", "size": 24}, {"crate": "tuf_no_std", "name": " as der::reader::Reader>::peek_byte", "size": 24}, {"crate": "tuf_no_std", "name": " as der::reader::Reader>::peek_byte", "size": 24}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 24}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 24}, {"crate": "spki", "name": "core::iter::adapters::zip::TrustedRandomAccessNoCoerce::size", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_msg_code", "size": 24}, {"crate": "smoltcp?", "name": "::fmt", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::arp::Packet::protocol_len", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::arp::Packet::hardware_len", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::hop_limit", "size": 24}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame<&T>::payload", "size": 24}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 24}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 24}, {"crate": "serde_json_core", "name": "serde_json_core::de::Deserializer::peek", "size": 24}, {"crate": "pem_rfc7468", "name": "base64ct::decoder::Decoder::is_finished", "size": 24}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 24}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::is_odd", "size": 24}, {"crate": "embassy_rp", "name": "embassy_rp::reset::unreset_wait", "size": 24}, {"crate": "embassy_rp", "name": "defmt::export::fmt", "size": 24}, {"crate": "embassy_rp", "name": "defmt::export::fmt", "size": 24}, {"crate": "embassy_executor", "name": "embassy_executor::raw::Executor::spawn", "size": 24}, {"crate": "embassy_executor", "name": "embassy_executor::raw::state::State::update", "size": 24}, {"crate": "defmt", "name": "defmt::export::str", "size": 24}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 24}, {"crate": "defmt", "name": "core::fmt::Write::write_fmt", "size": 24}, {"crate": "cyw43", "name": "defmt::export::fmt", "size": 24}, {"crate": "std", "name": "::fmt", "size": 24}, {"crate": "std", "name": "::fmt", "size": 24}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::payload_mut", "size": 24}, {"crate": "embassy_net_driver_channel?", "name": "::fmt", "size": 24}, {"crate": "embassy_executor?", "name": "::fmt", "size": 24}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 24}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 24}, {"crate": "std", "name": "core::ptr::drop_in_place>>::{{closure}}>", "size": 24}, {"crate": "std?", "name": "core::ptr::drop_in_place<> as tuf_no_std_common::remote::TufTransportAsync>::fetch_targets::{{closure}}>", "size": 24}, {"crate": "std?", "name": "core::ptr::drop_in_place<> as tuf_no_std_common::remote::TufTransportAsync>::fetch_root::{{closure}}>", "size": 24}, {"crate": "std", "name": "<&T as core::fmt::Debug>::fmt", "size": 24}, {"crate": "embassy_executor", "name": "embassy_executor::raw::TaskStorage::poll", "size": 24}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 24}, {"name": "__aeabi_ldivmod", "size": 22}, {"name": "__aeabi_uldivmod", "size": 22}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 22}, {"crate": "smoltcp", "name": "smoltcp::socket::waker::WakerRegistration::wake", "size": 22}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::waker_registration::WakerRegistration::wake", "size": 22}, {"crate": "der", "name": "der::asn1::integer::uint::::value_len", "size": 22}, {"crate": "defmt_rtt", "name": "defmt_rtt::channel::Channel::nonblocking_write", "size": 22}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 22}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 22}, {"crate": "std", "name": "core::array:: for [T; N]>::index", "size": 22}, {"crate": "std", "name": "core::array:: for [T; N]>::index", "size": 22}, {"name": "HardFaultTrampoline", "size": 20}, {"crate": "x509_cert", "name": "::encoded_len", "size": 20}, {"crate": "std", "name": "::next", "size": 20}, {"crate": "pkcs8", "name": "::encoded_len", "size": 20}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 20}, {"crate": "std", "name": "core::array:: for [T; N]>::index", "size": 20}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 20}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 20}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::fe_neg", "size": 20}, {"crate": "hash32", "name": "<&T as core::fmt::Debug>::fmt", "size": 20}, {"crate": "embassy_rp", "name": "::now", "size": 20}, {"crate": "der", "name": "der::asn1::integer::uint::::encode_value", "size": 20}, {"crate": "std", "name": "core::option::unwrap_failed", "size": 20}, {"crate": "std", "name": "core::fmt::Write::write_fmt", "size": 20}, {"crate": "heapless", "name": "heapless::indexmap::IndexMap::contains_key", "size": 20}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::backplane_set_window::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::check_status::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::core_is_up::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::write32_swapped::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::read32_swapped::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_write32::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::wlan_read::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_read8::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::write16::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::writen::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::readn::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::read8::{{closure}}>", "size": 20}, {"crate": "std?", "name": "core::ptr::drop_in_place< as cyw43::bus::SpiBusCyw43>::cmd_write::{{closure}}>", "size": 20}, {"crate": "std?", "name": "core::ptr::drop_in_place< as cyw43::bus::SpiBusCyw43>::cmd_read::{{closure}}>", "size": 20}, {"crate": "std", "name": "<() as core::fmt::Debug>::fmt", "size": 20}, {"crate": "embassy_executor", "name": "embassy_executor::raw::util::UninitCell::write_in_place", "size": 20}, {"crate": "std", "name": "__udivmodsi4", "size": 18}, {"name": "__aeabi_uidivmod", "size": 18}, {"crate": "std", "name": "__udivmoddi4", "size": 18}, {"crate": "tuf_no_std_der", "name": "sec1::point::EncodedPoint::is_identity", "size": 18}, {"crate": "tuf_no_std_common", "name": "der::writer::Writer::write_byte", "size": 18}, {"crate": "spki", "name": " as core::default::Default>::default", "size": 18}, {"crate": "smoltcp", "name": "smoltcp::socket::dhcpv4::Socket::config_changed", "size": 18}, {"crate": "der", "name": "der::writer::Writer::write_byte", "size": 18}, {"crate": "der", "name": "der::asn1::bit_string::BitStringRef::as_bytes", "size": 18}, {"crate": "der", "name": "der::asn1::integer::uint::::value_len", "size": 18}, {"crate": "der", "name": "der::asn1::integer::uint::::value_len", "size": 18}, {"crate": "defmt", "name": "defmt::export::integers::u64", "size": 18}, {"crate": "defmt", "name": "defmt::export::integers::u8", "size": 18}, {"crate": "defmt", "name": "defmt::export::istr", "size": 18}, {"crate": "benchmark_code_size_full", "name": "benchmark_code_size_full::__cortex_m_rt_main", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place>::read32_swapped::{{closure}},cyw43::bus::Bus>::init::{{closure}}::{{closure}}>>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place>::wait_for_event::{{closure}}>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_write8::{{closure}}>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place>::write8::{{closure}}>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place::cmd_read::{{closure}}>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place::write::{{closure}}>", "size": 18}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memset", "size": 16}, {"crate": "tuf_no_std", "name": ">::spec_eq", "size": 16}, {"crate": "tuf_no_std", "name": "<&T as core::fmt::Debug>::fmt", "size": 16}, {"crate": "tuf_no_std", "name": " as der::reader::Reader>::offset", "size": 16}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Repr::buffer_len", "size": 16}, {"crate": "smoltcp", "name": ">::add_assign", "size": 16}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 16}, {"crate": "pkcs8", "name": "<&T as core::fmt::Debug>::fmt", "size": 16}, {"crate": "pem_rfc7468", "name": "<&T as core::fmt::Display>::fmt", "size": 16}, {"crate": "p256", "name": "::eq", "size": 16}, {"crate": "p256", "name": "ff::Field::is_zero", "size": 16}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::State::pop_index", "size": 16}, {"crate": "embassy_executor", "name": "defmt::export::fmt", "size": 16}, {"crate": "der", "name": "der::tag::Tag::is_constructed", "size": 16}, {"crate": "der", "name": "der::asn1::bit_string::BitStringRef::from_bytes", "size": 16}, {"crate": "der", "name": ">::spec_eq", "size": 16}, {"crate": "defmt", "name": "defmt::encoding::inner::Encoder::write::{{closure}}", "size": 16}, {"crate": "defmt", "name": "defmt::export::integers::u32", "size": 16}, {"crate": "defmt", "name": "::write_str", "size": 16}, {"crate": "defmt", "name": "<&T as core::fmt::Display>::fmt", "size": 16}, {"crate": "std", "name": "::fmt", "size": 16}, {"crate": "std", "name": "<&T as core::fmt::Debug>::fmt", "size": 16}, {"crate": "std", "name": "<&T as core::fmt::Display>::fmt", "size": 16}, {"crate": "bt4ot_embedded", "name": "sec1::point::EncodedPoint::is_identity", "size": 16}, {"crate": "subtle?", "name": "::not", "size": 16}, {"crate": "embassy_net?", "name": " as smoltcp::phy::Device>::capabilities", "size": 16}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 16}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 16}, {"crate": "embassy_executor", "name": "embassy_executor::raw::util::UninitCell::write_in_place", "size": 16}, {"crate": "sha2?", "name": "::finalize_variable_core::{{closure}}", "size": 14}, {"crate": "std", "name": "core::fmt::Formatter::write_fmt", "size": 14}, {"crate": "pkcs8", "name": "der::encode::EncodeValue::header", "size": 14}, {"crate": "p256", "name": "p256::arithmetic::scalar::Scalar::is_even", "size": 14}, {"crate": "p256", "name": " as crypto_bigint::traits::Integer>::is_odd", "size": 14}, {"crate": "embassy_time", "name": "_defmt_timestamp", "size": 14}, {"crate": "der", "name": "der::tag::Tag::number", "size": 14}, {"crate": "defmt", "name": "defmt::export::header", "size": 14}, {"crate": "crypto_bigint", "name": "crypto_bigint::ct_choice:: for subtle::Choice>::from", "size": 14}, {"crate": "std", "name": "core::str::slice_error_fail", "size": 14}, {"name": "__Thumbv6MABSLongThunk__ZN10embassy_rp5flash11ram_helpers17write_flash_inner17h82c1bb1a60c73aa7E", "size": 12}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memclr8", "size": 12}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memclr", "size": 12}, {"crate": "x509_cert", "name": " as der::encode::EncodeValue>::value_len", "size": 12}, {"crate": "tuf_no_std_der", "name": "::encoded_len", "size": 12}, {"crate": "spki", "name": " as generic_array::sequence::GenericSequence>::generate", "size": 12}, {"crate": "spki", "name": " as generic_array::sequence::GenericSequence>::generate", "size": 12}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::State::push_index", "size": 12}, {"crate": "embassy_rp", "name": "TIMER_IRQ_0", "size": 12}, {"crate": "embassy_rp", "name": "TIMER_IRQ_1", "size": 12}, {"crate": "embassy_rp", "name": "TIMER_IRQ_2", "size": 12}, {"crate": "embassy_rp", "name": "TIMER_IRQ_3", "size": 12}, {"crate": "embassy_executor", "name": "embassy_executor::raw::waker::clone", "size": 12}, {"crate": "embassy_executor", "name": "embassy_executor::raw::SyncExecutor::alarm_callback", "size": 12}, {"crate": "der", "name": "::value_len", "size": 12}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 12}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 12}, {"crate": "crypto_bigint", "name": "subtle::black_box", "size": 12}, {"crate": "bt4ot_embedded", "name": "<&T as core::fmt::Debug>::fmt", "size": 12}, {"crate": "bt4ot_embedded", "name": " as der::encode::EncodeValue>::encode_value", "size": 12}, {"name": "__aeabi_memmove8", "size": 10}, {"name": "__aeabi_memmove", "size": 10}, {"name": "__aeabi_memcpy8", "size": 10}, {"name": "__aeabi_memmove4", "size": 10}, {"name": "__aeabi_memclr4", "size": 10}, {"name": "__aeabi_memcpy4", "size": 10}, {"name": "__aeabi_memcpy", "size": 10}, {"name": "__aeabi_uidiv", "size": 10}, {"name": "__aeabi_memclr", "size": 10}, {"name": "memcmp", "size": 10}, {"name": "__aeabi_memset4", "size": 10}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memmove8", "size": 10}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memmove", "size": 10}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memcpy8", "size": 10}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memcpy", "size": 10}, {"name": "__aeabi_memclr8", "size": 10}, {"crate": "pkcs8", "name": "::encoded_len", "size": 10}, {"crate": "der", "name": "der::tag:: for u8>::from", "size": 10}, {"crate": "defmt", "name": "defmt::export::bool", "size": 10}, {"crate": "std", "name": "core::cmp::impls:: for &A>::eq", "size": 10}, {"crate": "x509_cert", "name": "x509_cert::time::Time::to_unix_duration", "size": 8}, {"crate": "defmt", "name": "defmt::default_panic::panic_cold_explicit", "size": 8}, {"crate": "defmt", "name": "__defmt_default_panic", "size": 8}, {"name": "main", "size": 8}, {"crate": "cortex_m_rt", "name": "HardFault_", "size": 2}, {"crate": "embassy_executor", "name": "embassy_executor::raw::waker::drop", "size": 2}, {"crate": "defmt", "name": "__defmt_default_timestamp", "size": 2}, {"crate": "cortex_m_rt", "name": "DefaultHandler_", "size": 2}]}, "cargo_bloat_crates": {"file-size": 2393100, "text-section-size": 238104, "crates": [{"name": "tuf_no_std", "size": 52190}, {"name": "benchmark_code_size_full", "size": 37346}, {"name": "bt4ot_embedded", "size": 26686}, {"name": "smoltcp", "size": 25114}, {"name": "std", "size": 15832}, {"name": "p256", "size": 13236}, {"name": "cyw43", "size": 10212}, {"name": "embassy_executor", "size": 8938}, {"name": "der", "size": 7610}, {"name": "pem_rfc7468", "size": 5458}, {"name": "pkcs8", "size": 4796}, {"name": "sha2", "size": 3922}, {"name": "tuf_no_std_der", "size": 3656}, {"name": "embassy_net", "size": 3182}, {"name": "x509_cert", "size": 2826}, {"name": "tuf_no_std_common", "size": 2052}, {"name": "bt4ot_ota_common", "size": 2008}, {"name": "spki", "size": 1796}, {"name": "embassy_rp", "size": 1336}, {"name": "embassy_embedded_hal", "size": 1232}, {"name": "const_oid", "size": 1138}, {"name": "serde_json_core", "size": 1012}, {"name": "cyw43_pio", "size": 760}, {"name": "defmt", "size": 758}, {"name": "embassy_sync", "size": 622}, {"name": "defmt_rtt", "size": 466}, {"name": "[Unknown]", "size": 432}, {"name": "ecdsa", "size": 346}, {"name": "heapless", "size": 340}, {"name": "sec1", "size": 304}, {"name": "panic_probe", "size": 276}, {"name": "pio", "size": 244}, {"name": "crypto_bigint", "size": 228}, {"name": "base64ct", "size": 228}, {"name": "embassy_boot", "size": 198}, {"name": "embassy_time", "size": 134}, {"name": "embedded_io_async", "size": 132}, {"name": "byteorder", "size": 120}, {"name": "generic_array", "size": 88}, {"name": "serde", "size": 88}, {"name": "hex", "size": 72}, {"name": "subtle", "size": 68}, {"name": "embassy_net_driver_channel", "size": 60}, {"name": "hash32", "size": 52}, {"name": "embassy_hal_internal", "size": 48}, {"name": "cortex_m_rt", "size": 44}, {"name": "embassy_net_driver", "size": 36}, {"name": "fixed", "size": 36}, {"name": "cortex_m", "size": 36}, {"name": "portable_atomic", "size": 32}, {"name": "no_std_net", "size": 30}, {"name": "atomic_polyfill", "size": 28}, {"name": "critical_section", "size": 28}, {"name": "digest", "size": 26}]}}, "benchmark-code-size-no-tuf": {"raw_size": 194312, "cargo_bloat": {"file-size": 1773272, "text-section-size": 168980, "functions": [{"crate": "benchmark_code_size_no_tuf", "name": "benchmark_code_size_no_tuf::____embassy_main_task::{{closure}}", "size": 27864}, {"crate": "bt4ot_embedded", "name": "der::reader::Reader::read_nested", "size": 13320}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::ethernet::::process_ethernet", "size": 9676}, {"crate": "p256", "name": "::mul", "size": 5526}, {"crate": "embassy_executor", "name": "embassy_executor::raw::TaskStorage::poll", "size": 5452}, {"crate": "cyw43", "name": "cyw43::runner::Runner::check_status::{{closure}}", "size": 4320}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::dispatch_ip", "size": 4264}, {"crate": "bt4ot_embedded", "name": "der::reader::Reader::decode", "size": 3884}, {"crate": "sha2", "name": "sha2::sha256::compress256", "size": 3440}, {"crate": "embassy_executor", "name": "embassy_executor::raw::TaskStorage::poll", "size": 2528}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::fe_mul", "size": 2422}, {"crate": "bt4ot_embedded", "name": "bt4ot_embedded::verify_signature", "size": 2396}, {"crate": "pem_rfc7468", "name": "pem_rfc7468::decoder::decode", "size": 1996}, {"crate": "bt4ot_embedded", "name": "der::reader::Reader::decode", "size": 1820}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::montgomery_reduce", "size": 1670}, {"crate": "pem_rfc7468", "name": "::decode", "size": 1596}, {"crate": "pem_rfc7468", "name": "base64ct::decoder::Decoder::perform_decode", "size": 1556}, {"crate": "std", "name": "core::fmt::Formatter::pad", "size": 1536}, {"crate": "spki", "name": "spki::algorithm::AlgorithmIdentifier::assert_oids", "size": 1294}, {"crate": "pkcs8", "name": "der::reader::Reader::decode", "size": 1184}, {"crate": "std", "name": "core::char::methods::::escape_debug_ext", "size": 1020}, {"crate": "tuf_no_std_der", "name": " as core::convert::TryFrom>>::try_from", "size": 1000}, {"crate": "std", "name": "compiler_builtins::int::specialized_div_rem::u64_div_rem", "size": 938}, {"crate": "embassy_embedded_hal?", "name": " as embedded_storage::nor_flash::NorFlash>::write", "size": 828}, {"crate": "der", "name": "der::datetime::DateTime::from_unix_duration", "size": 820}, {"crate": "std", "name": "compiler_builtins::mem::memmove", "size": 788}, {"crate": "bt4ot_embedded", "name": "der::asn1::optional::>::der_cmp", "size": 778}, {"crate": "smoltcp", "name": "smoltcp::socket::dhcpv4::Socket::parse_ack", "size": 728}, {"crate": "std", "name": "core::str::slice_error_fail_rt", "size": 668}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::Interface::poll_at::{{closure}}", "size": 650}, {"crate": "der", "name": "der::datetime::DateTime::new", "size": 648}, {"crate": "bt4ot_embedded", "name": "bt4ot_embedded::parse_cert", "size": 632}, {"crate": "bt4ot_embedded", "name": "der::asn1::context_specific::ContextSpecific::decode_implicit", "size": 616}, {"crate": "der?", "name": "::fmt", "size": 612}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 608}, {"crate": "std", "name": "::write_str", "size": 604}, {"crate": "embassy_net", "name": "embassy_net::tcp::embedded_io_impls::::write::{{closure}}", "size": 584}, {"crate": "bt4ot_embedded", "name": ">::add", "size": 560}, {"crate": "std", "name": "core::str::converts::from_utf8", "size": 552}, {"crate": "embassy_net", "name": "embassy_net::tcp::TcpSocket::connect::{{closure}}", "size": 552}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Repr::emit", "size": 544}, {"crate": "embassy_net", "name": "embassy_net::tcp::embedded_io_impls::::read::{{closure}}", "size": 532}, {"crate": "bt4ot_embedded", "name": "primeorder::projective::ProjectivePoint::mul", "size": 500}, {"crate": "smoltcp", "name": "smoltcp::wire::arp::Repr::emit", "size": 500}, {"crate": "p256", "name": "p256::arithmetic::scalar::scalar_impl::subtract_n_if_necessary", "size": 488}, {"crate": "der", "name": "::decode", "size": 484}, {"crate": "std", "name": "core::fmt::Formatter::pad_integral", "size": 478}, {"crate": "der", "name": "<&T as core::fmt::Display>::fmt", "size": 472}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::sub_inner", "size": 464}, {"crate": "x509_cert", "name": "::decode", "size": 456}, {"crate": "x509_cert", "name": "::decode", "size": 456}, {"crate": "x509_cert", "name": "::decode", "size": 456}, {"crate": "pkcs8", "name": "::decode", "size": 456}, {"crate": "pkcs8", "name": "::decode", "size": 456}, {"crate": "bt4ot_embedded", "name": "::encode", "size": 456}, {"crate": "bt4ot_embedded", "name": ">::double", "size": 448}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 440}, {"crate": "std", "name": "core::fmt::num::::fmt", "size": 440}, {"crate": "serde_json_core?", "name": "<&mut serde_json_core::de::Deserializer as serde::de::Deserializer>::deserialize_ignored_any", "size": 438}, {"crate": "bt4ot_embedded", "name": "::encode", "size": 436}, {"crate": "cyw43", "name": "cyw43::runner::Runner::core_reset::{{closure}}", "size": 428}, {"crate": "embassy_net", "name": "embassy_net::Inner::apply_static_config", "size": 428}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::TcpOption::emit", "size": 412}, {"crate": "cyw43_pio?", "name": " as cyw43::bus::SpiBusCyw43>::cmd_read::{{closure}}", "size": 408}, {"crate": "cyw43", "name": "cyw43::runner::Runner::core_disable::{{closure}}", "size": 400}, {"crate": "embassy_executor", "name": "embassy_executor::arch::thread::Executor::run", "size": 400}, {"crate": "cyw43", "name": "cyw43::control::Control::set_iovar::{{closure}}", "size": 396}, {"crate": "std", "name": "compiler_builtins::int::specialized_div_rem::u32_div_rem", "size": 392}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_write::{{closure}}", "size": 384}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_read::{{closure}}", "size": 376}, {"crate": "embassy_net", "name": "embassy_net::tcp::TcpSocket::new", "size": 360}, {"crate": "cyw43_pio?", "name": " as cyw43::bus::SpiBusCyw43>::cmd_write::{{closure}}", "size": 352}, {"crate": "cyw43", "name": "cyw43::runner::Runner::handle_irq::{{closure}}", "size": 344}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::fe_add", "size": 340}, {"crate": "std", "name": "compiler_builtins::mem::memcpy", "size": 334}, {"crate": "const_oid", "name": "const_oid::arcs::Arcs::try_next", "size": 332}, {"crate": "std", "name": "core::fmt::write", "size": 330}, {"crate": "der", "name": ">::try_from", "size": 324}, {"crate": "std", "name": "core::fmt::builders::DebugStruct::field", "size": 324}, {"crate": "bt4ot_embedded", "name": " as der::encode::EncodeValue>::encode_value", "size": 320}, {"crate": "ecdsa", "name": "::decode", "size": 312}, {"crate": "x509_cert", "name": "der::reader::Reader::decode", "size": 304}, {"crate": "x509_cert", "name": " as der::reader::Reader>::read_into", "size": 298}, {"crate": "cyw43", "name": "cyw43::control::Control::get_iovar::{{closure}}", "size": 292}, {"crate": "cyw43", "name": "cyw43::bus::Bus::backplane_set_window::{{closure}}", "size": 288}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::ack_reply", "size": 280}, {"crate": "cyw43", "name": "cyw43::control::Control::ioctl::{{closure}}", "size": 272}, {"crate": "std", "name": "core::unicode::printable::check", "size": 260}, {"crate": "tuf_no_std_der", "name": " as elliptic_curve::point::DecompressPoint>::decompress", "size": 256}, {"crate": "smoltcp", "name": "<&T as core::fmt::Display>::fmt", "size": 256}, {"crate": "bt4ot_embedded", "name": "der::asn1::optional::>::encode", "size": 254}, {"crate": "std", "name": "core::ptr::drop_in_place>", "size": 248}, {"crate": "pio", "name": "pio::InstructionOperands::encode", "size": 244}, {"crate": "p256", "name": "::sqrt", "size": 244}, {"crate": "std", "name": "core::fmt::num::imp::::fmt", "size": 244}, {"crate": "sha2", "name": "sha2::sha256::soft::schedule", "size": 238}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 236}, {"crate": "der", "name": "::der_cmp", "size": 232}, {"crate": "cyw43", "name": "cyw43::bus::Bus::wlan_write::{{closure}}", "size": 232}, {"crate": "sha2", "name": "sha2::sha256::soft::sha256_digest_round_x2", "size": 230}, {"crate": "cyw43", "name": "cyw43::bus::Bus::wait_for_event::{{closure}}", "size": 224}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::reset", "size": 222}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::is_broadcast_v4", "size": 220}, {"crate": "smoltcp", "name": "smoltcp::iface::route::Routes::lookup", "size": 220}, {"crate": "embassy_embedded_hal?", "name": " as embedded_storage::nor_flash::NorFlash>::erase", "size": 216}, {"crate": "smoltcp", "name": "smoltcp::iface::route::Routes::remove_default_ipv4_route", "size": 204}, {"crate": "const_oid?", "name": "::fmt", "size": 204}, {"crate": "cyw43", "name": "cyw43::control::Control::set_iovar_u32x2::{{closure}}", "size": 204}, {"crate": "smoltcp", "name": "heapless::linear_map::LinearMap::insert", "size": 196}, {"crate": "std", "name": "core::fmt::Formatter::debug_tuple_field1_finish", "size": 196}, {"crate": "cyw43", "name": "cyw43::bus::Bus::readn::{{closure}}", "size": 196}, {"crate": "embassy_net", "name": "embassy_net::tcp::embedded_io_impls::::flush::{{closure}}", "size": 196}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::rst_reply", "size": 190}, {"crate": "p256", "name": "::add_assign", "size": 188}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::ipv4::::icmpv4_reply", "size": 186}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Repr::parse", "size": 184}, {"crate": "serde_json_core", "name": "serde_json_core::de::Deserializer::parse_str", "size": 184}, {"crate": "cyw43", "name": "cyw43::bus::Bus::backplane_writen::{{closure}}", "size": 184}, {"crate": "base64ct", "name": "::next", "size": 182}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::seq_to_transmit", "size": 180}, {"crate": "bt4ot_embedded", "name": " as der::encode::EncodeValue>::value_len", "size": 180}, {"crate": "bt4ot_embedded", "name": " as der::encode::EncodeValue>::value_len", "size": 176}, {"crate": "bt4ot_embedded", "name": " as der::encode::EncodeValue>::value_len", "size": 176}, {"crate": "embassy_rp", "name": "embassy_rp::pio::Common::try_load_program_at", "size": 176}, {"crate": "std", "name": "core::cmp::PartialEq::ne", "size": 172}, {"crate": "bt4ot_embedded", "name": "::value_len", "size": 172}, {"crate": "const_oid", "name": "<&T as core::fmt::Display>::fmt", "size": 168}, {"crate": "cyw43", "name": "cyw43::bus::Bus::backplane_readn::{{closure}}", "size": 168}, {"crate": "der", "name": "::read_slice", "size": 166}, {"crate": "std", "name": "compiler_builtins::mem::memset", "size": 160}, {"crate": "smoltcp", "name": "smoltcp::iface::socket_set::SocketSet::add::put", "size": 158}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::enqueue_many", "size": 156}, {"crate": "smoltcp", "name": "smoltcp::wire::ip::checksum::data", "size": 152}, {"crate": "panic_probe", "name": "<&T as core::fmt::Display>::fmt", "size": 152}, {"crate": "der", "name": "der::tag::Tag::octet", "size": 152}, {"crate": "std", "name": "core::panicking::assert_failed_inner", "size": 152}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::Interface::socket_egress::{{closure}}", "size": 152}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 152}, {"crate": "smoltcp", "name": "smoltcp::iface::neighbor::Cache::lookup", "size": 148}, {"crate": "embassy_net", "name": "::drop", "size": 148}, {"crate": "der", "name": "::encode", "size": 148}, {"crate": "cyw43", "name": "cyw43::bus::Bus::writen::{{closure}}", "size": 148}, {"crate": "tuf_no_std_common", "name": "<&T as core::fmt::Debug>::fmt", "size": 144}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::next_header", "size": 144}, {"crate": "pkcs8", "name": "::encode", "size": 144}, {"crate": "const_oid", "name": "const_oid::ObjectIdentifier::from_bytes", "size": 144}, {"crate": "bt4ot_embedded", "name": "::value_len", "size": 144}, {"crate": "bt4ot_embedded", "name": "<&T as core::fmt::Debug>::fmt", "size": 144}, {"crate": "defmt_rtt", "name": "_defmt_write", "size": 140}, {"crate": "sec1?", "name": "::fmt", "size": 136}, {"crate": "p256", "name": ">::sub_assign", "size": 136}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 136}, {"crate": "sec1?", "name": "::fmt", "size": 136}, {"crate": "cyw43", "name": "cyw43::bus::Bus::write32_swapped::{{closure}}", "size": 136}, {"crate": "pkcs8", "name": "::decode_value", "size": 132}, {"crate": "embassy_rp", "name": "_embassy_time_set_alarm", "size": 132}, {"crate": "cyw43", "name": "cyw43::bus::Bus::read32_swapped::{{closure}}", "size": 132}, {"crate": "embedded_io_async", "name": "embedded_io_async::Read::read_exact::{{closure}}", "size": 132}, {"crate": "embassy_rp", "name": "embassy_rp::flash::ram_helpers::flash_function_pointers_with_boot2", "size": 128}, {"crate": "der", "name": "der::tag::Tag::assert_eq", "size": 128}, {"crate": "std", "name": "core::fmt::Formatter::debug_struct_field2_finish", "size": 128}, {"crate": "defmt", "name": "core::fmt::Write::write_char", "size": 126}, {"crate": "panic_probe", "name": "rust_begin_unwind", "size": 124}, {"crate": "cyw43", "name": "cyw43::control::Control::gpio_set::{{closure}}", "size": 124}, {"crate": "std", "name": "__divmoddi4", "size": 122}, {"crate": "pkcs8", "name": "::decode", "size": 122}, {"crate": "smoltcp", "name": "smoltcp::wire::dhcpv4::Repr::buffer_len", "size": 120}, {"crate": "embassy_net", "name": "smoltcp::iface::socket_set::SocketSet::get_mut", "size": 120}, {"crate": "std", "name": "core::fmt::num::::fmt", "size": 120}, {"crate": "std", "name": "core::fmt::num::::fmt", "size": 120}, {"crate": "std", "name": "core::fmt::num::imp::::fmt", "size": 120}, {"crate": "const_oid", "name": "<&T as core::fmt::Debug>::fmt", "size": 120}, {"crate": "smoltcp", "name": "smoltcp::iface::socket_set::SocketSet::get_mut", "size": 120}, {"crate": "x509_cert", "name": "::value_len", "size": 118}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::fill_checksum", "size": 116}, {"crate": "embassy_rp", "name": "IO_IRQ_BANK0", "size": 116}, {"crate": "std", "name": "core::fmt::Formatter::debug_struct_field1_finish", "size": 116}, {"crate": "bt4ot_embedded", "name": " as der::encode::EncodeValue>::value_len", "size": 114}, {"crate": "tuf_no_std_common", "name": "<&T as core::fmt::Debug>::fmt", "size": 112}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::fe_sub", "size": 112}, {"crate": "der", "name": "::write", "size": 112}, {"crate": "bt4ot_embedded", "name": "<&T as core::fmt::Debug>::fmt", "size": 112}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memcpy4", "size": 110}, {"crate": "pkcs8", "name": "::encode", "size": 110}, {"crate": "bt4ot_embedded", "name": "der::datetime::encode_decimal", "size": 110}, {"crate": "embassy_executor", "name": "_embassy_time_schedule_wake", "size": 108}, {"crate": "cyw43", "name": "cyw43::control::Control::ioctl_set_u32::{{closure}}", "size": 108}, {"crate": "x509_cert", "name": "der::reader::nested::NestedReader::advance_position", "size": 104}, {"crate": "smoltcp", "name": "smoltcp::iface::socket_set::SocketSet::remove", "size": 104}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::get_unallocated", "size": 104}, {"crate": "embassy_rp", "name": "embassy_rp::time_driver::TimerDriver::check_alarm", "size": 104}, {"crate": "der", "name": "der::writer::slice::SliceWriter::encode", "size": 104}, {"crate": "embassy_boot?", "name": "::fmt", "size": 104}, {"crate": "x509_cert", "name": "der::reader::nested::NestedReader::advance_position", "size": 102}, {"crate": "std", "name": "::fmt", "size": 102}, {"crate": "x509_cert", "name": "der::reader::nested::NestedReader::advance_position", "size": 100}, {"crate": "embassy_rp", "name": "DMA_IRQ_0", "size": 100}, {"crate": "der", "name": "der::reader::Reader::read_into", "size": 100}, {"crate": "std", "name": "core::fmt::num::::fmt", "size": 100}, {"crate": "cyw43", "name": "cyw43::control::Control::set_iovar_u32::{{closure}}", "size": 100}, {"crate": "pkcs8", "name": "der::reader::nested::NestedReader::advance_position", "size": 98}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memset4", "size": 96}, {"crate": "smoltcp", "name": "::fmt", "size": 96}, {"crate": "pkcs8", "name": " as der::encode::EncodeValue>::value_len", "size": 96}, {"crate": "pkcs8", "name": "der::reader::nested::NestedReader::advance_position", "size": 96}, {"crate": "pem_rfc7468", "name": "base64ct::alphabet::Alphabet::decode_6bits", "size": 96}, {"crate": "cyw43", "name": "cyw43::structs::BdcHeader::parse", "size": 96}, {"crate": "std", "name": "core::ptr::drop_in_place>>", "size": 96}, {"crate": "embassy_embedded_hal", "name": "embassy_embedded_hal::flash::partition::blocking::BlockingPartition::new", "size": 96}, {"crate": "embassy_boot", "name": "embassy_boot::firmware_updater::blocking::BlockingFirmwareState::get_state", "size": 94}, {"crate": "x509_cert", "name": "der::reader::nested::NestedReader::new", "size": 92}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::reply", "size": 92}, {"crate": "cyw43", "name": "cyw43::bus::Bus::write16::{{closure}}", "size": 92}, {"crate": "embassy_embedded_hal?", "name": " as embedded_storage::nor_flash::ReadNorFlash>::read", "size": 92}, {"crate": "x509_cert", "name": "der::reader::nested::NestedReader::new", "size": 90}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::route", "size": 90}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::has_neighbor", "size": 90}, {"crate": "der", "name": "der::asn1::bit_string::BitStringRef::new", "size": 90}, {"crate": "bt4ot_embedded", "name": " as der::encode::EncodeValue>::encode_value", "size": 90}, {"crate": "x509_cert", "name": "der::reader::nested::NestedReader::new", "size": 88}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 88}, {"crate": "smoltcp", "name": "smoltcp::iface::route::Routes::lookup::{{closure}}", "size": 88}, {"crate": "p256", "name": ">>::reduce_bytes", "size": 88}, {"crate": "generic_array", "name": "generic_array::GenericArray::clone_from_slice", "size": 88}, {"crate": "serde", "name": "serde::de::MapAccess::next_value", "size": 88}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_read8::{{closure}}", "size": 88}, {"crate": "cyw43", "name": "cyw43::bus::Bus::write8::{{closure}}", "size": 88}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_write32::{{closure}}", "size": 88}, {"crate": "pkcs8", "name": "der::reader::nested::NestedReader::new", "size": 86}, {"crate": "smoltcp", "name": "smoltcp::wire::ip::checksum::pseudo_header", "size": 84}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::challenge_ack_reply", "size": 84}, {"crate": "pkcs8", "name": "der::reader::nested::NestedReader::new", "size": 84}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::atomic_waker::AtomicWaker::register", "size": 84}, {"crate": "embassy_net", "name": "defmt::export::fmt", "size": 84}, {"crate": "defmt_rtt", "name": "_defmt_acquire", "size": 84}, {"crate": "defmt_rtt", "name": "defmt_rtt::channel::Channel::write_impl", "size": 84}, {"crate": "std", "name": "core::ops::function::FnMut::call_mut", "size": 84}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_write8::{{closure}}", "size": 84}, {"crate": "cyw43", "name": "cyw43::bus::Bus::read32::{{closure}}", "size": 84}, {"crate": "cyw43", "name": "cyw43::bus::Bus::read8::{{closure}}", "size": 84}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 84}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::Receiver::receive_done", "size": 84}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::Sender::send_done", "size": 84}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::new_checked", "size": 80}, {"crate": "smoltcp", "name": "::next", "size": 80}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::to_canonical", "size": 80}, {"crate": "embassy_rp", "name": "embassy_rp::flash::ram_helpers::flash_range_program", "size": 80}, {"crate": "std?", "name": " as serde::de::DeserializeSeed>::deserialize", "size": 80}, {"crate": "std?", "name": " as serde::de::DeserializeSeed>::deserialize", "size": 80}, {"crate": "std?", "name": " as serde::de::DeserializeSeed>::deserialize", "size": 80}, {"crate": "der", "name": "der::asn1::integer::uint::decode_to_slice", "size": 78}, {"crate": "x509_cert", "name": " as der::reader::Reader>::read_into", "size": 76}, {"crate": "x509_cert", "name": " as der::reader::Reader>::read_into", "size": 76}, {"crate": "tuf_no_std_common", "name": "<&T as core::fmt::Debug>::fmt", "size": 76}, {"crate": "smoltcp", "name": "smoltcp::wire::dhcpv4::DhcpOptionWriter::emit", "size": 76}, {"crate": "smoltcp", "name": "::fmt", "size": 76}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Repr::header_len", "size": 76}, {"crate": "pkcs8", "name": " as der::reader::Reader>::read_into", "size": 76}, {"crate": "pkcs8", "name": " as der::reader::Reader>::read_into", "size": 76}, {"crate": "crypto_bigint", "name": "crypto_bigint::uint::array::>::from_be_byte_array", "size": 76}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 76}, {"crate": "der?", "name": "::fmt", "size": 76}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 76}, {"name": "__aeabi_lmul", "size": 74}, {"crate": "pkcs8", "name": "::encode", "size": 74}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::to_bytes", "size": 74}, {"crate": "smoltcp", "name": "heapless::vec::Vec::clone", "size": 72}, {"crate": "embassy_rp", "name": "::acquire", "size": 72}, {"crate": "embassy_net", "name": "embassy_net::tcp::TcpSocket::set_timeout", "size": 72}, {"crate": "der", "name": "der::length::Length::initial_octet", "size": 72}, {"crate": "der", "name": "der::reader::slice::SliceReader::remaining", "size": 72}, {"crate": "defmt_rtt", "name": "_defmt_release", "size": 72}, {"crate": "hex", "name": "hex::val", "size": 72}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::Sender::poll_send", "size": 72}, {"crate": "std", "name": "__clzsi2", "size": 70}, {"crate": "der", "name": "der::length::Length::for_tlv", "size": 70}, {"crate": "std", "name": ">::into", "size": 68}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::in_same_network", "size": 68}, {"crate": "p256", "name": "crypto_bigint::uint::add::>::wrapping_add", "size": 68}, {"crate": "std", "name": "core::result::unwrap_failed", "size": 68}, {"crate": "std", "name": "::write_char", "size": 68}, {"crate": "bt4ot_embedded", "name": "sec1::point::EncodedPoint::tag", "size": 68}, {"crate": "x509_cert", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "x509_cert", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "x509_cert", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "pkcs8", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "pkcs8", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "der", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 64}, {"crate": "pkcs8", "name": "::encode", "size": 64}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::from_bytes", "size": 64}, {"crate": "p256", "name": ">::shr_assign", "size": 64}, {"crate": "p256", "name": " as subtle::ConditionallySelectable>::conditional_select", "size": 64}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 64}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 64}, {"crate": "defmt_rtt", "name": "defmt_rtt::channel::Channel::blocking_write", "size": 64}, {"crate": "const_oid", "name": "::next", "size": 64}, {"crate": "bt4ot_embedded", "name": "::decode_value", "size": 64}, {"crate": "bt4ot_embedded", "name": " as der::encode::EncodeValue>::value_len", "size": 64}, {"crate": "x509_cert", "name": " as der::encode::EncodeValue>::value_len", "size": 62}, {"crate": "serde_json_core", "name": "serde_json_core::de::Deserializer::parse_ident", "size": 62}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::sqn", "size": 62}, {"crate": "std", "name": "core::fmt::Formatter::pad_integral::write_prefix", "size": 62}, {"crate": "bt4ot_embedded", "name": " as der::encode::EncodeValue>::value_len", "size": 62}, {"crate": "std", "name": " as core::fmt::Debug>::fmt", "size": 60}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::enqueue_one", "size": 60}, {"crate": "smoltcp", "name": "<&T as core::fmt::Display>::fmt", "size": 60}, {"crate": "pkcs8", "name": "::encode_value", "size": 60}, {"crate": "std", "name": " as core::iter::traits::iterator::Iterator>::next", "size": 60}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 60}, {"crate": "std", "name": "core::slice::::copy_from_slice::len_mismatch_fail", "size": 60}, {"crate": "std", "name": " as core::fmt::Debug>::fmt", "size": 60}, {"crate": "std", "name": "core::slice::index::slice_index_order_fail", "size": 60}, {"crate": "std", "name": "core::slice::index::slice_end_index_len_fail", "size": 60}, {"crate": "std", "name": "core::panicking::panic_bounds_check", "size": 60}, {"crate": "std", "name": "core::slice::index::slice_start_index_len_fail", "size": 60}, {"crate": "std", "name": "core::ptr::drop_in_place>::init::{{closure}}>", "size": 60}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::atomic_waker::AtomicWaker::wake", "size": 58}, {"crate": "bt4ot_embedded", "name": "der::asn1::optional::>::encoded_len", "size": 58}, {"crate": "serde_json_core?", "name": "<&mut serde_json_core::de::Deserializer as serde::de::Deserializer>::deserialize_str", "size": 58}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::Interface::socket_egress::{{closure}}", "size": 58}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::has_ip_addr", "size": 56}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 56}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 56}, {"crate": "pkcs8", "name": " as der::reader::Reader>::read_slice", "size": 56}, {"crate": "pkcs8", "name": " as der::reader::Reader>::read_slice", "size": 56}, {"crate": "embassy_executor", "name": "__pender", "size": 56}, {"crate": "std", "name": "core::panicking::panic_explicit", "size": 56}, {"crate": "bt4ot_embedded", "name": " as der::reader::Reader>::read_slice", "size": 56}, {"crate": "bt4ot_embedded", "name": " as der::reader::Reader>::read_slice", "size": 56}, {"crate": "bt4ot_embedded", "name": "der::encode::EncodeValue::header", "size": 56}, {"crate": "bt4ot_embedded", "name": "elliptic_curve::scalar::primitive::ScalarPrimitive::from_slice", "size": 56}, {"name": "PIO0_IRQ_0", "size": 56}, {"crate": "heapless", "name": "heapless::deque::Deque::pop_front", "size": 56}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 56}, {"crate": "embassy_executor", "name": "embassy_executor::raw::util::UninitCell::write_in_place", "size": 56}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::Sender::try_send", "size": 56}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::waker_registration::WakerRegistration::register", "size": 54}, {"crate": "der", "name": "der::error::Error::nested", "size": 54}, {"crate": "tuf_no_std_common", "name": "sec1::point::EncodedPoint::tag", "size": 52}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet<&T>::payload", "size": 52}, {"crate": "serde_json_core", "name": "serde_json_core::de::Deserializer::parse_whitespace", "size": 52}, {"crate": "embassy_time", "name": "::poll", "size": 52}, {"crate": "embassy_rp", "name": "__pre_init", "size": 52}, {"crate": "embassy_rp", "name": "_embassy_time_set_alarm_callback", "size": 52}, {"crate": "embassy_net", "name": "embassy_net::to_smoltcp_hardware_address", "size": 52}, {"crate": "embassy_executor", "name": "embassy_executor::arch::thread::Executor::new", "size": 52}, {"crate": "der", "name": "::fmt", "size": 52}, {"crate": "std", "name": "core::slice::::split_at_mut", "size": 52}, {"crate": "std", "name": "core::option::expect_failed", "size": 52}, {"crate": "std", "name": "core::slice::::split_at", "size": 52}, {"crate": "std", "name": "core::ptr::drop_in_place>::core_reset::{{closure}}>", "size": 52}, {"crate": "smoltcp", "name": "smoltcp::socket::waker::WakerRegistration::register", "size": 50}, {"crate": "pem_rfc7468", "name": "pem_rfc7468::grammar::strip_trailing_eol", "size": 50}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Address::from_bytes", "size": 48}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 48}, {"crate": "smoltcp", "name": "defmt::traits::Format::_format_data", "size": 48}, {"crate": "smoltcp", "name": "::sub", "size": 48}, {"crate": "smoltcp", "name": ">::add", "size": 48}, {"crate": "serde_json_core", "name": "::unit_variant", "size": 48}, {"crate": "pem_rfc7468", "name": "base64ct::decoder::Decoder::advance_line", "size": 48}, {"crate": "crypto_bigint", "name": "crypto_bigint::uint::Uint<_>::from_words", "size": 48}, {"crate": "embassy_hal_internal", "name": "embassy_hal_internal::interrupt::InterruptExt::set_priority", "size": 48}, {"crate": "der", "name": "der::asn1::integer::uint::encoded_len", "size": 48}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 48}, {"crate": "std", "name": "core::cell::panic_already_mutably_borrowed", "size": 48}, {"crate": "std", "name": "core::cell::panic_already_borrowed", "size": 48}, {"crate": "bt4ot_ota_common", "name": "defmt::export::fmt", "size": 48}, {"crate": "bt4ot_embedded", "name": "ecdsa::der::Signature::s", "size": 48}, {"crate": "bt4ot_embedded", "name": "ecdsa::der::Signature::r", "size": 48}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::set_src_addr", "size": 48}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::set_dst_addr", "size": 48}, {"crate": "tuf_no_std_common?", "name": "::fmt", "size": 48}, {"crate": "embassy_sync?", "name": "::fmt", "size": 48}, {"crate": "std", "name": "compiler_builtins::mem::memcmp", "size": 46}, {"crate": "x509_cert", "name": " as der::reader::Reader>::peek_byte", "size": 46}, {"crate": "serde_json_core", "name": "serde_json_core::de::Deserializer::end_map", "size": 46}, {"crate": "base64ct", "name": "base64ct::decoder::Line::trim_end", "size": 46}, {"name": "__aeabi_llsl", "size": 44}, {"crate": "byteorder", "name": "::write_u32", "size": 44}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::msg_type", "size": 44}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 44}, {"crate": "defmt", "name": "defmt::impls::primitives::::_format_data", "size": 44}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::ack_to_transmit", "size": 44}, {"crate": "pkcs8", "name": "::encoded_len", "size": 44}, {"crate": "std", "name": "core::result::Result::and_then", "size": 44}, {"crate": "embassy_rp", "name": "_embassy_time_allocate_alarm", "size": 44}, {"crate": "bt4ot_embedded", "name": "::encoded_len", "size": 44}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::set_ethertype", "size": 44}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 44}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::new_checked", "size": 42}, {"crate": "der", "name": "der::length:: for core::result::Result>::add", "size": 42}, {"crate": "der", "name": "core::slice::cmp::::cmp", "size": 42}, {"crate": "heapless?", "name": " as core::iter::traits::iterator::Iterator>::next", "size": 42}, {"crate": "std", "name": "core::ptr::drop_in_place>::core_disable::{{closure}}>", "size": 42}, {"crate": "std", "name": "core::ptr::drop_in_place>::handle_irq::{{closure}}>", "size": 42}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet<&mut T>::data_mut", "size": 40}, {"crate": "pem_rfc7468", "name": "pem_rfc7468::decoder::check_for_headers", "size": 40}, {"crate": "p256", "name": "core::panicking::assert_failed", "size": 40}, {"crate": "p256", "name": "core::panicking::assert_failed", "size": 40}, {"crate": "crypto_bigint", "name": "crypto_bigint::uint::cmp::>::ct_lt", "size": 40}, {"crate": "embassy_executor", "name": "embassy_executor::raw::state::State::update", "size": 40}, {"crate": "der", "name": "::peek_byte", "size": 40}, {"crate": "der", "name": "der::asn1::integer::uint::strip_leading_zeroes", "size": 40}, {"crate": "std", "name": "core::panicking::panic_const::panic_const_rem_by_zero", "size": 40}, {"crate": "const_oid", "name": ">::try_from", "size": 40}, {"crate": "subtle", "name": "subtle::CtOption::unwrap", "size": 40}, {"crate": "byteorder", "name": "::write_u16", "size": 40}, {"crate": "std", "name": "<&T as core::fmt::Debug>::fmt", "size": 40}, {"crate": "cortex_m_rt", "name": "Reset", "size": 40}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Timer::should_keep_alive", "size": 38}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::contiguous_window", "size": 38}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::is_unicast_v4", "size": 38}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::window_to_update", "size": 38}, {"crate": "serde_json_core", "name": "serde_json_core::de::Deserializer::parse_object_colon", "size": 38}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::fe32_to_fe64", "size": 38}, {"crate": "crypto_bigint", "name": "crypto_bigint::uint::cmp::>::ct_eq", "size": 38}, {"crate": "embassy_executor", "name": "embassy_executor::raw::waker::wake", "size": 38}, {"crate": "const_oid", "name": "<&T as core::fmt::Debug>::fmt", "size": 38}, {"crate": "embassy_net?", "name": "::clone", "size": 38}, {"name": "__aeabi_idiv", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::set_checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_echo_seq_no", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_echo_ident", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_msg_type", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::set_checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::payload_mut", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::set_len", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::set_dst_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::set_src_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Packet::set_checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::len", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::echo_seq_no", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::echo_ident", "size": 36}, {"crate": "byteorder", "name": "::read_u16", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Packet::dst_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Packet::src_port", "size": 36}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::socket::dhcpv4::Socket::reset", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::dst_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::src_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::total_len", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::scaled_window", "size": 36}, {"crate": "serde_json_core", "name": "serde_json_core::de::Deserializer::end", "size": 36}, {"crate": "pkcs8", "name": " as der::reader::Reader>::peek_byte", "size": 36}, {"crate": "pem_rfc7468", "name": "core::slice::::starts_with", "size": 36}, {"crate": "embassy_time", "name": ">::add", "size": 36}, {"crate": "embassy_rp", "name": "::release", "size": 36}, {"crate": "embassy_net_driver", "name": "defmt::export::fmt_array", "size": 36}, {"crate": "der", "name": "::add", "size": 36}, {"crate": "std", "name": "core::fmt::num::::fmt", "size": 36}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 36}, {"crate": "std", "name": "::fmt", "size": 36}, {"crate": "std", "name": "core::panicking::panic_const::panic_const_async_fn_resumed", "size": 36}, {"crate": "std", "name": "core::panicking::panic", "size": 36}, {"crate": "bt4ot_ota_common", "name": "defmt::export::fmt", "size": 36}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 36}, {"crate": "der?", "name": "::fmt", "size": 36}, {"crate": "embassy_net_driver_channel?", "name": " as embassy_net_driver::Driver>::hardware_address", "size": 36}, {"crate": "cortex_m", "name": "cortex_m::peripheral::scb::::sys_reset", "size": 36}, {"crate": "embassy_rp?", "name": " as core::future::future::Future>::poll", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::header_len", "size": 36}, {"crate": "std", "name": "core::ptr::drop_in_place>", "size": 36}, {"crate": "embassy_rp", "name": "embassy_rp::pio::instr::set_pindir", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::set_state", "size": 34}, {"crate": "ecdsa", "name": "ecdsa::der::find_scalar_range", "size": 34}, {"crate": "bt4ot_embedded", "name": "crypto_bigint::traits::Zero::is_zero", "size": 34}, {"crate": "std", "name": "core::iter::traits::iterator::Iterator::nth", "size": 34}, {"crate": "embassy_executor", "name": "embassy_executor::raw::state::State::update", "size": 34}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Address::from_bytes", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::dst_addr", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::src_addr", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet<&T>::data", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Packet::header_len", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::header_len", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::dst_addr", "size": 32}, {"crate": "std", "name": "core::ops::range::RangeInclusive::contains", "size": 32}, {"crate": "const_oid", "name": "const_oid::ObjectIdentifier::as_bytes", "size": 32}, {"crate": "sec1", "name": "sec1::point::Tag::from_u8", "size": 32}, {"crate": "heapless", "name": "heapless::deque::Deque::len", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::set_checksum", "size": 32}, {"crate": "std", "name": "core::cell::RefCell::borrow_mut", "size": 32}, {"crate": "std", "name": "core::ptr::drop_in_place>::backplane_writen::{{closure}}>", "size": 32}, {"crate": "std", "name": "core::ptr::drop_in_place>::wlan_write::{{closure}}>", "size": 32}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_write::{{closure}}>", "size": 32}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_read::{{closure}}>", "size": 32}, {"crate": "portable_atomic", "name": "portable_atomic::AtomicBool::compare_exchange", "size": 32}, {"crate": "embassy_time", "name": "embassy_time::timer::Timer::after_millis", "size": 32}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::multi_waker::MultiWakerRegistration<_>::wake", "size": 32}, {"crate": "embassy_rp", "name": "embassy_rp::pio::instr::exec_jmp", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ip::checksum::combine", "size": 30}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Cidr::contains_addr", "size": 30}, {"crate": "p256", "name": "::double", "size": 30}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::square", "size": 30}, {"crate": "no_std_net", "name": "core::slice::::copy_from_slice", "size": 30}, {"crate": "std", "name": "core::cell::RefCell::borrow_mut", "size": 30}, {"crate": "std", "name": "core::panicking::panic_fmt", "size": 30}, {"crate": "const_oid", "name": "<[A] as core::slice::cmp::SlicePartialEq>::equal", "size": 30}, {"crate": "bt4ot_embedded", "name": "elliptic_curve::scalar::nonzero::NonZeroScalar::new", "size": 30}, {"crate": "std", "name": "core::ptr::drop_in_place>::backplane_readn::{{closure}}>", "size": 30}, {"crate": "std", "name": "core::ptr::drop_in_place>::log_init::{{closure}}>", "size": 30}, {"crate": "smoltcp", "name": "smoltcp::parsers::Parser::advance", "size": 28}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 28}, {"crate": "pkcs8", "name": "::decode_value", "size": 28}, {"crate": "pkcs8", "name": "::decode_value", "size": 28}, {"crate": "std", "name": "core::array:: for [T; N]>::index", "size": 28}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::multiply", "size": 28}, {"crate": "critical_section", "name": "critical_section::with", "size": 28}, {"crate": "cyw43", "name": "defmt::export::fmt", "size": 28}, {"crate": "bt4ot_embedded", "name": "::decode_value", "size": 28}, {"crate": "p256?", "name": "::sub", "size": 28}, {"crate": "std", "name": ">::into", "size": 28}, {"crate": "p256?", "name": ">::add", "size": 28}, {"crate": "p256?", "name": ">::mul", "size": 28}, {"crate": "p256?", "name": "::neg", "size": 28}, {"crate": "atomic_polyfill", "name": "atomic_polyfill::polyfill::AtomicU32::fetch_or", "size": 28}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 28}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 28}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 28}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 28}, {"crate": "std?", "name": "core::ptr::drop_in_place< as cyw43::bus::SpiBusCyw43>::wait_for_event::{{closure}}>", "size": 28}, {"crate": "std", "name": "core::ptr::drop_in_place::{{closure}}>", "size": 28}, {"crate": "x509_cert", "name": "der::encode::EncodeValue::header", "size": 26}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::get_idx_unchecked", "size": 26}, {"crate": "smoltcp", "name": "smoltcp::parsers::Parser::accept_digit", "size": 26}, {"crate": "std", "name": "core::result::Result::and_then", "size": 26}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 26}, {"crate": "const_oid?", "name": "::eq", "size": 26}, {"crate": "digest", "name": " as digest::Update>::update::{{closure}}", "size": 26}, {"crate": "serde_json_core?", "name": "::next_value_seed", "size": 26}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 26}, {"crate": "x509_cert", "name": " as der::reader::Reader>::peek_byte", "size": 24}, {"crate": "x509_cert", "name": " as core::iter::traits::iterator::Iterator>::next", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_msg_code", "size": 24}, {"crate": "smoltcp?", "name": "::fmt", "size": 24}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::arp::Packet::protocol_len", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::arp::Packet::hardware_len", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::hop_limit", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame<&T>::payload", "size": 24}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 24}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 24}, {"crate": "serde_json_core", "name": "serde_json_core::de::Deserializer::peek", "size": 24}, {"crate": "pem_rfc7468", "name": "base64ct::decoder::Decoder::is_finished", "size": 24}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 24}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::is_odd", "size": 24}, {"crate": "embassy_rp", "name": "embassy_rp::reset::unreset_wait", "size": 24}, {"crate": "embassy_rp", "name": "defmt::export::fmt", "size": 24}, {"crate": "embassy_rp", "name": "defmt::export::fmt", "size": 24}, {"crate": "embassy_executor", "name": "embassy_executor::raw::Executor::spawn", "size": 24}, {"crate": "embassy_executor", "name": "embassy_executor::raw::state::State::update", "size": 24}, {"crate": "defmt", "name": "defmt::export::str", "size": 24}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 24}, {"crate": "defmt", "name": "core::fmt::Write::write_fmt", "size": 24}, {"crate": "cyw43", "name": "defmt::export::fmt", "size": 24}, {"crate": "std", "name": "::fmt", "size": 24}, {"crate": "std", "name": "::fmt", "size": 24}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::payload_mut", "size": 24}, {"crate": "embassy_net_driver_channel?", "name": "::fmt", "size": 24}, {"crate": "embassy_executor?", "name": "::fmt", "size": 24}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 24}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 24}, {"crate": "std", "name": "<&T as core::fmt::Debug>::fmt", "size": 24}, {"crate": "embassy_executor", "name": "embassy_executor::raw::TaskStorage::poll", "size": 24}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index", "size": 24}, {"name": "__aeabi_ldivmod", "size": 22}, {"name": "__aeabi_uldivmod", "size": 22}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 22}, {"crate": "smoltcp", "name": "smoltcp::socket::waker::WakerRegistration::wake", "size": 22}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::waker_registration::WakerRegistration::wake", "size": 22}, {"crate": "defmt_rtt", "name": "defmt_rtt::channel::Channel::nonblocking_write", "size": 22}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 22}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 22}, {"crate": "std", "name": "core::array:: for [T; N]>::index", "size": 22}, {"crate": "std", "name": "core::array:: for [T; N]>::index", "size": 22}, {"name": "HardFaultTrampoline", "size": 20}, {"crate": "x509_cert", "name": "::encoded_len", "size": 20}, {"crate": "std", "name": "::next", "size": 20}, {"crate": "pkcs8", "name": "::encoded_len", "size": 20}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 20}, {"crate": "std", "name": "core::array:: for [T; N]>::index", "size": 20}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 20}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 20}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::fe_neg", "size": 20}, {"crate": "hash32", "name": "<&T as core::fmt::Debug>::fmt", "size": 20}, {"crate": "embassy_rp", "name": "::now", "size": 20}, {"crate": "std", "name": "core::option::unwrap_failed", "size": 20}, {"crate": "std", "name": "core::fmt::Write::write_fmt", "size": 20}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::backplane_set_window::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::check_status::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::core_is_up::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::write32_swapped::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::read32_swapped::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_write32::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::wlan_read::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_read8::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::write16::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::writen::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::readn::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::read8::{{closure}}>", "size": 20}, {"crate": "std?", "name": "core::ptr::drop_in_place< as cyw43::bus::SpiBusCyw43>::cmd_write::{{closure}}>", "size": 20}, {"crate": "std?", "name": "core::ptr::drop_in_place< as cyw43::bus::SpiBusCyw43>::cmd_read::{{closure}}>", "size": 20}, {"crate": "std", "name": "<() as core::fmt::Debug>::fmt", "size": 20}, {"crate": "embassy_executor", "name": "embassy_executor::raw::util::UninitCell::write_in_place", "size": 20}, {"crate": "std", "name": "__udivmodsi4", "size": 18}, {"name": "__aeabi_uidivmod", "size": 18}, {"crate": "std", "name": "__udivmoddi4", "size": 18}, {"crate": "tuf_no_std_der", "name": "sec1::point::EncodedPoint::is_identity", "size": 18}, {"crate": "spki", "name": " as core::default::Default>::default", "size": 18}, {"crate": "smoltcp", "name": "smoltcp::socket::dhcpv4::Socket::config_changed", "size": 18}, {"crate": "der", "name": "der::writer::Writer::write_byte", "size": 18}, {"crate": "der", "name": "der::asn1::bit_string::BitStringRef::as_bytes", "size": 18}, {"crate": "der", "name": "der::asn1::integer::uint::::value_len", "size": 18}, {"crate": "defmt", "name": "defmt::export::integers::u64", "size": 18}, {"crate": "defmt", "name": "defmt::export::integers::u8", "size": 18}, {"crate": "defmt", "name": "defmt::export::istr", "size": 18}, {"crate": "benchmark_code_size_no_tuf", "name": "benchmark_code_size_no_tuf::__cortex_m_rt_main", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place>::read32_swapped::{{closure}},cyw43::bus::Bus>::init::{{closure}}::{{closure}}>>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place>::wait_for_event::{{closure}}>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_write8::{{closure}}>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place>::write8::{{closure}}>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place::cmd_read::{{closure}}>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place::write::{{closure}}>", "size": 18}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memset", "size": 16}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Repr::buffer_len", "size": 16}, {"crate": "smoltcp", "name": ">::add_assign", "size": 16}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 16}, {"crate": "pem_rfc7468", "name": "<&T as core::fmt::Display>::fmt", "size": 16}, {"crate": "p256", "name": "ff::Field::is_zero", "size": 16}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::State::pop_index", "size": 16}, {"crate": "embassy_executor", "name": "defmt::export::fmt", "size": 16}, {"crate": "der", "name": "der::tag::Tag::is_constructed", "size": 16}, {"crate": "der", "name": ">::spec_eq", "size": 16}, {"crate": "defmt", "name": "defmt::encoding::inner::Encoder::write::{{closure}}", "size": 16}, {"crate": "defmt", "name": "defmt::export::integers::u32", "size": 16}, {"crate": "defmt", "name": "::write_str", "size": 16}, {"crate": "defmt", "name": "<&T as core::fmt::Display>::fmt", "size": 16}, {"crate": "std", "name": "::fmt", "size": 16}, {"crate": "std", "name": "<&T as core::fmt::Debug>::fmt", "size": 16}, {"crate": "std", "name": "<&T as core::fmt::Display>::fmt", "size": 16}, {"crate": "bt4ot_embedded", "name": "sec1::point::EncodedPoint::is_identity", "size": 16}, {"crate": "subtle?", "name": "::not", "size": 16}, {"crate": "embassy_net?", "name": " as smoltcp::phy::Device>::capabilities", "size": 16}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 16}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 16}, {"crate": "embassy_executor", "name": "embassy_executor::raw::util::UninitCell::write_in_place", "size": 16}, {"crate": "std", "name": "core::fmt::Formatter::write_fmt", "size": 14}, {"crate": "pkcs8", "name": "der::encode::EncodeValue::header", "size": 14}, {"crate": "p256", "name": "p256::arithmetic::scalar::Scalar::is_even", "size": 14}, {"crate": "p256", "name": " as crypto_bigint::traits::Integer>::is_odd", "size": 14}, {"crate": "embassy_time", "name": "_defmt_timestamp", "size": 14}, {"crate": "der", "name": "der::tag::Tag::number", "size": 14}, {"crate": "defmt", "name": "defmt::export::header", "size": 14}, {"crate": "crypto_bigint", "name": "crypto_bigint::ct_choice:: for subtle::Choice>::from", "size": 14}, {"crate": "std", "name": "core::str::slice_error_fail", "size": 14}, {"crate": "sha2?", "name": "::finalize_variable_core::{{closure}}", "size": 14}, {"name": "__Thumbv6MABSLongThunk__ZN10embassy_rp5flash11ram_helpers17write_flash_inner17h82c1bb1a60c73aa7E", "size": 12}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memclr8", "size": 12}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memclr", "size": 12}, {"crate": "x509_cert", "name": " as der::encode::EncodeValue>::value_len", "size": 12}, {"crate": "spki", "name": " as generic_array::sequence::GenericSequence>::generate", "size": 12}, {"crate": "spki", "name": " as generic_array::sequence::GenericSequence>::generate", "size": 12}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::State::push_index", "size": 12}, {"crate": "embassy_rp", "name": "TIMER_IRQ_0", "size": 12}, {"crate": "embassy_rp", "name": "TIMER_IRQ_1", "size": 12}, {"crate": "embassy_rp", "name": "TIMER_IRQ_2", "size": 12}, {"crate": "embassy_rp", "name": "TIMER_IRQ_3", "size": 12}, {"crate": "embassy_executor", "name": "embassy_executor::raw::waker::clone", "size": 12}, {"crate": "embassy_executor", "name": "embassy_executor::raw::SyncExecutor::alarm_callback", "size": 12}, {"crate": "der", "name": "::value_len", "size": 12}, {"crate": "crypto_bigint", "name": "subtle::black_box", "size": 12}, {"crate": "bt4ot_embedded", "name": "<&T as core::fmt::Debug>::fmt", "size": 12}, {"name": "__aeabi_memmove8", "size": 10}, {"name": "__aeabi_memcpy8", "size": 10}, {"name": "__aeabi_memclr4", "size": 10}, {"name": "__aeabi_memcpy4", "size": 10}, {"name": "__aeabi_memcpy", "size": 10}, {"name": "__aeabi_uidiv", "size": 10}, {"name": "__aeabi_memclr", "size": 10}, {"name": "memcmp", "size": 10}, {"name": "__aeabi_memset4", "size": 10}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memmove8", "size": 10}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memmove", "size": 10}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memcpy8", "size": 10}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memcpy", "size": 10}, {"name": "__aeabi_memclr8", "size": 10}, {"crate": "pkcs8", "name": "::encoded_len", "size": 10}, {"crate": "der", "name": "der::tag:: for u8>::from", "size": 10}, {"crate": "defmt", "name": "defmt::export::bool", "size": 10}, {"crate": "std", "name": "core::cmp::impls:: for &A>::eq", "size": 10}, {"crate": "x509_cert", "name": "x509_cert::time::Time::to_unix_duration", "size": 8}, {"crate": "defmt", "name": "defmt::default_panic::panic_cold_explicit", "size": 8}, {"crate": "defmt", "name": "__defmt_default_panic", "size": 8}, {"name": "main", "size": 8}, {"crate": "cortex_m_rt", "name": "HardFault_", "size": 2}, {"crate": "embassy_executor", "name": "embassy_executor::raw::waker::drop", "size": 2}, {"crate": "defmt", "name": "__defmt_default_timestamp", "size": 2}, {"crate": "cortex_m_rt", "name": "DefaultHandler_", "size": 2}]}, "cargo_bloat_crates": {"file-size": 1773272, "text-section-size": 168980, "crates": [{"name": "bt4ot_embedded", "size": 28638}, {"name": "benchmark_code_size_no_tuf", "size": 27882}, {"name": "smoltcp", "size": 25114}, {"name": "std", "size": 15042}, {"name": "p256", "size": 12560}, {"name": "cyw43", "size": 10212}, {"name": "embassy_executor", "size": 8938}, {"name": "der", "size": 6866}, {"name": "pem_rfc7468", "size": 5458}, {"name": "sha2", "size": 3922}, {"name": "pkcs8", "size": 3838}, {"name": "x509_cert", "size": 3236}, {"name": "embassy_net", "size": 3182}, {"name": "spki", "size": 1336}, {"name": "embassy_rp", "size": 1336}, {"name": "tuf_no_std_der", "size": 1274}, {"name": "embassy_embedded_hal", "size": 1232}, {"name": "const_oid", "size": 1198}, {"name": "serde_json_core", "size": 1012}, {"name": "cyw43_pio", "size": 760}, {"name": "defmt", "size": 758}, {"name": "embassy_sync", "size": 622}, {"name": "defmt_rtt", "size": 466}, {"name": "tuf_no_std_common", "size": 432}, {"name": "[Unknown]", "size": 412}, {"name": "ecdsa", "size": 346}, {"name": "sec1", "size": 304}, {"name": "panic_probe", "size": 276}, {"name": "pio", "size": 244}, {"name": "base64ct", "size": 228}, {"name": "crypto_bigint", "size": 228}, {"name": "embassy_boot", "size": 198}, {"name": "embassy_time", "size": 134}, {"name": "embedded_io_async", "size": 132}, {"name": "heapless", "size": 130}, {"name": "byteorder", "size": 120}, {"name": "generic_array", "size": 88}, {"name": "serde", "size": 88}, {"name": "bt4ot_ota_common", "size": 84}, {"name": "hex", "size": 72}, {"name": "embassy_net_driver_channel", "size": 60}, {"name": "subtle", "size": 56}, {"name": "embassy_hal_internal", "size": 48}, {"name": "cortex_m_rt", "size": 44}, {"name": "cortex_m", "size": 36}, {"name": "embassy_net_driver", "size": 36}, {"name": "portable_atomic", "size": 32}, {"name": "no_std_net", "size": 30}, {"name": "atomic_polyfill", "size": 28}, {"name": "critical_section", "size": 28}, {"name": "digest", "size": 26}, {"name": "hash32", "size": 20}]}}, "benchmark-code-size-signature-only": {"raw_size": 147548, "cargo_bloat": {"file-size": 1324176, "text-section-size": 121812, "functions": [{"crate": "benchmark_code_size_signature_only", "name": "benchmark_code_size_signature_only::____embassy_main_task::{{closure}}", "size": 25908}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::ethernet::::process_ethernet", "size": 9676}, {"crate": "p256", "name": "::mul", "size": 5526}, {"crate": "embassy_executor", "name": "embassy_executor::raw::TaskStorage::poll", "size": 5452}, {"crate": "cyw43", "name": "cyw43::runner::Runner::check_status::{{closure}}", "size": 4320}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::dispatch_ip", "size": 4264}, {"crate": "sha2", "name": "sha2::sha256::compress256", "size": 3440}, {"crate": "embassy_executor", "name": "embassy_executor::raw::TaskStorage::poll", "size": 2528}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::fe_mul", "size": 2422}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::montgomery_reduce", "size": 1670}, {"crate": "std", "name": "core::fmt::Formatter::pad", "size": 1536}, {"crate": "std", "name": "core::char::methods::::escape_debug_ext", "size": 1020}, {"crate": "std", "name": "compiler_builtins::int::specialized_div_rem::u64_div_rem", "size": 938}, {"crate": "embassy_embedded_hal?", "name": " as embedded_storage::nor_flash::NorFlash>::write", "size": 828}, {"crate": "std", "name": "compiler_builtins::mem::memmove", "size": 788}, {"crate": "smoltcp", "name": "smoltcp::socket::dhcpv4::Socket::parse_ack", "size": 728}, {"crate": "std", "name": "core::str::slice_error_fail_rt", "size": 668}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::Interface::poll_at::{{closure}}", "size": 650}, {"crate": "der?", "name": "::fmt", "size": 612}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 608}, {"crate": "std", "name": "::write_str", "size": 604}, {"crate": "embassy_net", "name": "embassy_net::tcp::embedded_io_impls::::write::{{closure}}", "size": 584}, {"crate": "tuf_no_std_common", "name": ">::add", "size": 560}, {"crate": "std", "name": "core::str::converts::from_utf8", "size": 552}, {"crate": "embassy_net", "name": "embassy_net::tcp::TcpSocket::connect::{{closure}}", "size": 552}, {"crate": "der", "name": "::decode", "size": 548}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Repr::emit", "size": 544}, {"crate": "embassy_net", "name": "embassy_net::tcp::embedded_io_impls::::read::{{closure}}", "size": 532}, {"crate": "tuf_no_std_common", "name": " as core::ops::arith::Mul>::mul", "size": 500}, {"crate": "smoltcp", "name": "smoltcp::wire::arp::Repr::emit", "size": 500}, {"crate": "p256", "name": "p256::arithmetic::scalar::scalar_impl::subtract_n_if_necessary", "size": 488}, {"crate": "tuf_no_std_der", "name": " as elliptic_curve::point::DecompressPoint>::decompress", "size": 480}, {"crate": "std", "name": "core::fmt::Formatter::pad_integral", "size": 478}, {"crate": "der", "name": "<&T as core::fmt::Display>::fmt", "size": 472}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::sub_inner", "size": 464}, {"crate": "pkcs8", "name": "::decode", "size": 456}, {"crate": "pkcs8", "name": "::decode", "size": 456}, {"crate": "tuf_no_std_common", "name": ">::double", "size": 448}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 440}, {"crate": "std", "name": "core::fmt::num::::fmt", "size": 440}, {"crate": "cyw43", "name": "cyw43::runner::Runner::core_reset::{{closure}}", "size": 428}, {"crate": "embassy_net", "name": "embassy_net::Inner::apply_static_config", "size": 428}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::TcpOption::emit", "size": 412}, {"crate": "cyw43_pio?", "name": " as cyw43::bus::SpiBusCyw43>::cmd_read::{{closure}}", "size": 408}, {"crate": "cyw43", "name": "cyw43::runner::Runner::core_disable::{{closure}}", "size": 400}, {"crate": "embassy_executor", "name": "embassy_executor::arch::thread::Executor::run", "size": 400}, {"crate": "cyw43", "name": "cyw43::control::Control::set_iovar::{{closure}}", "size": 396}, {"crate": "std", "name": "compiler_builtins::int::specialized_div_rem::u32_div_rem", "size": 392}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_write::{{closure}}", "size": 384}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_read::{{closure}}", "size": 376}, {"crate": "embassy_net", "name": "embassy_net::tcp::TcpSocket::new", "size": 360}, {"crate": "cyw43_pio?", "name": " as cyw43::bus::SpiBusCyw43>::cmd_write::{{closure}}", "size": 352}, {"crate": "cyw43", "name": "cyw43::runner::Runner::handle_irq::{{closure}}", "size": 344}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::fe_add", "size": 340}, {"crate": "std", "name": "compiler_builtins::mem::memcpy", "size": 334}, {"crate": "ecdsa", "name": "::decode", "size": 332}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 332}, {"crate": "const_oid", "name": "const_oid::arcs::Arcs::try_next", "size": 332}, {"crate": "std", "name": "core::fmt::write", "size": 330}, {"crate": "der", "name": ">::try_from", "size": 324}, {"crate": "std", "name": "core::fmt::builders::DebugStruct::field", "size": 324}, {"crate": "cyw43", "name": "cyw43::control::Control::get_iovar::{{closure}}", "size": 292}, {"crate": "cyw43", "name": "cyw43::bus::Bus::backplane_set_window::{{closure}}", "size": 288}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::ack_reply", "size": 280}, {"crate": "cyw43", "name": "cyw43::control::Control::ioctl::{{closure}}", "size": 272}, {"crate": "std", "name": "core::unicode::printable::check", "size": 260}, {"crate": "smoltcp", "name": "<&T as core::fmt::Display>::fmt", "size": 256}, {"crate": "std", "name": "core::ptr::drop_in_place>", "size": 248}, {"crate": "pio", "name": "pio::InstructionOperands::encode", "size": 244}, {"crate": "std", "name": "core::fmt::num::imp::::fmt", "size": 244}, {"crate": "sha2", "name": "sha2::sha256::soft::schedule", "size": 238}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 236}, {"crate": "cyw43", "name": "cyw43::bus::Bus::wlan_write::{{closure}}", "size": 232}, {"crate": "sha2", "name": "sha2::sha256::soft::sha256_digest_round_x2", "size": 230}, {"crate": "cyw43", "name": "cyw43::bus::Bus::wait_for_event::{{closure}}", "size": 224}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::reset", "size": 222}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::is_broadcast_v4", "size": 220}, {"crate": "smoltcp", "name": "smoltcp::iface::route::Routes::lookup", "size": 220}, {"crate": "embassy_embedded_hal?", "name": " as embedded_storage::nor_flash::NorFlash>::erase", "size": 216}, {"crate": "smoltcp", "name": "smoltcp::iface::route::Routes::remove_default_ipv4_route", "size": 204}, {"crate": "const_oid?", "name": "::fmt", "size": 204}, {"crate": "cyw43", "name": "cyw43::control::Control::set_iovar_u32x2::{{closure}}", "size": 204}, {"crate": "smoltcp", "name": "heapless::linear_map::LinearMap::insert", "size": 196}, {"crate": "std", "name": "core::fmt::Formatter::debug_tuple_field1_finish", "size": 196}, {"crate": "cyw43", "name": "cyw43::bus::Bus::readn::{{closure}}", "size": 196}, {"crate": "embassy_net", "name": "embassy_net::tcp::embedded_io_impls::::flush::{{closure}}", "size": 196}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::rst_reply", "size": 190}, {"crate": "p256", "name": "::add_assign", "size": 188}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::ipv4::::icmpv4_reply", "size": 186}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Repr::parse", "size": 184}, {"crate": "cyw43", "name": "cyw43::bus::Bus::backplane_writen::{{closure}}", "size": 184}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::seq_to_transmit", "size": 180}, {"crate": "embassy_rp", "name": "embassy_rp::pio::Common::try_load_program_at", "size": 176}, {"crate": "std", "name": "core::cmp::PartialEq::ne", "size": 172}, {"crate": "const_oid", "name": "<&T as core::fmt::Display>::fmt", "size": 168}, {"crate": "cyw43", "name": "cyw43::bus::Bus::backplane_readn::{{closure}}", "size": 168}, {"crate": "der", "name": "::read_slice", "size": 166}, {"crate": "std", "name": "compiler_builtins::mem::memset", "size": 160}, {"crate": "std", "name": "core::panicking::assert_failed_inner", "size": 160}, {"crate": "smoltcp", "name": "smoltcp::iface::socket_set::SocketSet::add::put", "size": 158}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::enqueue_many", "size": 156}, {"crate": "smoltcp", "name": "smoltcp::wire::ip::checksum::data", "size": 152}, {"crate": "panic_probe", "name": "<&T as core::fmt::Display>::fmt", "size": 152}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::Interface::socket_egress::{{closure}}", "size": 152}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 152}, {"crate": "smoltcp", "name": "smoltcp::iface::neighbor::Cache::lookup", "size": 148}, {"crate": "embassy_net", "name": "::drop", "size": 148}, {"crate": "cyw43", "name": "cyw43::bus::Bus::writen::{{closure}}", "size": 148}, {"crate": "tuf_no_std_common", "name": "<&T as core::fmt::Debug>::fmt", "size": 144}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::next_header", "size": 144}, {"crate": "const_oid", "name": "const_oid::ObjectIdentifier::from_bytes", "size": 144}, {"crate": "defmt_rtt", "name": "_defmt_write", "size": 140}, {"crate": "spki?", "name": "::fmt", "size": 140}, {"crate": "sec1?", "name": "::fmt", "size": 136}, {"crate": "p256", "name": ">::sub_assign", "size": 136}, {"crate": "cyw43", "name": "cyw43::bus::Bus::write32_swapped::{{closure}}", "size": 136}, {"crate": "embassy_rp", "name": "_embassy_time_set_alarm", "size": 132}, {"crate": "cyw43", "name": "cyw43::bus::Bus::read32_swapped::{{closure}}", "size": 132}, {"crate": "embedded_io_async", "name": "embedded_io_async::Read::read_exact::{{closure}}", "size": 132}, {"crate": "embassy_rp", "name": "embassy_rp::flash::ram_helpers::flash_function_pointers_with_boot2", "size": 128}, {"crate": "der", "name": "der::tag::Tag::assert_eq", "size": 128}, {"crate": "std", "name": "core::fmt::Formatter::debug_struct_field2_finish", "size": 128}, {"crate": "defmt", "name": "core::fmt::Write::write_char", "size": 126}, {"crate": "panic_probe", "name": "rust_begin_unwind", "size": 124}, {"crate": "cyw43", "name": "cyw43::control::Control::gpio_set::{{closure}}", "size": 124}, {"crate": "smoltcp", "name": "smoltcp::wire::dhcpv4::Repr::buffer_len", "size": 120}, {"crate": "embassy_net", "name": "smoltcp::iface::socket_set::SocketSet::get_mut", "size": 120}, {"crate": "std", "name": "core::fmt::num::::fmt", "size": 120}, {"crate": "std", "name": "core::fmt::num::::fmt", "size": 120}, {"crate": "std", "name": "core::fmt::num::imp::::fmt", "size": 120}, {"crate": "const_oid", "name": "<&T as core::fmt::Debug>::fmt", "size": 120}, {"crate": "smoltcp", "name": "smoltcp::iface::socket_set::SocketSet::get_mut", "size": 120}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::fill_checksum", "size": 116}, {"crate": "embassy_rp", "name": "IO_IRQ_BANK0", "size": 116}, {"crate": "std", "name": "core::fmt::Formatter::debug_struct_field1_finish", "size": 116}, {"crate": "tuf_no_std_common", "name": "<&T as core::fmt::Debug>::fmt", "size": 112}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::fe_sub", "size": 112}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memcpy4", "size": 110}, {"crate": "embassy_executor", "name": "_embassy_time_schedule_wake", "size": 108}, {"crate": "cyw43", "name": "cyw43::control::Control::ioctl_set_u32::{{closure}}", "size": 108}, {"crate": "smoltcp", "name": "smoltcp::iface::socket_set::SocketSet::remove", "size": 104}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::get_unallocated", "size": 104}, {"crate": "embassy_rp", "name": "embassy_rp::time_driver::TimerDriver::check_alarm", "size": 104}, {"crate": "embassy_boot?", "name": "::fmt", "size": 104}, {"crate": "std", "name": "::fmt", "size": 102}, {"crate": "embassy_rp", "name": "DMA_IRQ_0", "size": 100}, {"crate": "der", "name": "der::reader::Reader::read_into", "size": 100}, {"crate": "std", "name": "core::fmt::num::::fmt", "size": 100}, {"crate": "cyw43", "name": "cyw43::control::Control::set_iovar_u32::{{closure}}", "size": 100}, {"crate": "pkcs8", "name": "der::reader::nested::NestedReader::advance_position", "size": 98}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memset4", "size": 96}, {"crate": "smoltcp", "name": "::fmt", "size": 96}, {"crate": "pkcs8", "name": "der::reader::nested::NestedReader::advance_position", "size": 96}, {"crate": "cyw43", "name": "cyw43::structs::BdcHeader::parse", "size": 96}, {"crate": "std", "name": "core::ptr::drop_in_place>>", "size": 96}, {"crate": "embassy_embedded_hal", "name": "embassy_embedded_hal::flash::partition::blocking::BlockingPartition::new", "size": 96}, {"crate": "embassy_boot", "name": "embassy_boot::firmware_updater::blocking::BlockingFirmwareState::get_state", "size": 94}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::reply", "size": 92}, {"crate": "cyw43", "name": "cyw43::bus::Bus::write16::{{closure}}", "size": 92}, {"crate": "embassy_embedded_hal?", "name": " as embedded_storage::nor_flash::ReadNorFlash>::read", "size": 92}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::route", "size": 90}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::has_neighbor", "size": 90}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 88}, {"crate": "smoltcp", "name": "smoltcp::iface::route::Routes::lookup::{{closure}}", "size": 88}, {"crate": "p256", "name": ">>::reduce_bytes", "size": 88}, {"crate": "generic_array", "name": "generic_array::GenericArray::clone_from_slice", "size": 88}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_read8::{{closure}}", "size": 88}, {"crate": "cyw43", "name": "cyw43::bus::Bus::write8::{{closure}}", "size": 88}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_write32::{{closure}}", "size": 88}, {"crate": "smoltcp", "name": "smoltcp::wire::ip::checksum::pseudo_header", "size": 84}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::challenge_ack_reply", "size": 84}, {"crate": "pkcs8", "name": "der::reader::nested::NestedReader::new", "size": 84}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::atomic_waker::AtomicWaker::register", "size": 84}, {"crate": "embassy_net", "name": "defmt::export::fmt", "size": 84}, {"crate": "defmt_rtt", "name": "_defmt_acquire", "size": 84}, {"crate": "defmt_rtt", "name": "defmt_rtt::channel::Channel::write_impl", "size": 84}, {"crate": "std", "name": "core::ops::function::FnMut::call_mut", "size": 84}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_write8::{{closure}}", "size": 84}, {"crate": "cyw43", "name": "cyw43::bus::Bus::read32::{{closure}}", "size": 84}, {"crate": "cyw43", "name": "cyw43::bus::Bus::read8::{{closure}}", "size": 84}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 84}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::Receiver::receive_done", "size": 84}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::Sender::send_done", "size": 84}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::new_checked", "size": 80}, {"crate": "smoltcp", "name": "::next", "size": 80}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::to_canonical", "size": 80}, {"crate": "embassy_rp", "name": "embassy_rp::flash::ram_helpers::flash_range_program", "size": 80}, {"crate": "smoltcp", "name": "smoltcp::wire::dhcpv4::DhcpOptionWriter::emit", "size": 76}, {"crate": "smoltcp", "name": "::fmt", "size": 76}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Repr::header_len", "size": 76}, {"crate": "pkcs8", "name": " as der::reader::Reader>::read_into", "size": 76}, {"crate": "pkcs8", "name": " as der::reader::Reader>::read_into", "size": 76}, {"crate": "crypto_bigint", "name": "crypto_bigint::uint::array::>::from_be_byte_array", "size": 76}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 76}, {"crate": "bt4ot_embedded", "name": "<&T as core::fmt::Debug>::fmt", "size": 76}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 76}, {"name": "__aeabi_lmul", "size": 74}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::to_bytes", "size": 74}, {"crate": "smoltcp", "name": "heapless::vec::Vec::clone", "size": 72}, {"crate": "der", "name": "der::length::Length::initial_octet", "size": 72}, {"crate": "embassy_rp", "name": "::acquire", "size": 72}, {"crate": "embassy_net", "name": "embassy_net::tcp::TcpSocket::set_timeout", "size": 72}, {"crate": "der", "name": "der::reader::slice::SliceReader::remaining", "size": 72}, {"crate": "defmt_rtt", "name": "_defmt_release", "size": 72}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::Sender::poll_send", "size": 72}, {"crate": "std", "name": "__clzsi2", "size": 70}, {"crate": "std", "name": ">::into", "size": 68}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::in_same_network", "size": 68}, {"crate": "p256", "name": "crypto_bigint::uint::add::>::wrapping_add", "size": 68}, {"crate": "std", "name": "core::result::unwrap_failed", "size": 68}, {"crate": "std", "name": "::write_char", "size": 68}, {"crate": "pkcs8", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "pkcs8", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "der", "name": "der::reader::Reader::read_byte", "size": 66}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 64}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::from_bytes", "size": 64}, {"crate": "p256", "name": ">::shr_assign", "size": 64}, {"crate": "p256", "name": " as subtle::ConditionallySelectable>::conditional_select", "size": 64}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 64}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 64}, {"crate": "defmt_rtt", "name": "defmt_rtt::channel::Channel::blocking_write", "size": 64}, {"crate": "const_oid", "name": "::next", "size": 64}, {"crate": "pkcs8", "name": "::decode_value", "size": 62}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::sqn", "size": 62}, {"crate": "std", "name": "core::fmt::Formatter::pad_integral::write_prefix", "size": 62}, {"crate": "std", "name": " as core::fmt::Debug>::fmt", "size": 60}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::enqueue_one", "size": 60}, {"crate": "smoltcp", "name": "<&T as core::fmt::Display>::fmt", "size": 60}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 60}, {"crate": "std", "name": "core::slice::::copy_from_slice::len_mismatch_fail", "size": 60}, {"crate": "std", "name": " as core::fmt::Debug>::fmt", "size": 60}, {"crate": "std", "name": "core::slice::index::slice_index_order_fail", "size": 60}, {"crate": "std", "name": "core::slice::index::slice_end_index_len_fail", "size": 60}, {"crate": "std", "name": "core::panicking::panic_bounds_check", "size": 60}, {"crate": "std", "name": "core::slice::index::slice_start_index_len_fail", "size": 60}, {"crate": "std", "name": "core::ptr::drop_in_place>::init::{{closure}}>", "size": 60}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::atomic_waker::AtomicWaker::wake", "size": 58}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::Interface::socket_egress::{{closure}}", "size": 58}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::has_ip_addr", "size": 56}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 56}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 56}, {"crate": "pkcs8", "name": " as der::reader::Reader>::read_slice", "size": 56}, {"crate": "embassy_executor", "name": "__pender", "size": 56}, {"crate": "std", "name": "core::panicking::panic_explicit", "size": 56}, {"crate": "bt4ot_embedded", "name": "elliptic_curve::scalar::primitive::ScalarPrimitive::from_slice", "size": 56}, {"name": "PIO0_IRQ_0", "size": 56}, {"crate": "heapless", "name": "heapless::deque::Deque::pop_front", "size": 56}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 56}, {"crate": "embassy_executor", "name": "embassy_executor::raw::util::UninitCell::write_in_place", "size": 56}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::Sender::try_send", "size": 56}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::waker_registration::WakerRegistration::register", "size": 54}, {"crate": "tuf_no_std_common", "name": "sec1::point::EncodedPoint::tag", "size": 52}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet<&T>::payload", "size": 52}, {"crate": "embassy_time", "name": "::poll", "size": 52}, {"crate": "embassy_rp", "name": "__pre_init", "size": 52}, {"crate": "embassy_rp", "name": "_embassy_time_set_alarm_callback", "size": 52}, {"crate": "embassy_net", "name": "embassy_net::to_smoltcp_hardware_address", "size": 52}, {"crate": "embassy_executor", "name": "embassy_executor::arch::thread::Executor::new", "size": 52}, {"crate": "der", "name": "::fmt", "size": 52}, {"crate": "std", "name": "core::slice::::split_at_mut", "size": 52}, {"crate": "std", "name": "core::option::expect_failed", "size": 52}, {"crate": "std", "name": "core::ptr::drop_in_place>::core_reset::{{closure}}>", "size": 52}, {"crate": "smoltcp", "name": "smoltcp::socket::waker::WakerRegistration::register", "size": 50}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Address::from_bytes", "size": 48}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 48}, {"crate": "smoltcp", "name": "defmt::traits::Format::_format_data", "size": 48}, {"crate": "smoltcp", "name": "::sub", "size": 48}, {"crate": "smoltcp", "name": ">::add", "size": 48}, {"crate": "crypto_bigint", "name": "crypto_bigint::uint::Uint<_>::from_words", "size": 48}, {"crate": "embassy_hal_internal", "name": "embassy_hal_internal::interrupt::InterruptExt::set_priority", "size": 48}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 48}, {"crate": "std", "name": "core::cell::panic_already_mutably_borrowed", "size": 48}, {"crate": "std", "name": "core::cell::panic_already_borrowed", "size": 48}, {"crate": "bt4ot_ota_common", "name": "defmt::export::fmt", "size": 48}, {"crate": "bt4ot_embedded", "name": "ecdsa::der::Signature::s", "size": 48}, {"crate": "bt4ot_embedded", "name": "ecdsa::der::Signature::r", "size": 48}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::set_src_addr", "size": 48}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::set_dst_addr", "size": 48}, {"crate": "tuf_no_std_common?", "name": "::fmt", "size": 48}, {"crate": "embassy_sync?", "name": "::fmt", "size": 48}, {"crate": "std", "name": "compiler_builtins::mem::memcmp", "size": 46}, {"name": "__aeabi_llsl", "size": 44}, {"crate": "byteorder", "name": "::write_u32", "size": 44}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::msg_type", "size": 44}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 44}, {"crate": "defmt", "name": "defmt::impls::primitives::::_format_data", "size": 44}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::ack_to_transmit", "size": 44}, {"crate": "embassy_rp", "name": "_embassy_time_allocate_alarm", "size": 44}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::set_ethertype", "size": 44}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 44}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::new_checked", "size": 42}, {"crate": "heapless?", "name": " as core::iter::traits::iterator::Iterator>::next", "size": 42}, {"crate": "std", "name": "core::ptr::drop_in_place>::core_disable::{{closure}}>", "size": 42}, {"crate": "std", "name": "core::ptr::drop_in_place>::handle_irq::{{closure}}>", "size": 42}, {"crate": "subtle", "name": "subtle::CtOption::unwrap", "size": 40}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet<&mut T>::data_mut", "size": 40}, {"crate": "crypto_bigint", "name": "crypto_bigint::uint::cmp::>::ct_lt", "size": 40}, {"crate": "embassy_executor", "name": "embassy_executor::raw::state::State::update", "size": 40}, {"crate": "der", "name": "der::asn1::integer::uint::strip_leading_zeroes", "size": 40}, {"crate": "std", "name": "core::panicking::panic_const::panic_const_rem_by_zero", "size": 40}, {"crate": "const_oid", "name": ">::try_from", "size": 40}, {"crate": "byteorder", "name": "::write_u16", "size": 40}, {"crate": "std", "name": "<&T as core::fmt::Debug>::fmt", "size": 40}, {"crate": "cortex_m_rt", "name": "Reset", "size": 40}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Timer::should_keep_alive", "size": 38}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::contiguous_window", "size": 38}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::is_unicast_v4", "size": 38}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::window_to_update", "size": 38}, {"crate": "p256", "name": "p256::arithmetic::field::field_impl::fe32_to_fe64", "size": 38}, {"crate": "crypto_bigint", "name": "crypto_bigint::uint::cmp::>::ct_eq", "size": 38}, {"crate": "embassy_executor", "name": "embassy_executor::raw::waker::wake", "size": 38}, {"crate": "const_oid", "name": "<&T as core::fmt::Debug>::fmt", "size": 38}, {"crate": "embassy_net?", "name": "::clone", "size": 38}, {"crate": "p256?", "name": "::neg", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::set_checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_echo_seq_no", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_echo_ident", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_msg_type", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::set_checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::payload_mut", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::set_len", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::set_dst_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::set_src_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Packet::set_checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::len", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::echo_seq_no", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::echo_ident", "size": 36}, {"crate": "byteorder", "name": "::read_u16", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Packet::dst_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Packet::src_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::socket::dhcpv4::Socket::reset", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::dst_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::src_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::total_len", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::scaled_window", "size": 36}, {"crate": "embassy_time", "name": ">::add", "size": 36}, {"crate": "embassy_rp", "name": "::release", "size": 36}, {"crate": "embassy_net_driver", "name": "defmt::export::fmt_array", "size": 36}, {"crate": "std", "name": "core::fmt::num::::fmt", "size": 36}, {"crate": "der", "name": "<&T as core::fmt::Debug>::fmt", "size": 36}, {"crate": "std", "name": "::fmt", "size": 36}, {"crate": "std", "name": "core::panicking::panic_const::panic_const_async_fn_resumed", "size": 36}, {"crate": "std", "name": "core::panicking::panic", "size": 36}, {"crate": "bt4ot_ota_common", "name": "defmt::export::fmt", "size": 36}, {"crate": "der?", "name": "::fmt", "size": 36}, {"crate": "embassy_net_driver_channel?", "name": " as embassy_net_driver::Driver>::hardware_address", "size": 36}, {"crate": "cortex_m", "name": "cortex_m::peripheral::scb::::sys_reset", "size": 36}, {"crate": "embassy_rp?", "name": " as core::future::future::Future>::poll", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::header_len", "size": 36}, {"crate": "std", "name": "core::ptr::drop_in_place>", "size": 36}, {"crate": "embassy_rp", "name": "embassy_rp::pio::instr::set_pindir", "size": 36}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 36}, {"crate": "const_oid?", "name": "::eq", "size": 34}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::set_state", "size": 34}, {"crate": "ecdsa", "name": "ecdsa::der::find_scalar_range", "size": 34}, {"crate": "bt4ot_embedded", "name": "crypto_bigint::traits::Zero::is_zero", "size": 34}, {"crate": "std", "name": "core::iter::traits::iterator::Iterator::nth", "size": 34}, {"crate": "embassy_executor", "name": "embassy_executor::raw::state::State::update", "size": 34}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Address::from_bytes", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::dst_addr", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::src_addr", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet<&T>::data", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Packet::header_len", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::header_len", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::dst_addr", "size": 32}, {"crate": "std", "name": "core::cell::RefCell::borrow_mut", "size": 32}, {"crate": "const_oid", "name": "const_oid::ObjectIdentifier::as_bytes", "size": 32}, {"crate": "heapless", "name": "heapless::deque::Deque::len", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::set_checksum", "size": 32}, {"crate": "std", "name": "core::ptr::drop_in_place>::backplane_writen::{{closure}}>", "size": 32}, {"crate": "std", "name": "core::ptr::drop_in_place>::wlan_write::{{closure}}>", "size": 32}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_write::{{closure}}>", "size": 32}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_read::{{closure}}>", "size": 32}, {"crate": "portable_atomic", "name": "portable_atomic::AtomicBool::compare_exchange", "size": 32}, {"crate": "embassy_time", "name": "embassy_time::timer::Timer::after_millis", "size": 32}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::multi_waker::MultiWakerRegistration<_>::wake", "size": 32}, {"crate": "embassy_rp", "name": "embassy_rp::pio::instr::exec_jmp", "size": 32}, {"crate": "tuf_no_std_der", "name": "elliptic_curve::scalar::nonzero::NonZeroScalar::new", "size": 30}, {"crate": "smoltcp", "name": "smoltcp::wire::ip::checksum::combine", "size": 30}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Cidr::contains_addr", "size": 30}, {"crate": "p256", "name": "::double", "size": 30}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::square", "size": 30}, {"crate": "no_std_net", "name": "core::slice::::copy_from_slice", "size": 30}, {"crate": "std", "name": "core::panicking::panic_fmt", "size": 30}, {"crate": "std", "name": "core::cell::RefCell::borrow_mut", "size": 30}, {"crate": "std", "name": "core::ptr::drop_in_place>::backplane_readn::{{closure}}>", "size": 30}, {"crate": "std", "name": "core::ptr::drop_in_place>::log_init::{{closure}}>", "size": 30}, {"crate": "p256?", "name": ">::add", "size": 28}, {"crate": "p256?", "name": ">::mul", "size": 28}, {"crate": "p256?", "name": "::sub", "size": 28}, {"crate": "smoltcp", "name": "smoltcp::parsers::Parser::advance", "size": 28}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 28}, {"crate": "p256", "name": "p256::arithmetic::field::FieldElement::multiply", "size": 28}, {"crate": "critical_section", "name": "critical_section::with", "size": 28}, {"crate": "cyw43", "name": "defmt::export::fmt", "size": 28}, {"crate": "atomic_polyfill", "name": "atomic_polyfill::polyfill::AtomicU32::fetch_or", "size": 28}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 28}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 28}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 28}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 28}, {"crate": "std?", "name": "core::ptr::drop_in_place< as cyw43::bus::SpiBusCyw43>::wait_for_event::{{closure}}>", "size": 28}, {"crate": "std", "name": "core::ptr::drop_in_place::{{closure}}>", "size": 28}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::get_idx_unchecked", "size": 26}, {"crate": "smoltcp", "name": "smoltcp::parsers::Parser::accept_digit", "size": 26}, {"crate": "std", "name": "core::result::Result::and_then", "size": 26}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 26}, {"crate": "digest", "name": " as digest::Update>::update::{{closure}}", "size": 26}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 26}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_msg_code", "size": 24}, {"crate": "smoltcp?", "name": "::fmt", "size": 24}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::arp::Packet::hardware_len", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::hop_limit", "size": 24}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame<&T>::payload", "size": 24}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 24}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 24}, {"crate": "signature", "name": "::fmt", "size": 24}, {"crate": "p256", "name": "core::panicking::assert_failed", "size": 24}, {"crate": "embassy_rp", "name": "embassy_rp::reset::unreset_wait", "size": 24}, {"crate": "embassy_rp", "name": "defmt::export::fmt", "size": 24}, {"crate": "embassy_rp", "name": "defmt::export::fmt", "size": 24}, {"crate": "embassy_executor", "name": "embassy_executor::raw::Executor::spawn", "size": 24}, {"crate": "embassy_executor", "name": "embassy_executor::raw::state::State::update", "size": 24}, {"crate": "defmt", "name": "defmt::export::str", "size": 24}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 24}, {"crate": "defmt", "name": "core::fmt::Write::write_fmt", "size": 24}, {"crate": "cyw43", "name": "defmt::export::fmt", "size": 24}, {"crate": "std", "name": "::fmt", "size": 24}, {"crate": "std", "name": "::fmt", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::payload_mut", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::arp::Packet::protocol_len", "size": 24}, {"crate": "embassy_net_driver_channel?", "name": "::fmt", "size": 24}, {"crate": "embassy_executor?", "name": "::fmt", "size": 24}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 24}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 24}, {"crate": "std", "name": "<&T as core::fmt::Debug>::fmt", "size": 24}, {"crate": "embassy_executor", "name": "embassy_executor::raw::TaskStorage::poll", "size": 24}, {"name": "__aeabi_uldivmod", "size": 22}, {"crate": "smoltcp", "name": "smoltcp::socket::waker::WakerRegistration::wake", "size": 22}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::waker_registration::WakerRegistration::wake", "size": 22}, {"crate": "defmt_rtt", "name": "defmt_rtt::channel::Channel::nonblocking_write", "size": 22}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 22}, {"crate": "std", "name": "core::array:: for [T; N]>::index", "size": 22}, {"crate": "std", "name": "core::array:: for [T; N]>::index", "size": 22}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 22}, {"name": "HardFaultTrampoline", "size": 20}, {"crate": "hash32", "name": "<&T as core::fmt::Debug>::fmt", "size": 20}, {"crate": "embassy_rp", "name": "::now", "size": 20}, {"crate": "std", "name": "core::option::unwrap_failed", "size": 20}, {"crate": "std", "name": "core::fmt::Write::write_fmt", "size": 20}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::backplane_set_window::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::check_status::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::core_is_up::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::write32_swapped::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::read32_swapped::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_write32::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::wlan_read::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_read8::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::write16::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::writen::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::readn::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::read8::{{closure}}>", "size": 20}, {"crate": "std?", "name": "core::ptr::drop_in_place< as cyw43::bus::SpiBusCyw43>::cmd_write::{{closure}}>", "size": 20}, {"crate": "std?", "name": "core::ptr::drop_in_place< as cyw43::bus::SpiBusCyw43>::cmd_read::{{closure}}>", "size": 20}, {"crate": "std", "name": "<() as core::fmt::Debug>::fmt", "size": 20}, {"crate": "embassy_executor", "name": "embassy_executor::raw::util::UninitCell::write_in_place", "size": 20}, {"crate": "std", "name": "__udivmodsi4", "size": 18}, {"name": "__aeabi_uidivmod", "size": 18}, {"crate": "std", "name": "__udivmoddi4", "size": 18}, {"crate": "tuf_no_std_der", "name": "sec1::point::EncodedPoint::is_identity", "size": 18}, {"crate": "smoltcp", "name": "smoltcp::socket::dhcpv4::Socket::config_changed", "size": 18}, {"crate": "defmt", "name": "defmt::export::integers::u64", "size": 18}, {"crate": "defmt", "name": "defmt::export::integers::u8", "size": 18}, {"crate": "defmt", "name": "defmt::export::istr", "size": 18}, {"crate": "benchmark_code_size_signature_only", "name": "benchmark_code_size_signature_only::__cortex_m_rt_main", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place>::read32_swapped::{{closure}},cyw43::bus::Bus>::init::{{closure}}::{{closure}}>>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place>::wait_for_event::{{closure}}>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_write8::{{closure}}>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place>::write8::{{closure}}>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place::cmd_read::{{closure}}>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place::write::{{closure}}>", "size": 18}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memset", "size": 16}, {"crate": "subtle?", "name": "::not", "size": 16}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Repr::buffer_len", "size": 16}, {"crate": "smoltcp", "name": ">::add_assign", "size": 16}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 16}, {"crate": "pem_rfc7468", "name": "<&T as core::fmt::Display>::fmt", "size": 16}, {"crate": "p256", "name": "ff::Field::is_zero", "size": 16}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::State::pop_index", "size": 16}, {"crate": "embassy_executor", "name": "defmt::export::fmt", "size": 16}, {"crate": "defmt", "name": "defmt::encoding::inner::Encoder::write::{{closure}}", "size": 16}, {"crate": "defmt", "name": "defmt::export::integers::u32", "size": 16}, {"crate": "defmt", "name": "::write_str", "size": 16}, {"crate": "defmt", "name": "<&T as core::fmt::Display>::fmt", "size": 16}, {"crate": "std", "name": "::fmt", "size": 16}, {"crate": "std", "name": "<&T as core::fmt::Debug>::fmt", "size": 16}, {"crate": "std", "name": "<&T as core::fmt::Display>::fmt", "size": 16}, {"crate": "embassy_net?", "name": " as smoltcp::phy::Device>::capabilities", "size": 16}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 16}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 16}, {"crate": "embassy_executor", "name": "embassy_executor::raw::util::UninitCell::write_in_place", "size": 16}, {"crate": "sha2?", "name": "::finalize_variable_core::{{closure}}", "size": 14}, {"crate": "std", "name": "core::fmt::Formatter::write_fmt", "size": 14}, {"crate": "p256", "name": "p256::arithmetic::scalar::Scalar::is_even", "size": 14}, {"crate": "p256", "name": " as crypto_bigint::traits::Integer>::is_odd", "size": 14}, {"crate": "embassy_time", "name": "_defmt_timestamp", "size": 14}, {"crate": "defmt", "name": "defmt::export::header", "size": 14}, {"crate": "crypto_bigint", "name": "crypto_bigint::ct_choice:: for subtle::Choice>::from", "size": 14}, {"crate": "std", "name": "core::str::slice_error_fail", "size": 14}, {"name": "__Thumbv6MABSLongThunk__ZN10embassy_rp5flash11ram_helpers17write_flash_inner17h82c1bb1a60c73aa7E", "size": 12}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memclr8", "size": 12}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memclr", "size": 12}, {"crate": "spki", "name": " as generic_array::sequence::GenericSequence>::generate", "size": 12}, {"crate": "spki", "name": " as generic_array::sequence::GenericSequence>::generate", "size": 12}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::State::push_index", "size": 12}, {"crate": "embassy_rp", "name": "TIMER_IRQ_0", "size": 12}, {"crate": "embassy_rp", "name": "TIMER_IRQ_1", "size": 12}, {"crate": "embassy_rp", "name": "TIMER_IRQ_2", "size": 12}, {"crate": "embassy_rp", "name": "TIMER_IRQ_3", "size": 12}, {"crate": "embassy_executor", "name": "embassy_executor::raw::waker::clone", "size": 12}, {"crate": "embassy_executor", "name": "embassy_executor::raw::SyncExecutor::alarm_callback", "size": 12}, {"crate": "crypto_bigint", "name": "subtle::black_box", "size": 12}, {"name": "__aeabi_memmove8", "size": 10}, {"name": "__aeabi_memcpy8", "size": 10}, {"name": "__aeabi_memclr4", "size": 10}, {"name": "__aeabi_memcpy4", "size": 10}, {"name": "__aeabi_memcpy", "size": 10}, {"name": "__aeabi_uidiv", "size": 10}, {"name": "__aeabi_memclr", "size": 10}, {"name": "memcmp", "size": 10}, {"name": "__aeabi_memset4", "size": 10}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memmove8", "size": 10}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memmove", "size": 10}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memcpy8", "size": 10}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memcpy", "size": 10}, {"name": "__aeabi_memclr8", "size": 10}, {"crate": "defmt", "name": "defmt::export::bool", "size": 10}, {"crate": "defmt", "name": "defmt::default_panic::panic_cold_explicit", "size": 8}, {"crate": "defmt", "name": "__defmt_default_panic", "size": 8}, {"name": "main", "size": 8}, {"crate": "cortex_m_rt", "name": "HardFault_", "size": 2}, {"crate": "embassy_executor", "name": "embassy_executor::raw::waker::drop", "size": 2}, {"crate": "defmt", "name": "__defmt_default_timestamp", "size": 2}, {"crate": "cortex_m_rt", "name": "DefaultHandler_", "size": 2}]}, "cargo_bloat_crates": {"file-size": 1324176, "text-section-size": 121812, "crates": [{"name": "benchmark_code_size_signature_only", "size": 25926}, {"name": "smoltcp", "size": 25114}, {"name": "std", "size": 14228}, {"name": "p256", "size": 12224}, {"name": "cyw43", "size": 10212}, {"name": "embassy_executor", "size": 8938}, {"name": "der", "size": 4212}, {"name": "sha2", "size": 3922}, {"name": "embassy_net", "size": 3182}, {"name": "tuf_no_std_common", "size": 1864}, {"name": "pkcs8", "size": 1592}, {"name": "embassy_rp", "size": 1336}, {"name": "embassy_embedded_hal", "size": 1232}, {"name": "const_oid", "size": 1176}, {"name": "cyw43_pio", "size": 760}, {"name": "defmt", "size": 758}, {"name": "embassy_sync", "size": 622}, {"name": "tuf_no_std_der", "size": 528}, {"name": "defmt_rtt", "size": 466}, {"name": "ecdsa", "size": 366}, {"name": "[Unknown]", "size": 354}, {"name": "panic_probe", "size": 276}, {"name": "bt4ot_embedded", "size": 262}, {"name": "pio", "size": 244}, {"name": "crypto_bigint", "size": 228}, {"name": "embassy_boot", "size": 198}, {"name": "spki", "size": 164}, {"name": "sec1", "size": 136}, {"name": "embassy_time", "size": 134}, {"name": "embedded_io_async", "size": 132}, {"name": "heapless", "size": 130}, {"name": "byteorder", "size": 120}, {"name": "generic_array", "size": 88}, {"name": "bt4ot_ota_common", "size": 84}, {"name": "embassy_net_driver_channel", "size": 60}, {"name": "subtle", "size": 56}, {"name": "embassy_hal_internal", "size": 48}, {"name": "cortex_m_rt", "size": 44}, {"name": "cortex_m", "size": 36}, {"name": "embassy_net_driver", "size": 36}, {"name": "portable_atomic", "size": 32}, {"name": "no_std_net", "size": 30}, {"name": "critical_section", "size": 28}, {"name": "atomic_polyfill", "size": 28}, {"name": "digest", "size": 26}, {"name": "signature", "size": 24}, {"name": "hash32", "size": 20}, {"name": "pem_rfc7468", "size": 16}]}}, "benchmark-code-size-update-only": {"raw_size": 103556, "cargo_bloat": {"file-size": 1031252, "text-section-size": 84740, "functions": [{"crate": "benchmark_code_size_update_only", "name": "benchmark_code_size_update_only::____embassy_main_task::{{closure}}", "size": 17416}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::ethernet::::process_ethernet", "size": 9676}, {"crate": "embassy_executor", "name": "embassy_executor::raw::TaskStorage::poll", "size": 5452}, {"crate": "cyw43", "name": "cyw43::runner::Runner::check_status::{{closure}}", "size": 4348}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::dispatch_ip", "size": 4260}, {"crate": "digest", "name": " as digest::Update>::update::{{closure}}", "size": 3460}, {"crate": "embassy_executor", "name": "embassy_executor::raw::TaskStorage::poll", "size": 2528}, {"crate": "std", "name": "core::fmt::Formatter::pad", "size": 1536}, {"crate": "std", "name": "compiler_builtins::int::specialized_div_rem::u64_div_rem", "size": 938}, {"crate": "embassy_embedded_hal?", "name": " as embedded_storage::nor_flash::NorFlash>::write", "size": 828}, {"crate": "std", "name": "compiler_builtins::mem::memmove", "size": 788}, {"crate": "smoltcp", "name": "smoltcp::socket::dhcpv4::Socket::parse_ack", "size": 728}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::Interface::poll_at::{{closure}}", "size": 650}, {"crate": "std", "name": "::write_str", "size": 604}, {"crate": "embassy_net", "name": "embassy_net::tcp::embedded_io_impls::::write::{{closure}}", "size": 584}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Repr::emit", "size": 544}, {"crate": "embassy_net", "name": "embassy_net::tcp::embedded_io_impls::::read::{{closure}}", "size": 532}, {"crate": "smoltcp", "name": "smoltcp::wire::arp::Repr::emit", "size": 500}, {"crate": "std", "name": "core::fmt::Formatter::pad_integral", "size": 478}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 440}, {"crate": "cyw43", "name": "cyw43::runner::Runner::core_reset::{{closure}}", "size": 428}, {"crate": "embassy_net", "name": "embassy_net::Inner::apply_static_config", "size": 428}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::TcpOption::emit", "size": 412}, {"crate": "cyw43_pio?", "name": " as cyw43::bus::SpiBusCyw43>::cmd_read::{{closure}}", "size": 408}, {"crate": "cyw43", "name": "cyw43::runner::Runner::core_disable::{{closure}}", "size": 400}, {"crate": "embassy_executor", "name": "embassy_executor::arch::thread::Executor::run", "size": 400}, {"crate": "cyw43", "name": "cyw43::control::Control::set_iovar::{{closure}}", "size": 396}, {"crate": "std", "name": "compiler_builtins::int::specialized_div_rem::u32_div_rem", "size": 392}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_write::{{closure}}", "size": 384}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_read::{{closure}}", "size": 376}, {"crate": "cyw43_pio?", "name": " as cyw43::bus::SpiBusCyw43>::cmd_write::{{closure}}", "size": 352}, {"crate": "cyw43", "name": "cyw43::runner::Runner::handle_irq::{{closure}}", "size": 344}, {"crate": "std", "name": "compiler_builtins::mem::memcpy", "size": 334}, {"crate": "std", "name": "core::fmt::write", "size": 330}, {"crate": "cyw43", "name": "cyw43::control::Control::get_iovar::{{closure}}", "size": 292}, {"crate": "cyw43", "name": "cyw43::bus::Bus::backplane_set_window::{{closure}}", "size": 288}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::ack_reply", "size": 280}, {"crate": "cyw43", "name": "cyw43::control::Control::ioctl::{{closure}}", "size": 272}, {"crate": "smoltcp", "name": "<&T as core::fmt::Display>::fmt", "size": 256}, {"crate": "std", "name": "core::ptr::drop_in_place>", "size": 248}, {"crate": "pio", "name": "pio::InstructionOperands::encode", "size": 244}, {"crate": "std", "name": "core::fmt::num::imp::::fmt", "size": 244}, {"crate": "sha2", "name": "sha2::sha256::soft::schedule", "size": 238}, {"crate": "cyw43", "name": "cyw43::bus::Bus::wlan_write::{{closure}}", "size": 232}, {"crate": "sha2", "name": "sha2::sha256::soft::sha256_digest_round_x2", "size": 230}, {"crate": "cyw43", "name": "cyw43::bus::Bus::wait_for_event::{{closure}}", "size": 224}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::reset", "size": 222}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::is_broadcast_v4", "size": 220}, {"crate": "smoltcp", "name": "smoltcp::iface::route::Routes::lookup", "size": 220}, {"crate": "embassy_embedded_hal?", "name": " as embedded_storage::nor_flash::NorFlash>::erase", "size": 216}, {"crate": "smoltcp", "name": "smoltcp::iface::route::Routes::remove_default_ipv4_route", "size": 204}, {"crate": "cyw43", "name": "cyw43::control::Control::set_iovar_u32x2::{{closure}}", "size": 204}, {"crate": "smoltcp", "name": "heapless::linear_map::LinearMap::insert", "size": 196}, {"crate": "std", "name": "core::fmt::Formatter::debug_tuple_field1_finish", "size": 196}, {"crate": "cyw43", "name": "cyw43::bus::Bus::readn::{{closure}}", "size": 196}, {"crate": "embassy_net", "name": "embassy_net::tcp::embedded_io_impls::::flush::{{closure}}", "size": 196}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::rst_reply", "size": 190}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::ipv4::::icmpv4_reply", "size": 186}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Repr::parse", "size": 184}, {"crate": "cyw43", "name": "cyw43::bus::Bus::backplane_writen::{{closure}}", "size": 184}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::seq_to_transmit", "size": 180}, {"crate": "embassy_rp", "name": "embassy_rp::pio::Common::try_load_program_at", "size": 176}, {"crate": "std", "name": "core::cmp::PartialEq::ne", "size": 172}, {"crate": "cyw43", "name": "cyw43::bus::Bus::backplane_readn::{{closure}}", "size": 168}, {"crate": "std", "name": "compiler_builtins::mem::memset", "size": 160}, {"crate": "smoltcp", "name": "smoltcp::iface::socket_set::SocketSet::add::put", "size": 158}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::enqueue_many", "size": 156}, {"crate": "smoltcp", "name": "smoltcp::wire::ip::checksum::data", "size": 152}, {"crate": "panic_probe", "name": "<&T as core::fmt::Display>::fmt", "size": 152}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::Interface::socket_egress::{{closure}}", "size": 152}, {"crate": "smoltcp", "name": "smoltcp::iface::neighbor::Cache::lookup", "size": 148}, {"crate": "cyw43", "name": "cyw43::bus::Bus::writen::{{closure}}", "size": 148}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::next_header", "size": 144}, {"crate": "defmt_rtt", "name": "_defmt_write", "size": 140}, {"crate": "cyw43", "name": "cyw43::bus::Bus::write32_swapped::{{closure}}", "size": 136}, {"crate": "embassy_rp", "name": "_embassy_time_set_alarm", "size": 132}, {"crate": "cyw43", "name": "cyw43::bus::Bus::read32_swapped::{{closure}}", "size": 132}, {"crate": "embassy_rp", "name": "embassy_rp::flash::ram_helpers::flash_function_pointers_with_boot2", "size": 128}, {"crate": "defmt", "name": "core::fmt::Write::write_char", "size": 126}, {"crate": "panic_probe", "name": "rust_begin_unwind", "size": 124}, {"crate": "cyw43", "name": "cyw43::control::Control::gpio_set::{{closure}}", "size": 124}, {"crate": "smoltcp", "name": "smoltcp::wire::dhcpv4::Repr::buffer_len", "size": 120}, {"crate": "embassy_net", "name": "smoltcp::iface::socket_set::SocketSet::get_mut", "size": 120}, {"crate": "std", "name": "core::fmt::num::imp::::fmt", "size": 120}, {"crate": "smoltcp", "name": "smoltcp::iface::socket_set::SocketSet::get_mut", "size": 120}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::fill_checksum", "size": 116}, {"crate": "embassy_rp", "name": "IO_IRQ_BANK0", "size": 116}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memcpy4", "size": 110}, {"crate": "embassy_executor", "name": "_embassy_time_schedule_wake", "size": 108}, {"crate": "cyw43", "name": "cyw43::control::Control::ioctl_set_u32::{{closure}}", "size": 108}, {"crate": "smoltcp", "name": "smoltcp::iface::socket_set::SocketSet::remove", "size": 104}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::get_unallocated", "size": 104}, {"crate": "embassy_rp", "name": "embassy_rp::time_driver::TimerDriver::check_alarm", "size": 104}, {"crate": "embassy_boot?", "name": "::fmt", "size": 104}, {"crate": "embassy_rp", "name": "DMA_IRQ_0", "size": 100}, {"crate": "std", "name": "core::fmt::num::::fmt", "size": 100}, {"crate": "cyw43", "name": "cyw43::control::Control::set_iovar_u32::{{closure}}", "size": 100}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memset4", "size": 96}, {"crate": "smoltcp", "name": "::fmt", "size": 96}, {"crate": "std", "name": "core::ptr::drop_in_place>>", "size": 96}, {"crate": "embassy_embedded_hal", "name": "embassy_embedded_hal::flash::partition::blocking::BlockingPartition::new", "size": 96}, {"crate": "embassy_boot", "name": "embassy_boot::firmware_updater::blocking::BlockingFirmwareState::get_state", "size": 94}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::reply", "size": 92}, {"crate": "cyw43", "name": "cyw43::structs::BdcHeader::parse", "size": 92}, {"crate": "cyw43", "name": "cyw43::bus::Bus::write16::{{closure}}", "size": 92}, {"crate": "embassy_embedded_hal?", "name": " as embedded_storage::nor_flash::ReadNorFlash>::read", "size": 92}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::route", "size": 90}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::has_neighbor", "size": 90}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 88}, {"crate": "smoltcp", "name": "smoltcp::iface::route::Routes::lookup::{{closure}}", "size": 88}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_read8::{{closure}}", "size": 88}, {"crate": "cyw43", "name": "cyw43::bus::Bus::write8::{{closure}}", "size": 88}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_write32::{{closure}}", "size": 88}, {"crate": "smoltcp", "name": "smoltcp::wire::ip::checksum::pseudo_header", "size": 84}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::challenge_ack_reply", "size": 84}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::atomic_waker::AtomicWaker::register", "size": 84}, {"crate": "embassy_net", "name": "defmt::export::fmt", "size": 84}, {"crate": "defmt_rtt", "name": "_defmt_acquire", "size": 84}, {"crate": "defmt_rtt", "name": "defmt_rtt::channel::Channel::write_impl", "size": 84}, {"crate": "std", "name": "core::ops::function::FnMut::call_mut", "size": 84}, {"crate": "cyw43", "name": "cyw43::bus::Bus::bp_write8::{{closure}}", "size": 84}, {"crate": "cyw43", "name": "cyw43::bus::Bus::read32::{{closure}}", "size": 84}, {"crate": "cyw43", "name": "cyw43::bus::Bus::read8::{{closure}}", "size": 84}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 84}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::Receiver::receive_done", "size": 84}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::Sender::send_done", "size": 84}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::new_checked", "size": 80}, {"crate": "smoltcp", "name": "::next", "size": 80}, {"crate": "embassy_rp", "name": "embassy_rp::flash::ram_helpers::flash_range_program", "size": 80}, {"crate": "smoltcp", "name": "smoltcp::wire::dhcpv4::DhcpOptionWriter::emit", "size": 76}, {"crate": "smoltcp", "name": "::fmt", "size": 76}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Repr::header_len", "size": 76}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 76}, {"name": "__aeabi_lmul", "size": 74}, {"crate": "smoltcp", "name": "heapless::vec::Vec::clone", "size": 72}, {"crate": "embassy_rp", "name": "::acquire", "size": 72}, {"crate": "defmt_rtt", "name": "_defmt_release", "size": 72}, {"crate": "std", "name": "core::result::unwrap_failed", "size": 72}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::Sender::poll_send", "size": 72}, {"crate": "std", "name": "__clzsi2", "size": 70}, {"crate": "std", "name": ">::into", "size": 68}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::in_same_network", "size": 68}, {"crate": "std", "name": "::write_char", "size": 68}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 64}, {"crate": "defmt_rtt", "name": "defmt_rtt::channel::Channel::blocking_write", "size": 64}, {"crate": "std", "name": "core::fmt::Formatter::pad_integral::write_prefix", "size": 62}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::enqueue_one", "size": 60}, {"crate": "smoltcp", "name": "<&T as core::fmt::Display>::fmt", "size": 60}, {"crate": "std", "name": "core::slice::::copy_from_slice::len_mismatch_fail", "size": 60}, {"crate": "std", "name": "core::slice::index::slice_index_order_fail", "size": 60}, {"crate": "std", "name": "core::slice::index::slice_end_index_len_fail", "size": 60}, {"crate": "std", "name": "core::panicking::panic_bounds_check", "size": 60}, {"crate": "std", "name": "core::slice::index::slice_start_index_len_fail", "size": 60}, {"crate": "std", "name": "core::ptr::drop_in_place>::init::{{closure}}>", "size": 60}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::atomic_waker::AtomicWaker::wake", "size": 58}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::Interface::socket_egress::{{closure}}", "size": 58}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::has_ip_addr", "size": 56}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 56}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 56}, {"crate": "embassy_executor", "name": "__pender", "size": 56}, {"crate": "std", "name": "core::panicking::panic_explicit", "size": 56}, {"name": "PIO0_IRQ_0", "size": 56}, {"crate": "heapless", "name": "heapless::deque::Deque::pop_front", "size": 56}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 56}, {"crate": "embassy_executor", "name": "embassy_executor::raw::util::UninitCell::write_in_place", "size": 56}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::Sender::try_send", "size": 56}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::waker_registration::WakerRegistration::register", "size": 54}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet<&T>::payload", "size": 52}, {"crate": "embassy_time", "name": "::poll", "size": 52}, {"crate": "embassy_rp", "name": "__pre_init", "size": 52}, {"crate": "embassy_rp", "name": "_embassy_time_set_alarm_callback", "size": 52}, {"crate": "embassy_net", "name": "embassy_net::to_smoltcp_hardware_address", "size": 52}, {"crate": "embassy_executor", "name": "embassy_executor::arch::thread::Executor::new", "size": 52}, {"crate": "std", "name": "core::slice::::split_at_mut", "size": 52}, {"crate": "std", "name": "core::option::expect_failed", "size": 52}, {"crate": "std", "name": "core::ptr::drop_in_place>::core_reset::{{closure}}>", "size": 52}, {"crate": "smoltcp", "name": "smoltcp::socket::waker::WakerRegistration::register", "size": 50}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Address::from_bytes", "size": 48}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 48}, {"crate": "smoltcp", "name": "defmt::traits::Format::_format_data", "size": 48}, {"crate": "smoltcp", "name": "::sub", "size": 48}, {"crate": "smoltcp", "name": ">::add", "size": 48}, {"crate": "embassy_hal_internal", "name": "embassy_hal_internal::interrupt::InterruptExt::set_priority", "size": 48}, {"crate": "std", "name": "core::cell::panic_already_mutably_borrowed", "size": 48}, {"crate": "std", "name": "core::cell::panic_already_borrowed", "size": 48}, {"crate": "bt4ot_ota_common", "name": "defmt::export::fmt", "size": 48}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::set_src_addr", "size": 48}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::set_dst_addr", "size": 48}, {"crate": "tuf_no_std_common?", "name": "::fmt", "size": 48}, {"crate": "embassy_sync?", "name": "::fmt", "size": 48}, {"crate": "std", "name": "compiler_builtins::mem::memcmp", "size": 46}, {"name": "__aeabi_llsl", "size": 44}, {"crate": "byteorder", "name": "::write_u32", "size": 44}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::msg_type", "size": 44}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 44}, {"crate": "defmt", "name": "defmt::impls::primitives::::_format_data", "size": 44}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::ack_to_transmit", "size": 44}, {"crate": "embassy_rp", "name": "_embassy_time_allocate_alarm", "size": 44}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::set_ethertype", "size": 44}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 44}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::new_checked", "size": 42}, {"crate": "heapless?", "name": " as core::iter::traits::iterator::Iterator>::next", "size": 42}, {"crate": "std", "name": "core::ptr::drop_in_place>::core_disable::{{closure}}>", "size": 42}, {"crate": "std", "name": "core::ptr::drop_in_place>::handle_irq::{{closure}}>", "size": 42}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet<&mut T>::data_mut", "size": 40}, {"crate": "embassy_executor", "name": "embassy_executor::raw::state::State::update", "size": 40}, {"crate": "std", "name": "core::panicking::panic_const::panic_const_rem_by_zero", "size": 40}, {"crate": "byteorder", "name": "::write_u16", "size": 40}, {"crate": "std", "name": "<&T as core::fmt::Debug>::fmt", "size": 40}, {"crate": "cortex_m_rt", "name": "Reset", "size": 40}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Timer::should_keep_alive", "size": 38}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::contiguous_window", "size": 38}, {"crate": "smoltcp", "name": "smoltcp::iface::interface::InterfaceInner::is_unicast_v4", "size": 38}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::window_to_update", "size": 38}, {"crate": "embassy_executor", "name": "embassy_executor::raw::waker::wake", "size": 38}, {"crate": "embassy_net?", "name": "::clone", "size": 38}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::set_checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_echo_seq_no", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_echo_ident", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_msg_type", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::set_checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::payload_mut", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::set_len", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::set_dst_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::set_src_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Packet::set_checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::checksum", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::len", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::echo_seq_no", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::echo_ident", "size": 36}, {"crate": "byteorder", "name": "::read_u16", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Packet::dst_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Packet::src_port", "size": 36}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::socket::dhcpv4::Socket::reset", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::dst_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::udp::Packet::src_port", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::total_len", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::scaled_window", "size": 36}, {"crate": "embassy_time", "name": ">::add", "size": 36}, {"crate": "embassy_rp", "name": "::release", "size": 36}, {"crate": "embassy_net_driver", "name": "defmt::export::fmt_array", "size": 36}, {"crate": "std", "name": "::fmt", "size": 36}, {"crate": "std", "name": "core::panicking::panic_const::panic_const_async_fn_resumed", "size": 36}, {"crate": "std", "name": "core::panicking::panic", "size": 36}, {"crate": "bt4ot_ota_common", "name": "defmt::export::fmt", "size": 36}, {"crate": "embassy_net_driver_channel?", "name": " as embassy_net_driver::Driver>::hardware_address", "size": 36}, {"crate": "cortex_m", "name": "cortex_m::peripheral::scb::::sys_reset", "size": 36}, {"crate": "embassy_rp?", "name": " as core::future::future::Future>::poll", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::header_len", "size": 36}, {"crate": "std", "name": "core::ptr::drop_in_place>", "size": 36}, {"crate": "embassy_rp", "name": "embassy_rp::pio::instr::set_pindir", "size": 36}, {"crate": "smoltcp", "name": "smoltcp::socket::tcp::Socket::set_state", "size": 34}, {"crate": "std", "name": "core::iter::traits::iterator::Iterator::nth", "size": 34}, {"crate": "embassy_executor", "name": "embassy_executor::raw::state::State::update", "size": 34}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Address::from_bytes", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::dst_addr", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::src_addr", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet<&T>::data", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Packet::header_len", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::header_len", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::dst_addr", "size": 32}, {"crate": "heapless", "name": "heapless::deque::Deque::len", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::set_checksum", "size": 32}, {"crate": "std", "name": "core::cell::RefCell::borrow_mut", "size": 32}, {"crate": "std", "name": "core::ptr::drop_in_place>::backplane_writen::{{closure}}>", "size": 32}, {"crate": "std", "name": "core::ptr::drop_in_place>::wlan_write::{{closure}}>", "size": 32}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_write::{{closure}}>", "size": 32}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_read::{{closure}}>", "size": 32}, {"crate": "portable_atomic", "name": "portable_atomic::AtomicBool::compare_exchange", "size": 32}, {"crate": "embassy_time", "name": "embassy_time::timer::Timer::after_millis", "size": 32}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::multi_waker::MultiWakerRegistration<_>::wake", "size": 32}, {"crate": "embassy_rp", "name": "embassy_rp::pio::instr::exec_jmp", "size": 32}, {"crate": "smoltcp", "name": "smoltcp::wire::ip::checksum::combine", "size": 30}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Cidr::contains_addr", "size": 30}, {"crate": "no_std_net", "name": "core::slice::::copy_from_slice", "size": 30}, {"crate": "std", "name": "core::cell::RefCell::borrow_mut", "size": 30}, {"crate": "std", "name": "core::panicking::panic_fmt", "size": 30}, {"crate": "std", "name": "core::ptr::drop_in_place>::backplane_readn::{{closure}}>", "size": 30}, {"crate": "std", "name": "core::ptr::drop_in_place>::log_init::{{closure}}>", "size": 30}, {"crate": "smoltcp", "name": "smoltcp::parsers::Parser::advance", "size": 28}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 28}, {"crate": "critical_section", "name": "critical_section::with", "size": 28}, {"crate": "cyw43", "name": "defmt::export::fmt", "size": 28}, {"crate": "atomic_polyfill", "name": "atomic_polyfill::polyfill::AtomicU32::fetch_or", "size": 28}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 28}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 28}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 28}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 28}, {"crate": "std?", "name": "core::ptr::drop_in_place< as cyw43::bus::SpiBusCyw43>::wait_for_event::{{closure}}>", "size": 28}, {"crate": "std", "name": "core::ptr::drop_in_place::{{closure}}>", "size": 28}, {"crate": "smoltcp", "name": "smoltcp::storage::ring_buffer::RingBuffer::get_idx_unchecked", "size": 26}, {"crate": "smoltcp", "name": "smoltcp::parsers::Parser::accept_digit", "size": 26}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 26}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 26}, {"crate": "smoltcp", "name": "smoltcp::wire::icmpv4::Packet::set_msg_code", "size": 24}, {"crate": "smoltcp?", "name": "::fmt", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::arp::Packet::protocol_len", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::arp::Packet::hardware_len", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::ipv4::Packet::hop_limit", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame<&T>::payload", "size": 24}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 24}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 24}, {"crate": "embassy_rp", "name": "embassy_rp::reset::unreset_wait", "size": 24}, {"crate": "embassy_rp", "name": "defmt::export::fmt", "size": 24}, {"crate": "embassy_rp", "name": "defmt::export::fmt", "size": 24}, {"crate": "embassy_executor", "name": "embassy_executor::raw::Executor::spawn", "size": 24}, {"crate": "embassy_executor", "name": "embassy_executor::raw::state::State::update", "size": 24}, {"crate": "defmt", "name": "defmt::export::str", "size": 24}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 24}, {"crate": "defmt", "name": "core::fmt::Write::write_fmt", "size": 24}, {"crate": "cyw43", "name": "defmt::export::fmt", "size": 24}, {"crate": "std", "name": "::fmt", "size": 24}, {"crate": "std", "name": "::fmt", "size": 24}, {"crate": "smoltcp", "name": "smoltcp::wire::ethernet::Frame::payload_mut", "size": 24}, {"crate": "embassy_net_driver_channel?", "name": "::fmt", "size": 24}, {"crate": "embassy_executor?", "name": "::fmt", "size": 24}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 24}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 24}, {"crate": "std", "name": "<&T as core::fmt::Debug>::fmt", "size": 24}, {"crate": "embassy_executor", "name": "embassy_executor::raw::TaskStorage::poll", "size": 24}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 24}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index", "size": 24}, {"name": "__aeabi_uldivmod", "size": 22}, {"crate": "smoltcp", "name": "smoltcp::socket::waker::WakerRegistration::wake", "size": 22}, {"crate": "embassy_sync", "name": "embassy_sync::waitqueue::waker_registration::WakerRegistration::wake", "size": 22}, {"crate": "defmt_rtt", "name": "defmt_rtt::channel::Channel::nonblocking_write", "size": 22}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 22}, {"crate": "std", "name": "core::array:: for [T; N]>::index", "size": 22}, {"crate": "std", "name": "core::array:: for [T; N]>::index", "size": 22}, {"crate": "std", "name": " as core::slice::index::SliceIndex<[T]>>::index_mut", "size": 22}, {"name": "HardFaultTrampoline", "size": 20}, {"crate": "hash32", "name": "<&T as core::fmt::Debug>::fmt", "size": 20}, {"crate": "embassy_rp", "name": "::now", "size": 20}, {"crate": "std", "name": "core::option::unwrap_failed", "size": 20}, {"crate": "std", "name": "core::fmt::Write::write_fmt", "size": 20}, {"crate": "std", "name": "core::array:: for [T; N]>::index_mut", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::backplane_set_window::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::check_status::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::core_is_up::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::write32_swapped::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::read32_swapped::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_write32::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::wlan_read::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_read8::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::write16::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::writen::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::readn::{{closure}}>", "size": 20}, {"crate": "std", "name": "core::ptr::drop_in_place>::read8::{{closure}}>", "size": 20}, {"crate": "std?", "name": "core::ptr::drop_in_place< as cyw43::bus::SpiBusCyw43>::cmd_write::{{closure}}>", "size": 20}, {"crate": "std?", "name": "core::ptr::drop_in_place< as cyw43::bus::SpiBusCyw43>::cmd_read::{{closure}}>", "size": 20}, {"crate": "std", "name": "<() as core::fmt::Debug>::fmt", "size": 20}, {"crate": "std", "name": "__udivmodsi4", "size": 18}, {"name": "__aeabi_uidivmod", "size": 18}, {"crate": "std", "name": "__udivmoddi4", "size": 18}, {"crate": "smoltcp", "name": "smoltcp::socket::dhcpv4::Socket::config_changed", "size": 18}, {"crate": "defmt", "name": "defmt::export::integers::u64", "size": 18}, {"crate": "defmt", "name": "defmt::export::integers::u8", "size": 18}, {"crate": "defmt", "name": "defmt::export::istr", "size": 18}, {"crate": "benchmark_code_size_update_only", "name": "benchmark_code_size_update_only::__cortex_m_rt_main", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place>::read32_swapped::{{closure}},cyw43::bus::Bus>::init::{{closure}}::{{closure}}>>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place>::wait_for_event::{{closure}}>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place>::bp_write8::{{closure}}>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place>::write8::{{closure}}>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place::cmd_read::{{closure}}>", "size": 18}, {"crate": "std", "name": "core::ptr::drop_in_place::write::{{closure}}>", "size": 18}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memset", "size": 16}, {"crate": "smoltcp", "name": "smoltcp::wire::tcp::Repr::buffer_len", "size": 16}, {"crate": "smoltcp", "name": ">::add_assign", "size": 16}, {"crate": "smoltcp", "name": "defmt::export::fmt", "size": 16}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::State::pop_index", "size": 16}, {"crate": "embassy_executor", "name": "defmt::export::fmt", "size": 16}, {"crate": "defmt", "name": "defmt::encoding::inner::Encoder::write::{{closure}}", "size": 16}, {"crate": "defmt", "name": "defmt::export::integers::u32", "size": 16}, {"crate": "defmt", "name": "::write_str", "size": 16}, {"crate": "defmt", "name": "<&T as core::fmt::Display>::fmt", "size": 16}, {"crate": "std", "name": "<&T as core::fmt::Debug>::fmt", "size": 16}, {"crate": "std", "name": "<&T as core::fmt::Display>::fmt", "size": 16}, {"crate": "embassy_net?", "name": " as smoltcp::phy::Device>::capabilities", "size": 16}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 16}, {"crate": "defmt", "name": "defmt::export::fmt", "size": 16}, {"crate": "embassy_executor", "name": "embassy_executor::raw::util::UninitCell::write_in_place", "size": 16}, {"crate": "std", "name": "core::fmt::Formatter::write_fmt", "size": 14}, {"crate": "embassy_time", "name": "_defmt_timestamp", "size": 14}, {"crate": "defmt", "name": "defmt::export::header", "size": 14}, {"name": "__Thumbv6MABSLongThunk__ZN10embassy_rp5flash11ram_helpers17write_flash_inner17h82c1bb1a60c73aa7E", "size": 12}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memclr8", "size": 12}, {"crate": "embassy_sync", "name": "embassy_sync::zerocopy_channel::State::push_index", "size": 12}, {"crate": "embassy_rp", "name": "TIMER_IRQ_0", "size": 12}, {"crate": "embassy_rp", "name": "TIMER_IRQ_1", "size": 12}, {"crate": "embassy_rp", "name": "TIMER_IRQ_2", "size": 12}, {"crate": "embassy_rp", "name": "TIMER_IRQ_3", "size": 12}, {"crate": "embassy_executor", "name": "embassy_executor::raw::waker::clone", "size": 12}, {"crate": "embassy_executor", "name": "embassy_executor::raw::SyncExecutor::alarm_callback", "size": 12}, {"name": "__aeabi_memmove8", "size": 10}, {"name": "__aeabi_memcpy8", "size": 10}, {"name": "__aeabi_memclr4", "size": 10}, {"name": "__aeabi_memcpy4", "size": 10}, {"name": "__aeabi_memcpy", "size": 10}, {"name": "__aeabi_uidiv", "size": 10}, {"name": "memcmp", "size": 10}, {"name": "__aeabi_memset4", "size": 10}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memmove8", "size": 10}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memmove", "size": 10}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memcpy8", "size": 10}, {"crate": "std", "name": "compiler_builtins::arm::__aeabi_memcpy", "size": 10}, {"name": "__aeabi_memclr8", "size": 10}, {"crate": "defmt", "name": "defmt::export::bool", "size": 10}, {"crate": "embassy_executor", "name": "embassy_executor::raw::util::UninitCell::write_in_place", "size": 10}, {"crate": "defmt", "name": "defmt::default_panic::panic_cold_explicit", "size": 8}, {"crate": "defmt", "name": "__defmt_default_panic", "size": 8}, {"name": "main", "size": 8}, {"crate": "cortex_m_rt", "name": "HardFault_", "size": 2}, {"crate": "embassy_executor", "name": "embassy_executor::raw::waker::drop", "size": 2}, {"crate": "defmt", "name": "__defmt_default_timestamp", "size": 2}, {"crate": "cortex_m_rt", "name": "DefaultHandler_", "size": 2}]}, "cargo_bloat_crates": {"file-size": 1031252, "text-section-size": 84740, "crates": [{"name": "smoltcp", "size": 25110}, {"name": "benchmark_code_size_update_only", "size": 17434}, {"name": "cyw43", "size": 10236}, {"name": "std", "size": 9998}, {"name": "embassy_executor", "size": 8928}, {"name": "digest", "size": 3460}, {"name": "embassy_net", "size": 2050}, {"name": "embassy_rp", "size": 1336}, {"name": "embassy_embedded_hal", "size": 1232}, {"name": "cyw43_pio", "size": 760}, {"name": "embassy_sync", "size": 622}, {"name": "defmt", "size": 606}, {"name": "sha2", "size": 468}, {"name": "defmt_rtt", "size": 466}, {"name": "[Unknown]", "size": 344}, {"name": "panic_probe", "size": 276}, {"name": "pio", "size": 244}, {"name": "embassy_boot", "size": 198}, {"name": "embassy_time", "size": 134}, {"name": "heapless", "size": 130}, {"name": "byteorder", "size": 120}, {"name": "bt4ot_ota_common", "size": 84}, {"name": "embassy_net_driver_channel", "size": 60}, {"name": "tuf_no_std_common", "size": 48}, {"name": "embassy_hal_internal", "size": 48}, {"name": "cortex_m_rt", "size": 44}, {"name": "cortex_m", "size": 36}, {"name": "embassy_net_driver", "size": 36}, {"name": "portable_atomic", "size": 32}, {"name": "no_std_net", "size": 30}, {"name": "critical_section", "size": 28}, {"name": "atomic_polyfill", "size": 28}, {"name": "hash32", "size": 20}]}}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:15:36.214852.json b/benchmark-output/performance-benchmark-2024-08-20 07:15:36.214852.json new file mode 100644 index 0000000..e023c66 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:15:36.214852.json @@ -0,0 +1 @@ +{"start_time":4441185,"end_time":16458552,"binary_size":172520,"fetch_target_files":{"secs":0,"nanos":84403000},"update_repo":{"secs":3,"nanos":65548000},"fetch_signature":{"secs":0,"nanos":27420000},"fetch_binary":{"secs":1,"nanos":254208000},"verify_binary":{"secs":2,"nanos":917122000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:16:39.421518.json b/benchmark-output/performance-benchmark-2024-08-20 07:16:39.421518.json new file mode 100644 index 0000000..a14cc42 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:16:39.421518.json @@ -0,0 +1 @@ +{"start_time":4395718,"end_time":17138315,"binary_size":172520,"fetch_target_files":{"secs":0,"nanos":55218000},"update_repo":{"secs":3,"nanos":34535000},"fetch_signature":{"secs":0,"nanos":25820000},"fetch_binary":{"secs":2,"nanos":53178000},"verify_binary":{"secs":2,"nanos":916978000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:17:33.877914.json b/benchmark-output/performance-benchmark-2024-08-20 07:17:33.877914.json new file mode 100644 index 0000000..b4d2b33 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:17:33.877914.json @@ -0,0 +1 @@ +{"start_time":4434554,"end_time":17890433,"binary_size":172520,"fetch_target_files":{"secs":0,"nanos":55187000},"update_repo":{"secs":3,"nanos":753057000},"fetch_signature":{"secs":0,"nanos":23908000},"fetch_binary":{"secs":2,"nanos":37076000},"verify_binary":{"secs":2,"nanos":917126000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:18:27.641227.json b/benchmark-output/performance-benchmark-2024-08-20 07:18:27.641227.json new file mode 100644 index 0000000..270d415 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:18:27.641227.json @@ -0,0 +1 @@ +{"start_time":4436082,"end_time":17160847,"binary_size":172520,"fetch_target_files":{"secs":0,"nanos":62738000},"update_repo":{"secs":3,"nanos":784426000},"fetch_signature":{"secs":0,"nanos":25617000},"fetch_binary":{"secs":1,"nanos":267674000},"verify_binary":{"secs":2,"nanos":916949000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:19:22.223523.json b/benchmark-output/performance-benchmark-2024-08-20 07:19:22.223523.json new file mode 100644 index 0000000..4a4633a --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:19:22.223523.json @@ -0,0 +1 @@ +{"start_time":4393016,"end_time":17955695,"binary_size":172520,"fetch_target_files":{"secs":0,"nanos":82345000},"update_repo":{"secs":3,"nanos":783756000},"fetch_signature":{"secs":0,"nanos":26647000},"fetch_binary":{"secs":2,"nanos":88228000},"verify_binary":{"secs":2,"nanos":916938000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:22:22.761514.json b/benchmark-output/performance-benchmark-2024-08-20 07:22:22.761514.json new file mode 100644 index 0000000..3d86f24 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:22:22.761514.json @@ -0,0 +1 @@ +{"start_time":4446383,"end_time":18036709,"binary_size":238060,"fetch_target_files":{"secs":0,"nanos":84216000},"update_repo":{"secs":4,"nanos":91252000},"fetch_signature":{"secs":0,"nanos":26625000},"fetch_binary":{"secs":1,"nanos":805855000},"verify_binary":{"secs":2,"nanos":917332000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:23:17.150873.json b/benchmark-output/performance-benchmark-2024-08-20 07:23:17.150873.json new file mode 100644 index 0000000..9d0b1e5 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:23:17.150873.json @@ -0,0 +1 @@ +{"start_time":4411479,"end_time":17748179,"binary_size":238060,"fetch_target_files":{"secs":0,"nanos":76761000},"update_repo":{"secs":3,"nanos":791243000},"fetch_signature":{"secs":0,"nanos":25880000},"fetch_binary":{"secs":1,"nanos":878900000},"verify_binary":{"secs":2,"nanos":917305000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:24:12.539264.json b/benchmark-output/performance-benchmark-2024-08-20 07:24:12.539264.json new file mode 100644 index 0000000..5e216d4 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:24:12.539264.json @@ -0,0 +1 @@ +{"start_time":4393258,"end_time":18717362,"binary_size":238060,"fetch_target_files":{"secs":0,"nanos":84714000},"update_repo":{"secs":4,"nanos":810419000},"fetch_signature":{"secs":0,"nanos":26528000},"fetch_binary":{"secs":1,"nanos":833615000},"verify_binary":{"secs":2,"nanos":917247000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:25:08.425179.json b/benchmark-output/performance-benchmark-2024-08-20 07:25:08.425179.json new file mode 100644 index 0000000..a6eeb7e --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:25:08.425179.json @@ -0,0 +1 @@ +{"start_time":4398741,"end_time":18713211,"binary_size":238060,"fetch_target_files":{"secs":0,"nanos":95037000},"update_repo":{"secs":4,"nanos":808650000},"fetch_signature":{"secs":0,"nanos":28306000},"fetch_binary":{"secs":1,"nanos":799234000},"verify_binary":{"secs":2,"nanos":917295000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:26:04.337105.json b/benchmark-output/performance-benchmark-2024-08-20 07:26:04.337105.json new file mode 100644 index 0000000..2e0508d --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:26:04.337105.json @@ -0,0 +1 @@ +{"start_time":4426171,"end_time":19251050,"binary_size":303592,"fetch_target_files":{"secs":0,"nanos":89613000},"update_repo":{"secs":4,"nanos":811238000},"fetch_signature":{"secs":0,"nanos":26880000},"fetch_binary":{"secs":2,"nanos":331732000},"verify_binary":{"secs":2,"nanos":917345000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:27:00.148576.json b/benchmark-output/performance-benchmark-2024-08-20 07:27:00.148576.json new file mode 100644 index 0000000..8b23fda --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:27:00.148576.json @@ -0,0 +1 @@ +{"start_time":4471740,"end_time":18983180,"binary_size":303592,"fetch_target_files":{"secs":0,"nanos":92505000},"update_repo":{"secs":3,"nanos":777270000},"fetch_signature":{"secs":0,"nanos":28562000},"fetch_binary":{"secs":3,"nanos":40432000},"verify_binary":{"secs":2,"nanos":917401000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:27:55.237711.json b/benchmark-output/performance-benchmark-2024-08-20 07:27:55.237711.json new file mode 100644 index 0000000..ac5b5f2 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:27:55.237711.json @@ -0,0 +1 @@ +{"start_time":4449730,"end_time":18273713,"binary_size":303592,"fetch_target_files":{"secs":0,"nanos":83366000},"update_repo":{"secs":3,"nanos":785555000},"fetch_signature":{"secs":0,"nanos":25751000},"fetch_binary":{"secs":2,"nanos":369321000},"verify_binary":{"secs":2,"nanos":917490000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:28:50.945571.json b/benchmark-output/performance-benchmark-2024-08-20 07:28:50.945571.json new file mode 100644 index 0000000..bdd23fd --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:28:50.945571.json @@ -0,0 +1 @@ +{"start_time":4440227,"end_time":18869666,"binary_size":303592,"fetch_target_files":{"secs":0,"nanos":82032000},"update_repo":{"secs":3,"nanos":755653000},"fetch_signature":{"secs":0,"nanos":24815000},"fetch_binary":{"secs":2,"nanos":984310000},"verify_binary":{"secs":2,"nanos":917428000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:29:46.754391.json b/benchmark-output/performance-benchmark-2024-08-20 07:29:46.754391.json new file mode 100644 index 0000000..d87e095 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:29:46.754391.json @@ -0,0 +1 @@ +{"start_time":4431775,"end_time":18972493,"binary_size":303592,"fetch_target_files":{"secs":0,"nanos":55518000},"update_repo":{"secs":3,"nanos":851820000},"fetch_signature":{"secs":0,"nanos":24019000},"fetch_binary":{"secs":3,"nanos":19667000},"verify_binary":{"secs":2,"nanos":917367000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:30:40.412155.json b/benchmark-output/performance-benchmark-2024-08-20 07:30:40.412155.json new file mode 100644 index 0000000..c309417 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:30:40.412155.json @@ -0,0 +1 @@ +{"start_time":4446647,"end_time":16807391,"binary_size":106992,"fetch_target_files":{"secs":0,"nanos":78852000},"update_repo":{"secs":3,"nanos":767037000},"fetch_signature":{"secs":0,"nanos":24518000},"fetch_binary":{"secs":0,"nanos":917692000},"verify_binary":{"secs":2,"nanos":917263000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:31:35.143103.json b/benchmark-output/performance-benchmark-2024-08-20 07:31:35.143103.json new file mode 100644 index 0000000..c22488e --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:31:35.143103.json @@ -0,0 +1 @@ +{"start_time":4391460,"end_time":18392905,"binary_size":106992,"fetch_target_files":{"secs":0,"nanos":58843000},"update_repo":{"secs":4,"nanos":762034000},"fetch_signature":{"secs":0,"nanos":24822000},"fetch_binary":{"secs":1,"nanos":591189000},"verify_binary":{"secs":2,"nanos":917315000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:32:28.985440.json b/benchmark-output/performance-benchmark-2024-08-20 07:32:28.985440.json new file mode 100644 index 0000000..50acfa7 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:32:28.985440.json @@ -0,0 +1 @@ +{"start_time":4437488,"end_time":17493901,"binary_size":106992,"fetch_target_files":{"secs":0,"nanos":87330000},"update_repo":{"secs":3,"nanos":786108000},"fetch_signature":{"secs":0,"nanos":27062000},"fetch_binary":{"secs":1,"nanos":563285000},"verify_binary":{"secs":2,"nanos":917376000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:33:22.107728.json b/benchmark-output/performance-benchmark-2024-08-20 07:33:22.107728.json new file mode 100644 index 0000000..76b2a11 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:33:22.107728.json @@ -0,0 +1 @@ +{"start_time":4414715,"end_time":16704938,"binary_size":106992,"fetch_target_files":{"secs":0,"nanos":86221000},"update_repo":{"secs":3,"nanos":787027000},"fetch_signature":{"secs":0,"nanos":28421000},"fetch_binary":{"secs":0,"nanos":819779000},"verify_binary":{"secs":2,"nanos":917324000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:34:16.072524.json b/benchmark-output/performance-benchmark-2024-08-20 07:34:16.072524.json new file mode 100644 index 0000000..9760595 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:34:16.072524.json @@ -0,0 +1 @@ +{"start_time":4450529,"end_time":17526172,"binary_size":106992,"fetch_target_files":{"secs":0,"nanos":54040000},"update_repo":{"secs":3,"nanos":788704000},"fetch_signature":{"secs":0,"nanos":28923000},"fetch_binary":{"secs":1,"nanos":614286000},"verify_binary":{"secs":2,"nanos":917248000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:36:24.696037.json b/benchmark-output/performance-benchmark-2024-08-20 07:36:24.696037.json new file mode 100644 index 0000000..348874e --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:36:24.696037.json @@ -0,0 +1 @@ +{"start_time":4476221,"end_time":15513377,"binary_size":41440,"fetch_target_files":{"secs":0,"nanos":78240000},"update_repo":{"secs":3,"nanos":76938000},"fetch_signature":{"secs":0,"nanos":27392000},"fetch_binary":{"secs":0,"nanos":335845000},"verify_binary":{"secs":2,"nanos":918183000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:37:17.733229.json b/benchmark-output/performance-benchmark-2024-08-20 07:37:17.733229.json new file mode 100644 index 0000000..efec3da --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:37:17.733229.json @@ -0,0 +1 @@ +{"start_time":4466519,"end_time":16961718,"binary_size":41440,"fetch_target_files":{"secs":0,"nanos":58321000},"update_repo":{"secs":3,"nanos":758177000},"fetch_signature":{"secs":0,"nanos":23990000},"fetch_binary":{"secs":1,"nanos":138777000},"verify_binary":{"secs":2,"nanos":918230000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:38:10.775495.json b/benchmark-output/performance-benchmark-2024-08-20 07:38:10.775495.json new file mode 100644 index 0000000..fed90a0 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:38:10.775495.json @@ -0,0 +1 @@ +{"start_time":4413188,"end_time":16904066,"binary_size":41440,"fetch_target_files":{"secs":0,"nanos":84188000},"update_repo":{"secs":3,"nanos":789471000},"fetch_signature":{"secs":0,"nanos":24181000},"fetch_binary":{"secs":1,"nanos":75226000},"verify_binary":{"secs":2,"nanos":918244000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:39:03.822099.json b/benchmark-output/performance-benchmark-2024-08-20 07:39:03.822099.json new file mode 100644 index 0000000..0b904b1 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:39:03.822099.json @@ -0,0 +1 @@ +{"start_time":4403018,"end_time":16897237,"binary_size":41440,"fetch_target_files":{"secs":0,"nanos":113537000},"update_repo":{"secs":3,"nanos":757623000},"fetch_signature":{"secs":0,"nanos":26103000},"fetch_binary":{"secs":1,"nanos":67313000},"verify_binary":{"secs":2,"nanos":918213000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 07:39:56.865710.json b/benchmark-output/performance-benchmark-2024-08-20 07:39:56.865710.json new file mode 100644 index 0000000..5eecee1 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 07:39:56.865710.json @@ -0,0 +1 @@ +{"start_time":4418158,"end_time":16912471,"binary_size":41440,"fetch_target_files":{"secs":0,"nanos":88791000},"update_repo":{"secs":3,"nanos":790205000},"fetch_signature":{"secs":0,"nanos":24817000},"fetch_binary":{"secs":1,"nanos":61199000},"verify_binary":{"secs":2,"nanos":918214000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:28:50.463366.json b/benchmark-output/performance-benchmark-2024-08-20 08:28:50.463366.json new file mode 100644 index 0000000..efdceeb --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:28:50.463366.json @@ -0,0 +1 @@ +{"start_time":4418280,"end_time":15483283,"binary_size":41440,"fetch_target_files":{"secs":0,"nanos":83616000},"update_repo":{"secs":3,"nanos":84023000},"fetch_signature":{"secs":0,"nanos":25621000},"fetch_binary":{"secs":0,"nanos":342537000},"verify_binary":{"secs":2,"nanos":918321000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:29:42.892983.json b/benchmark-output/performance-benchmark-2024-08-20 08:29:42.892983.json new file mode 100644 index 0000000..f0a26b9 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:29:42.892983.json @@ -0,0 +1 @@ +{"start_time":4419111,"end_time":16315821,"binary_size":41440,"fetch_target_files":{"secs":0,"nanos":83052000},"update_repo":{"secs":3,"nanos":803999000},"fetch_signature":{"secs":0,"nanos":25527000},"fetch_binary":{"secs":0,"nanos":439961000},"verify_binary":{"secs":2,"nanos":918178000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:30:36.962670.json b/benchmark-output/performance-benchmark-2024-08-20 08:30:36.962670.json new file mode 100644 index 0000000..856cd1c --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:30:36.962670.json @@ -0,0 +1 @@ +{"start_time":4388161,"end_time":17862446,"binary_size":41440,"fetch_target_files":{"secs":0,"nanos":63475000},"update_repo":{"secs":4,"nanos":826562000},"fetch_signature":{"secs":0,"nanos":23692000},"fetch_binary":{"secs":1,"nanos":32990000},"verify_binary":{"secs":2,"nanos":918141000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:31:31.136874.json b/benchmark-output/performance-benchmark-2024-08-20 08:31:31.136874.json new file mode 100644 index 0000000..a5d53a3 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:31:31.136874.json @@ -0,0 +1 @@ +{"start_time":4385713,"end_time":18019086,"binary_size":41440,"fetch_target_files":{"secs":0,"nanos":94991000},"update_repo":{"secs":4,"nanos":827024000},"fetch_signature":{"secs":0,"nanos":22641000},"fetch_binary":{"secs":1,"nanos":132877000},"verify_binary":{"secs":2,"nanos":918050000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:32:24.280363.json b/benchmark-output/performance-benchmark-2024-08-20 08:32:24.280363.json new file mode 100644 index 0000000..ed44df7 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:32:24.280363.json @@ -0,0 +1 @@ +{"start_time":4428184,"end_time":16929156,"binary_size":41440,"fetch_target_files":{"secs":0,"nanos":83828000},"update_repo":{"secs":3,"nanos":802930000},"fetch_signature":{"secs":0,"nanos":27858000},"fetch_binary":{"secs":1,"nanos":32674000},"verify_binary":{"secs":2,"nanos":918153000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:34:02.378899.json b/benchmark-output/performance-benchmark-2024-08-20 08:34:02.378899.json new file mode 100644 index 0000000..85a7701 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:34:02.378899.json @@ -0,0 +1 @@ +{"start_time":4424849,"end_time":16083735,"binary_size":106992,"fetch_target_files":{"secs":0,"nanos":83795000},"update_repo":{"secs":3,"nanos":86140000},"fetch_signature":{"secs":0,"nanos":23764000},"fetch_binary":{"secs":0,"nanos":882224000},"verify_binary":{"secs":2,"nanos":917397000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:34:55.625728.json b/benchmark-output/performance-benchmark-2024-08-20 08:34:55.625728.json new file mode 100644 index 0000000..f796ce3 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:34:55.625728.json @@ -0,0 +1 @@ +{"start_time":4424352,"end_time":16746630,"binary_size":106992,"fetch_target_files":{"secs":0,"nanos":83943000},"update_repo":{"secs":3,"nanos":804049000},"fetch_signature":{"secs":0,"nanos":30813000},"fetch_binary":{"secs":0,"nanos":802845000},"verify_binary":{"secs":2,"nanos":917216000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:35:48.872563.json b/benchmark-output/performance-benchmark-2024-08-20 08:35:48.872563.json new file mode 100644 index 0000000..2e6a254 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:35:48.872563.json @@ -0,0 +1 @@ +{"start_time":4426659,"end_time":16797195,"binary_size":106992,"fetch_target_files":{"secs":0,"nanos":87096000},"update_repo":{"secs":3,"nanos":803320000},"fetch_signature":{"secs":0,"nanos":23648000},"fetch_binary":{"secs":0,"nanos":862730000},"verify_binary":{"secs":2,"nanos":917284000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:36:43.145201.json b/benchmark-output/performance-benchmark-2024-08-20 08:36:43.145201.json new file mode 100644 index 0000000..20132cd --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:36:43.145201.json @@ -0,0 +1 @@ +{"start_time":4393060,"end_time":17778386,"binary_size":106992,"fetch_target_files":{"secs":0,"nanos":54255000},"update_repo":{"secs":4,"nanos":840007000},"fetch_signature":{"secs":0,"nanos":23989000},"fetch_binary":{"secs":0,"nanos":870011000},"verify_binary":{"secs":2,"nanos":917351000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:37:36.392582.json b/benchmark-output/performance-benchmark-2024-08-20 08:37:36.392582.json new file mode 100644 index 0000000..e963546 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:37:36.392582.json @@ -0,0 +1 @@ +{"start_time":4415000,"end_time":16791819,"binary_size":106992,"fetch_target_files":{"secs":0,"nanos":86277000},"update_repo":{"secs":3,"nanos":801744000},"fetch_signature":{"secs":0,"nanos":23849000},"fetch_binary":{"secs":0,"nanos":871892000},"verify_binary":{"secs":2,"nanos":917399000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:38:29.743328.json b/benchmark-output/performance-benchmark-2024-08-20 08:38:29.743328.json new file mode 100644 index 0000000..53d4fba --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:38:29.743328.json @@ -0,0 +1 @@ +{"start_time":4503412,"end_time":16879257,"binary_size":106992,"fetch_target_files":{"secs":0,"nanos":110872000},"update_repo":{"secs":3,"nanos":776025000},"fetch_signature":{"secs":0,"nanos":24223000},"fetch_binary":{"secs":0,"nanos":874702000},"verify_binary":{"secs":2,"nanos":917241000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:39:24.220492.json b/benchmark-output/performance-benchmark-2024-08-20 08:39:24.220492.json new file mode 100644 index 0000000..cb180ec --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:39:24.220492.json @@ -0,0 +1 @@ +{"start_time":4426401,"end_time":18011158,"binary_size":172520,"fetch_target_files":{"secs":0,"nanos":112626000},"update_repo":{"secs":3,"nanos":775555000},"fetch_signature":{"secs":0,"nanos":27108000},"fetch_binary":{"secs":2,"nanos":69017000},"verify_binary":{"secs":2,"nanos":915839000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:40:18.185840.json b/benchmark-output/performance-benchmark-2024-08-20 08:40:18.185840.json new file mode 100644 index 0000000..8af8442 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:40:18.185840.json @@ -0,0 +1 @@ +{"start_time":4474880,"end_time":17321495,"binary_size":172520,"fetch_target_files":{"secs":0,"nanos":84009000},"update_repo":{"secs":3,"nanos":803187000},"fetch_signature":{"secs":0,"nanos":25172000},"fetch_binary":{"secs":1,"nanos":340138000},"verify_binary":{"secs":2,"nanos":915854000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:41:12.867675.json b/benchmark-output/performance-benchmark-2024-08-20 08:41:12.867675.json new file mode 100644 index 0000000..df2a7b0 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:41:12.867675.json @@ -0,0 +1 @@ +{"start_time":4422796,"end_time":18008737,"binary_size":172520,"fetch_target_files":{"secs":0,"nanos":81835000},"update_repo":{"secs":3,"nanos":805091000},"fetch_signature":{"secs":0,"nanos":25228000},"fetch_binary":{"secs":2,"nanos":66434000},"verify_binary":{"secs":2,"nanos":915819000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:42:07.437976.json b/benchmark-output/performance-benchmark-2024-08-20 08:42:07.437976.json new file mode 100644 index 0000000..6d2e308 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:42:07.437976.json @@ -0,0 +1 @@ +{"start_time":4448376,"end_time":18002815,"binary_size":172520,"fetch_target_files":{"secs":0,"nanos":91068000},"update_repo":{"secs":3,"nanos":805180000},"fetch_signature":{"secs":0,"nanos":23494000},"fetch_binary":{"secs":2,"nanos":18034000},"verify_binary":{"secs":2,"nanos":915812000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:43:02.032717.json b/benchmark-output/performance-benchmark-2024-08-20 08:43:02.032717.json new file mode 100644 index 0000000..7b7775a --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:43:02.032717.json @@ -0,0 +1 @@ +{"start_time":4427464,"end_time":17932210,"binary_size":172520,"fetch_target_files":{"secs":0,"nanos":84325000},"update_repo":{"secs":3,"nanos":805799000},"fetch_signature":{"secs":0,"nanos":24156000},"fetch_binary":{"secs":1,"nanos":997783000},"verify_binary":{"secs":2,"nanos":915815000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:43:55.949029.json b/benchmark-output/performance-benchmark-2024-08-20 08:43:55.949029.json new file mode 100644 index 0000000..b15da7c --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:43:55.949029.json @@ -0,0 +1 @@ +{"start_time":4445267,"end_time":17305885,"binary_size":172520,"fetch_target_files":{"secs":0,"nanos":57131000},"update_repo":{"secs":3,"nanos":805397000},"fetch_signature":{"secs":0,"nanos":23258000},"fetch_binary":{"secs":1,"nanos":357450000},"verify_binary":{"secs":2,"nanos":915870000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:44:49.855015.json b/benchmark-output/performance-benchmark-2024-08-20 08:44:49.855015.json new file mode 100644 index 0000000..4d4a6cb --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:44:49.855015.json @@ -0,0 +1 @@ +{"start_time":4428705,"end_time":17256810,"binary_size":172520,"fetch_target_files":{"secs":0,"nanos":84700000},"update_repo":{"secs":3,"nanos":806351000},"fetch_signature":{"secs":0,"nanos":22685000},"fetch_binary":{"secs":1,"nanos":290192000},"verify_binary":{"secs":2,"nanos":915804000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:45:44.434503.json b/benchmark-output/performance-benchmark-2024-08-20 08:45:44.434503.json new file mode 100644 index 0000000..95357e7 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:45:44.434503.json @@ -0,0 +1 @@ +{"start_time":4428585,"end_time":17955783,"binary_size":172520,"fetch_target_files":{"secs":0,"nanos":83883000},"update_repo":{"secs":3,"nanos":806026000},"fetch_signature":{"secs":0,"nanos":25576000},"fetch_binary":{"secs":2,"nanos":1739000},"verify_binary":{"secs":2,"nanos":915920000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:46:39.117894.json b/benchmark-output/performance-benchmark-2024-08-20 08:46:39.117894.json new file mode 100644 index 0000000..a31e260 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:46:39.117894.json @@ -0,0 +1 @@ +{"start_time":4463980,"end_time":18056441,"binary_size":172520,"fetch_target_files":{"secs":0,"nanos":81985000},"update_repo":{"secs":3,"nanos":806824000},"fetch_signature":{"secs":0,"nanos":24527000},"fetch_binary":{"secs":2,"nanos":57031000},"verify_binary":{"secs":2,"nanos":915894000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:47:34.209877.json b/benchmark-output/performance-benchmark-2024-08-20 08:47:34.209877.json new file mode 100644 index 0000000..0cced91 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:47:34.209877.json @@ -0,0 +1 @@ +{"start_time":4417556,"end_time":18384177,"binary_size":238060,"fetch_target_files":{"secs":0,"nanos":84091000},"update_repo":{"secs":3,"nanos":806509000},"fetch_signature":{"secs":0,"nanos":23351000},"fetch_binary":{"secs":2,"nanos":439917000},"verify_binary":{"secs":2,"nanos":916337000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:48:28.789175.json b/benchmark-output/performance-benchmark-2024-08-20 08:48:28.789175.json new file mode 100644 index 0000000..548f4fd --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:48:28.789175.json @@ -0,0 +1 @@ +{"start_time":4419398,"end_time":17766486,"binary_size":238060,"fetch_target_files":{"secs":0,"nanos":85800000},"update_repo":{"secs":3,"nanos":806128000},"fetch_signature":{"secs":0,"nanos":26476000},"fetch_binary":{"secs":1,"nanos":800608000},"verify_binary":{"secs":2,"nanos":916378000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:49:24.085695.json b/benchmark-output/performance-benchmark-2024-08-20 08:49:24.085695.json new file mode 100644 index 0000000..a9e4b02 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:49:24.085695.json @@ -0,0 +1 @@ +{"start_time":4427502,"end_time":18493535,"binary_size":238060,"fetch_target_files":{"secs":0,"nanos":82647000},"update_repo":{"secs":3,"nanos":807278000},"fetch_signature":{"secs":0,"nanos":24466000},"fetch_binary":{"secs":2,"nanos":531167000},"verify_binary":{"secs":2,"nanos":916351000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:50:19.382249.json b/benchmark-output/performance-benchmark-2024-08-20 08:50:19.382249.json new file mode 100644 index 0000000..d42288f --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:50:19.382249.json @@ -0,0 +1 @@ +{"start_time":4448377,"end_time":18505752,"binary_size":238060,"fetch_target_files":{"secs":0,"nanos":98545000},"update_repo":{"secs":3,"nanos":793294000},"fetch_signature":{"secs":0,"nanos":24278000},"fetch_binary":{"secs":2,"nanos":532835000},"verify_binary":{"secs":2,"nanos":916356000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:51:14.650965.json b/benchmark-output/performance-benchmark-2024-08-20 08:51:14.650965.json new file mode 100644 index 0000000..b63b398 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:51:14.650965.json @@ -0,0 +1 @@ +{"start_time":4420939,"end_time":18471392,"binary_size":238060,"fetch_target_files":{"secs":0,"nanos":63890000},"update_repo":{"secs":3,"nanos":807568000},"fetch_signature":{"secs":0,"nanos":26426000},"fetch_binary":{"secs":2,"nanos":523504000},"verify_binary":{"secs":2,"nanos":916400000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:52:10.182122.json b/benchmark-output/performance-benchmark-2024-08-20 08:52:10.182122.json new file mode 100644 index 0000000..f8f3635 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:52:10.182122.json @@ -0,0 +1 @@ +{"start_time":4389156,"end_time":18757982,"binary_size":238060,"fetch_target_files":{"secs":0,"nanos":86901000},"update_repo":{"secs":4,"nanos":833356000},"fetch_signature":{"secs":0,"nanos":23748000},"fetch_binary":{"secs":1,"nanos":804081000},"verify_binary":{"secs":2,"nanos":916452000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:53:04.763449.json b/benchmark-output/performance-benchmark-2024-08-20 08:53:04.763449.json new file mode 100644 index 0000000..624ef3f --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:53:04.763449.json @@ -0,0 +1 @@ +{"start_time":4450536,"end_time":17799980,"binary_size":238060,"fetch_target_files":{"secs":0,"nanos":82251000},"update_repo":{"secs":3,"nanos":810398000},"fetch_signature":{"secs":0,"nanos":26313000},"fetch_binary":{"secs":1,"nanos":832350000},"verify_binary":{"secs":2,"nanos":916271000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:54:00.160700.json b/benchmark-output/performance-benchmark-2024-08-20 08:54:00.160700.json new file mode 100644 index 0000000..60de86b --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:54:00.160700.json @@ -0,0 +1 @@ +{"start_time":4465848,"end_time":18538497,"binary_size":238060,"fetch_target_files":{"secs":0,"nanos":54989000},"update_repo":{"secs":3,"nanos":809186000},"fetch_signature":{"secs":0,"nanos":28715000},"fetch_binary":{"secs":2,"nanos":560813000},"verify_binary":{"secs":2,"nanos":916485000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:54:54.841759.json b/benchmark-output/performance-benchmark-2024-08-20 08:54:54.841759.json new file mode 100644 index 0000000..0000a8b --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:54:54.841759.json @@ -0,0 +1 @@ +{"start_time":4451997,"end_time":17808394,"binary_size":238060,"fetch_target_files":{"secs":0,"nanos":81301000},"update_repo":{"secs":3,"nanos":815036000},"fetch_signature":{"secs":0,"nanos":24932000},"fetch_binary":{"secs":1,"nanos":816302000},"verify_binary":{"secs":2,"nanos":916358000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:55:50.241128.json b/benchmark-output/performance-benchmark-2024-08-20 08:55:50.241128.json new file mode 100644 index 0000000..c756f43 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:55:50.241128.json @@ -0,0 +1 @@ +{"start_time":4460472,"end_time":18532159,"binary_size":238060,"fetch_target_files":{"secs":0,"nanos":82784000},"update_repo":{"secs":3,"nanos":809209000},"fetch_signature":{"secs":0,"nanos":23595000},"fetch_binary":{"secs":2,"nanos":534603000},"verify_binary":{"secs":2,"nanos":916362000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:56:45.536299.json b/benchmark-output/performance-benchmark-2024-08-20 08:56:45.536299.json new file mode 100644 index 0000000..a0d5cd1 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:56:45.536299.json @@ -0,0 +1 @@ +{"start_time":4426574,"end_time":18483084,"binary_size":238060,"fetch_target_files":{"secs":0,"nanos":95857000},"update_repo":{"secs":3,"nanos":810532000},"fetch_signature":{"secs":0,"nanos":24451000},"fetch_binary":{"secs":2,"nanos":488641000},"verify_binary":{"secs":2,"nanos":916469000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:57:40.118298.json b/benchmark-output/performance-benchmark-2024-08-20 08:57:40.118298.json new file mode 100644 index 0000000..ea07692 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:57:40.118298.json @@ -0,0 +1 @@ +{"start_time":4462076,"end_time":17784949,"binary_size":238060,"fetch_target_files":{"secs":0,"nanos":109916000},"update_repo":{"secs":3,"nanos":786351000},"fetch_signature":{"secs":0,"nanos":24462000},"fetch_binary":{"secs":1,"nanos":787092000},"verify_binary":{"secs":2,"nanos":916420000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:58:35.186132.json b/benchmark-output/performance-benchmark-2024-08-20 08:58:35.186132.json new file mode 100644 index 0000000..ef85687 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:58:35.186132.json @@ -0,0 +1 @@ +{"start_time":4479335,"end_time":18329084,"binary_size":303592,"fetch_target_files":{"secs":0,"nanos":105688000},"update_repo":{"secs":3,"nanos":790567000},"fetch_signature":{"secs":0,"nanos":24061000},"fetch_binary":{"secs":2,"nanos":325375000},"verify_binary":{"secs":2,"nanos":916948000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 08:59:31.019219.json b/benchmark-output/performance-benchmark-2024-08-20 08:59:31.019219.json new file mode 100644 index 0000000..6746dbe --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 08:59:31.019219.json @@ -0,0 +1 @@ +{"start_time":4443597,"end_time":18921801,"binary_size":303592,"fetch_target_files":{"secs":0,"nanos":55096000},"update_repo":{"secs":3,"nanos":809854000},"fetch_signature":{"secs":0,"nanos":23272000},"fetch_binary":{"secs":2,"nanos":971757000},"verify_binary":{"secs":2,"nanos":917001000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:00:27.237984.json b/benchmark-output/performance-benchmark-2024-08-20 09:00:27.237984.json new file mode 100644 index 0000000..589f877 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:00:27.237984.json @@ -0,0 +1 @@ +{"start_time":4450609,"end_time":19312859,"binary_size":303592,"fetch_target_files":{"secs":0,"nanos":57207000},"update_repo":{"secs":4,"nanos":833306000},"fetch_signature":{"secs":0,"nanos":26874000},"fetch_binary":{"secs":2,"nanos":350826000},"verify_binary":{"secs":2,"nanos":916974000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:01:23.149472.json b/benchmark-output/performance-benchmark-2024-08-20 09:01:23.149472.json new file mode 100644 index 0000000..90c3caf --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:01:23.149472.json @@ -0,0 +1 @@ +{"start_time":4434776,"end_time":18993833,"binary_size":303592,"fetch_target_files":{"secs":0,"nanos":86691000},"update_repo":{"secs":3,"nanos":810831000},"fetch_signature":{"secs":0,"nanos":26773000},"fetch_binary":{"secs":3,"nanos":15980000},"verify_binary":{"secs":2,"nanos":916946000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:02:19.674217.json b/benchmark-output/performance-benchmark-2024-08-20 09:02:19.674217.json new file mode 100644 index 0000000..fb63b92 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:02:19.674217.json @@ -0,0 +1 @@ +{"start_time":4477666,"end_time":19474759,"binary_size":369132,"fetch_target_files":{"secs":0,"nanos":86294000},"update_repo":{"secs":3,"nanos":810036000},"fetch_signature":{"secs":0,"nanos":25671000},"fetch_binary":{"secs":3,"nanos":448716000},"verify_binary":{"secs":2,"nanos":916578000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:03:24.598129.json b/benchmark-output/performance-benchmark-2024-08-20 09:03:24.598129.json new file mode 100644 index 0000000..ae43a15 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:03:24.598129.json @@ -0,0 +1 @@ +{"start_time":4439013,"end_time":18121998,"binary_size":369132,"fetch_target_files":{"secs":0,"nanos":84940000},"update_repo":{"secs":3,"nanos":196927000},"fetch_signature":{"secs":0,"nanos":25201000},"fetch_binary":{"secs":2,"nanos":767413000},"verify_binary":{"secs":2,"nanos":916610000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:04:21.226169.json b/benchmark-output/performance-benchmark-2024-08-20 09:04:21.226169.json new file mode 100644 index 0000000..4250020 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:04:21.226169.json @@ -0,0 +1 @@ +{"start_time":4415655,"end_time":19442418,"binary_size":369132,"fetch_target_files":{"secs":0,"nanos":85874000},"update_repo":{"secs":3,"nanos":804816000},"fetch_signature":{"secs":0,"nanos":23160000},"fetch_binary":{"secs":3,"nanos":492996000},"verify_binary":{"secs":2,"nanos":916772000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:05:17.137034.json b/benchmark-output/performance-benchmark-2024-08-20 09:05:17.137034.json new file mode 100644 index 0000000..f071cf1 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:05:17.137034.json @@ -0,0 +1 @@ +{"start_time":4421575,"end_time":18736254,"binary_size":369132,"fetch_target_files":{"secs":0,"nanos":84640000},"update_repo":{"secs":3,"nanos":810736000},"fetch_signature":{"secs":0,"nanos":26118000},"fetch_binary":{"secs":2,"nanos":759790000},"verify_binary":{"secs":2,"nanos":916748000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:06:13.048665.json b/benchmark-output/performance-benchmark-2024-08-20 09:06:13.048665.json new file mode 100644 index 0000000..da9644c --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:06:13.048665.json @@ -0,0 +1 @@ +{"start_time":4400414,"end_time":18720400,"binary_size":369132,"fetch_target_files":{"secs":0,"nanos":56447000},"update_repo":{"secs":3,"nanos":778447000},"fetch_signature":{"secs":0,"nanos":24811000},"fetch_binary":{"secs":2,"nanos":844935000},"verify_binary":{"secs":2,"nanos":916643000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:07:09.061002.json b/benchmark-output/performance-benchmark-2024-08-20 09:07:09.061002.json new file mode 100644 index 0000000..c4d273a --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:07:09.061002.json @@ -0,0 +1 @@ +{"start_time":4407023,"end_time":18844305,"binary_size":369132,"fetch_target_files":{"secs":0,"nanos":89660000},"update_repo":{"secs":3,"nanos":813486000},"fetch_signature":{"secs":0,"nanos":26095000},"fetch_binary":{"secs":2,"nanos":849283000},"verify_binary":{"secs":2,"nanos":916748000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:08:05.015132.json b/benchmark-output/performance-benchmark-2024-08-20 09:08:05.015132.json new file mode 100644 index 0000000..bdb366d --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:08:05.015132.json @@ -0,0 +1 @@ +{"start_time":4444224,"end_time":18877700,"binary_size":369132,"fetch_target_files":{"secs":0,"nanos":97872000},"update_repo":{"secs":3,"nanos":816520000},"fetch_signature":{"secs":0,"nanos":26693000},"fetch_binary":{"secs":2,"nanos":863839000},"verify_binary":{"secs":2,"nanos":916704000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:09:00.881587.json b/benchmark-output/performance-benchmark-2024-08-20 09:09:00.881587.json new file mode 100644 index 0000000..30fc771 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:09:00.881587.json @@ -0,0 +1 @@ +{"start_time":4414753,"end_time":18742225,"binary_size":369132,"fetch_target_files":{"secs":0,"nanos":87127000},"update_repo":{"secs":3,"nanos":813189000},"fetch_signature":{"secs":0,"nanos":25311000},"fetch_binary":{"secs":2,"nanos":777237000},"verify_binary":{"secs":2,"nanos":916696000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:09:57.487831.json b/benchmark-output/performance-benchmark-2024-08-20 09:09:57.487831.json new file mode 100644 index 0000000..4a786bc --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:09:57.487831.json @@ -0,0 +1 @@ +{"start_time":4433635,"end_time":19487904,"binary_size":369132,"fetch_target_files":{"secs":0,"nanos":87704000},"update_repo":{"secs":3,"nanos":812718000},"fetch_signature":{"secs":0,"nanos":26307000},"fetch_binary":{"secs":3,"nanos":503253000},"verify_binary":{"secs":2,"nanos":916695000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:10:54.033808.json b/benchmark-output/performance-benchmark-2024-08-20 09:10:54.033808.json new file mode 100644 index 0000000..53339f7 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:10:54.033808.json @@ -0,0 +1 @@ +{"start_time":4467698,"end_time":19464342,"binary_size":369132,"fetch_target_files":{"secs":0,"nanos":87498000},"update_repo":{"secs":3,"nanos":812634000},"fetch_signature":{"secs":0,"nanos":26191000},"fetch_binary":{"secs":3,"nanos":432831000},"verify_binary":{"secs":2,"nanos":916636000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:11:50.558019.json b/benchmark-output/performance-benchmark-2024-08-20 09:11:50.558019.json new file mode 100644 index 0000000..25f0bc6 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:11:50.558019.json @@ -0,0 +1 @@ +{"start_time":4424396,"end_time":19390598,"binary_size":369132,"fetch_target_files":{"secs":0,"nanos":53260000},"update_repo":{"secs":3,"nanos":813931000},"fetch_signature":{"secs":0,"nanos":27063000},"fetch_binary":{"secs":3,"nanos":440748000},"verify_binary":{"secs":2,"nanos":916684000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:12:47.697540.json b/benchmark-output/performance-benchmark-2024-08-20 09:12:47.697540.json new file mode 100644 index 0000000..e11729a --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:12:47.697540.json @@ -0,0 +1 @@ +{"start_time":4439226,"end_time":19952287,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":87083000},"update_repo":{"secs":3,"nanos":813104000},"fetch_signature":{"secs":0,"nanos":23473000},"fetch_binary":{"secs":3,"nanos":952907000},"verify_binary":{"secs":2,"nanos":915930000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:13:44.324380.json b/benchmark-output/performance-benchmark-2024-08-20 09:13:44.324380.json new file mode 100644 index 0000000..f3d9211 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:13:44.324380.json @@ -0,0 +1 @@ +{"start_time":4487319,"end_time":19324827,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":86598000},"update_repo":{"secs":3,"nanos":813285000},"fetch_signature":{"secs":0,"nanos":25621000},"fetch_binary":{"secs":3,"nanos":278512000},"verify_binary":{"secs":2,"nanos":915924000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:14:40.746971.json b/benchmark-output/performance-benchmark-2024-08-20 09:14:40.746971.json new file mode 100644 index 0000000..a09cf26 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:14:40.746971.json @@ -0,0 +1 @@ +{"start_time":4411016,"end_time":19169330,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":84311000},"update_repo":{"secs":3,"nanos":816114000},"fetch_signature":{"secs":0,"nanos":23572000},"fetch_binary":{"secs":3,"nanos":205915000},"verify_binary":{"secs":2,"nanos":915867000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:15:38.176186.json b/benchmark-output/performance-benchmark-2024-08-20 09:15:38.176186.json new file mode 100644 index 0000000..b5fdfcd --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:15:38.176186.json @@ -0,0 +1 @@ +{"start_time":4387653,"end_time":20192288,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":112985000},"update_repo":{"secs":4,"nanos":807699000},"fetch_signature":{"secs":0,"nanos":24339000},"fetch_binary":{"secs":3,"nanos":237070000},"verify_binary":{"secs":2,"nanos":915911000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:16:35.334034.json b/benchmark-output/performance-benchmark-2024-08-20 09:16:35.334034.json new file mode 100644 index 0000000..62585e7 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:16:35.334034.json @@ -0,0 +1 @@ +{"start_time":4423387,"end_time":19917375,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":85401000},"update_repo":{"secs":3,"nanos":815220000},"fetch_signature":{"secs":0,"nanos":24936000},"fetch_binary":{"secs":3,"nanos":943269000},"verify_binary":{"secs":2,"nanos":915917000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:17:31.844067.json b/benchmark-output/performance-benchmark-2024-08-20 09:17:31.844067.json new file mode 100644 index 0000000..dbd9f08 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:17:31.844067.json @@ -0,0 +1 @@ +{"start_time":4435522,"end_time":19223538,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":57938000},"update_repo":{"secs":3,"nanos":816144000},"fetch_signature":{"secs":0,"nanos":29394000},"fetch_binary":{"secs":3,"nanos":266374000},"verify_binary":{"secs":2,"nanos":915978000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:18:28.999147.json b/benchmark-output/performance-benchmark-2024-08-20 09:18:28.999147.json new file mode 100644 index 0000000..8ea29c1 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:18:28.999147.json @@ -0,0 +1 @@ +{"start_time":4401214,"end_time":19871597,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":86124000},"update_repo":{"secs":3,"nanos":814132000},"fetch_signature":{"secs":0,"nanos":24313000},"fetch_binary":{"secs":3,"nanos":906348000},"verify_binary":{"secs":2,"nanos":915973000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:19:25.625981.json b/benchmark-output/performance-benchmark-2024-08-20 09:19:25.625981.json new file mode 100644 index 0000000..d08f4c1 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:19:25.625981.json @@ -0,0 +1 @@ +{"start_time":4486487,"end_time":19307568,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":89765000},"update_repo":{"secs":3,"nanos":814650000},"fetch_signature":{"secs":0,"nanos":26758000},"fetch_binary":{"secs":3,"nanos":270137000},"verify_binary":{"secs":2,"nanos":915969000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:20:31.062208.json b/benchmark-output/performance-benchmark-2024-08-20 09:20:31.062208.json new file mode 100644 index 0000000..8c578cd --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:20:31.062208.json @@ -0,0 +1 @@ +{"start_time":4435727,"end_time":18603643,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":90344000},"update_repo":{"secs":3,"nanos":203152000},"fetch_signature":{"secs":0,"nanos":27243000},"fetch_binary":{"secs":3,"nanos":221473000},"verify_binary":{"secs":2,"nanos":915992000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:21:28.611003.json b/benchmark-output/performance-benchmark-2024-08-20 09:21:28.611003.json new file mode 100644 index 0000000..476fef7 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:21:28.611003.json @@ -0,0 +1 @@ +{"start_time":4383904,"end_time":20220382,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":84264000},"update_repo":{"secs":4,"nanos":839955000},"fetch_signature":{"secs":0,"nanos":25870000},"fetch_binary":{"secs":3,"nanos":263669000},"verify_binary":{"secs":2,"nanos":915902000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:22:25.340802.json b/benchmark-output/performance-benchmark-2024-08-20 09:22:25.340802.json new file mode 100644 index 0000000..e5dd2c7 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:22:25.340802.json @@ -0,0 +1 @@ +{"start_time":4472209,"end_time":19390332,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":103850000},"update_repo":{"secs":3,"nanos":816403000},"fetch_signature":{"secs":0,"nanos":24788000},"fetch_binary":{"secs":3,"nanos":331809000},"verify_binary":{"secs":2,"nanos":915890000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:23:22.684988.json b/benchmark-output/performance-benchmark-2024-08-20 09:23:22.684988.json new file mode 100644 index 0000000..0d78126 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:23:22.684988.json @@ -0,0 +1 @@ +{"start_time":4476887,"end_time":19996699,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":84096000},"update_repo":{"secs":3,"nanos":815918000},"fetch_signature":{"secs":0,"nanos":23659000},"fetch_binary":{"secs":3,"nanos":972297000},"verify_binary":{"secs":2,"nanos":915938000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:24:20.949997.json b/benchmark-output/performance-benchmark-2024-08-20 09:24:20.949997.json new file mode 100644 index 0000000..a5af356 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:24:20.949997.json @@ -0,0 +1 @@ +{"start_time":4386629,"end_time":20955039,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":54464000},"update_repo":{"secs":4,"nanos":840350000},"fetch_signature":{"secs":0,"nanos":28061000},"fetch_binary":{"secs":3,"nanos":996547000},"verify_binary":{"secs":2,"nanos":915964000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:25:17.577855.json b/benchmark-output/performance-benchmark-2024-08-20 09:25:17.577855.json new file mode 100644 index 0000000..f0121c4 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:25:17.577855.json @@ -0,0 +1 @@ +{"start_time":4467581,"end_time":19285607,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":87068000},"update_repo":{"secs":3,"nanos":816078000},"fetch_signature":{"secs":0,"nanos":24224000},"fetch_binary":{"secs":3,"nanos":264436000},"verify_binary":{"secs":2,"nanos":915924000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:26:15.844016.json b/benchmark-output/performance-benchmark-2024-08-20 09:26:15.844016.json new file mode 100644 index 0000000..1061d17 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:26:15.844016.json @@ -0,0 +1 @@ +{"start_time":4398752,"end_time":20949998,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":87163000},"update_repo":{"secs":4,"nanos":839550000},"fetch_signature":{"secs":0,"nanos":24132000},"fetch_binary":{"secs":3,"nanos":971643000},"verify_binary":{"secs":2,"nanos":915937000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:27:12.474049.json b/benchmark-output/performance-benchmark-2024-08-20 09:27:12.474049.json new file mode 100644 index 0000000..6c8f781 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:27:12.474049.json @@ -0,0 +1 @@ +{"start_time":4431829,"end_time":19250524,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":87162000},"update_repo":{"secs":3,"nanos":817357000},"fetch_signature":{"secs":0,"nanos":24167000},"fetch_binary":{"secs":3,"nanos":259660000},"verify_binary":{"secs":2,"nanos":915902000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:28:09.714267.json b/benchmark-output/performance-benchmark-2024-08-20 09:28:09.714267.json new file mode 100644 index 0000000..1936363 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:28:09.714267.json @@ -0,0 +1 @@ +{"start_time":4430618,"end_time":19937473,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":83228000},"update_repo":{"secs":3,"nanos":818778000},"fetch_signature":{"secs":0,"nanos":22357000},"fetch_binary":{"secs":3,"nanos":948933000},"verify_binary":{"secs":2,"nanos":915867000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:29:06.342918.json b/benchmark-output/performance-benchmark-2024-08-20 09:29:06.342918.json new file mode 100644 index 0000000..3823cb2 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:29:06.342918.json @@ -0,0 +1 @@ +{"start_time":4431608,"end_time":19249290,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":87085000},"update_repo":{"secs":3,"nanos":817215000},"fetch_signature":{"secs":0,"nanos":23266000},"fetch_binary":{"secs":3,"nanos":255446000},"verify_binary":{"secs":2,"nanos":915967000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:30:02.885976.json b/benchmark-output/performance-benchmark-2024-08-20 09:30:02.885976.json new file mode 100644 index 0000000..d36b99b --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:30:02.885976.json @@ -0,0 +1 @@ +{"start_time":4460917,"end_time":19283019,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":87644000},"update_repo":{"secs":3,"nanos":817021000},"fetch_signature":{"secs":0,"nanos":24469000},"fetch_binary":{"secs":3,"nanos":266397000},"verify_binary":{"secs":2,"nanos":916010000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:31:00.110025.json b/benchmark-output/performance-benchmark-2024-08-20 09:31:00.110025.json new file mode 100644 index 0000000..18bbf05 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:31:00.110025.json @@ -0,0 +1 @@ +{"start_time":4431146,"end_time":19942781,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":85944000},"update_repo":{"secs":3,"nanos":826364000},"fetch_signature":{"secs":0,"nanos":23593000},"fetch_binary":{"secs":3,"nanos":931214000},"verify_binary":{"secs":2,"nanos":915923000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:31:57.370331.json b/benchmark-output/performance-benchmark-2024-08-20 09:31:57.370331.json new file mode 100644 index 0000000..2a72c98 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:31:57.370331.json @@ -0,0 +1 @@ +{"start_time":4411839,"end_time":19950582,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":54961000},"update_repo":{"secs":3,"nanos":817694000},"fetch_signature":{"secs":0,"nanos":25027000},"fetch_binary":{"secs":3,"nanos":995983000},"verify_binary":{"secs":2,"nanos":915962000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:32:55.619965.json b/benchmark-output/performance-benchmark-2024-08-20 09:32:55.619965.json new file mode 100644 index 0000000..2f4998d --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:32:55.619965.json @@ -0,0 +1 @@ +{"start_time":4387125,"end_time":20826910,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":82664000},"update_repo":{"secs":4,"nanos":843015000},"fetch_signature":{"secs":0,"nanos":24982000},"fetch_binary":{"secs":3,"nanos":842188000},"verify_binary":{"secs":2,"nanos":915917000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:33:52.964818.json b/benchmark-output/performance-benchmark-2024-08-20 09:33:52.964818.json new file mode 100644 index 0000000..e0edd91 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:33:52.964818.json @@ -0,0 +1 @@ +{"start_time":4443362,"end_time":19986137,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":85551000},"update_repo":{"secs":3,"nanos":818862000},"fetch_signature":{"secs":0,"nanos":23523000},"fetch_binary":{"secs":3,"nanos":990664000},"verify_binary":{"secs":2,"nanos":915935000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:34:50.308819.json b/benchmark-output/performance-benchmark-2024-08-20 09:34:50.308819.json new file mode 100644 index 0000000..e9b27f2 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:34:50.308819.json @@ -0,0 +1 @@ +{"start_time":4449041,"end_time":19982841,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":52326000},"update_repo":{"secs":3,"nanos":818567000},"fetch_signature":{"secs":0,"nanos":27571000},"fetch_binary":{"secs":4,"nanos":1449000},"verify_binary":{"secs":2,"nanos":915851000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:35:47.567040.json b/benchmark-output/performance-benchmark-2024-08-20 09:35:47.567040.json new file mode 100644 index 0000000..ac91cc8 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:35:47.567040.json @@ -0,0 +1 @@ +{"start_time":4456692,"end_time":19992155,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":116741000},"update_repo":{"secs":3,"nanos":787665000},"fetch_signature":{"secs":0,"nanos":23320000},"fetch_binary":{"secs":3,"nanos":970644000},"verify_binary":{"secs":2,"nanos":915952000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:36:44.081613.json b/benchmark-output/performance-benchmark-2024-08-20 09:36:44.081613.json new file mode 100644 index 0000000..822a15c --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:36:44.081613.json @@ -0,0 +1 @@ +{"start_time":4439824,"end_time":19214927,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":88103000},"update_repo":{"secs":3,"nanos":818913000},"fetch_signature":{"secs":0,"nanos":25059000},"fetch_binary":{"secs":3,"nanos":214162000},"verify_binary":{"secs":2,"nanos":915925000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:37:41.421666.json b/benchmark-output/performance-benchmark-2024-08-20 09:37:41.421666.json new file mode 100644 index 0000000..1b3f1e7 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:37:41.421666.json @@ -0,0 +1 @@ +{"start_time":4461964,"end_time":19987855,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":60683000},"update_repo":{"secs":3,"nanos":819785000},"fetch_signature":{"secs":0,"nanos":28545000},"fetch_binary":{"secs":3,"nanos":981710000},"verify_binary":{"secs":2,"nanos":916025000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:38:38.049922.json b/benchmark-output/performance-benchmark-2024-08-20 09:38:38.049922.json new file mode 100644 index 0000000..6e0429c --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:38:38.049922.json @@ -0,0 +1 @@ +{"start_time":4441771,"end_time":19259790,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":83900000},"update_repo":{"secs":3,"nanos":819932000},"fetch_signature":{"secs":0,"nanos":32941000},"fetch_binary":{"secs":3,"nanos":258371000},"verify_binary":{"secs":2,"nanos":915913000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:39:35.366876.json b/benchmark-output/performance-benchmark-2024-08-20 09:39:35.366876.json new file mode 100644 index 0000000..b6ec72e --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:39:35.366876.json @@ -0,0 +1 @@ +{"start_time":4414667,"end_time":19952507,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":89609000},"update_repo":{"secs":3,"nanos":820839000},"fetch_signature":{"secs":0,"nanos":24303000},"fetch_binary":{"secs":3,"nanos":967507000},"verify_binary":{"secs":2,"nanos":915860000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:40:32.950956.json b/benchmark-output/performance-benchmark-2024-08-20 09:40:32.950956.json new file mode 100644 index 0000000..1dde11a --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:40:32.950956.json @@ -0,0 +1 @@ +{"start_time":4402665,"end_time":20263594,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":84695000},"update_repo":{"secs":4,"nanos":844120000},"fetch_signature":{"secs":0,"nanos":23613000},"fetch_binary":{"secs":3,"nanos":249129000},"verify_binary":{"secs":2,"nanos":915911000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:41:29.679246.json b/benchmark-output/performance-benchmark-2024-08-20 09:41:29.679246.json new file mode 100644 index 0000000..abf1a0c --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:41:29.679246.json @@ -0,0 +1 @@ +{"start_time":4431043,"end_time":19359882,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":85793000},"update_repo":{"secs":3,"nanos":820469000},"fetch_signature":{"secs":0,"nanos":23406000},"fetch_binary":{"secs":3,"nanos":341897000},"verify_binary":{"secs":2,"nanos":915901000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:42:27.020558.json b/benchmark-output/performance-benchmark-2024-08-20 09:42:27.020558.json new file mode 100644 index 0000000..3362bad --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:42:27.020558.json @@ -0,0 +1 @@ +{"start_time":4407016,"end_time":19958730,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":147024000},"update_repo":{"secs":3,"nanos":790307000},"fetch_signature":{"secs":0,"nanos":23777000},"fetch_binary":{"secs":3,"nanos":940908000},"verify_binary":{"secs":2,"nanos":915879000}} \ No newline at end of file diff --git a/benchmark-output/performance-benchmark-2024-08-20 09:43:24.365362.json b/benchmark-output/performance-benchmark-2024-08-20 09:43:24.365362.json new file mode 100644 index 0000000..bf24a06 --- /dev/null +++ b/benchmark-output/performance-benchmark-2024-08-20 09:43:24.365362.json @@ -0,0 +1 @@ +{"start_time":4439164,"end_time":20007720,"binary_size":434668,"fetch_target_files":{"secs":0,"nanos":87568000},"update_repo":{"secs":3,"nanos":820602000},"fetch_signature":{"secs":0,"nanos":24415000},"fetch_binary":{"secs":3,"nanos":977224000},"verify_binary":{"secs":2,"nanos":915946000}} \ No newline at end of file diff --git a/benchmarking/.gitignore b/benchmarking/.gitignore new file mode 100644 index 0000000..addc655 --- /dev/null +++ b/benchmarking/.gitignore @@ -0,0 +1,3 @@ +__pychache__ +plots +benchmark-output \ No newline at end of file diff --git a/benchmarking/benchmark_server.py b/benchmarking/benchmark_server.py new file mode 100644 index 0000000..ae50a58 --- /dev/null +++ b/benchmarking/benchmark_server.py @@ -0,0 +1,240 @@ +#"" +# Apache License +# Version 2.0, January 2004 +# http://www.apache.org/licenses/ +# +# TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +# +# 1. Definitions. +# +# "License" shall mean the terms and conditions for use, reproduction, +# and distribution as defined by Sections 1 through 9 of this document. +# +# "Licensor" shall mean the copyright owner or entity authorized by +# the copyright owner that is granting the License. +# +# "Legal Entity" shall mean the union of the acting entity and all +# other entities that control, are controlled by, or are under common +# control with that entity. For the purposes of this definition, +# "control" means (i) the power, direct or indirect, to cause the +# direction or management of such entity, whether by contract or +# otherwise, or (ii) ownership of fifty percent (50%) or more of the +# outstanding shares, or (iii) beneficial ownership of such entity. +# +# "You" (or "Your") shall mean an individual or Legal Entity +# exercising permissions granted by this License. +# +# "Source" form shall mean the preferred form for making modifications, +# including but not limited to software source code, documentation +# source, and configuration files. +# +# "Object" form shall mean any form resulting from mechanical +# transformation or translation of a Source form, including but +# not limited to compiled object code, generated documentation, +# and conversions to other media types. +# +# "Work" shall mean the work of authorship, whether in Source or +# Object form, made available under the License, as indicated by a +# copyright notice that is included in or attached to the work +# (an example is provided in the Appendix below). +# +# "Derivative Works" shall mean any work, whether in Source or Object +# form, that is based on (or derived from) the Work and for which the +# editorial revisions, annotations, elaborations, or other modifications +# represent, as a whole, an original work of authorship. For the purposes +# of this License, Derivative Works shall not include works that remain +# separable from, or merely link (or bind by name) to the interfaces of, +# the Work and Derivative Works thereof. +# +# "Contribution" shall mean any work of authorship, including +# the original version of the Work and any modifications or additions +# to that Work or Derivative Works thereof, that is intentionally +# submitted to Licensor for inclusion in the Work by the copyright owner +# or by an individual or Legal Entity authorized to submit on behalf of +# the copyright owner. For the purposes of this definition, "submitted" +# means any form of electronic, verbal, or written communication sent +# to the Licensor or its representatives, including but not limited to +# communication on electronic mailing lists, source code control systems, +# and issue tracking systems that are managed by, or on behalf of, the +# Licensor for the purpose of discussing and improving the Work, but +# excluding communication that is conspicuously marked or otherwise +# designated in writing by the copyright owner as "Not a Contribution." +# +# "Contributor" shall mean Licensor and any individual or Legal Entity +# on behalf of whom a Contribution has been received by Licensor and +# subsequently incorporated within the Work. +# +# 2. Grant of Copyright License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# copyright license to reproduce, prepare Derivative Works of, +# publicly display, publicly perform, sublicense, and distribute the +# Work and such Derivative Works in Source or Object form. +# +# 3. Grant of Patent License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# (except as stated in this section) patent license to make, have made, +# use, offer to sell, sell, import, and otherwise transfer the Work, +# where such license applies only to those patent claims licensable +# by such Contributor that are necessarily infringed by their +# Contribution(s) alone or by combination of their Contribution(s) +# with the Work to which such Contribution(s) was submitted. If You +# institute patent litigation against any entity (including a +# cross-claim or counterclaim in a lawsuit) alleging that the Work +# or a Contribution incorporated within the Work constitutes direct +# or contributory patent infringement, then any patent licenses +# granted to You under this License for that Work shall terminate +# as of the date such litigation is filed. +# +# 4. Redistribution. You may reproduce and distribute copies of the +# Work or Derivative Works thereof in any medium, with or without +# modifications, and in Source or Object form, provided that You +# meet the following conditions: +# +# (a) You must give any other recipients of the Work or +# Derivative Works a copy of this License; and +# +# (b) You must cause any modified files to carry prominent notices +# stating that You changed the files; and +# +# (c) You must retain, in the Source form of any Derivative Works +# that You distribute, all copyright, patent, trademark, and +# attribution notices from the Source form of the Work, +# excluding those notices that do not pertain to any part of +# the Derivative Works; and +# +# (d) If the Work includes a "NOTICE" text file as part of its +# distribution, then any Derivative Works that You distribute must +# include a readable copy of the attribution notices contained +# within such NOTICE file, excluding those notices that do not +# pertain to any part of the Derivative Works, in at least one +# of the following places: within a NOTICE text file distributed +# as part of the Derivative Works; within the Source form or +# documentation, if provided along with the Derivative Works; or, +# within a display generated by the Derivative Works, if and +# wherever such third-party notices normally appear. The contents +# of the NOTICE file are for informational purposes only and +# do not modify the License. You may add Your own attribution +# notices within Derivative Works that You distribute, alongside +# or as an addendum to the NOTICE text from the Work, provided +# that such additional attribution notices cannot be construed +# as modifying the License. +# +# You may add Your own copyright statement to Your modifications and +# may provide additional or different license terms and conditions +# for use, reproduction, or distribution of Your modifications, or +# for any such Derivative Works as a whole, provided Your use, +# reproduction, and distribution of the Work otherwise complies with +# the conditions stated in this License. +# +# 5. Submission of Contributions. Unless You explicitly state otherwise, +# any Contribution intentionally submitted for inclusion in the Work +# by You to the Licensor shall be under the terms and conditions of +# this License, without any additional terms or conditions. +# Notwithstanding the above, nothing herein shall supersede or modify +# the terms of any separate license agreement you may have executed +# with Licensor regarding such Contributions. +# +# 6. Trademarks. This License does not grant permission to use the trade +# names, trademarks, service marks, or product names of the Licensor, +# except as required for reasonable and customary use in describing the +# origin of the Work and reproducing the content of the NOTICE file. +# +# 7. Disclaimer of Warranty. Unless required by applicable law or +# agreed to in writing, Licensor provides the Work (and each +# Contributor provides its Contributions) on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied, including, without limitation, any warranties or conditions +# of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +# PARTICULAR PURPOSE. You are solely responsible for determining the +# appropriateness of using or redistributing the Work and assume any +# risks associated with Your exercise of permissions under this License. +# +# 8. Limitation of Liability. In no event and under no legal theory, +# whether in tort (including negligence), contract, or otherwise, +# unless required by applicable law (such as deliberate and grossly +# negligent acts) or agreed to in writing, shall any Contributor be +# liable to You for damages, including any direct, indirect, special, +# incidental, or consequential damages of any character arising as a +# result of this License or out of the use or inability to use the +# Work (including but not limited to damages for loss of goodwill, +# work stoppage, computer failure or malfunction, or any and all +# other commercial damages or losses), even if such Contributor +# has been advised of the possibility of such damages. +# +# 9. Accepting Warranty or Additional Liability. While redistributing +# the Work or Derivative Works thereof, You may choose to offer, +# and charge a fee for, acceptance of support, warranty, indemnity, +# or other liability obligations and/or rights consistent with this +# License. However, in accepting such obligations, You may act only +# on Your own behalf and on Your sole responsibility, not on behalf +# of any other Contributor, and only if You agree to indemnify, +# defend, and hold each Contributor harmless for any liability +# incurred by, or claims asserted against, such Contributor by reason +# of your accepting any such warranty or additional liability. +# +# END OF TERMS AND CONDITIONS +# +# APPENDIX: How to apply the Apache License to your work. +# +# To apply the Apache License to your work, attach the following +# boilerplate notice, with the fields enclosed by brackets "[]" +# replaced with your own identifying information. (Don't include +# the brackets!) The text should be enclosed in the appropriate +# comment syntax for the file format. We also recommend that a +# file or class name and description of purpose be included on the +# same "printed page" as the copyright notice for easier +# identification within third-party archives. +# +# Copyright 2024 Fraunhofer AISEC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from pydantic import BaseModel +from fastapi import FastAPI +import uvicorn +from datetime import datetime +import os + +class BenchmarkData(BaseModel): + start_time: int + end_time: int + binary_size: int | None + fetch_target_files: dict + update_repo: dict + fetch_signature: dict + fetch_binary: dict + verify_binary: dict + verify_binary_naive: dict | None + +class Item(BaseModel): + name: str + description: str | None = None + price: float + tax: float | None = None + + +app = FastAPI() + +@app.post("/") +async def data(data: BenchmarkData): + os.makedirs("benchmark-output", exist_ok=True) + with open(f"benchmark-output/performance-benchmark-{datetime.utcnow()}.json", "w+") as f: + f.write(data.json()) + print(f"{data}") + return {} + +if __name__ == "__main__": + if __name__ == "__main__": + uvicorn.run("benchmark_server:app", port=8080, host="0.0.0.0", log_level="info") \ No newline at end of file diff --git a/benchmarking/performance-benchmarks.ipynb b/benchmarking/performance-benchmarks.ipynb new file mode 100644 index 0000000..2cabfd6 --- /dev/null +++ b/benchmarking/performance-benchmarks.ipynb @@ -0,0 +1,899 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 442, + "metadata": {}, + "outputs": [], + "source": [ + "#\"\"\n", + "# Apache License\n", + "# Version 2.0, January 2004\n", + "# http://www.apache.org/licenses/\n", + "#\n", + "# TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n", + "#\n", + "# 1. Definitions.\n", + "#\n", + "# \"License\" shall mean the terms and conditions for use, reproduction,\n", + "# and distribution as defined by Sections 1 through 9 of this document.\n", + "#\n", + "# \"Licensor\" shall mean the copyright owner or entity authorized by\n", + "# the copyright owner that is granting the License.\n", + "#\n", + "# \"Legal Entity\" shall mean the union of the acting entity and all\n", + "# other entities that control, are controlled by, or are under common\n", + "# control with that entity. For the purposes of this definition,\n", + "# \"control\" means (i) the power, direct or indirect, to cause the\n", + "# direction or management of such entity, whether by contract or\n", + "# otherwise, or (ii) ownership of fifty percent (50%) or more of the\n", + "# outstanding shares, or (iii) beneficial ownership of such entity.\n", + "#\n", + "# \"You\" (or \"Your\") shall mean an individual or Legal Entity\n", + "# exercising permissions granted by this License.\n", + "#\n", + "# \"Source\" form shall mean the preferred form for making modifications,\n", + "# including but not limited to software source code, documentation\n", + "# source, and configuration files.\n", + "#\n", + "# \"Object\" form shall mean any form resulting from mechanical\n", + "# transformation or translation of a Source form, including but\n", + "# not limited to compiled object code, generated documentation,\n", + "# and conversions to other media types.\n", + "#\n", + "# \"Work\" shall mean the work of authorship, whether in Source or\n", + "# Object form, made available under the License, as indicated by a\n", + "# copyright notice that is included in or attached to the work\n", + "# (an example is provided in the Appendix below).\n", + "#\n", + "# \"Derivative Works\" shall mean any work, whether in Source or Object\n", + "# form, that is based on (or derived from) the Work and for which the\n", + "# editorial revisions, annotations, elaborations, or other modifications\n", + "# represent, as a whole, an original work of authorship. For the purposes\n", + "# of this License, Derivative Works shall not include works that remain\n", + "# separable from, or merely link (or bind by name) to the interfaces of,\n", + "# the Work and Derivative Works thereof.\n", + "#\n", + "# \"Contribution\" shall mean any work of authorship, including\n", + "# the original version of the Work and any modifications or additions\n", + "# to that Work or Derivative Works thereof, that is intentionally\n", + "# submitted to Licensor for inclusion in the Work by the copyright owner\n", + "# or by an individual or Legal Entity authorized to submit on behalf of\n", + "# the copyright owner. For the purposes of this definition, \"submitted\"\n", + "# means any form of electronic, verbal, or written communication sent\n", + "# to the Licensor or its representatives, including but not limited to\n", + "# communication on electronic mailing lists, source code control systems,\n", + "# and issue tracking systems that are managed by, or on behalf of, the\n", + "# Licensor for the purpose of discussing and improving the Work, but\n", + "# excluding communication that is conspicuously marked or otherwise\n", + "# designated in writing by the copyright owner as \"Not a Contribution.\"\n", + "#\n", + "# \"Contributor\" shall mean Licensor and any individual or Legal Entity\n", + "# on behalf of whom a Contribution has been received by Licensor and\n", + "# subsequently incorporated within the Work.\n", + "#\n", + "# 2. Grant of Copyright License. Subject to the terms and conditions of\n", + "# this License, each Contributor hereby grants to You a perpetual,\n", + "# worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n", + "# copyright license to reproduce, prepare Derivative Works of,\n", + "# publicly display, publicly perform, sublicense, and distribute the\n", + "# Work and such Derivative Works in Source or Object form.\n", + "#\n", + "# 3. Grant of Patent License. Subject to the terms and conditions of\n", + "# this License, each Contributor hereby grants to You a perpetual,\n", + "# worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n", + "# (except as stated in this section) patent license to make, have made,\n", + "# use, offer to sell, sell, import, and otherwise transfer the Work,\n", + "# where such license applies only to those patent claims licensable\n", + "# by such Contributor that are necessarily infringed by their\n", + "# Contribution(s) alone or by combination of their Contribution(s)\n", + "# with the Work to which such Contribution(s) was submitted. If You\n", + "# institute patent litigation against any entity (including a\n", + "# cross-claim or counterclaim in a lawsuit) alleging that the Work\n", + "# or a Contribution incorporated within the Work constitutes direct\n", + "# or contributory patent infringement, then any patent licenses\n", + "# granted to You under this License for that Work shall terminate\n", + "# as of the date such litigation is filed.\n", + "#\n", + "# 4. Redistribution. You may reproduce and distribute copies of the\n", + "# Work or Derivative Works thereof in any medium, with or without\n", + "# modifications, and in Source or Object form, provided that You\n", + "# meet the following conditions:\n", + "#\n", + "# (a) You must give any other recipients of the Work or\n", + "# Derivative Works a copy of this License; and\n", + "#\n", + "# (b) You must cause any modified files to carry prominent notices\n", + "# stating that You changed the files; and\n", + "#\n", + "# (c) You must retain, in the Source form of any Derivative Works\n", + "# that You distribute, all copyright, patent, trademark, and\n", + "# attribution notices from the Source form of the Work,\n", + "# excluding those notices that do not pertain to any part of\n", + "# the Derivative Works; and\n", + "#\n", + "# (d) If the Work includes a \"NOTICE\" text file as part of its\n", + "# distribution, then any Derivative Works that You distribute must\n", + "# include a readable copy of the attribution notices contained\n", + "# within such NOTICE file, excluding those notices that do not\n", + "# pertain to any part of the Derivative Works, in at least one\n", + "# of the following places: within a NOTICE text file distributed\n", + "# as part of the Derivative Works; within the Source form or\n", + "# documentation, if provided along with the Derivative Works; or,\n", + "# within a display generated by the Derivative Works, if and\n", + "# wherever such third-party notices normally appear. The contents\n", + "# of the NOTICE file are for informational purposes only and\n", + "# do not modify the License. You may add Your own attribution\n", + "# notices within Derivative Works that You distribute, alongside\n", + "# or as an addendum to the NOTICE text from the Work, provided\n", + "# that such additional attribution notices cannot be construed\n", + "# as modifying the License.\n", + "#\n", + "# You may add Your own copyright statement to Your modifications and\n", + "# may provide additional or different license terms and conditions\n", + "# for use, reproduction, or distribution of Your modifications, or\n", + "# for any such Derivative Works as a whole, provided Your use,\n", + "# reproduction, and distribution of the Work otherwise complies with\n", + "# the conditions stated in this License.\n", + "#\n", + "# 5. Submission of Contributions. Unless You explicitly state otherwise,\n", + "# any Contribution intentionally submitted for inclusion in the Work\n", + "# by You to the Licensor shall be under the terms and conditions of\n", + "# this License, without any additional terms or conditions.\n", + "# Notwithstanding the above, nothing herein shall supersede or modify\n", + "# the terms of any separate license agreement you may have executed\n", + "# with Licensor regarding such Contributions.\n", + "#\n", + "# 6. Trademarks. This License does not grant permission to use the trade\n", + "# names, trademarks, service marks, or product names of the Licensor,\n", + "# except as required for reasonable and customary use in describing the\n", + "# origin of the Work and reproducing the content of the NOTICE file.\n", + "#\n", + "# 7. Disclaimer of Warranty. Unless required by applicable law or\n", + "# agreed to in writing, Licensor provides the Work (and each\n", + "# Contributor provides its Contributions) on an \"AS IS\" BASIS,\n", + "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n", + "# implied, including, without limitation, any warranties or conditions\n", + "# of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n", + "# PARTICULAR PURPOSE. You are solely responsible for determining the\n", + "# appropriateness of using or redistributing the Work and assume any\n", + "# risks associated with Your exercise of permissions under this License.\n", + "#\n", + "# 8. Limitation of Liability. In no event and under no legal theory,\n", + "# whether in tort (including negligence), contract, or otherwise,\n", + "# unless required by applicable law (such as deliberate and grossly\n", + "# negligent acts) or agreed to in writing, shall any Contributor be\n", + "# liable to You for damages, including any direct, indirect, special,\n", + "# incidental, or consequential damages of any character arising as a\n", + "# result of this License or out of the use or inability to use the\n", + "# Work (including but not limited to damages for loss of goodwill,\n", + "# work stoppage, computer failure or malfunction, or any and all\n", + "# other commercial damages or losses), even if such Contributor\n", + "# has been advised of the possibility of such damages.\n", + "#\n", + "# 9. Accepting Warranty or Additional Liability. While redistributing\n", + "# the Work or Derivative Works thereof, You may choose to offer,\n", + "# and charge a fee for, acceptance of support, warranty, indemnity,\n", + "# or other liability obligations and/or rights consistent with this\n", + "# License. However, in accepting such obligations, You may act only\n", + "# on Your own behalf and on Your sole responsibility, not on behalf\n", + "# of any other Contributor, and only if You agree to indemnify,\n", + "# defend, and hold each Contributor harmless for any liability\n", + "# incurred by, or claims asserted against, such Contributor by reason\n", + "# of your accepting any such warranty or additional liability.\n", + "#\n", + "# END OF TERMS AND CONDITIONS\n", + "#\n", + "# APPENDIX: How to apply the Apache License to your work.\n", + "#\n", + "# To apply the Apache License to your work, attach the following\n", + "# boilerplate notice, with the fields enclosed by brackets \"[]\"\n", + "# replaced with your own identifying information. (Don't include\n", + "# the brackets!) The text should be enclosed in the appropriate\n", + "# comment syntax for the file format. We also recommend that a\n", + "# file or class name and description of purpose be included on the\n", + "# same \"printed page\" as the copyright notice for easier\n", + "# identification within third-party archives.\n", + "#\n", + "# Copyright 2024 Fraunhofer AISEC\n", + "#\n", + "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", + "# you may not use this file except in compliance with the License.\n", + "# You may obtain a copy of the License at\n", + "#\n", + "# http://www.apache.org/licenses/LICENSE-2.0\n", + "#\n", + "# Unless required by applicable law or agreed to in writing, software\n", + "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", + "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", + "# See the License for the specific language governing permissions and\n", + "# limitations under the License." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "import datetime\n", + "from matplotlib.patches import Polygon\n", + "import os\n", + "from datetime import timedelta\n", + "from itertools import product\n", + "from functools import reduce\n", + "from typing import Iterable\n", + "from mpl_toolkits.axes_grid1 import host_subplot\n", + "from pydantic import BaseModel" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Helpers and Setup" + ] + }, + { + "cell_type": "code", + "execution_count": 443, + "metadata": {}, + "outputs": [], + "source": [ + "def dict_to_seconds(d: dict) -> float:\n", + " return timedelta(seconds=d[\"secs\"] + 1e-9*d[\"nanos\"]).total_seconds()\n", + "\n", + "def helper(acc: dict, a):\n", + " if a.binary_size not in acc:\n", + " acc[a.binary_size] = []\n", + " acc[a.binary_size].append(a)\n", + " return acc\n", + "\n", + "os.makedirs(\"plots\", exist_ok=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Styling" + ] + }, + { + "cell_type": "code", + "execution_count": 444, + "metadata": {}, + "outputs": [], + "source": [ + "plt.style.use(\"Solarize_Light2\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Notes on Data\n", + "\n", + "- The data was collected in full runs of the application. On a Pi Pico W connected to a WiFi network that had other devices contending for the Network, however it is unlikely that the network bandwidth was a major bottlenecks.\n", + "- It being collected in full runs means there was no \"heating up\" with caches being filled. This is reflective of the expected operation which is unlikely to be in a hot loop. Furthermore, the processor pipeline of the RP2040 processor is simple enough (no speculative execution, etc.) that we would likey see no major differences.\n", + "- To simulate different binary sizes we padded the update binary with random bytes." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Prepare Data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] + }, + { + "cell_type": "code", + "execution_count": 445, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{41440: [1.067313, 0.342537, 1.132877, 1.032674, 1.03299, 1.061199, 1.138777, 1.075226, 0.335845, 0.439961], 106992: [1.563285, 0.882224, 0.86273, 0.819779, 1.591189, 0.870011, 0.871892, 0.802845, 0.874702, 1.614286, 0.917692], 172520: [2.053178, 1.340138, 2.037076, 1.35745, 2.069017, 1.254208, 2.001739, 1.290192, 1.267674, 2.088228, 2.018034, 1.997783, 2.057031, 2.066434], 238060: [2.531167, 1.816302, 1.833615, 1.800608, 2.534603, 1.83235, 2.439917, 1.8789, 2.560813, 1.804081, 2.523504, 1.799234, 1.805855, 2.488641, 2.532835, 1.787092], 303592: [3.019667, 2.331732, 2.98431, 3.01598, 2.350826, 2.369321, 2.325375, 3.040432, 2.971757], 369132: [2.844935, 3.503253, 3.440748, 2.849283, 2.75979, 2.863839, 2.767413, 3.432831, 2.777237, 3.448716, 3.492996], 434668: [3.214162, 3.972297, 3.278512, 3.205915, 3.906348, 3.258371, 3.266374, 3.971643, 3.25966, 3.952907, 3.977224, 3.943269, 3.970644, 3.331809, 3.221473, 3.967507, 3.264436, 3.341897, 3.948933, 3.995983, 3.23707, 3.263669, 3.931214, 3.98171, 3.249129, 3.996547, 3.842188, 3.990664, 3.940908, 4.001449, 3.270137, 3.266397, 3.255446]}\n" + ] + } + ], + "source": [ + "class BenchmarkData(BaseModel):\n", + " start_time: int\n", + " end_time: int\n", + " binary_size: int | None\n", + " fetch_target_files: dict\n", + " update_repo: dict\n", + " fetch_signature: dict\n", + " fetch_binary: dict\n", + " verify_binary: dict\n", + " \n", + "files = [f for f in os.listdir(\"../benchmark-output\") if f.startswith(\"performance-benchmark\")]\n", + "data = [BenchmarkData.parse_file(f\"../benchmark-output/{f}\") for f in files]\n", + "data.sort(key=lambda x: x.binary_size)\n", + "data_fetch_targets = [m.fetch_target_files for m in data]\n", + "data_update_repo = [m.update_repo for m in data]\n", + "data_fetch_signature = [m.fetch_signature for m in data]\n", + "data_fetch_binary = [m.fetch_binary for m in data]\n", + "\n", + "data_by_size = reduce(helper, data, {})\n", + "data_fetch_binary_by_size = {k:[d.fetch_binary for d in vals] for (k,vals) in data_by_size.items()}\n", + "data_fetch_binary_by_size = {k: [dict_to_seconds(d) for d in vals] for (k,vals) in data_fetch_binary_by_size.items()}\n", + "print(data_fetch_binary_by_size)\n", + "data_verify_binary = [m.verify_binary for m in data]\n", + "data_fetch_targets = [dict_to_seconds(d) for d in data_fetch_targets]\n", + "data_update_repo = [dict_to_seconds(d) for d in data_update_repo]\n", + "data_fetch_signature = [dict_to_seconds(d) for d in data_fetch_signature]\n", + "data_fetch_binary = [dict_to_seconds(d) for d in data_fetch_binary]\n", + "data_verify_binary_full = [dict_to_seconds(d) for d in data_verify_binary]\n", + "data_verify_binary = {k:[d.verify_binary for d in vals] for (k,vals) in data_by_size.items()}\n", + "data_verify_binary = {k: [dict_to_seconds(d) for d in vals] for (k,vals) in data_verify_binary.items()}\n", + "\n", + "\n", + "data_full = {k:[\n", + " (timedelta(seconds=d.fetch_target_files[\"secs\"] + d.fetch_target_files[\"nanos\"] * 1e-9)\n", + " + timedelta(seconds=d.update_repo[\"secs\"] + d.update_repo[\"nanos\"] * 1e-9)\n", + " + timedelta(seconds=d.fetch_signature[\"secs\"] + d.fetch_signature[\"nanos\"] * 1e-9)\n", + " + timedelta(seconds=d.fetch_binary[\"secs\"] + d.fetch_binary[\"nanos\"] * 1e-9)\n", + " + timedelta(seconds=d.verify_binary[\"secs\"] + d.verify_binary[\"nanos\"] * 1e-9)\n", + " ).total_seconds()\n", + " for d in vals\n", + "] for (k,vals) in data_by_size.items()}\n", + "data_no_tuf = {k:[\n", + " (timedelta(seconds=d.fetch_signature[\"secs\"] + d.fetch_signature[\"nanos\"] * 1e-9)\n", + " + timedelta(seconds=d.fetch_binary[\"secs\"] + d.fetch_binary[\"nanos\"] * 1e-9)\n", + " + timedelta(seconds=d.verify_binary[\"secs\"] + d.verify_binary[\"nanos\"] * 1e-9)\n", + " ).total_seconds()\n", + " for d in vals\n", + "] for (k,vals) in data_by_size.items()}" + ] + }, + { + "cell_type": "code", + "execution_count": 446, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAOkAAACTCAYAAABrjj5EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAAsTAAALEwEAmpwYAAARiklEQVR4nO3de1hUBd4H8O+ZYbgMzDCDKDDeQfCCYrleCSUty1uC67Zl7fNoltrqrmv4qK+XvKTpVq++pb3Wuk+5l8fcSl9KpTR3dV1IJUpL8oqCogIil+E2w1zOmfcPZGJShgNz5pzDzO/zj82N+enTl3P/HoY13XSAECJbCqkHIIS4RyElROYopITIHIWUEJmjkBIicxRSQmQuQOoBvKGmtlbqEXwWwzBwOOiondAYAFqt9oGv0ZKUtItWo5F6BJ+kULQeRQopITJHISW87M/MQnJqGlRhvZGcmob9mVlSj+Q3fHKblAhrf2YWNm3Zju3bXsOTEx/FkaP/xuKMtQCAmTOmSjyd72N88dxd2nEkrOTUNLzx+iqMTRmFcK0WNbW1yM7JxYrVm3HyxOdSj+cTlAoFwsLCHvgare6SNl0pKMToUcNcnhs9ahiuFBRKNJF/oZCSNiXEx+J07hmX507nnkFCfKxEE/kXCilp09Il87E4Yy2yc3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akhIicxRSQmSOQkqIzFFICZE5CikhMvf/THZo23iaGNMAAAAASUVORK5CYII=", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "fig: plt.Figure\n", + "axs: Iterable[plt.Axes]\n", + "fig, ax = plt.subplots(1, 1)\n", + "\n", + "ax.boxplot(\n", + " data_fetch_targets,\n", + " tick_labels=[\"\"],\n", + " )\n", + "#ax.set_title(\"Fetch TUF Target Files\")\n", + "ax.set_ylabel(\"Time (s)\")\n", + "fig.subplots_adjust(left=0.1, right=0.5, bottom=0.05, top=0.5, hspace=0.4, wspace=0.3)\n", + "fig.savefig(\"plots/benchmark-fetch-tuf-targets.pdf\", bbox_inches='tight')" + ] + }, + { + "cell_type": "code", + "execution_count": 447, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAOMAAACTCAYAAAB8rK6NAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPCklEQVR4nO3da3BUZZ7H8W930rlfASEBIRATQkSQ26AikUutihdEZHXK1Sp3ZpUXWrII67hGYWZcrjPrarkzrOWs4syU4o6DGW4utTooBpEMSDQYAgQCJAgB5JIQcqG7T++LYIZMkrYxfS6kf593OafT/IvixznPc87z/F3+xpoAImI7t90FiEgrhVHEIRRGEYdQGEUcQmEUcQiFUcQhou0uoDvq6uvtLqFHcrlcBAJ64mUGF5CSktLpOV0ZpYOU5GS7S+ix3O6uI6cwijjEFX2bKuGVOWgULRe8bT/Hxng4Vv2FfQVFGF0ZBegYRICWC14yB42yp6AIpDAKQIcgftdxCT+FUdqZdttkjleXMu22yXaXEnFcV/KqDT3aCJ9eGcPxeKI4XlNGakoKdfX19Bs4Eq/Xz+nacrvL6zGi3G6SkpI6PacJHGnj9frp038EhmHgdrsxDMPukiKKblOln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x4lf1gOi194hgcfuNfu0nqUYM1SLX/of2l/xkvDmJacwJn686SnJOI3DJpaLpAYH9vh9wvG5FEwJg9oHTNq3Bg+d06byp3TprZrfKO/3/CKcnd9M+qY/owjcwfyWdl+AHZWHCJvcCYuLeGRCGLJbOqR46c79Ge8q2BUu/6MXp+PlWuKqTl+moS41kcbV6UHf7RRX1/f9vqWhM+5xmaSE+LsLqNHMgyDlJSUTs9d0f0ZxRxLXl9H4T9Nt7uMiKPLiohDKIwiDqEwSgcFo4faXUJE0phRxCF0ZRRxCIVRxCEURhGHUBhFHEJhFHGI/wc6jnz8wHcnOAAAAABJRU5ErkJggg==", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "fig: plt.Figure\n", + "axs: Iterable[plt.Axes]\n", + "fig, ax = plt.subplots(1, 1)\n", + "ax.boxplot(\n", + " data_update_repo,\n", + " tick_labels=[\"\"],\n", + " )\n", + "# ax.set_title(\"TUF Repo Update\")\n", + "ax.set_ylabel(\"Time (s)\")\n", + "fig.subplots_adjust(left=0.1, right=0.5, bottom=0.05, top=0.5, hspace=0.4, wspace=0.3)\n", + "fig.savefig(\"plots/benchmark-tuf-repo-update.pdf\", bbox_inches='tight')" + ] + }, + { + "cell_type": "code", + "execution_count": 448, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAO8AAACUCAYAAAB7lX67AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAAsTAAALEwEAmpwYAAAQFElEQVR4nO3de1STd54G8OdNuAYSEm6CIHgD8YbXqkWodqzWWq1oZ23ruGtnO7Vn2q529LQ7056x53Q6vc24p+u2zh53R3s5XWe1DouVqoO1tKgVEbywVAUFFLnINRDuIcn+gWSNEngJvAlv8nzO6Tny8ibv9039+t5+vyeCqa3cAiKSHYWrCyA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5+XTJvCtJO5AGANfp1+6ZUbFyVjL3pts8fz1+5AV8fPq4mz+OU5pUq+rWjy4jjOYV4bOEMZ+wG0YjilObtK/q10dBms4696Ne73R39CvTEvj4yfyp8vPnNheR5ZHO+eW/0a3l1PeoaDVi3dB7q9IZ+X8vo18FzxleR6HRBjH4VYdDRr8NJiujXkopa3Kiqw+sfHYDZbIGhtQM7Pj+CbX//2H3bZ/Tr4DgyZNHRoY78fzEwe9GvTmneu6NftWoVcn8sxXOptuHovdGv46PDRUW/LpqTgEVzEgAAdXoDdu3/ps/GJXJXTmleqaJfiTwZZxXRsOAMIelwVhGRm2HzEskUm5dIpti8RDLF5iWSKTYvkUyxeYlkis1LJFNsXiKZYvMSyRSbl0im2LxEMsXmJZIp2aZHdhm7sftgFmr1zVAICiTGRWPNT+Y6a3c81nt/+Bgf7NjV5+/spW+8tu1F/PrVl6QsyyM5ZUqg2WzG9j+lYcv6ZdBpVHh3z2E8l7oIo8O01nWyzl1BRU0DfrYiCbmFJbhw9SaeX7sYN6vroQnwh1atQkVNI3buy8T7W9ahy9iN0opaTBobiW6TCR9+cQzLkxIxbWJ0v7VwSqA0HPmiMRLHpVMCpUiP9PH2wqQ7+c1eSiXGRITcF2pH5M5knR7Zq62jEwXF5feFsRO5M9mmR/Yymc34c9r3ePiByQjTqft8LdMjnYNJkNJwu/TIXl9knEZ4sAZL5tmPKmV6pPR4zSsdt0uPBID0rHy0dxqxYeVC0bUIABR2PgxyXFVNHdQqP1eX4ZbMZnOfy50WQFdw7RYOZJ61pkeuSJ5hkx5p7O7G3vRslN9usKZHhunU+PrkRRw9XYDwu06JN69fBpPJjN/82wFEhATBS9nTjIvnTkbyrHhn7A7d450/f4XXn1vl6jI8iselR5I02LzOx/NHIpli89KwSOHlitPxtJlIpnjkJZIpNi+RTLF5iWSKzUskU2xeIpn6P53seRmVlh9EAAAAAElFTkSuQmCC", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "fig: plt.Figure\n", + "axs: Iterable[plt.Axes]\n", + "fig, ax = plt.subplots(1, 1)\n", + "ax.boxplot(\n", + " data_fetch_signature,\n", + " tick_labels=[\"\"],\n", + " )\n", + "# ax.set_title(\"Signature Fetching\")\n", + "ax.set_ylabel(\"time (s)\")\n", + "fig.subplots_adjust(left=0.1, right=0.5, bottom=0.05, top=0.5, hspace=0.4, wspace=0.3)\n", + "fig.savefig(\"plots/benchmark-fetch-signature.pdf\", bbox_inches='tight')" + ] + }, + { + "cell_type": "code", + "execution_count": 449, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAbMAAACyCAYAAADIxiGWAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAAsTAAALEwEAmpwYAAAvD0lEQVR4nO3deXxU1d348c+dyWSfZLJvJCEhG6sQNgNhEUSUHVHbigqu1eqv1S6Pa32UUtvqg0/L82gVrKVQ5RFlDSigsiUB2ZewmAQIkAAhCclksi8z8/sjMDpkYQYzk4x8369XX5V7zz3zncmd+d5z7rnnKMbaQjNCCCGEC1N1dQBCCCHEDyXJTAghhMuTZCaEEMLlSTITQgjh8iSZCSGEcHmSzIQQQrg8t64OoLuoNBgcVreiKJjNrvUEhMTsPK4Yt8TsHK4YMzgubgXw8/Nrc5+0zJzAT6vt6hDsJjE7jyvGLTE7hyvGDI6LW6VqP2VJMhNCCOHyJJkJIYRweZLMhBBCuDxJZkIIIVyejGbsRH9+6x3eXPCuzeX/4ze/4IXfPe3AiGxjT9zdJWYhhPg+RWbNb+HIofmB4X0pLz7msPodwRVj9vfzc+jf0VFcMW6J2TlcMWZwXNxqlQpfX98290k3oxBCCJcnyUwIIYTLk2QmhBDC5ckAkJtIfEoaer3t/diB4X1tKqfT+XH62103GpYQQvxgksxuIpqxo+kzc0qn11u6en2n1ymEEPaQZHYTKV2znt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yT08/UiOTacw3mFDOkT12p/oL8vzz0wkQVLv0DjpmZUG+tK/d+mb/j0SrLz8/Vi2phB9EvoAbQ8Z3b0VBEvjZl6Q5+JEJ1FHpoW4kfuQqmef2Vk8sLDUzq8N3Yjtu49QbmhhlltJGQhnEmSmRBCCJcn98yEEEK4PElmQgghXJ4kMyGEEC5PkpkQQgiXJ8lMCCGEy5NkJoQQwuVJMhNCCOHyJJkJIYRwef8foRQ63xQserUAAAAASUVORK5CYII=", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "fig: plt.Figure\n", + "axs: Iterable[plt.Axes]\n", + "fig, ax = plt.subplots(1, 1)\n", + "# ax.set_title(\"Verification Duration by Size\")\n", + "ax.boxplot(\n", + " [data_verify_binary_full] + list(data_verify_binary.values()),\n", + " tick_labels=[\"all samples\"] + [f\"{k/1024:.1f}\" for k in data_verify_binary.keys()] \n", + " )\n", + "ax.set_xlabel(\"Size (KiB)\")\n", + "ax.set_ylabel(\"Time (s)\")\n", + "fig.subplots_adjust(left=0.1, right=1.5/1.6, bottom=0.05, top=0.75/1.5, hspace=0.4, wspace=0.3)\n", + "fig.savefig(\"plots/benchmark-verification-duration-by-size.pdf\", bbox_inches='tight')" + ] + }, + { + "cell_type": "code", + "execution_count": 450, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZYAAACyCAYAAABhsukCAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAAsTAAALEwEAmpwYAAArsElEQVR4nO3dd3gU973v8ffsatW1klAvoILoiF4sQGCKjY2pNrETYxu35Dixb3KcG584TuIb5yZOdc51cuI4jjtxHBdMNc10UU1HNNFRBwkhrbq0O3P/GFghtIIVbNGi7+t58gTtzs58Je/uZ2Z+TbHVFWgIIYQQLmLwdgFCCCFuLxIsQg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9cvpVHp4+97iJLD909Wm9j0TROFVzgb5+t44eP3GO/0mlsbLavay+Et0iwCIG+dkjWoAxy9uU5fH7VtoOcv2hptZBWN3MIfn5G/vjDb7W7ZvvVkmMj2Z57ss3j5pAg/nPeVF5bsJKPV+1wauZhg6LQq0ccMZFhHDlTbA+WkouVTt9OE8JdZByL6JJKyyv5asch++JNFZZadh0543DZhkMnC9mw6yjPfGMS/qaWc7HwsGD6pSXy+dpd1Dc2oWoaZZcsHD9X6vCY/dISKSitoNna9qolIiyY5+dN5fCpIj796munfofThRcoKa8iMTrC/tiJc+cZcJ3liYXwBLliEV1SgL+JM8XlrN15hPrGJoIC/BnUK5n7J49os+3uo2eormvglTcX2R8bNTCdedPG8MTMbBZt2MMrf19MQ1MzMRFh3J3luEeWOTSIPinxHDhewIj+aW2e7xYeyvOPTOW1D1di8jOS7WBdjH+v3sFnl4PHHBrEzAlDGZihL4HdbLVy6FQhL02YcVN/EyFcRQZICuFBxWWVfLAshxefmH7dtpSbsWHXUSostTzgIByF8CQJFiGEEC4lbSxCCCFcSoJFCCGES0mwCCGEcCkJFiGEEC4lwSKEEMKlJFiEEEK4lASLEEIIl5JgEUII4VL/HzOfu+Sh3t8oAAAAAElFTkSuQmCC", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "fig: plt.Figure\n", + "axs: Iterable[plt.Axes]\n", + "fig, ax = plt.subplots(1, 1)\n", + "# ax.set_title(\"Binary Fetch Duration by Size\")\n", + "ax.plot(\n", + " [0, 1] + [f\"{k/1024:.1f}\" for k in data_fetch_binary_by_size.keys()],\n", + " [None, None] + [np.average(v) for v in data_fetch_binary_by_size.values()],\n", + " linestyle=\"--\"\n", + " ) \n", + "ax.boxplot(\n", + " [data_fetch_binary] + list(data_fetch_binary_by_size.values()),\n", + " tick_labels=[\"all samples\"] + [f\"{k/1024:.1f}\" for (k, v) in data_fetch_binary_by_size.items()]\n", + " )\n", + "ax.set_ylabel(\"Time (s)\")\n", + "ax.set_xlabel(\"Size (KiB)\")\n", + "fig.subplots_adjust(left=0.1, right=1.5/1.6, bottom=0.05, top=0.75/1.5, hspace=0.4, wspace=0.3)\n", + "fig.savefig(\"plots/benchmark-fetch-binary-duration-by-size.pdf\", bbox_inches='tight')" + ] + }, + { + "cell_type": "code", + "execution_count": 451, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeIAAAGmCAYAAACgIIfZAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAAsTAAALEwEAmpwYAABuCUlEQVR4nO3dd1xT9/7H8ddJSIAEQthTEETce+9qW+3Qurr3vm1teztuWztueztvx8/eTtvbvXs7rB221dpl3XsvVBwgIHuPkOT8/ghGEVCIQEj4PB8PH5KTnHO+X0be+X7P93y/iq0iXUUIIYQQbqFxdwGEEEKIjkyCWAghhHAjCWIhhBDCjSSIhRBCCDeSIBZCCCHcyMfdBWiu4pISdxdBCCFEOxJkMrm7CKdFWsSn4Ok/4JPx5rqBd9fPm+sG3l0/b64beH/9WoMEsRBCCOFGEsRCCCGEG0kQCyGEEG7kcYO1GmKzqeQX11BTY6el5+vMzLVgt9tb+KjtQ1vUTQF0Og2hQTq0WqVVzyWEEJ7IK4I4v7gGf18N4cE6FKVl3+y1Gg02Lw3itqibqqqUVtjIL64hIkTfqucSQghP5BVd0zU1dgIM2hYPYXH6FEUh0KClpsY7P8wIIcTpapMW8Uc/LGPr3gwCjX48evM0AOb9tpYte9Lx0WoJMwdyzZRRGPx8XTq+ChLC7ZiiKC1+yUAIIbxFm7SIR/RL5o5Lz66zrUdiDI/ePI1/3jSVyFATC1dsbYuiCCGEEO1Km7SIu8ZHkVdUWmdbz6RY59eJMeFs2HWwLYrSKgoKiph20fUA5OTkodVqCQ0N5lB6JlGR4axa+oPztc++8DpGo4E7bruOWXc+xP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YII=", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "#fig: plt.Figure\n", + "#axs: Iterable[plt.Axes]\n", + "fig, ax = plt.subplots(1, 1)\n", + "par = ax.twinx()\n", + "par.plot(\n", + " [0] + [f\"{k/1024:.1f}\" for k in data_no_tuf.keys()],\n", + " [None] + [np.average(v2)/np.average(v1)*100 for (v1, v2) in zip(data_no_tuf.values(), data_full.values())],\n", + " label=\"TUF overhead\",\n", + " linestyle=\"-.\",\n", + ")\n", + "par.set_ylim(0, 240)\n", + "par.set_ylabel(\"TUF overhead (%)\")\n", + "ax.plot([], [], label=\"TUF overhead\") \n", + "ax.plot(\n", + " [0] + [f\"{k/1024:.1f}\" for k in data_full.keys()],\n", + " [None] + [np.average(v) for v in data_full.values()],\n", + " label=\"TUF + BT\",\n", + " linestyle=\"dotted\",\n", + " ) \n", + "ax.plot(\n", + " [0] + [f\"{k/1024:.1f}\" for k in data_no_tuf.keys()],\n", + " [None] + [np.average(v) for v in data_no_tuf.values()],\n", + " label=\"BT only\",\n", + " linestyle=\"dashed\",\n", + " )\n", + "\n", + "ax.boxplot(\n", + " data_full.values(),\n", + " tick_labels=[f\"{k/1024:.1f}\" for k in data_full.keys()],\n", + " )\n", + "ax.boxplot(\n", + " data_no_tuf.values(),\n", + " tick_labels=[f\"{k/1024:.1f}\" for k in data_no_tuf.keys()],\n", + " )\n", + "\n", + "ax.legend() \n", + "# ax.set_title(\"Cumulative Duration by Size\")\n", + "ax.set_xlabel(\"Size (KiB)\")\n", + "ax.set_ylabel(\"Time (s)\")\n", + "fig.subplots_adjust(left=0.1, right=1.0, bottom=0.05, top=1.35, hspace=0.4, wspace=0.3)\n", + "fig.savefig(\"plots/benchmark-cumulative-duration-by-size.pdf\", bbox_inches='tight')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Analysis\n", + "\n", + "- We see that the fetch duration scales linearly to the size of the binry, which is the expected outcome.\n", + "- We also see that signature verificaion does not scale with the size of the binary and and effectively has no correlation with the size of the binary. The lack of correlation is related to the fact that the hash for the binary is calculated during the binary fetch step. \n", + "- We see that the TUF repo update is the a costly operation. Which requires significant effort for parsing, networking I/O operations as well as cryptographic operations such as calculating hashes and verifying signatures. However, the amount of data transferred via the network is much smaller than the data size of the binary.\n", + "- Furthermore, we see that similarly to the TUF repo update we also spend a significant amount of time in the verification step. Which is also biased towards parsing and cryptographic operations. However, we can speculate that this result could indicate that using DER instead of JSON is more performant, as this step requires JSON parsing while also requiring fewer files to be parsed and nonetheless requiring similar durations.\n", + "- We see that the verification overhead falls with increasing binary sizes.\n", + "- Fetching and verifying target files is relatively fast, because the TUF repo update step already established trust in the corresponding hashes of the target files. Therefore, it is only necessary to download them and then compare the hashes." + ] + }, + { + "cell_type": "code", + "execution_count": 452, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "dict_keys([41440, 106992, 172520, 238060, 303592, 369132, 434668])\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAA5IAAAEOCAYAAAD7SigDAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAAsTAAALEwEAmpwYAAB6hUlEQVR4nO3ddXxV9R/H8det3XVvbGyju7tTSgUVBLFRVFTsDoyfXdiK3YmKAoqgoNLd3bHBYMn6dvz+GE6R2tjdvjc+Tx88hN1zz3lvsO/O53xL4zQddCOEEEIIIYQQQlSSVnUAIYQQQgghhBC+RQpJIYQQQgghhBBVIoWkEEIIIYQQQogqkUJSCCGEEEIIIUSVSCEphBBCCCGEEKJKpJAUQgghhBBCCFElUkgK4UHnXXgVutA0HnvipRNeKygoZMLE+0lMa0dEfDOGDr+czVu2V+q8jVr0RBeadsKvGT//dsb3njPsEvoNuviEjz/+5OTjsn725ffoQtM4kH7wuPf++3phsU1o1WEAzzz/Olart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EIIIYQQQghRJVJICiGEEEIIIYSoEikkhRBCCCGEEEJUiRSSQgghhBBCCCGqRApJIYQQQgghhBBVIoWkEEIIIYQQQogqkUJSCCGEEEIIIUSVSCEphBBCCCGEEKJKpJAUQgghhBBCCFElUkgKIYQQQgghhKgSKSSFEEIIIYQQQlSJFJJCCCGEEEIIIapECkkhhBBCCCGEEFUihaQQQgghhBBCiCqRQlIIIYQQQgghRJVIISmEEEIIIYQQokqkkBRCCCGEEEIIUSX/B90Nv09ET0jTAAAAAElFTkSuQmCC", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "print(data_by_size.keys())\n", + "chosen_sizes = {41440, 238060, 434668}\n", + "data_by_size_filtered = {k:v for k,v in data_by_size.items() if k in chosen_sizes}\n", + "n = len(data_by_size_filtered.keys())\n", + "fig, axs = plt.subplots(1, n)\n", + "legend_added = False\n", + "for (ax, (k, vals)) in zip(axs, data_by_size_filtered.items()):\n", + " sizes = [\n", + " np.average([dict_to_seconds(d.fetch_target_files) for d in vals]),\n", + " np.average([dict_to_seconds(d.update_repo) for d in vals]),\n", + " np.average([dict_to_seconds(d.fetch_signature) for d in vals]),\n", + " np.average([dict_to_seconds(d.fetch_binary) for d in vals]),\n", + " np.average([dict_to_seconds(d.verify_binary) for d in vals]),\n", + " ]\n", + "\n", + " labels = [\n", + " \"Fetching Target Files\",\n", + " \"TUF Repo Update\",\n", + " \"Fetching Signature\",\n", + " \"Fetching Binary\",\n", + " \"Binary Verification\",\n", + " ]\n", + " wedges, texts = ax.pie(sizes)\n", + " if not legend_added:\n", + " ax.legend(wedges, labels,\n", + " title=\"Operations\",\n", + " loc=\"center left\",\n", + " bbox_to_anchor=(-0.5, 0, 0, +1.75)\n", + " )\n", + " legend_added = True\n", + " ax.set_title(f\"{k/1024:.1f} KiB\")\n", + "fig.subplots_adjust(left=0.18, right=2, bottom=0.05, top=2, hspace=0.4, wspace=0.15)\n", + "fig.savefig(\"plots/benchmark-time-shares-per-file-size.pdf\", bbox_inches='tight')\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Analysis\n", + "\n", + "- We see that the overhead of fetching signatures and TUF target files is neglible compared to the other steps.\n", + "- Smaller file sizes are dominated by the overhead of verification." + ] + }, + { + "cell_type": "code", + "execution_count": 453, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "40.5 KiB (('fetch_binary', np.float64(7.744213899999999)), ('fetch_binary', np.float64(7.992618181818182)), ('fetch_binary', np.float64(8.487051642857143)), ('fetch_binary', np.float64(9.161874749999999)), ('fetch_binary', np.float64(9.758790777777778)), ('fetch_binary', np.float64(9.88472109090909)), ('fetch_binary', np.float64(10.629747424242424)))\n", + "40.5 KiB [np.float64(7.744213899999999), np.float64(7.992618181818182), np.float64(8.487051642857143), np.float64(9.161874749999999), np.float64(9.758790777777778), np.float64(9.88472109090909), np.float64(10.629747424242424)]\n", + "104.5 KiB (('verify_binary', np.float64(6.878273999999999)), ('verify_binary', np.float64(6.931651363636364)), ('verify_binary', np.float64(6.708610071428572)), ('verify_binary', np.float64(7.0387799375)), ('verify_binary', np.float64(7.046635222222221)), ('verify_binary', np.float64(6.777353727272727)), ('verify_binary', np.float64(7.009265848484848)))\n", + "104.5 KiB [np.float64(6.878273999999999), np.float64(6.931651363636364), np.float64(6.708610071428572), np.float64(7.0387799375), np.float64(7.046635222222221), np.float64(6.777353727272727), np.float64(7.009265848484848)]\n", + "168.5 KiB (('fetch_signature', np.float64(3.9600812999999997)), ('fetch_signature', np.float64(4.014341)), ('fetch_signature', np.float64(3.7923429285714283)), ('fetch_signature', np.float64(4.1221663125)), ('fetch_signature', np.float64(4.129424111111111)), ('fetch_signature', np.float64(3.8606706363636363)), ('fetch_signature', np.float64(4.093336696969697)))\n", + "168.5 KiB [np.float64(3.9600812999999997), np.float64(4.014341), np.float64(3.7923429285714283), np.float64(4.1221663125), np.float64(4.129424111111111), np.float64(3.8606706363636363), np.float64(4.093336696969697)]\n", + "232.5 KiB (('update_repo', np.float64(3.9348990999999995)), ('update_repo', np.float64(3.988519909090909)), ('update_repo', np.float64(3.7672989285714285)), ('update_repo', np.float64(4.0966318125)), ('update_repo', np.float64(4.1037566666666665)), ('update_repo', np.float64(3.834977818181818)), ('update_repo', np.float64(4.0682240606060605)))\n", + "232.5 KiB [np.float64(3.9348990999999995), np.float64(3.988519909090909), np.float64(3.7672989285714285), np.float64(4.0966318125), np.float64(4.1037566666666665), np.float64(3.834977818181818), np.float64(4.0682240606060605)]\n", + "296.5 KiB (('fetch_target_files', np.float64(0.0832039)), ('fetch_target_files', np.float64(0.07922945454545455)), ('fetch_target_files', np.float64(0.07867521428571429)), ('fetch_target_files', np.float64(0.08435625)), ('fetch_target_files', np.float64(0.07863511111111111)), ('fetch_target_files', np.float64(0.08193781818181817)), ('fetch_target_files', np.float64(0.08582227272727273)))\n", + "296.5 KiB [np.float64(0.0832039), np.float64(0.07922945454545455), np.float64(0.07867521428571429), np.float64(0.08435625), np.float64(0.07863511111111111), np.float64(0.08193781818181817), np.float64(0.08582227272727273)]\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAaYAAAENCAYAAABEqsEuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAAsTAAALEwEAmpwYAABcNUlEQVR4nO3dd3wUZf7A8c/M9k1200NCICEQOqGE3qSpYEGx915PveKdd97pnVf1+t3PcnpnO3s9BUQRUelSpQakhhZIQno2ZbNt5vfHhoWQBBIIyYZ8368Xmp195pnvTjbznXnmmedRAjW5OkIIIUSYUNs7ACGEEOJ4kpiEEEKEFUlMQgghwookJiGEEGFFEpMQQoiwIolJCCFEWDG2xUbemLeC7D2HcERYeeLeWQB89PU6tuzOxWgwEB/t4LaZ47FbLW0RjhBCiBPU1Hp487OV5BWVoaB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cH7PQXF5bw6dzkffLmWu6+Y1Gj5Nz/7hi5xTqaPC149lVRUEQhoPPr0+6Eyuk69Se2OZ7daqPX6Gyy/4aIxfL5iC299+g23XDr+pPPnXHfh6OA9Jl0nJ7eQFz78mh/fPCN0peXx+LBZmp5kUIiOThKT6DSS4qMZOziD5Rt3Nvr+gpVbOFLiqjcZYKwzAqPRwN9+fEOTs4oer1tiTGiKkuM5I2z86Kbp/P3Nz3l3wepTjj4OoCoKvVO7kBDj4Lt9eaHElF9S3uzmQCE6InmOSZyzCorL+XL11tAEdKWuatZ9t6/BPRuArXsOsXjddu6/Zmq92YejHHb6p3flf1+tw+3xouk6RWUudh1ofJbT/uldyS0oxedveNUU7bDz8E3T2ZZzmA++XNusz7D3UCH5xRV0jY8OLdt94AgDTzLFuxAdnVwxiXOWxWxiX14xX635DrfHi81iZnDvblw5bUSDst9u30dlTS2//ffs0LJRg3py08XjuOOyicxevJ7f/mcOtV4fCdEOLhzbeI84Z6SNvmlJbN6Vy4gB6Q3ej42K5OGbp/P3Nz7HZDQwsZG5ed77YjUf1iUuZ6SNyyYNC83r5fP72ZpziMcmzTytfSJERyAP2ArRyvKKynl93nJ+fselJ72XdDoWr9tOqauaqxpJrkKcKyQxCSGECCtyj0kIIURYkcQkhBAirEhiEkIIEVYkMQkhhAgrkpiEEEKEFUlMQgghwookJiGEEGHl/wEBl4wS1EoUggAAAABJRU5ErkJggg==", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "host = host_subplot(111)\n", + "par = host.twinx()\n", + "\n", + "host.set_xlabel(\"Size (KiB)\")\n", + "host.set_ylabel(\"Time(s)\")\n", + "par.set_ylabel(\"Overhead (%)\")\n", + "sizes_x = []\n", + "sizes_y = []\n", + "data = { k: {\n", + " \"fetch_target_files\" : np.average([dict_to_seconds(d.fetch_target_files) for d in vals]),\n", + " \"update_repo\" : np.average([dict_to_seconds(d.update_repo) for d in vals]),\n", + " \"fetch_signature\" : np.average([dict_to_seconds(d.fetch_signature) for d in vals]),\n", + " \"verify_binary\" : np.average([dict_to_seconds(d.verify_binary) for d in vals]),\n", + " \"fetch_binary\" : np.average([dict_to_seconds(d.fetch_binary) for d in vals]),\n", + "} for (k, vals) in data_by_size.items()}\n", + "bar_x = [f\"{x/1024:.1f} KiB\" for x in data.keys()]\n", + "def helper(acc, a):\n", + " k,v = a\n", + " acc_ctr, acc_l = acc\n", + " acc_l.append((k, acc_ctr + v))\n", + " acc_ctr += v\n", + " return (acc_ctr, acc_l)\n", + "bar_y = [list(reduce(helper, vals.items(), (0, []))) for vals in data.values()]\n", + "bar_y = [d for (ctr, d) in bar_y]\n", + "bar_y = list(zip(*bar_y))\n", + "bar_y.reverse()\n", + "for x, y in zip(bar_x, bar_y):\n", + " label = y[0][0]\n", + " print(x, y)\n", + " y = [v for k, v in y]\n", + " print(x, y)\n", + " # host.plot(bar_x, y) \n", + " host.bar(bar_x, y, label=label) \n", + "#p2, = par.plot([0, 1, 2], [0, 3, 2], label=\"Temperature\", color=\"tab:red\")\n", + "data_overhead_tuf = [\n", + " 100.0 * np.sum(\n", + " np.average([dict_to_seconds(d.fetch_target_files) for d in vals])\n", + " + np.average([dict_to_seconds(d.update_repo) for d in vals])\n", + " ) / np.sum(\n", + " np.average([dict_to_seconds(d.fetch_target_files) for d in vals])\n", + " + np.average([dict_to_seconds(d.update_repo) for d in vals])\n", + " + np.average([dict_to_seconds(d.fetch_signature) for d in vals])\n", + " + np.average([dict_to_seconds(d.verify_binary) for d in vals])\n", + " + np.average([dict_to_seconds(d.fetch_binary) for d in vals])\n", + " )\n", + " for (k, vals) in data_by_size.items()]\n", + "data_overhead_no_tuf = [\n", + " 100.0 * np.sum(\n", + " np.average([dict_to_seconds(d.fetch_signature) for d in vals])\n", + " + np.average([dict_to_seconds(d.verify_binary) for d in vals])\n", + " ) / np.sum(\n", + " np.average([dict_to_seconds(d.fetch_target_files) for d in vals])\n", + " + np.average([dict_to_seconds(d.update_repo) for d in vals])\n", + " + np.average([dict_to_seconds(d.fetch_signature) for d in vals]) + np.average([dict_to_seconds(d.verify_binary) for d in vals])\n", + " + np.average([dict_to_seconds(d.fetch_binary) for d in vals])\n", + " )\n", + "for (k, vals) in data_by_size.items()]\n", + "host.legend(labelcolor=\"linecolor\")\n", + "par.plot(\n", + " bar_x,\n", + " data_overhead_no_tuf,\n", + " color=\"grey\", linestyle=\"--\",\n", + ")\n", + "par.plot(\n", + " bar_x,\n", + " data_overhead_tuf,\n", + " color=\"black\", linestyle=\"-.\",\n", + ")\n", + "# host.yaxis.get_label().set_color(p1.get_color())\n", + "#par.yaxis.get_label().set_color(p2.get_color())\n", + "par.set_ylim(0, 60)\n", + "host.set_ylim(0, 12)\n", + "\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Audit Level Comparison" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Prepare Data" + ] + }, + { + "cell_type": "code", + "execution_count": 454, + "metadata": {}, + "outputs": [], + "source": [ + "class BenchmarkData(BaseModel):\n", + " start_time: int\n", + " end_time: int\n", + " binary_size: int | None\n", + " fetch_target_files: dict\n", + " update_repo: dict\n", + " fetch_signature: dict\n", + " fetch_binary: dict\n", + " verify_binary: dict\n", + " verify_binary_naive: dict | None\n", + " \n", + "files = [f for f in os.listdir(\"../benchmark-output/benchmark-levels\") if f.startswith(\"performance-benchmark\")]\n", + "data = [BenchmarkData.parse_file(f\"../benchmark-output/benchmark-levels/{f}\") for f in files]\n", + "\n", + "data_fetch_targets = [dict_to_seconds(m.fetch_target_files) for m in data]\n", + "data_update_repo = [dict_to_seconds(m.update_repo) for m in data]\n", + "data_fetch_signature = [dict_to_seconds(m.fetch_signature) for m in data]\n", + "data_fetch_binary = [dict_to_seconds(m.fetch_binary) for m in data]\n", + "data_verify_binary = [dict_to_seconds(m.verify_binary) for m in data]\n", + "data_verify_binary_naive = [dict_to_seconds(m.verify_binary_naive) for m in data]\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Plot" + ] + }, + { + "cell_type": "code", + "execution_count": 455, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_14587/1789779907.py:2: MatplotlibDeprecationWarning: The 'labels' parameter of boxplot() has been renamed 'tick_labels' since Matplotlib 3.9; support for the old name will be dropped in 3.11.\n", + " ax.boxplot(\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZUAAAExCAYAAAC01j/DAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAAsTAAALEwEAmpwYAAAblUlEQVR4nO3de3xU9Z3/8fdM7rfJQIK5cUuEhKtAvEYIoKi0LhRSrXZ/tmqt4mO1u7X60J+L1e5aaltdu6396brabb2sdRcX8YIuongDuSqgMQUSrglCuIUkDAkkmZnfH0hKTCZMku+ZMye+nn81Z05mPnyS5u33+z3ne1z+ppqgAAAwwG13AQCA/oNQAQAYQ6gAAIwhVAAAxhAqAABjCBUAgDGxdhfQUw2NjXaX0CMul0vBIFdtW4keW4v+Ws9pPXZJ8ng8Xb7GSMVinrQ0u0vo9+ixteiv9ZzWY7c7dHQQKgAAYwgVAIAxhAoAwBhCBQBgDKECADDGcZcUA0B/MTB7bKdjdbUVNlRiDiMVALBBV4HS3XGnIFQAAMZEZPrruddXqnzbHqWlJOqBeXMlSYuWr9dnVTWKjYlRpjdNN8yerOTEhEiUAwCwSERGKiUTRujvv3t5h2Oj83P1wLy5uv+WOcrK8GjpqvJIlAIAsFBEQmXk0GwlJ8V3ODamIE8xX97qn587SEcamyJRCgDAQlGxprLq0yqNOzvP7jIAAH1k+yXFb678VG63WxeMKwh5zooNW7ViY6Uk6cZZJcrNyoxUeUakh9jNE+bQY2vR38iK9n77fL6Qr9kaKqs+rVL5tj36yXUz5XK5Qp5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Oxpk+wuwwh6jJ5gpAIAMIaRCgDAGEIFAGAMoQIAMIZQAQAYQ6gAAIwhVAAAxvx/+hO4QkE40o8AAAAASUVORK5CYII=", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "\n", + "fig, ax = plt.subplots(1, 1)\n", + "ax.boxplot(\n", + " [\n", + " [sum(vals) for vals in product(data_fetch_binary)],\n", + " [sum(vals) for vals in product(data_fetch_binary, data_fetch_signature, data_verify_binary_naive)],\n", + " [sum(vals) for vals in product(data_fetch_binary, data_fetch_signature, data_verify_binary)],\n", + " [sum(vals) for vals in product(data_fetch_targets, data_update_repo, data_fetch_binary, data_fetch_signature, data_verify_binary)],\n", + " ],\n", + " labels=[\n", + " \"Level 0\",\n", + " \"Level 1 (no TUF)\",\n", + " \"Level 2 (no TUF)\",\n", + " \"Level 2\",\n", + " ],\n", + ")\n", + "ax.set_ylabel(\"Time (s)\")\n", + "# ax.set_title(\"Comparison of Different Audit Levels\")\n", + "ax.set_ylim(0, None)\n", + "fig.subplots_adjust(left=0.18, right=1, bottom=0.05, top=1, hspace=0.4, wspace=0.1)\n", + "fig.savefig(\"plots/benchmark-time-per-audit-level.png\", bbox_inches='tight', dpi=300)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/benchmarking/requirements.txt b/benchmarking/requirements.txt new file mode 100644 index 0000000..510faad --- /dev/null +++ b/benchmarking/requirements.txt @@ -0,0 +1,3 @@ +matplotlib +numpy +jupyter \ No newline at end of file diff --git a/benchmarking/size-benchmarks.ipynb b/benchmarking/size-benchmarks.ipynb new file mode 100644 index 0000000..efad468 --- /dev/null +++ b/benchmarking/size-benchmarks.ipynb @@ -0,0 +1,489 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 150, + "metadata": {}, + "outputs": [], + "source": [ + "#\"\"\n", + "# Apache License\n", + "# Version 2.0, January 2004\n", + "# http://www.apache.org/licenses/\n", + "#\n", + "# TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n", + "#\n", + "# 1. Definitions.\n", + "#\n", + "# \"License\" shall mean the terms and conditions for use, reproduction,\n", + "# and distribution as defined by Sections 1 through 9 of this document.\n", + "#\n", + "# \"Licensor\" shall mean the copyright owner or entity authorized by\n", + "# the copyright owner that is granting the License.\n", + "#\n", + "# \"Legal Entity\" shall mean the union of the acting entity and all\n", + "# other entities that control, are controlled by, or are under common\n", + "# control with that entity. For the purposes of this definition,\n", + "# \"control\" means (i) the power, direct or indirect, to cause the\n", + "# direction or management of such entity, whether by contract or\n", + "# otherwise, or (ii) ownership of fifty percent (50%) or more of the\n", + "# outstanding shares, or (iii) beneficial ownership of such entity.\n", + "#\n", + "# \"You\" (or \"Your\") shall mean an individual or Legal Entity\n", + "# exercising permissions granted by this License.\n", + "#\n", + "# \"Source\" form shall mean the preferred form for making modifications,\n", + "# including but not limited to software source code, documentation\n", + "# source, and configuration files.\n", + "#\n", + "# \"Object\" form shall mean any form resulting from mechanical\n", + "# transformation or translation of a Source form, including but\n", + "# not limited to compiled object code, generated documentation,\n", + "# and conversions to other media types.\n", + "#\n", + "# \"Work\" shall mean the work of authorship, whether in Source or\n", + "# Object form, made available under the License, as indicated by a\n", + "# copyright notice that is included in or attached to the work\n", + "# (an example is provided in the Appendix below).\n", + "#\n", + "# \"Derivative Works\" shall mean any work, whether in Source or Object\n", + "# form, that is based on (or derived from) the Work and for which the\n", + "# editorial revisions, annotations, elaborations, or other modifications\n", + "# represent, as a whole, an original work of authorship. For the purposes\n", + "# of this License, Derivative Works shall not include works that remain\n", + "# separable from, or merely link (or bind by name) to the interfaces of,\n", + "# the Work and Derivative Works thereof.\n", + "#\n", + "# \"Contribution\" shall mean any work of authorship, including\n", + "# the original version of the Work and any modifications or additions\n", + "# to that Work or Derivative Works thereof, that is intentionally\n", + "# submitted to Licensor for inclusion in the Work by the copyright owner\n", + "# or by an individual or Legal Entity authorized to submit on behalf of\n", + "# the copyright owner. For the purposes of this definition, \"submitted\"\n", + "# means any form of electronic, verbal, or written communication sent\n", + "# to the Licensor or its representatives, including but not limited to\n", + "# communication on electronic mailing lists, source code control systems,\n", + "# and issue tracking systems that are managed by, or on behalf of, the\n", + "# Licensor for the purpose of discussing and improving the Work, but\n", + "# excluding communication that is conspicuously marked or otherwise\n", + "# designated in writing by the copyright owner as \"Not a Contribution.\"\n", + "#\n", + "# \"Contributor\" shall mean Licensor and any individual or Legal Entity\n", + "# on behalf of whom a Contribution has been received by Licensor and\n", + "# subsequently incorporated within the Work.\n", + "#\n", + "# 2. Grant of Copyright License. Subject to the terms and conditions of\n", + "# this License, each Contributor hereby grants to You a perpetual,\n", + "# worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n", + "# copyright license to reproduce, prepare Derivative Works of,\n", + "# publicly display, publicly perform, sublicense, and distribute the\n", + "# Work and such Derivative Works in Source or Object form.\n", + "#\n", + "# 3. Grant of Patent License. Subject to the terms and conditions of\n", + "# this License, each Contributor hereby grants to You a perpetual,\n", + "# worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n", + "# (except as stated in this section) patent license to make, have made,\n", + "# use, offer to sell, sell, import, and otherwise transfer the Work,\n", + "# where such license applies only to those patent claims licensable\n", + "# by such Contributor that are necessarily infringed by their\n", + "# Contribution(s) alone or by combination of their Contribution(s)\n", + "# with the Work to which such Contribution(s) was submitted. If You\n", + "# institute patent litigation against any entity (including a\n", + "# cross-claim or counterclaim in a lawsuit) alleging that the Work\n", + "# or a Contribution incorporated within the Work constitutes direct\n", + "# or contributory patent infringement, then any patent licenses\n", + "# granted to You under this License for that Work shall terminate\n", + "# as of the date such litigation is filed.\n", + "#\n", + "# 4. Redistribution. You may reproduce and distribute copies of the\n", + "# Work or Derivative Works thereof in any medium, with or without\n", + "# modifications, and in Source or Object form, provided that You\n", + "# meet the following conditions:\n", + "#\n", + "# (a) You must give any other recipients of the Work or\n", + "# Derivative Works a copy of this License; and\n", + "#\n", + "# (b) You must cause any modified files to carry prominent notices\n", + "# stating that You changed the files; and\n", + "#\n", + "# (c) You must retain, in the Source form of any Derivative Works\n", + "# that You distribute, all copyright, patent, trademark, and\n", + "# attribution notices from the Source form of the Work,\n", + "# excluding those notices that do not pertain to any part of\n", + "# the Derivative Works; and\n", + "#\n", + "# (d) If the Work includes a \"NOTICE\" text file as part of its\n", + "# distribution, then any Derivative Works that You distribute must\n", + "# include a readable copy of the attribution notices contained\n", + "# within such NOTICE file, excluding those notices that do not\n", + "# pertain to any part of the Derivative Works, in at least one\n", + "# of the following places: within a NOTICE text file distributed\n", + "# as part of the Derivative Works; within the Source form or\n", + "# documentation, if provided along with the Derivative Works; or,\n", + "# within a display generated by the Derivative Works, if and\n", + "# wherever such third-party notices normally appear. The contents\n", + "# of the NOTICE file are for informational purposes only and\n", + "# do not modify the License. You may add Your own attribution\n", + "# notices within Derivative Works that You distribute, alongside\n", + "# or as an addendum to the NOTICE text from the Work, provided\n", + "# that such additional attribution notices cannot be construed\n", + "# as modifying the License.\n", + "#\n", + "# You may add Your own copyright statement to Your modifications and\n", + "# may provide additional or different license terms and conditions\n", + "# for use, reproduction, or distribution of Your modifications, or\n", + "# for any such Derivative Works as a whole, provided Your use,\n", + "# reproduction, and distribution of the Work otherwise complies with\n", + "# the conditions stated in this License.\n", + "#\n", + "# 5. Submission of Contributions. Unless You explicitly state otherwise,\n", + "# any Contribution intentionally submitted for inclusion in the Work\n", + "# by You to the Licensor shall be under the terms and conditions of\n", + "# this License, without any additional terms or conditions.\n", + "# Notwithstanding the above, nothing herein shall supersede or modify\n", + "# the terms of any separate license agreement you may have executed\n", + "# with Licensor regarding such Contributions.\n", + "#\n", + "# 6. Trademarks. This License does not grant permission to use the trade\n", + "# names, trademarks, service marks, or product names of the Licensor,\n", + "# except as required for reasonable and customary use in describing the\n", + "# origin of the Work and reproducing the content of the NOTICE file.\n", + "#\n", + "# 7. Disclaimer of Warranty. Unless required by applicable law or\n", + "# agreed to in writing, Licensor provides the Work (and each\n", + "# Contributor provides its Contributions) on an \"AS IS\" BASIS,\n", + "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n", + "# implied, including, without limitation, any warranties or conditions\n", + "# of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n", + "# PARTICULAR PURPOSE. You are solely responsible for determining the\n", + "# appropriateness of using or redistributing the Work and assume any\n", + "# risks associated with Your exercise of permissions under this License.\n", + "#\n", + "# 8. Limitation of Liability. In no event and under no legal theory,\n", + "# whether in tort (including negligence), contract, or otherwise,\n", + "# unless required by applicable law (such as deliberate and grossly\n", + "# negligent acts) or agreed to in writing, shall any Contributor be\n", + "# liable to You for damages, including any direct, indirect, special,\n", + "# incidental, or consequential damages of any character arising as a\n", + "# result of this License or out of the use or inability to use the\n", + "# Work (including but not limited to damages for loss of goodwill,\n", + "# work stoppage, computer failure or malfunction, or any and all\n", + "# other commercial damages or losses), even if such Contributor\n", + "# has been advised of the possibility of such damages.\n", + "#\n", + "# 9. Accepting Warranty or Additional Liability. While redistributing\n", + "# the Work or Derivative Works thereof, You may choose to offer,\n", + "# and charge a fee for, acceptance of support, warranty, indemnity,\n", + "# or other liability obligations and/or rights consistent with this\n", + "# License. However, in accepting such obligations, You may act only\n", + "# on Your own behalf and on Your sole responsibility, not on behalf\n", + "# of any other Contributor, and only if You agree to indemnify,\n", + "# defend, and hold each Contributor harmless for any liability\n", + "# incurred by, or claims asserted against, such Contributor by reason\n", + "# of your accepting any such warranty or additional liability.\n", + "#\n", + "# END OF TERMS AND CONDITIONS\n", + "#\n", + "# APPENDIX: How to apply the Apache License to your work.\n", + "#\n", + "# To apply the Apache License to your work, attach the following\n", + "# boilerplate notice, with the fields enclosed by brackets \"[]\"\n", + "# replaced with your own identifying information. (Don't include\n", + "# the brackets!) The text should be enclosed in the appropriate\n", + "# comment syntax for the file format. We also recommend that a\n", + "# file or class name and description of purpose be included on the\n", + "# same \"printed page\" as the copyright notice for easier\n", + "# identification within third-party archives.\n", + "#\n", + "# Copyright 2024 Fraunhofer AISEC\n", + "#\n", + "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", + "# you may not use this file except in compliance with the License.\n", + "# You may obtain a copy of the License at\n", + "#\n", + "# http://www.apache.org/licenses/LICENSE-2.0\n", + "#\n", + "# Unless required by applicable law or agreed to in writing, software\n", + "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", + "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", + "# See the License for the specific language governing permissions and\n", + "# limitations under the License." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "\n", + "import os\n", + "import matplotlib.pyplot as plt\n", + "import json" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Libs that are dependencies of both TUF and BT code\n", + "\n", + "The folowing libraries are mostly used by both and therefore cannot be assigned as dependencies for one of the specific features. \n" + ] + }, + { + "cell_type": "code", + "execution_count": 151, + "metadata": {}, + "outputs": [], + "source": [ + "crypto_libs = [\n", + " \"p256\",\n", + " \"sha2\",\n", + " \"pem_rfc7468\",\n", + " \"spki\",\n", + " \"pkcs8\",\n", + " \"der\",\n", + " \"der?\",\n", + " \"x509_cert\",\n", + " \"serde_json\",\n", + " \"const_oid\",\n", + " \"ecdsa\",\n", + " \"base64ct\",\n", + " \"sec1\",\n", + " \"crypto_bigint\",\n", + " \"heapless\",\n", + " \"smoltcp\",\n", + " \"embassy_net\",\n", + " \"fixed\",\n", + " \"hash32\",\n", + "]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Flash Size and WiFi Drivers\n", + "\n", + "- The flash size is listed as 2MB, which we convert to MiB\n", + "- The drivers for the WiFi chip on the Pi Pico W requires drivers that need to flashed onto the same flash chip as the binary itself. It can also be \"baked\" into the binary directly, however this makes it impossible to reuse the wifi drivers that are already stored on the chip for new binaries when updating. It also increases the size of the binaries significantly." + ] + }, + { + "cell_type": "code", + "execution_count": 152, + "metadata": {}, + "outputs": [], + "source": [ + "wifi_driver_size = os.stat(f\"../-pi-pico-w/firmware/43439A0_clm.bin\").st_size + os.stat(\"../-pi-pico-w/firmware/43439A0.bin\").st_size\n", + "wifi_driver_size /= 1024 # scale to KiB\n", + "\n", + "flash_size = 2 * 1e6 / 1024**1" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Colors" + ] + }, + { + "cell_type": "code", + "execution_count": 153, + "metadata": {}, + "outputs": [], + "source": [ + "flash_size_data_color = \"tab:blue\"\n", + "wifi_driver_size_data_color = \"tab:red\"\n", + "file_size_data_color = \"tab:olive\"\n", + "file_text_section_color =\"tab:pink\"\n", + "tuf_no_std_size_color = \"tab:cyan\"\n", + "_size_color=\"tab:orange\"\n", + "libs_size_color=\"tab:purple\"" + ] + }, + { + "cell_type": "code", + "execution_count": 154, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "processing size benchmarks\n", + "[('benchmark-code-size-full', 260.671875), ('benchmark-code-size-no-tuf', 189.7578125), ('benchmark-code-size-signature-only', 144.08984375), ('benchmark-code-size-update-only', 101.12890625)] [('benchmark-code-size-full', 484.248046875), ('benchmark-code-size-no-tuf', 413.333984375), ('benchmark-code-size-signature-only', 367.666015625), ('benchmark-code-size-update-only', 324.705078125)]\n" + ] + } + ], + "source": [ + "data_path = \"../benchmark-output/benchmarks-size.json\"\n", + "\n", + "plt.style.use(\"Solarize_Light2\")\n", + "print(\"processing size benchmarks\")\n", + "with open(data_path) as f:\n", + " raw_data = json.load(f)\n", + "\n", + "\n", + "file_size_data = [(name, data[\"raw_size\"]/(1024**1)) for (name, data) in raw_data.items()]\n", + "flash_size_data = [(name, flash_size) for (name, _) in raw_data.items()]\n", + "file_text_section = [(name, data[\"cargo_bloat_crates\"][\"text-section-size\"]/(1024**1)) for (name,data) in raw_data.items()]\n", + "tuf_no_std_size = []\n", + "_size = []\n", + "libs_size = []\n", + "for (name, data) in raw_data.items():\n", + " crates = data[\"cargo_bloat_crates\"][\"crates\"]\n", + " size_tuf_no_std = sum(c[\"size\"] for c in crates if c[\"name\"].startswith(\"tuf_no_std\")) / (1024**1)\n", + " size_ = sum(c[\"size\"] for c in crates if c[\"name\"].startswith(\"\")) / (1024**1)\n", + " size_libs = sum(c[\"size\"] for c in crates if any(c[\"name\"].startswith(l) for l in crypto_libs)) / (1024**1)\n", + " libs_size.append((name, size_libs, size_libs))\n", + " _size.append((name, size_ + size_libs, size_))\n", + " tuf_no_std_size.append((name, size_tuf_no_std + size_ + size_libs, size_tuf_no_std))\n", + "wifi_driver_size_data = [(name, data + wifi_driver_size) for (name, data) in file_size_data]\n", + "print(file_size_data, wifi_driver_size_data)\n", + "tuf_no_std_size = list(zip(*tuf_no_std_size))\n", + "_size = list(zip(*_size))\n", + "libs_size = list(zip(*libs_size))\n", + "\n", + "table_data = {\n", + " \"Entire Binary\": [f\"{v:.2f} KiB\" for (_, v) in file_size_data],\n", + " \".text section\": [f\"{v:.2f} KiB\" for (_, v) in file_text_section],\n", + " \"TUF\": [f\"{v:.2f} KiB\" for v in tuf_no_std_size[2]],\n", + " \"BT²X\": [f\"{v:.2f} KiB\" for v in _size[2]],\n", + " \"Libs\": [f\"{v:.2f} KiB\" for v in libs_size[2]],\n", + "}\n" + ] + }, + { + "cell_type": "code", + "execution_count": 155, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAg4AAAEfCAYAAAAp2U6aAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hT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j2bptAPx75DVEhYe69Dq5inhdrbRNasi+I6do3TTR4et167WXM3vpelZv2mW7yM5ZGiTUok/n1rw1+3skrIey7xhU8+P3/nOKdkmVe8wYfd7AuruhoLAYi6WU7fuO8u/brqnyRay3efMURn8/JNaO5bLWTXjxw28wmyRGXNtNFzsqQFSOFAgMS1FxCVO+WMFjo67T1AdScYmFyZ8vZ8Ko6zBrKC6tIOZNoHXEwkEgMDC7D56gXny0pvbdn07PIiM7l5aN9VEMzBeIeRNoGbFwEAgEAoFA4DTieJNAIBAIBAKnEQsHgUAgEAgETiMWDgKBQCAQCJxGLBwEAoFAIBA4jVg4CAQCgUAgcBqxcBAIBAKBQOA0/w/k/TLtJhjUlgAAAABJRU5ErkJggg==", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "fig, ax = plt.subplots()\n", + "x_labels = [\n", + " \"audit level 2\",\n", + " \"audit level 2 (no TUF)\",\n", + " \"audit level 1 (no TUF)\",\n", + " \"audit level 0\",\n", + "]\n", + "ax.set_ylabel(\"Size (KiB)\")\n", + "ax.bar(*zip(*flash_size_data), label=\"Total Flash\", width=0.85, hatch=\"*\", color=flash_size_data_color, align=\"edge\")\n", + "ax.bar(*zip(*wifi_driver_size_data), label=\"WiFi Drivers\", width=0.8, hatch=\"//\", color=wifi_driver_size_data_color, align=\"edge\")\n", + "ax.bar(*zip(*file_size_data), label=\"Entire Binary\", width=0.8, color=file_size_data_color, align=\"edge\")\n", + "ax.bar(*zip(*file_text_section), label=\".text section\", width=0.75, hatch=\"o\", color=file_text_section_color, align=\"edge\")\n", + "ax.bar(tuf_no_std_size[0], tuf_no_std_size[1], label=\"TUF\", width=0.7, hatch=\"+\", color=tuf_no_std_size_color, align=\"edge\")\n", + "ax.bar(_size[0], _size[1], label=\"BT²X\", width=0.7, hatch=\"//\", color=_size_color, align=\"edge\")\n", + "ax.bar(libs_size[0], libs_size[1], label=\"Libs\", width=0.7, hatch=\"\\\\\\\\\", color=libs_size_color, align=\"edge\")\n", + "ax.legend(loc=\"upper right\")\n", + "\n", + "# table = plt.table(\n", + "# colWidths=[0.25, 0.25, 0.25, 0.25],\n", + "# cellText=list(table_data.values()),\n", + "# rowLabels=list(table_data.keys()),\n", + "# colLabels=list(raw_data.keys()),\n", + "# )\n", + "# table.auto_set_font_size(False)\n", + "# table.set_fontsize(8)\n", + "plt.subplots_adjust(left=0.2, bottom=0.2)\n", + "x_tick_distances = [1*v for v in [0.445, 0.445 + 1*(0.85 + 2*0.075), 0.445 + 2*(0.85 + 2*0.075), 0.445 + 3*(0.85 + 2*0.075)]]\n", + "ax.set_xticks(x_tick_distances, labels=x_labels)\n", + "fig.subplots_adjust(left=0.18, right=2/1.5, bottom=0.05, top=1.5/1.6, hspace=0.4, wspace=0.3)\n", + "fig.savefig(\"plots/benchmark-size-total-storage.pdf\", bbox_inches='tight')\n" + ] + }, + { + "cell_type": "code", + "execution_count": 156, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAhsAAAFiCAYAAABf4hopAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAAsTAAALEwEAmpwYAABkxklEQVR4nO3dd1hT1/8H8HdARLYKOOveG21lQ8IQB6KiraPOuqp+nd9a/VVrW63bOqpWraNaV6tWrVq3VlTco7jqQAUHKg72kJXz+4NvYkJuWJLcc8Pn9Tx9npp8cu/NOeHm5I7zluWkPWEghBBCCDEQM7E3gBBCCCGmjQYbhBBCCDEoGmwQQgghxKBosEEIIYQQg6LBBiGEEEIMigYbhBBCCDGoMmJvAK8Sk5LE3gRCCCFEMmQA7O3tBZ+jIxuEEEIIeW9mZvqHFDTYIIQQQohB0WCDEEIIIQZFgw1CCCGEGBRdIEoIIYRrOTkMbxKzkJWlBIV5iUsGwMLCDI4OFjA3lxX6dTTYIIQQwrU3iVm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AAPXv2RHh4OCIjIzFp0iR07dpV3Z/jxo3DnTt3kJmZqU7cphRf8QklMnt4eODvv/9Wn+5SUfXljBkzEBsbqz7qcfDgQSxfvhxRUVEYPHgwAGD9+vXqHxWaxo0bh+HDh2PZsmVajy9YsABbtmxBZmam4J1J74NSX/WgyWZMB/WlaaH+NB3Ul6aFUl8JIYQQIhoabBBCCCHEoGiwQQghhBCDyvcC0Vo1a5TaRL7SnHhraqgvTQv1p+mgvjQttWrW0PtcvheIEkIIIYS8LzqNQgghhBCDosEGIYQQQgyKBhuEEEIIMSgabBBCCCHEoGiwQQghhBCD+n/XRMmZbHVkuAAAAABJRU5ErkJggg==", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "fig, ax = plt.subplots()\n", + "\n", + "ax.set_ylabel(\"Size (KiB)\")\n", + "ax.bar(*zip(*file_size_data), align=\"edge\", label=\"Entire Binary\", width=0.8, color=file_size_data_color)\n", + "ax.bar(*zip(*file_text_section), align=\"edge\", label=\".text section\", width=0.75, hatch=\"o\", color=file_text_section_color)\n", + "ax.bar(tuf_no_std_size[0], tuf_no_std_size[1], align=\"edge\", label=\"TUF\", width=0.7, hatch=\"+\", color=tuf_no_std_size_color)\n", + "ax.bar(_size[0], _size[1], align=\"edge\", label=\"BT²X\", width=0.7, hatch=\"//\", color=_size_color)\n", + "ax.bar(libs_size[0], libs_size[1], align=\"edge\", label=\"Libs\", width=0.7, hatch=\"\\\\\\\\\", color=libs_size_color)\n", + "ax.legend(loc=\"upper right\")\n", + "\n", + "\n", + "\n", + "table = plt.table(\n", + " colWidths=[0.25, 0.25, 0.25, 0.25],\n", + " cellText=list(table_data.values()),\n", + " rowLabels=list(table_data.keys()),\n", + " colLabels=x_labels,\n", + ")\n", + "table.auto_set_font_size(False)\n", + "table.set_fontsize(8)\n", + "plt.subplots_adjust(left=0.2, bottom=0.2)\n", + "plt.xticks([])\n", + "fig.subplots_adjust(left=0.18, right=2/1.6, bottom=0.05, top=1.5/1.6, hspace=0.4, wspace=0.3)\n", + "fig.savefig(\"plots/benchmark-size-used-storage.pdf\", bbox_inches='tight')\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Notes\n", + "\n", + "- The binaries include no business logic and the rest of the size is mostly from the embassy runtime.\n", + "\n", + "## Analysis\n", + "\n", + "- Using TUF in addition to BT²X introduces some overhead but is able to reuse a lot of the dependencies that are already required by BT²X.\n", + "- Overall, the overhead of the verification code is roughly equal to the size of the WiFi drivers. Both together take up roughly 1/4 of the available flash.\n", + "- The rest of the storage can be used for business logic and storage such as files and new updates. " + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/bt2x-embassy-std/.dockerignore b/bt2x-embassy-std/.dockerignore new file mode 100644 index 0000000..66a6354 --- /dev/null +++ b/bt2x-embassy-std/.dockerignore @@ -0,0 +1,16 @@ +### Rust template +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + diff --git a/bt2x-embassy-std/Cargo.lock b/bt2x-embassy-std/Cargo.lock new file mode 100644 index 0000000..ac0b616 --- /dev/null +++ b/bt2x-embassy-std/Cargo.lock @@ -0,0 +1,1822 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite", + "log", + "parking", + "polling", + "rustix", + "slab", + "socket2", + "waker-fn", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-trait" +version = "0.1.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "461abc97219de0eaaf81fe3ef974a540158f3d079c2ab200f891f1a2ef201e85" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bitfield" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c821a6e124197eb56d907ccc2188eab1038fb919c914f47976e64dd8dbc855d1" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bt2x-embassy-std" +version = "0.1.0" +dependencies = [ + "async-io", + "bt2x-embedded", + "bt2x-ota-common", + "clap", + "critical-section", + "embassy-executor", + "embassy-net", + "embassy-net-ppp", + "embassy-net-tuntap", + "embassy-sync", + "embassy-time", + "embedded-io-adapters", + "embedded-io-async", + "env_logger", + "futures", + "heapless 0.8.0", + "log", + "nix", + "rand_core", + "static_cell", + "tuf-no-std", +] + +[[package]] +name = "bt2x-embedded" +version = "0.1.0" +dependencies = [ + "base64", + "base64ct", + "der", + "ecdsa", + "hex", + "p256", + "pem-rfc7468", + "pkcs8", + "serde", + "serde-json-core", + "sha2", + "signature", + "spki", + "x509-cert", +] + +[[package]] +name = "bt2x-ota-common" +version = "0.1.0" +dependencies = [ + "bitfield", + "embassy-net", + "embassy-time", + "embedded-io-async", + "embedded-storage", + "log", + "sha2", + "tuf-no-std", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags", + "clap_derive", + "clap_lex", + "indexmap", + "once_cell", + "strsim", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap_derive" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "concurrent-queue" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "critical-section" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "platforms", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "darling" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.53", +] + +[[package]] +name = "darling_macro" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "der_derive", + "flagset", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "der_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fe87ce4529967e0ba1dcf8450bab64d97dfd5010a6256187ffe2e43e6f0e049" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "document-features" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95" +dependencies = [ + "litrs", +] + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +dependencies = [ + "curve25519-dalek", + "ed25519", + "serde", + "sha2", + "subtle", + "zeroize", +] + +[[package]] +name = "either" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "pem-rfc7468", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "embassy-executor" +version = "0.5.0" +source = "git+https://github.com/embassy-rs/embassy?rev=a2acb3e3dceddb4752f8fb1c17aa65e1959a2180#a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" +dependencies = [ + "critical-section", + "document-features", + "embassy-executor-macros", + "embassy-time-driver", + "embassy-time-queue-driver", + "log", +] + +[[package]] +name = "embassy-executor-macros" +version = "0.4.1" +source = "git+https://github.com/embassy-rs/embassy?rev=a2acb3e3dceddb4752f8fb1c17aa65e1959a2180#a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "embassy-futures" +version = "0.1.1" +source = "git+https://github.com/embassy-rs/embassy?rev=a2acb3e3dceddb4752f8fb1c17aa65e1959a2180#a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" + +[[package]] +name = "embassy-net" +version = "0.4.0" +source = "git+https://github.com/embassy-rs/embassy?rev=a2acb3e3dceddb4752f8fb1c17aa65e1959a2180#a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" +dependencies = [ + "document-features", + "embassy-net-driver", + "embassy-sync", + "embassy-time", + "embedded-io-async", + "embedded-nal-async", + "heapless 0.8.0", + "log", + "managed", + "smoltcp", +] + +[[package]] +name = "embassy-net-driver" +version = "0.2.0" +source = "git+https://github.com/embassy-rs/embassy?rev=a2acb3e3dceddb4752f8fb1c17aa65e1959a2180#a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" + +[[package]] +name = "embassy-net-driver-channel" +version = "0.2.0" +source = "git+https://github.com/embassy-rs/embassy?rev=a2acb3e3dceddb4752f8fb1c17aa65e1959a2180#a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" +dependencies = [ + "embassy-futures", + "embassy-net-driver", + "embassy-sync", +] + +[[package]] +name = "embassy-net-ppp" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/embassy?rev=a2acb3e3dceddb4752f8fb1c17aa65e1959a2180#a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" +dependencies = [ + "embassy-futures", + "embassy-net-driver-channel", + "embassy-sync", + "embedded-io-async", + "log", + "ppproto", +] + +[[package]] +name = "embassy-net-tuntap" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/embassy?rev=a2acb3e3dceddb4752f8fb1c17aa65e1959a2180#a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" +dependencies = [ + "async-io", + "embassy-net-driver", + "libc", + "log", +] + +[[package]] +name = "embassy-sync" +version = "0.6.0" +source = "git+https://github.com/embassy-rs/embassy?rev=a2acb3e3dceddb4752f8fb1c17aa65e1959a2180#a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" +dependencies = [ + "cfg-if", + "critical-section", + "embedded-io-async", + "futures-util", + "heapless 0.8.0", + "log", +] + +[[package]] +name = "embassy-time" +version = "0.3.1" +source = "git+https://github.com/embassy-rs/embassy?rev=a2acb3e3dceddb4752f8fb1c17aa65e1959a2180#a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" +dependencies = [ + "cfg-if", + "critical-section", + "document-features", + "embassy-time-driver", + "embassy-time-queue-driver", + "embedded-hal 0.2.7", + "embedded-hal 1.0.0", + "embedded-hal-async", + "futures-util", + "heapless 0.8.0", + "log", +] + +[[package]] +name = "embassy-time-driver" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/embassy?rev=a2acb3e3dceddb4752f8fb1c17aa65e1959a2180#a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" +dependencies = [ + "document-features", +] + +[[package]] +name = "embassy-time-queue-driver" +version = "0.1.0" +source = "git+https://github.com/embassy-rs/embassy?rev=a2acb3e3dceddb4752f8fb1c17aa65e1959a2180#a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" + +[[package]] +name = "embedded-hal" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35949884794ad573cf46071e41c9b60efb0cb311e3ca01f7af807af1debc66ff" +dependencies = [ + "nb 0.1.3", + "void", +] + +[[package]] +name = "embedded-hal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89" + +[[package]] +name = "embedded-hal-async" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884" +dependencies = [ + "embedded-hal 1.0.0", +] + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "embedded-io-adapters" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b03facd2b544d24916f312a6026c1b548b8af012f788a554d498afdc8ef9c775" +dependencies = [ + "embedded-io", + "embedded-io-async", + "futures", +] + +[[package]] +name = "embedded-io-async" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff09972d4073aa8c299395be75161d582e7629cd663171d62af73c8d50dba3f" +dependencies = [ + "embedded-io", +] + +[[package]] +name = "embedded-nal" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8a943fad5ed3d3f8a00f1e80f6bba371f1e7f0df28ec38477535eb318dc19cc" +dependencies = [ + "nb 1.1.0", + "no-std-net", +] + +[[package]] +name = "embedded-nal-async" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72229137a4fc12d239b0b7f50f04b30790678da6d782a0f3f1909bf57ec4b759" +dependencies = [ + "embedded-io-async", + "embedded-nal", + "no-std-net", +] + +[[package]] +name = "embedded-storage" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21dea9854beb860f3062d10228ce9b976da520a73474aed3171ec276bc0c032" + +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f" + +[[package]] +name = "flagset" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdeb3aa5e95cf9aabc17f060cfa0ced7b83f042390760ca53bf09df9968acaa1" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32 0.2.1", + "rustc_version", + "spin", + "stable_deref_trait", +] + +[[package]] +name = "heapless" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +dependencies = [ + "hash32 0.3.1", + "stable_deref_trait", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +dependencies = [ + "serde", +] + +[[package]] +name = "managed" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca88d725a0a943b096803bd34e73a4437208b6077654cc4ecb2947a5f91618d" + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + +[[package]] +name = "nb" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "801d31da0513b6ec5214e9bf433a77966320625a37860f910be265be6e18d06f" +dependencies = [ + "nb 1.1.0", +] + +[[package]] +name = "nb" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d5439c4ad607c3c23abf66de8c8bf57ba8adcd1f129e699851a6e43935d339d" + +[[package]] +name = "nix" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +dependencies = [ + "bitflags", + "cfg-if", + "libc", + "memoffset", + "pin-utils", +] + +[[package]] +name = "no-std-net" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" + +[[package]] +name = "num_enum" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "platforms" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" + +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] + +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + +[[package]] +name = "ppproto" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b08f23bada7fbe9266b2d485b3abefdff31f1d3cc8c77f067165cf23848c9a32" +dependencies = [ + "heapless 0.7.17", + "log", + "num_enum", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "regex" +version = "1.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.37.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "ryu" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" + +[[package]] +name = "serde" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-json-core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c9e1ab533c0bc414c34920ec7e5f097101d126ed5eac1a1aac711222e0bbb33" +dependencies = [ + "heapless 0.7.17", + "ryu", + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smoltcp" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a1a996951e50b5971a2c8c0fa05a381480d70a933064245c4a223ddc87ccc97" +dependencies = [ + "bitflags", + "byteorder", + "cfg-if", + "heapless 0.8.0", + "managed", +] + +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", + "sha2", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_cell" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa6ba4cf83bf80d3eb25f098ea5e790a0a1fcb5e357442259b231e412c2d3ca0" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" + +[[package]] +name = "tuf-no-std" +version = "0.1.0" +dependencies = [ + "anyhow", + "const-oid", + "der", + "ed25519", + "ed25519-dalek", + "either", + "hash32 0.3.1", + "heapless 0.8.0", + "hex", + "p256", + "pem-rfc7468", + "serde", + "serde-json-core", + "sha2", + "signature", + "spki", + "tuf-no-std-common", + "tuf-no-std-der", + "zeroize", +] + +[[package]] +name = "tuf-no-std-common" +version = "0.1.0" +dependencies = [ + "anyhow", + "async-trait", + "const-oid", + "der", + "ed25519", + "ed25519-dalek", + "either", + "hash32 0.3.1", + "hex", + "p256", + "pem-rfc7468", + "serde", + "sha2", + "signature", + "spki", + "zeroize", +] + +[[package]] +name = "tuf-no-std-der" +version = "0.1.0" +dependencies = [ + "anyhow", + "const-oid", + "der", + "ed25519", + "ed25519-dalek", + "either", + "hash32 0.3.1", + "hex", + "p256", + "pem-rfc7468", + "serde", + "serde-json-core", + "sha2", + "signature", + "spki", + "tuf-no-std-common", + "zeroize", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "waker-fn" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.4", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +dependencies = [ + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + +[[package]] +name = "x509-cert" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1301e935010a701ae5f8655edc0ad17c44bad3ac5ce8c39185f75453b720ae94" +dependencies = [ + "const-oid", + "der", + "spki", +] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/bt2x-embassy-std/Cargo.toml b/bt2x-embassy-std/Cargo.toml new file mode 100644 index 0000000..f3dc830 --- /dev/null +++ b/bt2x-embassy-std/Cargo.toml @@ -0,0 +1,37 @@ +[package] +name = "bt2x-embassy-std" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +embassy-sync = { version = "0.6.0", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180", features = ["log"] } +embassy-executor = { version = "0.5.0", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180", features = ["task-arena-size-1048576", "arch-std", "executor-thread", "log", "integrated-timers"] } +embassy-time = { version = "0.3.0", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180", features = ["log", "std", ] } +embassy-net = { version = "0.4.0", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180", features = ["std", "log", "medium-ethernet", "medium-ip", "tcp", "udp", "dns", "dhcpv4", "proto-ipv6"] } +embassy-net-tuntap = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" } +embassy-net-ppp = { version = "0.1.0", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180", features = ["log"] } +embedded-io-async = { version = "0.6.1" } +embedded-io-adapters = { version = "0.6.1", features = ["futures-03"] } +critical-section = { version = "1.1", features = ["std"] } + +async-io = "1.6.0" +env_logger = "0.9.0" +futures = { version = "0.3.17" } +log = "0.4.14" +nix = "0.26.2" +clap = { version = "3.0.0-beta.5", features = ["derive"] } +rand_core = { version = "0.6.3", features = ["std"] } +heapless = { version = "0.8", default-features = false } +static_cell = "2" +bt2x-embedded = { path = "../bt2x/bt2x-embedded" } +bt2x-ota-common = { path = "../bt2x/bt2x-ota-common", features = ["log", "mock_flash"], default-features = false } +tuf-no-std = { path = "../tuf-no-std/tuf-no-std", default-features = false, features = [ + "der", + "ed25519", + "verify", + "ecdsa", + "async", +] } diff --git a/bt2x-embassy-std/LICENSE.txt b/bt2x-embassy-std/LICENSE.txt new file mode 100644 index 0000000..4052ad4 --- /dev/null +++ b/bt2x-embassy-std/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2024 Fraunhofer AISEC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/bt2x-embassy-std/deny.toml b/bt2x-embassy-std/deny.toml new file mode 100644 index 0000000..185f3fa --- /dev/null +++ b/bt2x-embassy-std/deny.toml @@ -0,0 +1,238 @@ +# This template contains all of the possible sections and their default values + +# Note that all fields that take a lint level have these possible values: +# * deny - An error will be produced and the check will fail +# * warn - A warning will be produced, but the check will not fail +# * allow - No warning or error will be produced, though in some cases a note +# will be + +# The values provided in this template are the default values that will be used +# when any section or field is not specified in your own configuration + +# Root options + +# The graph table configures how the dependency graph is constructed and thus +# which crates the checks are performed against +[graph] +# If 1 or more target triples (and optionally, target_features) are specified, +# only the specified targets will be checked when running `cargo deny check`. +# This means, if a particular package is only ever used as a target specific +# dependency, such as, for example, the `nix` crate only being used via the +# `target_family = "unix"` configuration, that only having windows targets in +# this list would mean the nix crate, as well as any of its exclusive +# dependencies not shared by any other crates, would be ignored, as the target +# list here is effectively saying which targets you are building for. +targets = [ + # The triple can be any string, but only the target triples built in to + # rustc (as of 1.40) can be checked against actual config expressions + #"x86_64-unknown-linux-musl", + # You can also specify which target_features you promise are enabled for a + # particular target. target_features are currently not validated against + # the actual valid features supported by the target architecture. + #{ triple = "wasm32-unknown-unknown", features = ["atomics"] }, +] +# When creating the dependency graph used as the source of truth when checks are +# executed, this field can be used to prune crates from the graph, removing them +# from the view of cargo-deny. This is an extremely heavy hammer, as if a crate +# is pruned from the graph, all of its dependencies will also be pruned unless +# they are connected to another crate in the graph that hasn't been pruned, +# so it should be used with care. The identifiers are [Package ID Specifications] +# (https://doc.rust-lang.org/cargo/reference/pkgid-spec.html) +#exclude = [] +# If true, metadata will be collected with `--all-features`. Note that this can't +# be toggled off if true, if you want to conditionally enable `--all-features` it +# is recommended to pass `--all-features` on the cmd line instead +all-features = false +# If true, metadata will be collected with `--no-default-features`. The same +# caveat with `all-features` applies +no-default-features = false +# If set, these feature will be enabled when collecting metadata. If `--features` +# is specified on the cmd line they will take precedence over this option. +#features = [] + +# The output table provides options for how/if diagnostics are outputted +[output] +# When outputting inclusion graphs in diagnostics that include features, this +# option can be used to specify the depth at which feature edges will be added. +# This option is included since the graphs can be quite large and the addition +# of features from the crate(s) to all of the graph roots can be far too verbose. +# This option can be overridden via `--feature-depth` on the cmd line +feature-depth = 1 + +# This section is considered when running `cargo deny check advisories` +# More documentation for the advisories section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html +[advisories] +# The path where the advisory databases are cloned/fetched into +#db-path = "$CARGO_HOME/advisory-dbs" +# The url(s) of the advisory databases to use +#db-urls = ["https://github.com/rustsec/advisory-db"] +# A list of advisory IDs to ignore. Note that ignored advisories will still +# output a note when they are encountered. +ignore = [ + #"RUSTSEC-0000-0000", + #{ id = "RUSTSEC-0000-0000", reason = "you can specify a reason the advisory is ignored" }, + #"a-crate-that-is-yanked@0.1.1", # you can also ignore yanked crate versions if you wish + #{ crate = "a-crate-that-is-yanked@0.1.1", reason = "you can specify why you are ignoring the yanked crate" }, +] +# If this is true, then cargo deny will use the git executable to fetch advisory database. +# If this is false, then it uses a built-in git library. +# Setting this to true can be helpful if you have special authentication requirements that cargo-deny does not support. +# See Git Authentication for more information about setting up git authentication. +#git-fetch-with-cli = true + +# This section is considered when running `cargo deny check licenses` +# More documentation for the licenses section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html +[licenses] +# List of explicitly allowed licenses +# See https://spdx.org/licenses/ for list of possible licenses +# [possible values: any SPDX 3.11 short identifier (+ optional exception)]. +allow = [ + "MIT", + "Apache-2.0", + "Apache-2.0 WITH LLVM-exception", + "Unicode-DFS-2016", + "BSD-3-Clause", + "0BSD", +] +# The confidence threshold for detecting a license from license text. +# The higher the value, the more closely the license text must be to the +# canonical license text of a valid SPDX license file. +# [possible values: any between 0.0 and 1.0]. +confidence-threshold = 0.8 +# Allow 1 or more licenses on a per-crate basis, so that particular licenses +# aren't accepted for every possible crate as with the normal allow list +exceptions = [ + # Each entry is the crate and version constraint, and its specific allow + # list + #{ allow = ["Zlib"], crate = "adler32" }, +] + +# Some crates don't have (easily) machine readable licensing information, +# adding a clarification entry for it allows you to manually specify the +# licensing information +#[[licenses.clarify]] +# The package spec the clarification applies to +#crate = "ring" +# The SPDX expression for the license requirements of the crate +#expression = "MIT AND ISC AND OpenSSL" +# One or more files in the crate's source used as the "source of truth" for +# the license expression. If the contents match, the clarification will be used +# when running the license check, otherwise the clarification will be ignored +# and the crate will be checked normally, which may produce warnings or errors +# depending on the rest of your configuration +#license-files = [ +# Each entry is a crate relative path, and the (opaque) hash of its contents +#{ path = "LICENSE", hash = 0xbd0eed23 } +#] + +[licenses.private] +# If true, ignores workspace crates that aren't published, or are only +# published to private registries. +# To see how to mark a crate as unpublished (to the official registry), +# visit https://doc.rust-lang.org/cargo/reference/manifest.html#the-publish-field. +ignore = false +# One or more private registries that you might publish crates to, if a crate +# is only published to private registries, and ignore is true, the crate will +# not have its license(s) checked +registries = [ + #"https://sekretz.com/registry +] + +# This section is considered when running `cargo deny check bans`. +# More documentation about the 'bans' section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html +[bans] +# Lint level for when multiple versions of the same crate are detected +multiple-versions = "warn" +# Lint level for when a crate version requirement is `*` +wildcards = "allow" +# The graph highlighting used when creating dotgraphs for crates +# with multiple versions +# * lowest-version - The path to the lowest versioned duplicate is highlighted +# * simplest-path - The path to the version with the fewest edges is highlighted +# * all - Both lowest-version and simplest-path are used +highlight = "all" +# The default lint level for `default` features for crates that are members of +# the workspace that is being checked. This can be overridden by allowing/denying +# `default` on a crate-by-crate basis if desired. +workspace-default-features = "allow" +# The default lint level for `default` features for external crates that are not +# members of the workspace. This can be overridden by allowing/denying `default` +# on a crate-by-crate basis if desired. +external-default-features = "allow" +# List of crates that are allowed. Use with care! +allow = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason it is allowed" }, +] +# List of crates to deny +deny = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason it is banned" }, + # Wrapper crates can optionally be specified to allow the crate when it + # is a direct dependency of the otherwise banned crate + #{ crate = "ansi_term@0.11.0", wrappers = ["this-crate-directly-depends-on-ansi_term"] }, +] + +# List of features to allow/deny +# Each entry the name of a crate and a version range. If version is +# not specified, all versions will be matched. +#[[bans.features]] +#crate = "reqwest" +# Features to not allow +#deny = ["json"] +# Features to allow +#allow = [ +# "rustls", +# "__rustls", +# "__tls", +# "hyper-rustls", +# "rustls", +# "rustls-pemfile", +# "rustls-tls-webpki-roots", +# "tokio-rustls", +# "webpki-roots", +#] +# If true, the allowed features must exactly match the enabled feature set. If +# this is set there is no point setting `deny` +#exact = true + +# Certain crates/versions that will be skipped when doing duplicate detection. +skip = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason why it can't be updated/removed" }, +] +# Similarly to `skip` allows you to skip certain crates during duplicate +# detection. Unlike skip, it also includes the entire tree of transitive +# dependencies starting at the specified crate, up to a certain depth, which is +# by default infinite. +skip-tree = [ + #"ansi_term@0.11.0", # will be skipped along with _all_ of its direct and transitive dependencies + #{ crate = "ansi_term@0.11.0", depth = 20 }, +] + +# This section is considered when running `cargo deny check sources`. +# More documentation about the 'sources' section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html +[sources] +# Lint level for what to happen when a crate from a crate registry that is not +# in the allow list is encountered +unknown-registry = "warn" +# Lint level for what to happen when a crate from a git repository that is not +# in the allow list is encountered +unknown-git = "warn" +# List of URLs for allowed crate registries. Defaults to the crates.io index +# if not specified. If it is specified but empty, no registries are allowed. +allow-registry = ["https://github.com/rust-lang/crates.io-index"] +# List of URLs for allowed Git repositories +allow-git = [] + +[sources.allow-org] +# github.com organizations to allow git sources for +github = [] +# gitlab.com organizations to allow git sources for +gitlab = [] +# bitbucket.org organizations to allow git sources for +bitbucket = [] diff --git a/bt2x-embassy-std/readme.md b/bt2x-embassy-std/readme.md new file mode 100644 index 0000000..81fa9e3 --- /dev/null +++ b/bt2x-embassy-std/readme.md @@ -0,0 +1,20 @@ + +# Embassy `std` Example + +This example can be used to debug the updater code on a target that is easier to debug (locally). + +## Setup + +First, create the tap0 interface. You only need to do this once. + +```sh +sudo ip tuntap add name tap0 mode tap user $USER +sudo ip link set tap0 up +sudo ip addr add 192.168.69.100/24 dev tap0 +sudo ip -6 addr add fe80::100/64 dev tap0 +sudo ip -6 addr add fdaa::100/64 dev tap0 +sudo ip -6 route add fe80::/64 dev tap0 +sudo ip -6 route add fdaa::/64 dev tap0 +``` + +Then you can connect to the OTA server if it's running in the docker setup. diff --git a/bt2x-embassy-std/src/main.rs b/bt2x-embassy-std/src/main.rs new file mode 100644 index 0000000..e1a98b0 --- /dev/null +++ b/bt2x-embassy-std/src/main.rs @@ -0,0 +1,161 @@ +use clap::Parser; +use embassy_executor::{Executor, Spawner}; +use std::cmp::min; +use std::fs::OpenOptions; +use std::io::Write; +use std::path::PathBuf; +use std::process::exit; + +use embassy_net::{Config, IpEndpoint, Ipv4Address, Ipv4Cidr, Stack, StackResources}; +use embassy_net_tuntap::TunTapDevice; + +use bt2x_embedded::{verify_bt, Digest, Sha256}; +use bt2x_ota_common::net::Transport; +use heapless::Vec; +use log::*; +use rand_core::{OsRng, RngCore}; +use static_cell::StaticCell; +use tuf_no_std::utils::TufStorage; +use tuf_no_std::{DateTime, UtcTime}; + +use bt2x_ota_common::flash::mock_flash::ReadNorFlash; + +const TUF_ROOT: &[u8] = include_bytes!("../../build/1.root.der"); + +#[derive(Parser)] +#[clap(version = "1.0")] +struct Opts { + /// TAP device name + #[clap(long, default_value = "tap0")] + tap: String, + /// use a static IP instead of DHCP + #[clap(long)] + static_ip: bool, +} + +#[embassy_executor::task] +async fn net_task(stack: &'static Stack) -> ! { + stack.run().await +} + +#[embassy_executor::task] +async fn main_task(spawner: Spawner) { + let opts: Opts = Opts::parse(); + + // Init network device + let device = TunTapDevice::new(&opts.tap).unwrap(); + + // Choose between dhcp or static ip + let config = if opts.static_ip { + Config::ipv4_static(embassy_net::StaticConfigV4 { + address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), + dns_servers: Vec::new(), + gateway: Some(Ipv4Address::new(192, 168, 69, 1)), + }) + } else { + Config::dhcpv4(Default::default()) + }; + // Generate random seed + let mut seed = [0; 8]; + OsRng.fill_bytes(&mut seed); + let seed = u64::from_le_bytes(seed); + + // Init network stack + static STACK: StaticCell> = StaticCell::new(); + static RESOURCES: StaticCell> = StaticCell::new(); + let stack = &*STACK.init(Stack::new( + device, + config, + RESOURCES.init(StackResources::<3>::new()), + seed, + )); + + // Launch network task + spawner.spawn(net_task(stack)).unwrap(); + + let mut storage = TufStorage { + root: TUF_ROOT.try_into().unwrap(), + uncommitted_root: Default::default(), + snapshot: Default::default(), + timestamp: Default::default(), + targets: Default::default(), + }; + + let mut transport = Transport { + network_stack: &stack, + server: IpEndpoint::new("192.168.69.100".parse().unwrap(), 50000), + }; + let update_start = + UtcTime::from_date_time(DateTime::new(2024, 1, 1, 0, 0, 0).unwrap()).unwrap(); + debug!("starting repo update"); + tuf_no_std::update_repo_async(&mut storage, &mut transport, 4, update_start) + .await + .expect("failed to update repo"); + debug!("repo update complete"); + let mut rekor_pem = [0u8; 4096]; + debug!("fetching rekor.pem"); + let rekor_pem = tuf_no_std::fetch_and_verify_target_file_async( + &mut storage, + &mut transport, + b"rekor.pub", + &mut rekor_pem, + ) + .await + .unwrap(); + debug!("fetching fulcio.pem"); + let mut fulcio_pem = [0u8; 4096]; + let fulcio_pem = tuf_no_std::fetch_and_verify_target_file_async( + &mut storage, + &mut transport, + b"fulcio.crt.pem", + &mut fulcio_pem, + ) + .await + .unwrap(); + debug!("fetching binary"); + let mut flash = bt2x_ota_common::flash::mock_flash::FsWriter(PathBuf::from("flash-test")); + let (_, hasher) = transport + .fetch_binary_flash::(b"pi-pico-bin", &mut flash) + .await + .unwrap(); + + debug!("fetching signature"); + let mut signature_buf = [0u8; 4096]; + let bundle = transport + .fetch_signature(b"pi-pico-bin.canonical.json", &mut signature_buf) + .await + .unwrap(); + OpenOptions::new() + .create(true) + .truncate(true) + .write(true) + .open("pi-pico-bin.canonical.json") + .unwrap() + .write_all(bundle) + .unwrap(); + debug!("verifying bundle"); + verify_bt( + rekor_pem, + fulcio_pem, + bundle, + hasher, + &[(env!("GITHUB_EMAIL"), "http://dex-idp:8888/")], + ) + .unwrap(); + exit(0) +} + +static EXECUTOR: StaticCell = StaticCell::new(); + +fn main() { + env_logger::builder() + .filter_level(log::LevelFilter::Debug) + .filter_module("async_io", log::LevelFilter::Info) + .format_timestamp_nanos() + .init(); + info!("logging set up"); + let executor = EXECUTOR.init(Executor::new()); + executor.run(|spawner| { + spawner.spawn(main_task(spawner)).unwrap(); + }); +} diff --git a/bt2x-embedded-ffi/.cargo/config.toml b/bt2x-embedded-ffi/.cargo/config.toml new file mode 100644 index 0000000..9efee45 --- /dev/null +++ b/bt2x-embedded-ffi/.cargo/config.toml @@ -0,0 +1,16 @@ +rustflags = [ + # "-C", "linker=flip-link", + # "-C", "link-arg=--nmagic", + # "-C", "link-arg=-Tlink.x", + # "-C", "link-arg=-Tdefmt.x", + # Code-size optimizations. + # trap unreachable can save a lot of space, but requires nightly compiler. + # uncomment the next line if you wish to enable it + "-Z", "trap-unreachable=yes", + "-C", "inline-threshold=5", + "-C", "no-vectorize-loops", +] + +[build] +target = "thumbv6m-none-eabi" + diff --git a/bt2x-embedded-ffi/.dockerignore b/bt2x-embedded-ffi/.dockerignore new file mode 100644 index 0000000..66a6354 --- /dev/null +++ b/bt2x-embedded-ffi/.dockerignore @@ -0,0 +1,16 @@ +### Rust template +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + diff --git a/bt2x-embedded-ffi/.gitignore b/bt2x-embedded-ffi/.gitignore new file mode 100644 index 0000000..66a6354 --- /dev/null +++ b/bt2x-embedded-ffi/.gitignore @@ -0,0 +1,16 @@ +### Rust template +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + diff --git a/bt2x-embedded-ffi/Cargo.toml b/bt2x-embedded-ffi/Cargo.toml new file mode 100644 index 0000000..c303a4e --- /dev/null +++ b/bt2x-embedded-ffi/Cargo.toml @@ -0,0 +1,48 @@ +[package] +name = "bt2x-embedded-ffi" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" + +[profile.dev] +panic = "abort" + +# cargo build/run --release +[profile.release] +panic = "abort" +codegen-units = 1 +debug = false +debug-assertions = false +incremental = false +lto = 'fat' +opt-level = "z" +overflow-checks = false +strip = "symbols" + + +# do not optimize proc-macro crates = faster builds from scratch +[profile.dev.build-override] +codegen-units = 8 +debug = false +debug-assertions = false +opt-level = 0 +overflow-checks = false + +[profile.release.build-override] +codegen-units = 8 +debug = false +debug-assertions = false +opt-level = 0 +overflow-checks = false + +[lib] +crate-type = ["staticlib"] + +[dependencies] +bt2x-embedded = { path = "../bt2x/bt2x-embedded", features = ["no_std"] } +panic-halt = "0.2.0" +embedded-alloc = "0.5.0" +heapless = { version = "0.8" } + +[build-dependencies] +cbindgen = "0.24.0" diff --git a/bt2x-embedded-ffi/LICENSE.txt b/bt2x-embedded-ffi/LICENSE.txt new file mode 100644 index 0000000..4052ad4 --- /dev/null +++ b/bt2x-embedded-ffi/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2024 Fraunhofer AISEC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/bt2x-embedded-ffi/bindings.h b/bt2x-embedded-ffi/bindings.h new file mode 100644 index 0000000..1bb89e5 --- /dev/null +++ b/bt2x-embedded-ffi/bindings.h @@ -0,0 +1,20 @@ +#ifndef BT4OT +#define BT4OT + +typedef struct SubjectIdentity { + const char *identifier; + const char *issuer; +} SubjectIdentity; + +bool verify_bt(const uint8_t *rekor_pub_key, + uintptr_t rekor_pub_key_len, + const uint8_t *root_cert, + uintptr_t root_cert_len, + const uint8_t *bundle, + uintptr_t bundle_len, + const uint8_t *blob, + uintptr_t blob_len, + const struct SubjectIdentity *subject_identities, + uintptr_t subject_identities_len); + +#endif /* BT4OT */ diff --git a/bt2x-embedded-ffi/build.rs b/bt2x-embedded-ffi/build.rs new file mode 100644 index 0000000..ab2d4d7 --- /dev/null +++ b/bt2x-embedded-ffi/build.rs @@ -0,0 +1,17 @@ +extern crate cbindgen; + +use cbindgen::Language; +use std::env; + +fn main() { + let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); + + cbindgen::Builder::new() + .with_no_includes() + .with_language(Language::C) + .with_include_guard("BT4OT") + .with_crate(crate_dir) + .generate() + .expect("Unable to generate bindings") + .write_to_file("bindings.h"); +} diff --git a/bt2x-embedded-ffi/deny.toml b/bt2x-embedded-ffi/deny.toml new file mode 100644 index 0000000..0e169b2 --- /dev/null +++ b/bt2x-embedded-ffi/deny.toml @@ -0,0 +1,237 @@ +# This template contains all of the possible sections and their default values + +# Note that all fields that take a lint level have these possible values: +# * deny - An error will be produced and the check will fail +# * warn - A warning will be produced, but the check will not fail +# * allow - No warning or error will be produced, though in some cases a note +# will be + +# The values provided in this template are the default values that will be used +# when any section or field is not specified in your own configuration + +# Root options + +# The graph table configures how the dependency graph is constructed and thus +# which crates the checks are performed against +[graph] +# If 1 or more target triples (and optionally, target_features) are specified, +# only the specified targets will be checked when running `cargo deny check`. +# This means, if a particular package is only ever used as a target specific +# dependency, such as, for example, the `nix` crate only being used via the +# `target_family = "unix"` configuration, that only having windows targets in +# this list would mean the nix crate, as well as any of its exclusive +# dependencies not shared by any other crates, would be ignored, as the target +# list here is effectively saying which targets you are building for. +targets = [ + # The triple can be any string, but only the target triples built in to + # rustc (as of 1.40) can be checked against actual config expressions + #"x86_64-unknown-linux-musl", + # You can also specify which target_features you promise are enabled for a + # particular target. target_features are currently not validated against + # the actual valid features supported by the target architecture. + #{ triple = "wasm32-unknown-unknown", features = ["atomics"] }, +] +# When creating the dependency graph used as the source of truth when checks are +# executed, this field can be used to prune crates from the graph, removing them +# from the view of cargo-deny. This is an extremely heavy hammer, as if a crate +# is pruned from the graph, all of its dependencies will also be pruned unless +# they are connected to another crate in the graph that hasn't been pruned, +# so it should be used with care. The identifiers are [Package ID Specifications] +# (https://doc.rust-lang.org/cargo/reference/pkgid-spec.html) +#exclude = [] +# If true, metadata will be collected with `--all-features`. Note that this can't +# be toggled off if true, if you want to conditionally enable `--all-features` it +# is recommended to pass `--all-features` on the cmd line instead +all-features = false +# If true, metadata will be collected with `--no-default-features`. The same +# caveat with `all-features` applies +no-default-features = false +# If set, these feature will be enabled when collecting metadata. If `--features` +# is specified on the cmd line they will take precedence over this option. +#features = [] + +# The output table provides options for how/if diagnostics are outputted +[output] +# When outputting inclusion graphs in diagnostics that include features, this +# option can be used to specify the depth at which feature edges will be added. +# This option is included since the graphs can be quite large and the addition +# of features from the crate(s) to all of the graph roots can be far too verbose. +# This option can be overridden via `--feature-depth` on the cmd line +feature-depth = 1 + +# This section is considered when running `cargo deny check advisories` +# More documentation for the advisories section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html +[advisories] +# The path where the advisory databases are cloned/fetched into +#db-path = "$CARGO_HOME/advisory-dbs" +# The url(s) of the advisory databases to use +#db-urls = ["https://github.com/rustsec/advisory-db"] +# A list of advisory IDs to ignore. Note that ignored advisories will still +# output a note when they are encountered. +ignore = [ + #"RUSTSEC-0000-0000", + #{ id = "RUSTSEC-0000-0000", reason = "you can specify a reason the advisory is ignored" }, + #"a-crate-that-is-yanked@0.1.1", # you can also ignore yanked crate versions if you wish + #{ crate = "a-crate-that-is-yanked@0.1.1", reason = "you can specify why you are ignoring the yanked crate" }, +] +# If this is true, then cargo deny will use the git executable to fetch advisory database. +# If this is false, then it uses a built-in git library. +# Setting this to true can be helpful if you have special authentication requirements that cargo-deny does not support. +# See Git Authentication for more information about setting up git authentication. +#git-fetch-with-cli = true + +# This section is considered when running `cargo deny check licenses` +# More documentation for the licenses section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html +[licenses] +# List of explicitly allowed licenses +# See https://spdx.org/licenses/ for list of possible licenses +# [possible values: any SPDX 3.11 short identifier (+ optional exception)]. +allow = [ + "MIT", + "Apache-2.0", + "MPL-2.0", + "Unicode-DFS-2016", + "BSD-3-Clause", +] +# The confidence threshold for detecting a license from license text. +# The higher the value, the more closely the license text must be to the +# canonical license text of a valid SPDX license file. +# [possible values: any between 0.0 and 1.0]. +confidence-threshold = 0.8 +# Allow 1 or more licenses on a per-crate basis, so that particular licenses +# aren't accepted for every possible crate as with the normal allow list +exceptions = [ + # Each entry is the crate and version constraint, and its specific allow + # list + #{ allow = ["Zlib"], crate = "adler32" }, +] + +# Some crates don't have (easily) machine readable licensing information, +# adding a clarification entry for it allows you to manually specify the +# licensing information +#[[licenses.clarify]] +# The package spec the clarification applies to +#crate = "ring" +# The SPDX expression for the license requirements of the crate +#expression = "MIT AND ISC AND OpenSSL" +# One or more files in the crate's source used as the "source of truth" for +# the license expression. If the contents match, the clarification will be used +# when running the license check, otherwise the clarification will be ignored +# and the crate will be checked normally, which may produce warnings or errors +# depending on the rest of your configuration +#license-files = [ +# Each entry is a crate relative path, and the (opaque) hash of its contents +#{ path = "LICENSE", hash = 0xbd0eed23 } +#] + +[licenses.private] +# If true, ignores workspace crates that aren't published, or are only +# published to private registries. +# To see how to mark a crate as unpublished (to the official registry), +# visit https://doc.rust-lang.org/cargo/reference/manifest.html#the-publish-field. +ignore = false +# One or more private registries that you might publish crates to, if a crate +# is only published to private registries, and ignore is true, the crate will +# not have its license(s) checked +registries = [ + #"https://sekretz.com/registry +] + +# This section is considered when running `cargo deny check bans`. +# More documentation about the 'bans' section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html +[bans] +# Lint level for when multiple versions of the same crate are detected +multiple-versions = "warn" +# Lint level for when a crate version requirement is `*` +wildcards = "allow" +# The graph highlighting used when creating dotgraphs for crates +# with multiple versions +# * lowest-version - The path to the lowest versioned duplicate is highlighted +# * simplest-path - The path to the version with the fewest edges is highlighted +# * all - Both lowest-version and simplest-path are used +highlight = "all" +# The default lint level for `default` features for crates that are members of +# the workspace that is being checked. This can be overridden by allowing/denying +# `default` on a crate-by-crate basis if desired. +workspace-default-features = "allow" +# The default lint level for `default` features for external crates that are not +# members of the workspace. This can be overridden by allowing/denying `default` +# on a crate-by-crate basis if desired. +external-default-features = "allow" +# List of crates that are allowed. Use with care! +allow = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason it is allowed" }, +] +# List of crates to deny +deny = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason it is banned" }, + # Wrapper crates can optionally be specified to allow the crate when it + # is a direct dependency of the otherwise banned crate + #{ crate = "ansi_term@0.11.0", wrappers = ["this-crate-directly-depends-on-ansi_term"] }, +] + +# List of features to allow/deny +# Each entry the name of a crate and a version range. If version is +# not specified, all versions will be matched. +#[[bans.features]] +#crate = "reqwest" +# Features to not allow +#deny = ["json"] +# Features to allow +#allow = [ +# "rustls", +# "__rustls", +# "__tls", +# "hyper-rustls", +# "rustls", +# "rustls-pemfile", +# "rustls-tls-webpki-roots", +# "tokio-rustls", +# "webpki-roots", +#] +# If true, the allowed features must exactly match the enabled feature set. If +# this is set there is no point setting `deny` +#exact = true + +# Certain crates/versions that will be skipped when doing duplicate detection. +skip = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason why it can't be updated/removed" }, +] +# Similarly to `skip` allows you to skip certain crates during duplicate +# detection. Unlike skip, it also includes the entire tree of transitive +# dependencies starting at the specified crate, up to a certain depth, which is +# by default infinite. +skip-tree = [ + #"ansi_term@0.11.0", # will be skipped along with _all_ of its direct and transitive dependencies + #{ crate = "ansi_term@0.11.0", depth = 20 }, +] + +# This section is considered when running `cargo deny check sources`. +# More documentation about the 'sources' section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html +[sources] +# Lint level for what to happen when a crate from a crate registry that is not +# in the allow list is encountered +unknown-registry = "warn" +# Lint level for what to happen when a crate from a git repository that is not +# in the allow list is encountered +unknown-git = "warn" +# List of URLs for allowed crate registries. Defaults to the crates.io index +# if not specified. If it is specified but empty, no registries are allowed. +allow-registry = ["https://github.com/rust-lang/crates.io-index"] +# List of URLs for allowed Git repositories +allow-git = [] + +[sources.allow-org] +# github.com organizations to allow git sources for +github = [] +# gitlab.com organizations to allow git sources for +gitlab = [] +# bitbucket.org organizations to allow git sources for +bitbucket = [] diff --git a/bt2x-embedded-ffi/rust-toolchain.toml b/bt2x-embedded-ffi/rust-toolchain.toml new file mode 100644 index 0000000..5d56faf --- /dev/null +++ b/bt2x-embedded-ffi/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "nightly" diff --git a/bt2x-embedded-ffi/src/lib.rs b/bt2x-embedded-ffi/src/lib.rs new file mode 100644 index 0000000..97a5445 --- /dev/null +++ b/bt2x-embedded-ffi/src/lib.rs @@ -0,0 +1,88 @@ +#![no_std] +#![feature(alloc_error_handler)] +#![feature(iterator_try_collect)] +use core::{ + alloc::{GlobalAlloc, Layout}, + ffi::{c_char, CStr}, +}; +use panic_halt as _; + +struct PanicAllocator; + +#[cfg(not(test))] +#[global_allocator] +static GLOBAL: PanicAllocator = PanicAllocator; + +unsafe impl GlobalAlloc for PanicAllocator { + unsafe fn alloc(&self, _layout: Layout) -> *mut u8 { + panic!() + } + + unsafe fn dealloc(&self, _ptr: *mut u8, _layout: Layout) { + panic!() + } +} + +#[alloc_error_handler] +fn foo(_: core::alloc::Layout) -> ! { + panic!() +} + +#[repr(C)] +pub struct SubjectIdentity { + identifier: *const c_char, + issuer: *const c_char, +} + +impl Default for SubjectIdentity { + fn default() -> Self { + Self { + identifier: core::ptr::null(), + issuer: core::ptr::null(), + } + } +} + +#[no_mangle] +pub extern "C" fn verify_bt( + rekor_pub_key: *const u8, + rekor_pub_key_len: usize, + root_cert: *const u8, + root_cert_len: usize, + bundle: *const u8, + bundle_len: usize, + blob: *const u8, + blob_len: usize, + subject_identities: *const SubjectIdentity, + subject_identities_len: usize, +) -> bool { + let rekor_pub_key = unsafe { core::slice::from_raw_parts(rekor_pub_key, rekor_pub_key_len) }; + let root_cert = unsafe { core::slice::from_raw_parts(root_cert, root_cert_len) }; + let bundle = unsafe { core::slice::from_raw_parts(bundle, bundle_len) }; + let blob = unsafe { core::slice::from_raw_parts(blob, blob_len) }; + let subject_identities = + unsafe { core::slice::from_raw_parts(subject_identities, subject_identities_len) }; + let Ok(subject_identities) = subject_identities + .iter() + .map(|s| { + let identifier = unsafe { CStr::from_ptr(s.identifier) }; + let issuer = unsafe { CStr::from_ptr(s.issuer) }; + Ok(( + identifier.to_str().map_err(|_| ())?, + issuer.to_str().map_err(|_| ())?, + )) + }) + .collect::, ()>>() + else { + return false; + }; + + bt2x_embedded::verify_bt( + rekor_pub_key, + root_cert, + bundle, + blob, + subject_identities.as_slice(), + ) + .is_ok() +} diff --git a/bt2x-pi-pico-w/.cargo/config.toml b/bt2x-pi-pico-w/.cargo/config.toml new file mode 100644 index 0000000..07457de --- /dev/null +++ b/bt2x-pi-pico-w/.cargo/config.toml @@ -0,0 +1,30 @@ +[target.'cfg(all(target_arch = "arm", target_os = "none"))'] +# Choose a default "cargo run" tool: +# - probe-run provides flashing and defmt via a hardware debugger +# - cargo embed offers flashing, rtt, defmt and a gdb server via a hardware debugger +# it is configured via the Embed.toml in the root of this project +# - elf2uf2-rs loads firmware over USB when the rp2040 is in boot mode +runner = "probe-rs run --chip RP2040" +#runner = "cargo embed" +# runner = "elf2uf2-rs -d" + +rustflags = [ + #"-C", "linker=flip-link", + #"-C", "link-arg=--nmagic", + #"-C", "link-arg=-Tlink.x", + #"-C", "link-arg=-Tdefmt.x", + + # Code-size optimizations. + # trap unreachable can save a lot of space, but requires nightly compiler. + # uncomment the next line if you wish to enable it + "-Z", "trap-unreachable=yes", + "-C", "inline-threshold=5", + "-C", "no-vectorize-loops", +] + +[build] +target = "thumbv6m-none-eabi" + +[env] +DEFMT_LOG = "debug" + diff --git a/bt2x-pi-pico-w/.dockerignore b/bt2x-pi-pico-w/.dockerignore new file mode 100644 index 0000000..66a6354 --- /dev/null +++ b/bt2x-pi-pico-w/.dockerignore @@ -0,0 +1,16 @@ +### Rust template +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + diff --git a/bt2x-pi-pico-w/.gitignore b/bt2x-pi-pico-w/.gitignore new file mode 100644 index 0000000..b90e600 --- /dev/null +++ b/bt2x-pi-pico-w/.gitignore @@ -0,0 +1,17 @@ +### Rust template +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb +.env + diff --git a/bt2x-pi-pico-w/Cargo.toml b/bt2x-pi-pico-w/Cargo.toml new file mode 100644 index 0000000..9b4d381 --- /dev/null +++ b/bt2x-pi-pico-w/Cargo.toml @@ -0,0 +1,177 @@ +[package] +name = "pico-w-updater" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" + +[[bin]] +path = "src/blinky.rs" +name = "blinky" +license = "Apache-2.0" + +[[bin]] +path = "src/benchmarking/code-size-full.rs" +name = "benchmark-code-size-full" +license = "Apache-2.0" + +[[bin]] +path = "src/benchmarking/code-size-no-tuf.rs" +name = "benchmark-code-size-no-tuf" +license = "Apache-2.0" + +[[bin]] +path = "src/benchmarking/code-size-simple-signature.rs" +name = "benchmark-code-size-signature-only" +license = "Apache-2.0" + +[[bin]] +path = "src/benchmarking/code-size-update-only.rs" +name = "benchmark-code-size-update-only" +license = "Apache-2.0" + +[[bin]] +path = "src/benchmarking/performance.rs" +name = "benchmark-performance" +license = "Apache-2.0" + +[dependencies] +embassy-embedded-hal = { version = "0.1", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180", features = [ + "defmt", +] } +embassy-sync = { version = "0.6", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180", features = [ + "defmt", +] } +embassy-executor = { version = "0.5", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180", features = [ + "nightly", + "arch-cortex-m", + "executor-thread", + "executor-interrupt", + "defmt", + "integrated-timers", + "task-arena-size-16384", +] } +embassy-time = { version = "0.3", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180", features = [ + "defmt", + "defmt-timestamp-uptime", +] } +embassy-rp = { version = "0.1", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180", features = [ + "defmt", + "unstable-pac", + "time-driver", + "critical-section-impl", +] } +embassy-boot-rp = { version = "0.2", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180", features = [ +] } +embassy-usb = { version = "0.2", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180", features = [ + "defmt", +] } +embassy-net = { version = "0.4", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180", features = [ + "defmt", + "tcp", + "udp", + "dhcpv4", + "medium-ethernet", + "dns", +] } +embassy-net-wiznet = { version = "0.1", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180", features = [ + "defmt", +] } +embassy-futures = { version = "0.1", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" } +embassy-usb-logger = { version = "0.2", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" } +cyw43 = { git = "https://github.com/embassy-rs/embassy", features = [ + "defmt", + "firmware-logs", +], rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" } +cyw43-pio = { git = "https://github.com/embassy-rs/embassy", features = [ + "defmt", + "overclock", +], rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" } + +#smoltcp = { version = "0.10.0", default-features = false, features = [ +# "proto-ipv4", +# "socket", +# "async", +#] } + +bt2x-embedded = { path = "../bt2x/bt2x-embedded" } +bt2x-ota-common = { path = "../bt2x/bt2x-ota-common", default-features = false, features = [ + "defmt", +] } +tuf-no-std = { path = "../tuf-no-std/tuf-no-std", default-features = false, features = [ + "der", + "verify", + "ecdsa", + "async", +] } + +embedded-alloc = "0.5.0" +atomic-polyfill = "1.0.3" +ecdsa = { version = "0.16.1", default-features = false } +signature = "2.0.0" +p256 = { version = "0.13.0", default-features = false } +digest = "0.10.6" +serde = { version = "1.0", default-features = false } +serde-json-core = "0.5.0" +reqwless = { version = "0.12.0", default-features = false, features = [ + "defmt", +] } +defmt = "0.3" +defmt-rtt = "0.4" +fixed = "1.23.1" +fixed-macro = "1.2" + +cortex-m = { version = "0.7.6", features = ["inline-asm"] } +cortex-m-rt = "0.7.0" +panic-probe = { version = "0.3", features = ["print-defmt"] } +futures = { version = "0.3.17", default-features = false, features = [ + "async-await", + "cfg-target-has-atomic", + "unstable", +] } +byte-slice-cast = { version = "1.2.0", default-features = false } + +embedded-hal-1 = { package = "embedded-hal", version = "1.0" } +embedded-hal-async = "1.0" +embedded-hal-bus = { version = "0.2.0", features = ["async"] } +embedded-io-async = { version = "0.6", features = ["defmt-03"] } +embedded-storage = { version = "0.3" } +static_cell = { version = "2", features = ["nightly"] } +portable-atomic = { version = "1.5", features = ["critical-section"] } +log = "0.4" +pio-proc = "0.2" +pio = "0.2.1" +rand = { version = "0.8.5", default-features = false } + +[patch.crates-io] + + +[profile.dev] +debug = 2 +debug-assertions = true +opt-level = 1 +overflow-checks = true + +[profile.release] +codegen-units = 1 +debug = 1 +debug-assertions = false +incremental = false +lto = 'fat' +opt-level = 'z' +overflow-checks = false +strip = "symbols" + +# do not optimize proc-macro crates = faster builds from scratch +[profile.dev.build-override] +codegen-units = 8 +debug = false +debug-assertions = false +opt-level = 0 +overflow-checks = false + +[profile.release.build-override] +codegen-units = 1 +debug = false +debug-assertions = false +opt-level = "z" +overflow-checks = false diff --git a/bt2x-pi-pico-w/LICENSE.txt b/bt2x-pi-pico-w/LICENSE.txt new file mode 100644 index 0000000..4052ad4 --- /dev/null +++ b/bt2x-pi-pico-w/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2024 Fraunhofer AISEC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/bt2x-pi-pico-w/README.md b/bt2x-pi-pico-w/README.md new file mode 100644 index 0000000..c5de0d4 --- /dev/null +++ b/bt2x-pi-pico-w/README.md @@ -0,0 +1,52 @@ +# BT²X Example on a Pi Pico W + +This folder contains the source code for the Pi Pico W example. The `main.rs` file contains the updater and the `blinky.rs` file contains the dummy program. + +The WiFi drivers are in the `firmware` directory. The binaries used for benchmarking are in the `src/benchmarking` directory. + +## Building/Flashing + +### Environment variables + +The example application requires a network connection via WiFi. + +To configure the network connection create a `.env` file and source it, it has to set the correct environment variables. It has the following variables: +- `WIFI_NETWORK` +- `WIFI_PASSWORD` +- `OTA_SERVER_PORT`: TCP port of the OTA server, set it to `50000`. +- `OTA_SERVER_HOST`: the network address of the host running the docker setup. +- `GITHUB_EMAIL`: the email address that was used to sign the firmware. + + +### Flashing + +If you have [probe-rs](https://probe.rs/docs/getting-started/installation/) installed and the Pico W is correctly wired to a debug probe you can run the following command to flash binaries. + +```sh +cargo flash --release --bin= --chip RP2040 +``` +#### Flashing the Bootloader + +To run the code you need to flash the bootloader, it is put at the beginning of the flash. +The other applications are flashed at addresses that succeed it, refer to respective `memory.x` files for more details.+ + +You only need to run this command **once**, assuming you do not overwrite the part of the flash that stores the bootloader. + +```sh +cargo flash --manifest-path ../pico-w-bootloader/Cargo.toml --release --chip RP2040 +``` + +#### Flashing the Updater + +```sh +cargo flash --release --bin=pico-w-updater --chip RP2040 +``` + +#### WiFi Drivers + +You also need to flash the WiFi drivers once. If you overwrite the addresses where the drivers are stored you need to flash them again. However, this should not happen with the examples from this repository. + +```sh +probe-rs download 43439A0.bin --binary-format bin --chip RP2040 --base-address 0x10110000 +probe-rs download 43439A0_clm.bin --binary-format bin --chip RP2040 --base-address 0x10150000 +``` \ No newline at end of file diff --git a/bt2x-pi-pico-w/build.rs b/bt2x-pi-pico-w/build.rs new file mode 100644 index 0000000..81539fb --- /dev/null +++ b/bt2x-pi-pico-w/build.rs @@ -0,0 +1,37 @@ +//! This build script copies the `memory.x` file from the crate root into +//! a directory where the linker can always find it at build time. +//! For many projects this is optional, as the linker always searches the +//! project root directory -- wherever `Cargo.toml` is. However, if you +//! are using a workspace or have a more complicated build setup, this +//! build script becomes required. Additionally, by requesting that +//! Cargo re-run the build script whenever `memory.x` is changed, +//! updating `memory.x` ensures a rebuild of the application with the +//! new memory settings. + +use std::env; +use std::fs::File; +use std::io::Write; +use std::path::PathBuf; + +fn main() { + // Put `memory.x` in our output directory and ensure it's + // on the linker search path. + let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); + File::create(out.join("memory.x")) + .unwrap() + .write_all(include_bytes!("memory.x")) + .unwrap(); + println!("cargo:rustc-link-search={}", out.display()); + + // By default, Cargo will re-run a build script whenever + // any file in the project changes. By specifying `memory.x` + // here, we ensure the build script is only re-run when + // `memory.x` is changed. + println!("cargo:rerun-if-changed=memory.x"); + + println!("cargo:rustc-link-arg-bins=--nmagic"); + println!("cargo:rustc-link-arg-bins=-Tlink.x"); + // This is commented out so the bootloader is not overwritten + // println!("cargo:rustc-link-arg-bins=-Tlink-rp.x"); + println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); +} diff --git a/bt2x-pi-pico-w/deny.toml b/bt2x-pi-pico-w/deny.toml new file mode 100644 index 0000000..dfcec68 --- /dev/null +++ b/bt2x-pi-pico-w/deny.toml @@ -0,0 +1,238 @@ +# This template contains all of the possible sections and their default values + +# Note that all fields that take a lint level have these possible values: +# * deny - An error will be produced and the check will fail +# * warn - A warning will be produced, but the check will not fail +# * allow - No warning or error will be produced, though in some cases a note +# will be + +# The values provided in this template are the default values that will be used +# when any section or field is not specified in your own configuration + +# Root options + +# The graph table configures how the dependency graph is constructed and thus +# which crates the checks are performed against +[graph] +# If 1 or more target triples (and optionally, target_features) are specified, +# only the specified targets will be checked when running `cargo deny check`. +# This means, if a particular package is only ever used as a target specific +# dependency, such as, for example, the `nix` crate only being used via the +# `target_family = "unix"` configuration, that only having windows targets in +# this list would mean the nix crate, as well as any of its exclusive +# dependencies not shared by any other crates, would be ignored, as the target +# list here is effectively saying which targets you are building for. +targets = [ + # The triple can be any string, but only the target triples built in to + # rustc (as of 1.40) can be checked against actual config expressions + #"x86_64-unknown-linux-musl", + # You can also specify which target_features you promise are enabled for a + # particular target. target_features are currently not validated against + # the actual valid features supported by the target architecture. + #{ triple = "wasm32-unknown-unknown", features = ["atomics"] }, +] +# When creating the dependency graph used as the source of truth when checks are +# executed, this field can be used to prune crates from the graph, removing them +# from the view of cargo-deny. This is an extremely heavy hammer, as if a crate +# is pruned from the graph, all of its dependencies will also be pruned unless +# they are connected to another crate in the graph that hasn't been pruned, +# so it should be used with care. The identifiers are [Package ID Specifications] +# (https://doc.rust-lang.org/cargo/reference/pkgid-spec.html) +#exclude = [] +# If true, metadata will be collected with `--all-features`. Note that this can't +# be toggled off if true, if you want to conditionally enable `--all-features` it +# is recommended to pass `--all-features` on the cmd line instead +all-features = false +# If true, metadata will be collected with `--no-default-features`. The same +# caveat with `all-features` applies +no-default-features = false +# If set, these feature will be enabled when collecting metadata. If `--features` +# is specified on the cmd line they will take precedence over this option. +#features = [] + +# The output table provides options for how/if diagnostics are outputted +[output] +# When outputting inclusion graphs in diagnostics that include features, this +# option can be used to specify the depth at which feature edges will be added. +# This option is included since the graphs can be quite large and the addition +# of features from the crate(s) to all of the graph roots can be far too verbose. +# This option can be overridden via `--feature-depth` on the cmd line +feature-depth = 1 + +# This section is considered when running `cargo deny check advisories` +# More documentation for the advisories section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html +[advisories] +# The path where the advisory databases are cloned/fetched into +#db-path = "$CARGO_HOME/advisory-dbs" +# The url(s) of the advisory databases to use +#db-urls = ["https://github.com/rustsec/advisory-db"] +# A list of advisory IDs to ignore. Note that ignored advisories will still +# output a note when they are encountered. +ignore = [ + #"RUSTSEC-0000-0000", + #{ id = "RUSTSEC-0000-0000", reason = "you can specify a reason the advisory is ignored" }, + #"a-crate-that-is-yanked@0.1.1", # you can also ignore yanked crate versions if you wish + #{ crate = "a-crate-that-is-yanked@0.1.1", reason = "you can specify why you are ignoring the yanked crate" }, +] +# If this is true, then cargo deny will use the git executable to fetch advisory database. +# If this is false, then it uses a built-in git library. +# Setting this to true can be helpful if you have special authentication requirements that cargo-deny does not support. +# See Git Authentication for more information about setting up git authentication. +#git-fetch-with-cli = true + +# This section is considered when running `cargo deny check licenses` +# More documentation for the licenses section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html +[licenses] +# List of explicitly allowed licenses +# See https://spdx.org/licenses/ for list of possible licenses +# [possible values: any SPDX 3.11 short identifier (+ optional exception)]. +allow = [ + "MIT", + "Apache-2.0", + "Unicode-DFS-2016", + "BSD-3-Clause", + "0BSD", + "CC0-1.0", +] +# The confidence threshold for detecting a license from license text. +# The higher the value, the more closely the license text must be to the +# canonical license text of a valid SPDX license file. +# [possible values: any between 0.0 and 1.0]. +confidence-threshold = 0.8 +# Allow 1 or more licenses on a per-crate basis, so that particular licenses +# aren't accepted for every possible crate as with the normal allow list +exceptions = [ + # Each entry is the crate and version constraint, and its specific allow + # list + #{ allow = ["Zlib"], crate = "adler32" }, +] + +# Some crates don't have (easily) machine readable licensing information, +# adding a clarification entry for it allows you to manually specify the +# licensing information +#[[licenses.clarify]] +# The package spec the clarification applies to +#crate = "ring" +# The SPDX expression for the license requirements of the crate +#expression = "MIT AND ISC AND OpenSSL" +# One or more files in the crate's source used as the "source of truth" for +# the license expression. If the contents match, the clarification will be used +# when running the license check, otherwise the clarification will be ignored +# and the crate will be checked normally, which may produce warnings or errors +# depending on the rest of your configuration +#license-files = [ +# Each entry is a crate relative path, and the (opaque) hash of its contents +#{ path = "LICENSE", hash = 0xbd0eed23 } +#] + +[licenses.private] +# If true, ignores workspace crates that aren't published, or are only +# published to private registries. +# To see how to mark a crate as unpublished (to the official registry), +# visit https://doc.rust-lang.org/cargo/reference/manifest.html#the-publish-field. +ignore = false +# One or more private registries that you might publish crates to, if a crate +# is only published to private registries, and ignore is true, the crate will +# not have its license(s) checked +registries = [ + #"https://sekretz.com/registry +] + +# This section is considered when running `cargo deny check bans`. +# More documentation about the 'bans' section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html +[bans] +# Lint level for when multiple versions of the same crate are detected +multiple-versions = "warn" +# Lint level for when a crate version requirement is `*` +wildcards = "allow" +# The graph highlighting used when creating dotgraphs for crates +# with multiple versions +# * lowest-version - The path to the lowest versioned duplicate is highlighted +# * simplest-path - The path to the version with the fewest edges is highlighted +# * all - Both lowest-version and simplest-path are used +highlight = "all" +# The default lint level for `default` features for crates that are members of +# the workspace that is being checked. This can be overridden by allowing/denying +# `default` on a crate-by-crate basis if desired. +workspace-default-features = "allow" +# The default lint level for `default` features for external crates that are not +# members of the workspace. This can be overridden by allowing/denying `default` +# on a crate-by-crate basis if desired. +external-default-features = "allow" +# List of crates that are allowed. Use with care! +allow = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason it is allowed" }, +] +# List of crates to deny +deny = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason it is banned" }, + # Wrapper crates can optionally be specified to allow the crate when it + # is a direct dependency of the otherwise banned crate + #{ crate = "ansi_term@0.11.0", wrappers = ["this-crate-directly-depends-on-ansi_term"] }, +] + +# List of features to allow/deny +# Each entry the name of a crate and a version range. If version is +# not specified, all versions will be matched. +#[[bans.features]] +#crate = "reqwest" +# Features to not allow +#deny = ["json"] +# Features to allow +#allow = [ +# "rustls", +# "__rustls", +# "__tls", +# "hyper-rustls", +# "rustls", +# "rustls-pemfile", +# "rustls-tls-webpki-roots", +# "tokio-rustls", +# "webpki-roots", +#] +# If true, the allowed features must exactly match the enabled feature set. If +# this is set there is no point setting `deny` +#exact = true + +# Certain crates/versions that will be skipped when doing duplicate detection. +skip = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason why it can't be updated/removed" }, +] +# Similarly to `skip` allows you to skip certain crates during duplicate +# detection. Unlike skip, it also includes the entire tree of transitive +# dependencies starting at the specified crate, up to a certain depth, which is +# by default infinite. +skip-tree = [ + #"ansi_term@0.11.0", # will be skipped along with _all_ of its direct and transitive dependencies + #{ crate = "ansi_term@0.11.0", depth = 20 }, +] + +# This section is considered when running `cargo deny check sources`. +# More documentation about the 'sources' section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html +[sources] +# Lint level for what to happen when a crate from a crate registry that is not +# in the allow list is encountered +unknown-registry = "warn" +# Lint level for what to happen when a crate from a git repository that is not +# in the allow list is encountered +unknown-git = "warn" +# List of URLs for allowed crate registries. Defaults to the crates.io index +# if not specified. If it is specified but empty, no registries are allowed. +allow-registry = ["https://github.com/rust-lang/crates.io-index"] +# List of URLs for allowed Git repositories +allow-git = [] + +[sources.allow-org] +# github.com organizations to allow git sources for +github = [] +# gitlab.com organizations to allow git sources for +gitlab = [] +# bitbucket.org organizations to allow git sources for +bitbucket = [] diff --git a/bt2x-pi-pico-w/firmware/43439A0.bin b/bt2x-pi-pico-w/firmware/43439A0.bin new file mode 100755 index 0000000..b46b3be Binary files /dev/null and b/bt2x-pi-pico-w/firmware/43439A0.bin differ diff --git a/bt2x-pi-pico-w/firmware/43439A0_clm.bin b/bt2x-pi-pico-w/firmware/43439A0_clm.bin new file mode 100755 index 0000000..6e3ba78 Binary files /dev/null and b/bt2x-pi-pico-w/firmware/43439A0_clm.bin differ diff --git a/bt2x-pi-pico-w/firmware/LICENSE-permissive-binary-license-1.0.txt b/bt2x-pi-pico-w/firmware/LICENSE-permissive-binary-license-1.0.txt new file mode 100644 index 0000000..cbb51f9 --- /dev/null +++ b/bt2x-pi-pico-w/firmware/LICENSE-permissive-binary-license-1.0.txt @@ -0,0 +1,49 @@ +Permissive Binary License + +Version 1.0, July 2019 + +Redistribution. Redistribution and use in binary form, without +modification, are permitted provided that the following conditions are +met: + +1) Redistributions must reproduce the above copyright notice and the + following disclaimer in the documentation and/or other materials + provided with the distribution. + +2) Unless to the extent explicitly permitted by law, no reverse + engineering, decompilation, or disassembly of this software is + permitted. + +3) Redistribution as part of a software development kit must include the + accompanying file named �DEPENDENCIES� and any dependencies listed in + that file. + +4) Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +Limited patent license. The copyright holders (and contributors) grant a +worldwide, non-exclusive, no-charge, royalty-free patent license to +make, have made, use, offer to sell, sell, import, and otherwise +transfer this software, where such license applies only to those patent +claims licensable by the copyright holders (and contributors) that are +necessarily infringed by this software. This patent license shall not +apply to any combinations that include this software. No hardware is +licensed hereunder. + +If you institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the software +itself infringes your patent(s), then your rights granted under this +license shall terminate as of the date such litigation is filed. + +DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS." ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT +NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/bt2x-pi-pico-w/firmware/README.md b/bt2x-pi-pico-w/firmware/README.md new file mode 100644 index 0000000..7381fdc --- /dev/null +++ b/bt2x-pi-pico-w/firmware/README.md @@ -0,0 +1,5 @@ +# WiFi firmware + +Firmware obtained from https://github.com/Infineon/wifi-host-driver/tree/master/WiFi_Host_Driver/resources/firmware/COMPONENT_43439 + +Licensed under the [Infineon Permissive Binary License](./LICENSE-permissive-binary-license-1.0.txt) \ No newline at end of file diff --git a/bt2x-pi-pico-w/memory.x b/bt2x-pi-pico-w/memory.x new file mode 100644 index 0000000..2f8434b --- /dev/null +++ b/bt2x-pi-pico-w/memory.x @@ -0,0 +1,27 @@ +MEMORY +{ + /* NOTE 1 K = 1 KiBi = 1024 bytes */ + BOOT2 : ORIGIN = 0x10000000, LENGTH = 0x100 + BOOTLOADER_STATE : ORIGIN = 0x10006000, LENGTH = 4K + FLASH : ORIGIN = 0x10007000, LENGTH = 512K + DFU : ORIGIN = 0x10087000, LENGTH = 516K + + /* Pick one of the two options for RAM layout */ + + /* OPTION A: Use all RAM banks as one big block */ + /* Reasonable, unless you are doing something */ + /* really particular with DMA or other concurrent */ + /* access that would benefit from striping */ + RAM : ORIGIN = 0x20000000, LENGTH = 264K + + /* OPTION B: Keep the unstriped sections separate */ + /* RAM: ORIGIN = 0x20000000, LENGTH = 256K */ + /* SCRATCH_A: ORIGIN = 0x20040000, LENGTH = 4K */ + /* SCRATCH_B: ORIGIN = 0x20041000, LENGTH = 4K */ +} + +__bootloader_state_start = ORIGIN(BOOTLOADER_STATE) - ORIGIN(BOOT2); +__bootloader_state_end = ORIGIN(BOOTLOADER_STATE) + LENGTH(BOOTLOADER_STATE) - ORIGIN(BOOT2); + +__bootloader_dfu_start = ORIGIN(DFU) - ORIGIN(BOOT2); +__bootloader_dfu_end = ORIGIN(DFU) + LENGTH(DFU) - ORIGIN(BOOT2); diff --git a/bt2x-pi-pico-w/random-bytes b/bt2x-pi-pico-w/random-bytes new file mode 100644 index 0000000..8ba68e0 --- /dev/null +++ b/bt2x-pi-pico-w/random-bytes @@ -0,0 +1,3 @@ +fill this file with random bytes as needed +e.g. with: +dd if=/dev/urandom of=random-bytes bs=64K count=4 \ No newline at end of file diff --git a/bt2x-pi-pico-w/rust-toolchain.toml b/bt2x-pi-pico-w/rust-toolchain.toml new file mode 100644 index 0000000..c5d68c3 --- /dev/null +++ b/bt2x-pi-pico-w/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "nightly-2024-06-18" +components = ["rust-src", "rustfmt", "llvm-tools", "miri"] +targets = ["thumbv6m-none-eabi"] diff --git a/bt2x-pi-pico-w/src/benchmarking/code-size-full.rs b/bt2x-pi-pico-w/src/benchmarking/code-size-full.rs new file mode 100644 index 0000000..d90bc5c --- /dev/null +++ b/bt2x-pi-pico-w/src/benchmarking/code-size-full.rs @@ -0,0 +1,253 @@ +//! This example uses the RP Pico W board Wifi chip (cyw43). +//! Connects to specified Wifi network and creates a TCP endpoint on port 1234. + +#![no_std] +#![no_main] +#![feature(type_alias_impl_trait)] +#![feature(async_fn_in_trait)] +#![feature(impl_trait_in_assoc_type)] +#![allow(stable_features, unknown_lints, async_fn_in_trait)] + +use bt2x_embedded::{verify_bt, Sha256}; +use bt2x_ota_common::net::Transport; +use cyw43_pio::PioSpi; +// use defmt::*; +use embassy_boot_rp::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterConfig}; +use embassy_executor::Spawner; +use embassy_net::{Config, IpEndpoint, Stack, StackResources}; +use embassy_rp::bind_interrupts; +use embassy_rp::clocks::RoscRng; +use embassy_rp::flash::Flash; +use embassy_rp::gpio::{Level, Output}; +use embassy_rp::peripherals::{DMA_CH0, PIO0}; +use embassy_rp::pio::{InterruptHandler, Pio}; +use embassy_rp::watchdog::Watchdog; +use embassy_sync::blocking_mutex::Mutex; +use embassy_time::{Duration, Timer}; +use rand::RngCore; +//use embedded_io_async::Write as AsyncIoWrite; +use core::cell::RefCell; +use static_cell::StaticCell; +use tuf_no_std::utils::MemoryStorage; +use tuf_no_std::{DateTime, UtcTime}; +use {defmt_rtt as _, panic_probe as _}; + +use embedded_alloc::Heap; + +bind_interrupts!(struct Irqs { + PIO0_IRQ_0 => InterruptHandler; +}); + +// Dummy values +const WIFI_NETWORK: &str = "the network"; +const WIFI_PASSWORD: &str = "the password"; +const OTA_SERVER_PORT: &str = "5000"; +const OTA_SERVER_HOST: &str = "127.0.0.1"; +const TUF_ROOT: &[u8] = b""; +const FLASH_SIZE: usize = 2 * 1024 * 1024; + +#[embassy_executor::task] +async fn wifi_task( + runner: cyw43::Runner<'static, Output<'static>, PioSpi<'static, PIO0, 0, DMA_CH0>>, +) -> ! { + runner.run().await +} + +#[embassy_executor::task] +async fn net_task(stack: &'static Stack>) -> ! { + stack.run().await +} + +#[embassy_executor::main] +async fn main(spawner: Spawner) { + let p = embassy_rp::init(Default::default()); + { + use core::mem::MaybeUninit; + const HEAP_SIZE: usize = 1024; + static mut HEAP_MEM: [MaybeUninit; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE]; + unsafe { HEAP.init(HEAP_MEM.as_ptr() as usize, HEAP_SIZE) } + } + let mut rng = RoscRng; + let mut watchdog = Watchdog::new(p.WATCHDOG); + watchdog.start(Duration::from_secs(8)); + + //let fw = include_bytes!("../firmware/43439A0.bin"); + //let clm = include_bytes!("../firmware/43439A0_clm.bin"); + + // To make flashing faster for development, you may want to flash the firmwares independently + // at hardcoded addresses, instead of baking them into the program with `include_bytes!`: + // probe-rs download 43439A0.bin --binary-format bin --chip RP2040 --base-address 0x10110000 + // probe-rs download 43439A0_clm.bin --binary-format bin --chip RP2040 --base-address 0x10150000 + let fw = unsafe { core::slice::from_raw_parts(0x10110000 as *const u8, 230321) }; + let clm = unsafe { core::slice::from_raw_parts(0x10150000 as *const u8, 4752) }; + + let pwr = Output::new(p.PIN_23, Level::Low); + let cs = Output::new(p.PIN_25, Level::High); + let mut pio = Pio::new(p.PIO0, Irqs); + let spi = PioSpi::new( + &mut pio.common, + pio.sm0, + pio.irq0, + cs, + p.PIN_24, + p.PIN_29, + p.DMA_CH0, + ); + + static STATE: StaticCell = StaticCell::new(); + let state = STATE.init(cyw43::State::new()); + let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; + spawner.spawn(wifi_task(runner)).unwrap(); + + control.init(clm).await; + control + .set_power_management(cyw43::PowerManagementMode::PowerSave) + .await; + watchdog.feed(); + let config = Config::dhcpv4(Default::default()); + //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 { + // address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), + // dns_servers: Vec::new(), + // gateway: Some(Ipv4Address::new(192, 168, 69, 1)), + //}); + + let seed = rng.next_u64(); + + // Init network stack + static STACK: StaticCell>> = StaticCell::new(); + static RESOURCES: StaticCell> = StaticCell::new(); + let stack = &*STACK.init(Stack::new( + net_device, + config, + RESOURCES.init(StackResources::<2>::new()), + seed, + )); + spawner.spawn(net_task(stack)).unwrap(); + watchdog.feed(); + loop { + //control.join_open(WIFI_NETWORK).await; + match control.join_wpa2(WIFI_NETWORK, WIFI_PASSWORD).await { + Ok(_) => break, + Err(err) => { + panic!("join failed with status={}", err.status); + } + } + } + + // Wait for DHCP, not necessary when using static IP + //info!("waiting for DHCP..."); + while !stack.is_config_up() { + control.gpio_set(0, true).await; + Timer::after_millis(20).await; + watchdog.feed(); + control.gpio_set(0, false).await; + } + //info!("DHCP is now up!"); + + let mut storage = MemoryStorage { + root: TUF_ROOT.try_into().unwrap(), + uncommitted_root: Default::default(), + snapshot: Default::default(), + timestamp: Default::default(), + targets: Default::default(), + }; + + let mut transport = Transport { + network_stack: stack, + server: IpEndpoint::new( + OTA_SERVER_HOST.parse().unwrap(), + OTA_SERVER_PORT.parse().unwrap(), + ), + }; + watchdog.feed(); + + let update_start = + UtcTime::from_date_time(DateTime::new(2024, 1, 1, 0, 0, 0).unwrap()).unwrap(); + tuf_no_std::update_repo_async(&mut storage, &mut transport, 4, update_start) + .await + .expect("failed to update repo"); + + watchdog.feed(); + let mut rekor_pem = [0u8; 4096]; + let rekor_pem = tuf_no_std::fetch_and_verify_target_file_async( + &mut storage, + &mut transport, + b"rekor.pub", + &mut rekor_pem, + ) + .await + .unwrap(); + watchdog.feed(); + let mut fulcio_pem = [0u8; 4096]; + let fulcio_pem = tuf_no_std::fetch_and_verify_target_file_async( + &mut storage, + &mut transport, + b"fulcio.crt.pem", + &mut fulcio_pem, + ) + .await + .unwrap(); + watchdog.feed(); + let mut bundle = [0u8; 4096]; + let bundle = transport + .fetch_signature(b"pi-pico-bin.canonical.json", &mut bundle) + .await + .unwrap(); + watchdog.feed(); + + let flash = Flash::<_, _, FLASH_SIZE>::new_blocking(p.FLASH); + let flash = Mutex::new(RefCell::new(flash)); + + let config = FirmwareUpdaterConfig::from_linkerfile_blocking(&flash, &flash); + let mut aligned = AlignedBuffer([0; 1]); + let mut updater = BlockingFirmwareUpdater::new(config, &mut aligned.0); + let mut dfu = updater.prepare_update().unwrap(); + watchdog.feed(); + + control.gpio_set(0, true).await; + let (_, hasher) = transport + .fetch_binary_flash::(b"pi-pico-bin", &mut dfu) + .await + .unwrap(); + control.gpio_set(0, false).await; + Timer::after_millis(100).await; + control.gpio_set(0, true).await; + + match verify_bt( + rekor_pem, + fulcio_pem, + bundle, + hasher, + &[(env!("GITHUB_EMAIL"), "http://dex-idp:8888/")], + ) { + Ok(_) => {} + Err(_) => loop { + watchdog.feed(); + Timer::after_millis(100).await; + control.gpio_set(0, true).await; + Timer::after_millis(100).await; + control.gpio_set(0, false).await; + }, + } + watchdog.feed(); + control.gpio_set(0, true).await; + let Ok(_) = updater.mark_updated() else { + loop { + watchdog.feed(); + Timer::after_millis(200).await; + control.gpio_set(0, true).await; + Timer::after_millis(200).await; + control.gpio_set(0, false).await; + } + }; + watchdog.feed(); + Timer::after_millis(2000).await; + watchdog.feed(); + Timer::after_millis(2000).await; + watchdog.feed(); + control.gpio_set(0, false).await; + cortex_m::peripheral::SCB::sys_reset(); +} + +#[global_allocator] +static HEAP: Heap = Heap::empty(); diff --git a/bt2x-pi-pico-w/src/benchmarking/code-size-no-tuf.rs b/bt2x-pi-pico-w/src/benchmarking/code-size-no-tuf.rs new file mode 100644 index 0000000..f7cdf9b --- /dev/null +++ b/bt2x-pi-pico-w/src/benchmarking/code-size-no-tuf.rs @@ -0,0 +1,216 @@ +//! This example uses the RP Pico W board Wifi chip (cyw43). +//! Connects to specified Wifi network and creates a TCP endpoint on port 1234. + +#![no_std] +#![no_main] +#![feature(type_alias_impl_trait)] +#![feature(async_fn_in_trait)] +#![feature(impl_trait_in_assoc_type)] +#![allow(stable_features, unknown_lints, async_fn_in_trait)] + +use bt2x_embedded::{verify_bt, Sha256}; +use bt2x_ota_common::net::Transport; +use cyw43_pio::PioSpi; +// use defmt::*; +use embassy_boot_rp::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterConfig}; +use embassy_executor::Spawner; +use embassy_net::{Config, IpEndpoint, Stack, StackResources}; +use embassy_rp::bind_interrupts; +use embassy_rp::clocks::RoscRng; +use embassy_rp::flash::Flash; +use embassy_rp::gpio::{Level, Output}; +use embassy_rp::peripherals::{DMA_CH0, PIO0}; +use embassy_rp::pio::{InterruptHandler, Pio}; +use embassy_rp::watchdog::Watchdog; +use embassy_sync::blocking_mutex::Mutex; +use embassy_time::{Duration, Timer}; +use rand::RngCore; +//use embedded_io_async::Write as AsyncIoWrite; +use core::cell::RefCell; +use static_cell::StaticCell; +use {defmt_rtt as _, panic_probe as _}; + +use embedded_alloc::Heap; + +bind_interrupts!(struct Irqs { + PIO0_IRQ_0 => InterruptHandler; +}); + +// Dummy values +const WIFI_NETWORK: &str = "the network"; +const WIFI_PASSWORD: &str = "the password"; +const OTA_SERVER_PORT: &str = "5000"; +const OTA_SERVER_HOST: &str = "127.0.0.1"; +const FLASH_SIZE: usize = 2 * 1024 * 1024; + +#[embassy_executor::task] +async fn wifi_task( + runner: cyw43::Runner<'static, Output<'static>, PioSpi<'static, PIO0, 0, DMA_CH0>>, +) -> ! { + runner.run().await +} + +#[embassy_executor::task] +async fn net_task(stack: &'static Stack>) -> ! { + stack.run().await +} + +#[embassy_executor::main] +async fn main(spawner: Spawner) { + let p = embassy_rp::init(Default::default()); + { + use core::mem::MaybeUninit; + const HEAP_SIZE: usize = 1024; + static mut HEAP_MEM: [MaybeUninit; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE]; + unsafe { HEAP.init(HEAP_MEM.as_ptr() as usize, HEAP_SIZE) } + } + let mut watchdog = Watchdog::new(p.WATCHDOG); + watchdog.start(Duration::from_secs(8)); + + //let fw = include_bytes!("../firmware/43439A0.bin"); + //let clm = include_bytes!("../firmware/43439A0_clm.bin"); + + // To make flashing faster for development, you may want to flash the firmwares independently + // at hardcoded addresses, instead of baking them into the program with `include_bytes!`: + // probe-rs download 43439A0.bin --binary-format bin --chip RP2040 --base-address 0x10110000 + // probe-rs download 43439A0_clm.bin --binary-format bin --chip RP2040 --base-address 0x10150000 + let fw = unsafe { core::slice::from_raw_parts(0x10110000 as *const u8, 230321) }; + let clm = unsafe { core::slice::from_raw_parts(0x10150000 as *const u8, 4752) }; + + let pwr = Output::new(p.PIN_23, Level::Low); + let cs = Output::new(p.PIN_25, Level::High); + let mut pio = Pio::new(p.PIO0, Irqs); + let spi = PioSpi::new( + &mut pio.common, + pio.sm0, + pio.irq0, + cs, + p.PIN_24, + p.PIN_29, + p.DMA_CH0, + ); + + static STATE: StaticCell = StaticCell::new(); + let state = STATE.init(cyw43::State::new()); + let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; + spawner.spawn(wifi_task(runner)).unwrap(); + + control.init(clm).await; + control + .set_power_management(cyw43::PowerManagementMode::PowerSave) + .await; + watchdog.feed(); + let config = Config::dhcpv4(Default::default()); + //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 { + // address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), + // dns_servers: Vec::new(), + // gateway: Some(Ipv4Address::new(192, 168, 69, 1)), + //}); + + let mut rng = RoscRng; + // Generate random seed + let seed = rng.next_u64(); + + // Init network stack + static STACK: StaticCell>> = StaticCell::new(); + static RESOURCES: StaticCell> = StaticCell::new(); + let stack = &*STACK.init(Stack::new( + net_device, + config, + RESOURCES.init(StackResources::<2>::new()), + seed, + )); + spawner.spawn(net_task(stack)).unwrap(); + watchdog.feed(); + loop { + //control.join_open(WIFI_NETWORK).await; + match control.join_wpa2(WIFI_NETWORK, WIFI_PASSWORD).await { + Ok(_) => break, + Err(err) => { + panic!("join failed with status={}", err.status); + } + } + } + + // Wait for DHCP, not necessary when using static IP + //info!("waiting for DHCP..."); + while !stack.is_config_up() { + control.gpio_set(0, true).await; + Timer::after_millis(20).await; + watchdog.feed(); + control.gpio_set(0, false).await; + } + //info!("DHCP is now up!"); + + let transport = Transport { + network_stack: stack, + server: IpEndpoint::new( + OTA_SERVER_HOST.parse().unwrap(), + OTA_SERVER_PORT.parse().unwrap(), + ), + }; + + watchdog.feed(); + let mut bundle = [0u8; 4096]; + let bundle = transport + .fetch_signature(b"pi-pico-bin.canonical.json", &mut bundle) + .await + .unwrap(); + watchdog.feed(); + + let flash = Flash::<_, _, FLASH_SIZE>::new_blocking(p.FLASH); + let flash = Mutex::new(RefCell::new(flash)); + + let config = FirmwareUpdaterConfig::from_linkerfile_blocking(&flash, &flash); + let mut aligned = AlignedBuffer([0; 1]); + let mut updater = BlockingFirmwareUpdater::new(config, &mut aligned.0); + let mut dfu = updater.prepare_update().unwrap(); + watchdog.feed(); + + control.gpio_set(0, true).await; + let (_, hasher) = transport + .fetch_binary_flash::(b"pi-pico-bin", &mut dfu) + .await + .unwrap(); + control.gpio_set(0, false).await; + Timer::after_millis(100).await; + control.gpio_set(0, true).await; + + match verify_bt( + b"", + b"", + bundle, + hasher, + &[(env!("GITHUB_EMAIL"), "http://dex-idp:8888/")], + ) { + Ok(_) => {} + Err(_) => loop { + watchdog.feed(); + Timer::after_millis(100).await; + control.gpio_set(0, true).await; + Timer::after_millis(100).await; + control.gpio_set(0, false).await; + }, + } + watchdog.feed(); + control.gpio_set(0, true).await; + let Ok(_) = updater.mark_updated() else { + loop { + watchdog.feed(); + Timer::after_millis(200).await; + control.gpio_set(0, true).await; + Timer::after_millis(200).await; + control.gpio_set(0, false).await; + } + }; + watchdog.feed(); + Timer::after_millis(2000).await; + watchdog.feed(); + Timer::after_millis(2000).await; + watchdog.feed(); + control.gpio_set(0, false).await; + cortex_m::peripheral::SCB::sys_reset(); +} + +#[global_allocator] +static HEAP: Heap = Heap::empty(); diff --git a/bt2x-pi-pico-w/src/benchmarking/code-size-simple-signature.rs b/bt2x-pi-pico-w/src/benchmarking/code-size-simple-signature.rs new file mode 100644 index 0000000..70d1d08 --- /dev/null +++ b/bt2x-pi-pico-w/src/benchmarking/code-size-simple-signature.rs @@ -0,0 +1,204 @@ +//! This example uses the RP Pico W board Wifi chip (cyw43). +//! Connects to specified Wifi network and creates a TCP endpoint on port 1234. + +#![no_std] +#![no_main] +#![feature(type_alias_impl_trait)] +#![feature(async_fn_in_trait)] +#![feature(impl_trait_in_assoc_type)] +#![allow(stable_features, unknown_lints, async_fn_in_trait)] + +use bt2x_embedded::Sha256; +use bt2x_ota_common::net::Transport; +use cyw43_pio::PioSpi; +// use defmt::*; +use embassy_boot_rp::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterConfig}; +use embassy_executor::Spawner; +use embassy_net::{Config, IpEndpoint, Stack, StackResources}; +use embassy_rp::bind_interrupts; +use embassy_rp::clocks::RoscRng; +use embassy_rp::flash::Flash; +use embassy_rp::gpio::{Level, Output}; +use embassy_rp::peripherals::{DMA_CH0, PIO0}; +use embassy_rp::pio::{InterruptHandler, Pio}; +use embassy_rp::watchdog::Watchdog; +use embassy_sync::blocking_mutex::Mutex; +use embassy_time::{Duration, Timer}; +use p256::pkcs8::DecodePublicKey; +use rand::RngCore; +use signature::DigestVerifier; +//use embedded_io_async::Write as AsyncIoWrite; +use core::cell::RefCell; +use static_cell::StaticCell; +use {defmt_rtt as _, panic_probe as _}; + +use embedded_alloc::Heap; + +bind_interrupts!(struct Irqs { + PIO0_IRQ_0 => InterruptHandler; +}); + +// Dummy values +const WIFI_NETWORK: &str = "the network"; +const WIFI_PASSWORD: &str = "the password"; +const OTA_SERVER_PORT: &str = "5000"; +const OTA_SERVER_HOST: &str = "127.0.0.1"; +const FLASH_SIZE: usize = 2 * 1024 * 1024; + +#[embassy_executor::task] +async fn wifi_task( + runner: cyw43::Runner<'static, Output<'static>, PioSpi<'static, PIO0, 0, DMA_CH0>>, +) -> ! { + runner.run().await +} + +#[embassy_executor::task] +async fn net_task(stack: &'static Stack>) -> ! { + stack.run().await +} + +#[embassy_executor::main] +async fn main(spawner: Spawner) { + let p = embassy_rp::init(Default::default()); + { + use core::mem::MaybeUninit; + const HEAP_SIZE: usize = 1024; + static mut HEAP_MEM: [MaybeUninit; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE]; + unsafe { HEAP.init(HEAP_MEM.as_ptr() as usize, HEAP_SIZE) } + } + let mut watchdog = Watchdog::new(p.WATCHDOG); + watchdog.start(Duration::from_secs(8)); + + //let fw = include_bytes!("../firmware/43439A0.bin"); + //let clm = include_bytes!("../firmware/43439A0_clm.bin"); + + // To make flashing faster for development, you may want to flash the firmwares independently + // at hardcoded addresses, instead of baking them into the program with `include_bytes!`: + // probe-rs download 43439A0.bin --binary-format bin --chip RP2040 --base-address 0x10110000 + // probe-rs download 43439A0_clm.bin --binary-format bin --chip RP2040 --base-address 0x10150000 + let fw = unsafe { core::slice::from_raw_parts(0x10110000 as *const u8, 230321) }; + let clm = unsafe { core::slice::from_raw_parts(0x10150000 as *const u8, 4752) }; + + let pwr = Output::new(p.PIN_23, Level::Low); + let cs = Output::new(p.PIN_25, Level::High); + let mut pio = Pio::new(p.PIO0, Irqs); + let spi = PioSpi::new( + &mut pio.common, + pio.sm0, + pio.irq0, + cs, + p.PIN_24, + p.PIN_29, + p.DMA_CH0, + ); + + static STATE: StaticCell = StaticCell::new(); + let state = STATE.init(cyw43::State::new()); + let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; + spawner.spawn(wifi_task(runner)).unwrap(); + + control.init(clm).await; + control + .set_power_management(cyw43::PowerManagementMode::PowerSave) + .await; + watchdog.feed(); + let config = Config::dhcpv4(Default::default()); + //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 { + // address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), + // dns_servers: Vec::new(), + // gateway: Some(Ipv4Address::new(192, 168, 69, 1)), + //}); + + let mut rng = RoscRng; + // Generate random seed + let seed = rng.next_u64(); + + // Init network stack + static STACK: StaticCell>> = StaticCell::new(); + static RESOURCES: StaticCell> = StaticCell::new(); + let stack = &*STACK.init(Stack::new( + net_device, + config, + RESOURCES.init(StackResources::<2>::new()), + seed, + )); + spawner.spawn(net_task(stack)).unwrap(); + watchdog.feed(); + loop { + //control.join_open(WIFI_NETWORK).await; + match control.join_wpa2(WIFI_NETWORK, WIFI_PASSWORD).await { + Ok(_) => break, + Err(err) => { + panic!("join failed with status={}", err.status); + } + } + } + + // Wait for DHCP, not necessary when using static IP + //info!("waiting for DHCP..."); + while !stack.is_config_up() { + control.gpio_set(0, true).await; + Timer::after_millis(20).await; + watchdog.feed(); + control.gpio_set(0, false).await; + } + + let transport = Transport { + network_stack: stack, + server: IpEndpoint::new( + OTA_SERVER_HOST.parse().unwrap(), + OTA_SERVER_PORT.parse().unwrap(), + ), + }; + + watchdog.feed(); + let mut bundle = [0u8; 4096]; + // Left in, we assume this has the same code complexity as fetching a regular + let _ = transport + .fetch_signature(b"pi-pico-bin.canonical.json", &mut bundle) + .await + .unwrap(); + watchdog.feed(); + + let flash = Flash::<_, _, FLASH_SIZE>::new_blocking(p.FLASH); + let flash = Mutex::new(RefCell::new(flash)); + + let config = FirmwareUpdaterConfig::from_linkerfile_blocking(&flash, &flash); + let mut aligned = AlignedBuffer([0; 1]); + let mut updater = BlockingFirmwareUpdater::new(config, &mut aligned.0); + let mut dfu = updater.prepare_update().unwrap(); + watchdog.feed(); + + control.gpio_set(0, true).await; + let (_, hasher) = transport + .fetch_binary_flash::(b"pi-pico-bin", &mut dfu) + .await + .unwrap(); + + // Dummy verification + let verifying_key = p256::ecdsa::VerifyingKey::from_public_key_der(&[]).unwrap(); + let signature = p256::ecdsa::DerSignature::from_bytes(&[]).unwrap(); + verifying_key.verify_digest(hasher, &signature).unwrap(); + + watchdog.feed(); + control.gpio_set(0, true).await; + let Ok(_) = updater.mark_updated() else { + loop { + watchdog.feed(); + Timer::after_millis(200).await; + control.gpio_set(0, true).await; + Timer::after_millis(200).await; + control.gpio_set(0, false).await; + } + }; + watchdog.feed(); + Timer::after_millis(2000).await; + watchdog.feed(); + Timer::after_millis(2000).await; + watchdog.feed(); + control.gpio_set(0, false).await; + cortex_m::peripheral::SCB::sys_reset(); +} + +#[global_allocator] +static HEAP: Heap = Heap::empty(); diff --git a/bt2x-pi-pico-w/src/benchmarking/code-size-update-only.rs b/bt2x-pi-pico-w/src/benchmarking/code-size-update-only.rs new file mode 100644 index 0000000..f56cf48 --- /dev/null +++ b/bt2x-pi-pico-w/src/benchmarking/code-size-update-only.rs @@ -0,0 +1,193 @@ +//! This example uses the RP Pico W board Wifi chip (cyw43). +//! Connects to specified Wifi network and creates a TCP endpoint on port 1234. + +#![no_std] +#![no_main] +#![feature(type_alias_impl_trait)] +#![feature(async_fn_in_trait)] +#![feature(impl_trait_in_assoc_type)] +#![allow(stable_features, unknown_lints, async_fn_in_trait)] + +use bt2x_embedded::Sha256; +use bt2x_ota_common::net::Transport; +use cyw43_pio::PioSpi; +// use defmt::*; +use embassy_boot_rp::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterConfig}; +use embassy_executor::Spawner; +use embassy_net::{Config, IpEndpoint, Stack, StackResources}; +use embassy_rp::bind_interrupts; +use embassy_rp::clocks::RoscRng; +use embassy_rp::flash::Flash; +use embassy_rp::gpio::{Level, Output}; +use embassy_rp::peripherals::{DMA_CH0, PIO0}; +use embassy_rp::pio::{InterruptHandler, Pio}; +use embassy_rp::watchdog::Watchdog; +use embassy_sync::blocking_mutex::Mutex; +use embassy_time::{Duration, Timer}; +use rand::RngCore; +//use embedded_io_async::Write as AsyncIoWrite; +use core::cell::RefCell; +use static_cell::StaticCell; +use {defmt_rtt as _, panic_probe as _}; + +use embedded_alloc::Heap; + +bind_interrupts!(struct Irqs { + PIO0_IRQ_0 => InterruptHandler; +}); + +// Dummy values +const WIFI_NETWORK: &str = "the network"; +const WIFI_PASSWORD: &str = "the password"; +const OTA_SERVER_PORT: &str = "5000"; +const OTA_SERVER_HOST: &str = "127.0.0.1"; +const FLASH_SIZE: usize = 2 * 1024 * 1024; + +#[embassy_executor::task] +async fn wifi_task( + runner: cyw43::Runner<'static, Output<'static>, PioSpi<'static, PIO0, 0, DMA_CH0>>, +) -> ! { + runner.run().await +} + +#[embassy_executor::task] +async fn net_task(stack: &'static Stack>) -> ! { + stack.run().await +} + +#[embassy_executor::main] +async fn main(spawner: Spawner) { + let p = embassy_rp::init(Default::default()); + { + use core::mem::MaybeUninit; + const HEAP_SIZE: usize = 1024; + static mut HEAP_MEM: [MaybeUninit; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE]; + unsafe { HEAP.init(HEAP_MEM.as_ptr() as usize, HEAP_SIZE) } + } + let mut watchdog = Watchdog::new(p.WATCHDOG); + watchdog.start(Duration::from_secs(8)); + + //let fw = include_bytes!("../firmware/43439A0.bin"); + //let clm = include_bytes!("../firmware/43439A0_clm.bin"); + + // To make flashing faster for development, you may want to flash the firmwares independently + // at hardcoded addresses, instead of baking them into the program with `include_bytes!`: + // probe-rs download 43439A0.bin --binary-format bin --chip RP2040 --base-address 0x10110000 + // probe-rs download 43439A0_clm.bin --binary-format bin --chip RP2040 --base-address 0x10150000 + let fw = unsafe { core::slice::from_raw_parts(0x10110000 as *const u8, 230321) }; + let clm = unsafe { core::slice::from_raw_parts(0x10150000 as *const u8, 4752) }; + + let pwr = Output::new(p.PIN_23, Level::Low); + let cs = Output::new(p.PIN_25, Level::High); + let mut pio = Pio::new(p.PIO0, Irqs); + let spi = PioSpi::new( + &mut pio.common, + pio.sm0, + pio.irq0, + cs, + p.PIN_24, + p.PIN_29, + p.DMA_CH0, + ); + + static STATE: StaticCell = StaticCell::new(); + let state = STATE.init(cyw43::State::new()); + let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; + spawner.spawn(wifi_task(runner)).unwrap(); + + control.init(clm).await; + control + .set_power_management(cyw43::PowerManagementMode::PowerSave) + .await; + watchdog.feed(); + let config = Config::dhcpv4(Default::default()); + //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 { + // address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), + // dns_servers: Vec::new(), + // gateway: Some(Ipv4Address::new(192, 168, 69, 1)), + //}); + + let mut rng = RoscRng; + // Generate random seed + let seed = rng.next_u64(); + + // Init network stack + static STACK: StaticCell>> = StaticCell::new(); + static RESOURCES: StaticCell> = StaticCell::new(); + let stack = &*STACK.init(Stack::new( + net_device, + config, + RESOURCES.init(StackResources::<2>::new()), + seed, + )); + spawner.spawn(net_task(stack)).unwrap(); + watchdog.feed(); + loop { + //control.join_open(WIFI_NETWORK).await; + match control.join_wpa2(WIFI_NETWORK, WIFI_PASSWORD).await { + Ok(_) => break, + Err(err) => { + panic!("join failed with status={}", err.status); + } + } + } + + // Wait for DHCP, not necessary when using static IP + //info!("waiting for DHCP..."); + while !stack.is_config_up() { + control.gpio_set(0, true).await; + Timer::after_millis(20).await; + watchdog.feed(); + control.gpio_set(0, false).await; + } + + let transport = Transport { + network_stack: stack, + server: IpEndpoint::new( + OTA_SERVER_HOST.parse().unwrap(), + OTA_SERVER_PORT.parse().unwrap(), + ), + }; + + watchdog.feed(); + + let flash = Flash::<_, _, FLASH_SIZE>::new_blocking(p.FLASH); + let flash = Mutex::new(RefCell::new(flash)); + + let config = FirmwareUpdaterConfig::from_linkerfile_blocking(&flash, &flash); + let mut aligned = AlignedBuffer([0; 1]); + let mut updater = BlockingFirmwareUpdater::new(config, &mut aligned.0); + let mut dfu = updater.prepare_update().unwrap(); + watchdog.feed(); + + control.gpio_set(0, true).await; + let (_, _) = transport + .fetch_binary_flash::(b"pi-pico-bin", &mut dfu) + .await + .unwrap(); + control.gpio_set(0, false).await; + Timer::after_millis(100).await; + control.gpio_set(0, true).await; + + watchdog.feed(); + control.gpio_set(0, true).await; + let Ok(_) = updater.mark_updated() else { + loop { + watchdog.feed(); + Timer::after_millis(200).await; + control.gpio_set(0, true).await; + Timer::after_millis(200).await; + control.gpio_set(0, false).await; + } + }; + watchdog.feed(); + Timer::after_millis(2000).await; + watchdog.feed(); + Timer::after_millis(2000).await; + watchdog.feed(); + control.gpio_set(0, false).await; + cortex_m::peripheral::SCB::sys_reset(); +} + +#[global_allocator] +static HEAP: Heap = Heap::empty(); diff --git a/bt2x-pi-pico-w/src/benchmarking/performance.rs b/bt2x-pi-pico-w/src/benchmarking/performance.rs new file mode 100644 index 0000000..1748519 --- /dev/null +++ b/bt2x-pi-pico-w/src/benchmarking/performance.rs @@ -0,0 +1,338 @@ +//! This example uses the RP Pico W board Wifi chip (cyw43). +//! Connects to specified Wifi network and creates a TCP endpoint on port 1234. + +#![no_std] +#![no_main] +#![feature(type_alias_impl_trait)] +#![feature(async_fn_in_trait)] +#![feature(impl_trait_in_assoc_type)] +#![allow(stable_features, unknown_lints, async_fn_in_trait)] + +use bt2x_embedded::{verify_bt, Sha256}; +use bt2x_ota_common::net::Transport; +use cyw43_pio::PioSpi; +// use defmt::*; +use embassy_boot_rp::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterConfig}; +use embassy_executor::Spawner; +use embassy_net::tcp::client::{TcpClient, TcpClientState}; +use embassy_net::{IpEndpoint, Ipv4Address, Ipv4Cidr, Stack, StackResources}; +use embassy_rp::bind_interrupts; +use embassy_rp::clocks::RoscRng; +use embassy_rp::flash::Flash; +use embassy_rp::gpio::{Level, Output}; +use embassy_rp::peripherals::{DMA_CH0, PIO0}; +use embassy_rp::pio::{InterruptHandler, Pio}; +use embassy_rp::watchdog::Watchdog; +use embassy_sync::blocking_mutex::Mutex; +use embassy_time::{Duration, Instant, Timer}; +use rand::RngCore; +use reqwless::request::{Method, RequestBuilder}; +//use embedded_io_async::Write as AsyncIoWrite; +use core::cell::RefCell; +use static_cell::StaticCell; +use tuf_no_std::utils::MemoryStorage; +use tuf_no_std::{DateTime, UtcTime}; +use {defmt_rtt as _, panic_probe as _}; + +use embedded_alloc::Heap; + +use p256::pkcs8::DecodePublicKey; +use signature::DigestVerifier; + +bind_interrupts!(struct Irqs { + PIO0_IRQ_0 => InterruptHandler; +}); + +const WIFI_NETWORK: &str = env!("WIFI_NETWORK"); +const WIFI_PASSWORD: &str = env!("WIFI_PASSWORD"); +const OTA_SERVER_PORT: &str = env!("OTA_SERVER_PORT"); +const OTA_SERVER_HOST: &str = env!("OTA_SERVER_HOST"); +const TUF_ROOT: &[u8] = include_bytes!("../../../build/1.root.der"); +const FLASH_SIZE: usize = 2 * 1024 * 1024; + +const DUMMY_KEY: &[u8] = include_bytes!("key.der"); +const DUMMY_SIGNATURE: &[u8] = include_bytes!("sig.der"); + +#[embassy_executor::task] +async fn wifi_task( + runner: cyw43::Runner<'static, Output<'static>, PioSpi<'static, PIO0, 0, DMA_CH0>>, +) -> ! { + runner.run().await +} + +#[embassy_executor::task] +async fn net_task(stack: &'static Stack>) -> ! { + stack.run().await +} + +#[embassy_executor::main] +async fn main(spawner: Spawner) { + let p = embassy_rp::init(Default::default()); + { + use core::mem::MaybeUninit; + const HEAP_SIZE: usize = 1024; + static mut HEAP_MEM: [MaybeUninit; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE]; + unsafe { HEAP.init(HEAP_MEM.as_ptr() as usize, HEAP_SIZE) } + } + let mut watchdog = Watchdog::new(p.WATCHDOG); + watchdog.start(Duration::from_secs(8)); + + //let fw = include_bytes!("../firmware/43439A0.bin"); + //let clm = include_bytes!("../firmware/43439A0_clm.bin"); + + // To make flashing faster for development, you may want to flash the firmwares independently + // at hardcoded addresses, instead of baking them into the program with `include_bytes!`: + // probe-rs download 43439A0.bin --binary-format bin --chip RP2040 --base-address 0x10110000 + // probe-rs download 43439A0_clm.bin --binary-format bin --chip RP2040 --base-address 0x10150000 + let fw = unsafe { core::slice::from_raw_parts(0x10110000 as *const u8, 230321) }; + let clm = unsafe { core::slice::from_raw_parts(0x10150000 as *const u8, 4752) }; + + let pwr = Output::new(p.PIN_23, Level::Low); + let cs = Output::new(p.PIN_25, Level::High); + let mut pio = Pio::new(p.PIO0, Irqs); + let spi = PioSpi::new( + &mut pio.common, + pio.sm0, + pio.irq0, + cs, + p.PIN_24, + p.PIN_29, + p.DMA_CH0, + ); + + static STATE: StaticCell = StaticCell::new(); + let state = STATE.init(cyw43::State::new()); + let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; + spawner.spawn(wifi_task(runner)).unwrap(); + + control.init(clm).await; + control + .set_power_management(cyw43::PowerManagementMode::PowerSave) + .await; + watchdog.feed(); + //let config = Config::dhcpv4(Default::default()); + let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 { + address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 0, 100), 24), + dns_servers: Default::default(), + gateway: Some(Ipv4Address::new(192, 168, 0, 1)), + }); + + let mut rng = RoscRng; + // Generate random seed + let seed = rng.next_u64(); + + // Init network stack + static STACK: StaticCell>> = StaticCell::new(); + static RESOURCES: StaticCell> = StaticCell::new(); + let stack = &*STACK.init(Stack::new( + net_device, + config, + RESOURCES.init(StackResources::<2>::new()), + seed, + )); + spawner.spawn(net_task(stack)).unwrap(); + watchdog.feed(); + loop { + //control.join_open(WIFI_NETWORK).await; + match control.join_wpa2(WIFI_NETWORK, WIFI_PASSWORD).await { + Ok(_) => break, + Err(err) => { + panic!("join failed with status={}", err.status); + } + } + } + + // Wait for DHCP, not necessary when using static IP + //info!("waiting for DHCP..."); + while !stack.is_config_up() { + control.gpio_set(0, true).await; + Timer::after_millis(20).await; + watchdog.feed(); + control.gpio_set(0, false).await; + } + + let mut storage = MemoryStorage { + root: TUF_ROOT.try_into().unwrap(), + uncommitted_root: Default::default(), + snapshot: Default::default(), + timestamp: Default::default(), + targets: Default::default(), + }; + + let mut transport = Transport { + network_stack: &stack, + server: IpEndpoint::new( + OTA_SERVER_HOST.parse().unwrap(), + OTA_SERVER_PORT.parse().unwrap(), + ), + }; + watchdog.feed(); + + let update_start = + UtcTime::from_date_time(DateTime::new(2024, 1, 1, 0, 0, 0).unwrap()).unwrap(); + let start_total = Instant::now(); + tuf_no_std::update_repo_async(&mut storage, &mut transport, 4, update_start) + .await + .expect("failed to update repo"); + let duration_update_repo = start_total.elapsed(); + watchdog.feed(); + + let start_fetch_sigstore_keys = Instant::now(); + let mut rekor_pem = [0u8; 4096]; + let rekor_pem = tuf_no_std::fetch_and_verify_target_file_async( + &mut storage, + &mut transport, + b"rekor.pub", + &mut rekor_pem, + ) + .await + .unwrap(); + watchdog.feed(); + let mut fulcio_pem = [0u8; 4096]; + let fulcio_pem = tuf_no_std::fetch_and_verify_target_file_async( + &mut storage, + &mut transport, + b"fulcio.crt.pem", + &mut fulcio_pem, + ) + .await + .unwrap(); + let duration_fetch_sigstore_keys = start_fetch_sigstore_keys.elapsed(); + + watchdog.feed(); + let start_fetch_signature = Instant::now(); + let mut bundle = [0u8; 4096]; + let bundle = transport + .fetch_signature(b"pi-pico-bin.canonical.json", &mut bundle) + .await + .unwrap(); + let duration_fetch_signature = start_fetch_signature.elapsed(); + + watchdog.feed(); + + let flash = Flash::<_, _, FLASH_SIZE>::new_blocking(p.FLASH); + let flash = Mutex::new(RefCell::new(flash)); + + let config = FirmwareUpdaterConfig::from_linkerfile_blocking(&flash, &flash); + let mut aligned = AlignedBuffer([0; 1]); + let mut updater = BlockingFirmwareUpdater::new(config, &mut aligned.0); + let mut dfu = updater.prepare_update().unwrap(); + + control.gpio_set(0, true).await; + let start_fetch_binary = Instant::now(); + watchdog.feed(); + let (n, hasher) = transport + .fetch_binary_flash::(b"pi-pico-bin", &mut dfu) + .await + .unwrap(); + watchdog.feed(); + let duration_fetch_binary = start_fetch_binary.elapsed(); + watchdog.feed(); + + let start_verify_binary = Instant::now(); + match verify_bt( + rekor_pem, + fulcio_pem, + bundle, + hasher.clone(), + &[(env!("GITHUB_EMAIL"), "http://dex-idp:8888/")], + ) { + Ok(_) => {} + Err(err) => loop { + watchdog.feed(); + Timer::after_millis(100).await; + control.gpio_set(0, true).await; + Timer::after_millis(100).await; + control.gpio_set(0, false).await; + }, + } + let duration_verify_binary = start_verify_binary.elapsed(); + watchdog.feed(); + + let start_verification_naive = Instant::now(); + let verifying_key = p256::ecdsa::VerifyingKey::from_public_key_der(DUMMY_KEY).unwrap(); + let signature = p256::ecdsa::DerSignature::from_bytes(DUMMY_SIGNATURE).unwrap(); + let _ = verifying_key.verify_digest(hasher, &signature); // result does not matter for performance + let duration_verification_naive = start_verification_naive.elapsed(); + watchdog.feed(); + + let end = Instant::now(); + let benchmark_data = BenchmarkData { + start_time: Some(start_total.as_ticks()), + end_time: Some(end.as_ticks()), + binary_size: Some(n), + fetch_target_files: Some(duration_fetch_sigstore_keys.into()), + update_repo: Some(duration_update_repo.into()), + fetch_signature: Some(duration_fetch_signature.into()), + fetch_binary: Some(duration_fetch_binary.into()), + verify_binary: Some(duration_verify_binary.into()), + verify_binary_naive: Some(duration_verification_naive.into()), + }; + watchdog.feed(); + let mut serialize_buf = [0u8; 2048]; + let n = serde_json_core::to_slice(&benchmark_data, &mut serialize_buf) + .expect("failed to serialize"); + watchdog.feed(); + let data = &serialize_buf[..n]; + let client_state = TcpClientState::<1, 1024, 1024>::new(); + let tcp_client = TcpClient::new(stack, &client_state); + let dns_client = embassy_net::dns::DnsSocket::new(stack); + let mut http_client = reqwless::client::HttpClient::new(&tcp_client, &dns_client); + let url = concat!("http://", env!("OTA_SERVER_HOST"), ":8080/"); + // for non-TLS requests, use this instead: + // let mut http_client = HttpClient::new(&tcp_client, &dns_client); + // let url = "http://worldtimeapi.org/api/timezone/Europe/Berlin"; + watchdog.feed(); + let mut request = match http_client.request(Method::POST, &url).await { + Ok(req) => req, + Err(e) => { + return; // handle the error + } + }; + watchdog.feed(); + let mut rx_buffer = [0; 8192]; + let response = request + .body(data) + .send(&mut rx_buffer) + .await + .unwrap() + .body() + .read_to_end() + .await + .unwrap(); + + watchdog.feed(); + control.gpio_set(0, true).await; + let Ok(_) = updater.mark_updated() else { + loop { + watchdog.feed(); + Timer::after_millis(200).await; + control.gpio_set(0, true).await; + Timer::after_millis(200).await; + control.gpio_set(0, false).await; + } + }; + + Timer::after_millis(3000).await; + watchdog.feed(); + Timer::after_millis(3000).await; + watchdog.feed(); + control.gpio_set(0, false).await; + cortex_m::peripheral::SCB::sys_reset(); +} + +#[global_allocator] +static HEAP: Heap = Heap::empty(); + +#[derive(serde::Deserialize, serde::Serialize, Debug, Default)] +struct BenchmarkData { + start_time: Option, + end_time: Option, + binary_size: Option, + fetch_target_files: Option, + update_repo: Option, + fetch_signature: Option, + fetch_binary: Option, + verify_binary: Option, + verify_binary_naive: Option, +} diff --git a/bt2x-pi-pico-w/src/blinky.rs b/bt2x-pi-pico-w/src/blinky.rs new file mode 100644 index 0000000..8f4b5bb --- /dev/null +++ b/bt2x-pi-pico-w/src/blinky.rs @@ -0,0 +1,86 @@ +//! This example test the RP Pico W on board LED. +//! +//! It does not work with the RP Pico board. See blinky.rs. + +#![no_std] +#![no_main] +#![feature(impl_trait_in_assoc_type)] + +use core::hint::black_box; + +use cyw43_pio::PioSpi; +use defmt::*; +use embassy_executor::Spawner; +use embassy_rp::bind_interrupts; +use embassy_rp::gpio::{Level, Output}; +use embassy_rp::peripherals::{DMA_CH0, PIO0}; +use embassy_rp::pio::{InterruptHandler, Pio}; +use embassy_time::{Duration, Timer}; +use static_cell::StaticCell; +use {defmt_rtt as _, panic_probe as _}; + +bind_interrupts!(struct Irqs { + PIO0_IRQ_0 => InterruptHandler; +}); + +#[embassy_executor::task] +async fn wifi_task( + runner: cyw43::Runner<'static, Output<'static>, PioSpi<'static, PIO0, 0, DMA_CH0>>, +) -> ! { + runner.run().await +} + +const RANDOM_BYTES: &[u8] = include_bytes!("../random-bytes"); + +#[embassy_executor::main] +async fn main(spawner: Spawner) { + let p = embassy_rp::init(Default::default()); + //let fw = include_bytes!("../firmware/43439A0.bin"); + //let clm = include_bytes!("../firmware/43439A0_clm.bin"); + + //let mut watchdog = Watchdog::new(p.WATCHDOG); + //watchdog.start(Duration::from_secs(8)); + //watchdog.feed(); + //Timer::after_secs(5).await; + // To make flashing faster for development, you may want to flash the firmwares independently + // at hardcoded addresses, instead of baking them into the program with `include_bytes!`: + // probe-rs download 43439A0.bin --binary-format bin --chip RP2040 --base-address 0x10108000 + // probe-rs download 43439A0_clm.bin --binary-format bin --chip RP2040 --base-address 0x10150000 + let fw = unsafe { core::slice::from_raw_parts(0x10110000 as *const u8, 230321) }; + let clm = unsafe { core::slice::from_raw_parts(0x10150000 as *const u8, 4752) }; + + let pwr = Output::new(p.PIN_23, Level::Low); + let cs = Output::new(p.PIN_25, Level::High); + let mut pio = Pio::new(p.PIO0, Irqs); + let spi = PioSpi::new( + &mut pio.common, + pio.sm0, + pio.irq0, + cs, + p.PIN_24, + p.PIN_29, + p.DMA_CH0, + ); + + static STATE: StaticCell = StaticCell::new(); + let state = STATE.init(cyw43::State::new()); + let (_net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; + unwrap!(spawner.spawn(wifi_task(runner))); + + control.init(clm).await; + control + .set_power_management(cyw43::PowerManagementMode::PowerSave) + .await; + black_box(RANDOM_BYTES); + let delay = Duration::from_millis(100); + loop { + //watchdog.feed(); + info!("led on!"); + control.gpio_set(0, true).await; + Timer::after(delay).await; + + info!("led off!"); + control.gpio_set(0, false).await; + Timer::after(delay).await; + } +} diff --git a/bt2x-pi-pico-w/src/main.rs b/bt2x-pi-pico-w/src/main.rs new file mode 100644 index 0000000..6ebcb82 --- /dev/null +++ b/bt2x-pi-pico-w/src/main.rs @@ -0,0 +1,252 @@ +//! This example uses the RP Pico W board Wifi chip (cyw43). +//! Connects to specified Wifi network and creates a TCP endpoint on port 1234. + +#![no_std] +#![no_main] +#![feature(type_alias_impl_trait)] +#![feature(async_fn_in_trait)] +#![feature(impl_trait_in_assoc_type)] +#![allow(stable_features, unknown_lints, async_fn_in_trait)] + +use bt2x_embedded::{verify_bt, Sha256}; +use bt2x_ota_common::net::Transport; +use cyw43_pio::PioSpi; +// use defmt::*; +use embassy_boot_rp::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterConfig}; +use embassy_executor::Spawner; +use embassy_net::{IpEndpoint, Ipv4Address, Stack, StackResources}; +use embassy_rp::bind_interrupts; +use embassy_rp::clocks::RoscRng; +use embassy_rp::flash::Flash; +use embassy_rp::gpio::{Level, Output}; +use embassy_rp::peripherals::{DMA_CH0, PIO0}; +use embassy_rp::pio::{InterruptHandler, Pio}; +use embassy_rp::watchdog::Watchdog; +use embassy_sync::blocking_mutex::Mutex; +use embassy_time::{Duration, Timer}; +use rand::RngCore; +//use embedded_io_async::Write as AsyncIoWrite; +use core::cell::RefCell; +use static_cell::StaticCell; +use tuf_no_std::utils::MemoryStorage; +use tuf_no_std::{DateTime, UtcTime}; +use {defmt_rtt as _, panic_probe as _}; + +use embedded_alloc::Heap; + +bind_interrupts!(struct Irqs { + PIO0_IRQ_0 => InterruptHandler; +}); + +const WIFI_NETWORK: &str = env!("WIFI_NETWORK"); +const WIFI_PASSWORD: &str = env!("WIFI_PASSWORD"); +const OTA_SERVER_PORT: &str = env!("OTA_SERVER_PORT"); +const OTA_SERVER_HOST: &str = env!("OTA_SERVER_HOST"); +const TUF_ROOT: &[u8] = include_bytes!("../../build/1.root.der"); +const FLASH_SIZE: usize = 2 * 1024 * 1024; + +#[embassy_executor::task] +async fn wifi_task( + runner: cyw43::Runner<'static, Output<'static>, PioSpi<'static, PIO0, 0, DMA_CH0>>, +) -> ! { + runner.run().await +} + +#[embassy_executor::task] +async fn net_task(stack: &'static Stack>) -> ! { + stack.run().await +} + +#[embassy_executor::main] +async fn main(spawner: Spawner) { + let p = embassy_rp::init(Default::default()); + { + use core::mem::MaybeUninit; + const HEAP_SIZE: usize = 1024; + static mut HEAP_MEM: [MaybeUninit; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE]; + unsafe { HEAP.init(HEAP_MEM.as_ptr() as usize, HEAP_SIZE) } + } + let mut rng = RoscRng; + let mut watchdog = Watchdog::new(p.WATCHDOG); + watchdog.start(Duration::from_secs(8)); + + //let fw = include_bytes!("../firmware/43439A0.bin"); + //let clm = include_bytes!("../firmware/43439A0_clm.bin"); + + // To make flashing faster for development, you may want to flash the firmwares independently + // at hardcoded addresses, instead of baking them into the program with `include_bytes!`: + // probe-rs download 43439A0.bin --binary-format bin --chip RP2040 --base-address 0x10110000 + // probe-rs download 43439A0_clm.bin --binary-format bin --chip RP2040 --base-address 0x10150000 + let fw = unsafe { core::slice::from_raw_parts(0x10110000 as *const u8, 230321) }; + let clm = unsafe { core::slice::from_raw_parts(0x10150000 as *const u8, 4752) }; + + let pwr = Output::new(p.PIN_23, Level::Low); + let cs = Output::new(p.PIN_25, Level::High); + let mut pio = Pio::new(p.PIO0, Irqs); + let spi = PioSpi::new( + &mut pio.common, + pio.sm0, + pio.irq0, + cs, + p.PIN_24, + p.PIN_29, + p.DMA_CH0, + ); + + static STATE: StaticCell = StaticCell::new(); + let state = STATE.init(cyw43::State::new()); + let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; + spawner.spawn(wifi_task(runner)).unwrap(); + + control.init(clm).await; + control + .set_power_management(cyw43::PowerManagementMode::PowerSave) + .await; + watchdog.feed(); + //let config = Config::dhcpv4(Default::default()); + let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 { + address: embassy_net::Ipv4Cidr::new(embassy_net::Ipv4Address::new(192, 168, 0, 100), 24), + dns_servers: Default::default(), + gateway: Some(Ipv4Address::new(192, 168, 0, 1)), + }); + + // Generate random seed + let seed = rng.next_u64(); + + // Init network stack + static STACK: StaticCell>> = StaticCell::new(); + static RESOURCES: StaticCell> = StaticCell::new(); + let stack = &*STACK.init(Stack::new( + net_device, + config, + RESOURCES.init(StackResources::<2>::new()), + seed, + )); + spawner.spawn(net_task(stack)).unwrap(); + watchdog.feed(); + loop { + //control.join_open(WIFI_NETWORK).await; + match control.join_wpa2(WIFI_NETWORK, WIFI_PASSWORD).await { + Ok(_) => break, + Err(err) => { + panic!("join failed with status={}", err.status); + } + } + } + + // Wait for DHCP, not necessary when using static IP + //info!("waiting for DHCP..."); + while !stack.is_config_up() { + control.gpio_set(0, true).await; + Timer::after_millis(20).await; + watchdog.feed(); + control.gpio_set(0, false).await; + } + + let mut storage = MemoryStorage { + root: TUF_ROOT.try_into().unwrap(), + uncommitted_root: Default::default(), + snapshot: Default::default(), + timestamp: Default::default(), + targets: Default::default(), + }; + + let mut transport = Transport { + network_stack: &stack, + server: IpEndpoint::new( + OTA_SERVER_HOST.parse().unwrap(), + OTA_SERVER_PORT.parse().unwrap(), + ), + }; + watchdog.feed(); + + let update_start = + UtcTime::from_date_time(DateTime::new(2024, 1, 1, 0, 0, 0).unwrap()).unwrap(); + tuf_no_std::update_repo_async(&mut storage, &mut transport, 4, update_start) + .await + .expect("failed to update repo"); + + watchdog.feed(); + let mut rekor_pem = [0u8; 4096]; + let rekor_pem = tuf_no_std::fetch_and_verify_target_file_async( + &mut storage, + &mut transport, + b"rekor.pub", + &mut rekor_pem, + ) + .await + .unwrap(); + watchdog.feed(); + let mut fulcio_pem = [0u8; 4096]; + let fulcio_pem = tuf_no_std::fetch_and_verify_target_file_async( + &mut storage, + &mut transport, + b"fulcio.crt.pem", + &mut fulcio_pem, + ) + .await + .unwrap(); + watchdog.feed(); + let mut bundle = [0u8; 4096]; + let bundle = transport + .fetch_signature(b"pi-pico-bin.canonical.json", &mut bundle) + .await + .unwrap(); + watchdog.feed(); + + let flash = Flash::<_, _, FLASH_SIZE>::new_blocking(p.FLASH); + let flash = Mutex::new(RefCell::new(flash)); + + let config = FirmwareUpdaterConfig::from_linkerfile_blocking(&flash, &flash); + let mut aligned = AlignedBuffer([0; 1]); + let mut updater = BlockingFirmwareUpdater::new(config, &mut aligned.0); + let mut dfu = updater.prepare_update().unwrap(); + watchdog.feed(); + + control.gpio_set(0, true).await; + let (_, hasher) = transport + .fetch_binary_flash::(b"pi-pico-bin", &mut dfu) + .await + .unwrap(); + control.gpio_set(0, false).await; + Timer::after_millis(100).await; + control.gpio_set(0, true).await; + + match verify_bt( + rekor_pem, + fulcio_pem, + bundle, + hasher, + &[(env!("GITHUB_EMAIL"), "http://dex-idp:8888/")], + ) { + Ok(_) => {} + Err(_) => loop { + watchdog.feed(); + Timer::after_millis(100).await; + control.gpio_set(0, true).await; + Timer::after_millis(100).await; + control.gpio_set(0, false).await; + }, + } + watchdog.feed(); + control.gpio_set(0, true).await; + let Ok(_) = updater.mark_updated() else { + loop { + watchdog.feed(); + Timer::after_millis(200).await; + control.gpio_set(0, true).await; + Timer::after_millis(200).await; + control.gpio_set(0, false).await; + } + }; + watchdog.feed(); + Timer::after_millis(2000).await; + watchdog.feed(); + Timer::after_millis(2000).await; + watchdog.feed(); + control.gpio_set(0, false).await; + cortex_m::peripheral::SCB::sys_reset(); +} + +#[global_allocator] +static HEAP: Heap = Heap::empty(); diff --git a/bt2x-pi-pico/.cargo/config.toml b/bt2x-pi-pico/.cargo/config.toml new file mode 100644 index 0000000..75a050d --- /dev/null +++ b/bt2x-pi-pico/.cargo/config.toml @@ -0,0 +1,29 @@ +[target.'cfg(all(target_arch = "arm", target_os = "none"))'] +# Choose a default "cargo run" tool: +# - probe-run provides flashing and defmt via a hardware debugger +# - cargo embed offers flashing, rtt, defmt and a gdb server via a hardware debugger +# it is configured via the Embed.toml in the root of this project +# - elf2uf2-rs loads firmware over USB when the rp2040 is in boot mode +# runner = "probe-run --chip RP2040" +# runner = "cargo embed" +runner = "elf2uf2-rs -d" + +rustflags = [ + "-C", "linker=flip-link", + "-C", "link-arg=--nmagic", + "-C", "link-arg=-Tlink.x", + "-C", "link-arg=-Tdefmt.x", + + # Code-size optimizations. + # trap unreachable can save a lot of space, but requires nightly compiler. + # uncomment the next line if you wish to enable it + "-Z", "trap-unreachable=no", + "-C", "inline-threshold=5", + "-C", "no-vectorize-loops", +] + +[build] +target = "thumbv6m-none-eabi" + +[env] +DEFMT_LOG = "debug" diff --git a/bt2x-pi-pico/.dockerignore b/bt2x-pi-pico/.dockerignore new file mode 100644 index 0000000..66a6354 --- /dev/null +++ b/bt2x-pi-pico/.dockerignore @@ -0,0 +1,16 @@ +### Rust template +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + diff --git a/bt2x-pi-pico/.github/workflows/ci_checks.yml b/bt2x-pi-pico/.github/workflows/ci_checks.yml new file mode 100644 index 0000000..b397f4b --- /dev/null +++ b/bt2x-pi-pico/.github/workflows/ci_checks.yml @@ -0,0 +1,66 @@ +name: CI Checks + +on: [push, pull_request] + +env: + CARGO_TERM_COLOR: always + +jobs: + building: + name: Building + continue-on-error: ${{ matrix.experimental || false }} + strategy: + matrix: + # All generated code should be running on stable now + rust: [nightly, stable] + include: + # Nightly is only for reference and allowed to fail + - rust: nightly + experimental: true + os: + # Check compilation works on common OSes + # (i.e. no path issues) + - ubuntu-latest + - macOS-latest + - windows-latest + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + - run: cargo install flip-link + - run: rustup target install --toolchain=${{ matrix.rust }} thumbv6m-none-eabi + - run: cargo build --all + - run: cargo build --all --release + linting: + name: Linting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: clippy + - run: rustup target install thumbv6m-none-eabi + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features -- -D warnings + formatting: + name: Formatting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: rustfmt + - run: rustup target install thumbv6m-none-eabi + - run: cargo fmt -- --check diff --git a/bt2x-pi-pico/.gitignore b/bt2x-pi-pico/.gitignore new file mode 100644 index 0000000..3a0e903 --- /dev/null +++ b/bt2x-pi-pico/.gitignore @@ -0,0 +1,14 @@ +**/*.rs.bk +.#* +.gdb_history +Cargo.lock +target/ + +# editor files +.vscode/* +!.vscode/*.md +!.vscode/*.svd +!.vscode/launch.json +!.vscode/tasks.json +!.vscode/extensions.json +!.vscode/settings.json \ No newline at end of file diff --git a/bt2x-pi-pico/.vscode/launch.json b/bt2x-pi-pico/.vscode/launch.json new file mode 100644 index 0000000..45a2207 --- /dev/null +++ b/bt2x-pi-pico/.vscode/launch.json @@ -0,0 +1,45 @@ +// The format of this file is specified in https://probe.rs/docs/tools/vscode/#start-a-debug-session-with-minimum-configuration +{ + "version": "0.2.0", + "configurations": [ + { + "preLaunchTask": "rust: cargo build", + "type": "probe-rs-debug", + "request": "launch", + "name": "rp2040-project", + "cwd": "${workspaceFolder}", + "chip": "rp2040", + // RP2040 doesn't support connectUnderReset + "connectUnderReset": false, + "speed": 4000, + "runtimeExecutable": "probe-rs-debugger", + "runtimeArgs": [ + "debug" + ], + "flashingConfig": { + "flashingEnabled": true, + "resetAfterFlashing": true, + "haltAfterReset": true, + }, + "coreConfigs": [ + { + "coreIndex": 0, + "programBinary": "target/thumbv6m-none-eabi/debug/rp2040-project-template", + "chip": "RP2040", + // Uncomment this if you've downloaded the SVD from + // https://github.com/raspberrypi/pico-sdk/raw/1.3.1/src/rp2040/hardware_regs/rp2040.svd + // and placed it in the .vscode directory + // "svdFile": "./.vscode/rp2040.svd", + "rttEnabled": true, + "options": { + "env": { + "DEFMT_LOG": "debug" + } + }, + } + ], + "consoleLogLevel": "Info", //Error, Warn, Info, Debug, Trace + "wireProtocol": "Swd" + } + ] +} \ No newline at end of file diff --git a/bt2x-pi-pico/.vscode/settings.json b/bt2x-pi-pico/.vscode/settings.json new file mode 100644 index 0000000..5234c64 --- /dev/null +++ b/bt2x-pi-pico/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "rust-analyzer.cargo.target": "thumbv6m-none-eabi", + "rust-analyzer.checkOnSave.allTargets": false, + "editor.formatOnSave": true +} \ No newline at end of file diff --git a/bt2x-pi-pico/Cargo.toml b/bt2x-pi-pico/Cargo.toml new file mode 100644 index 0000000..899c7bd --- /dev/null +++ b/bt2x-pi-pico/Cargo.toml @@ -0,0 +1,83 @@ +[package] +edition = "2021" +name = "rp2040-project-template" +version = "0.1.0" + +[dependencies] +cortex-m = "0.7" +cortex-m-rt = "0.7" +embedded-hal = { version = "0.2.5", features = ["unproven"] } + +defmt = "0.3" +defmt-rtt = "0.4" +panic-probe = { version = "0.3", features = ["print-defmt"] } + +# We're using a Pico by default on this template +rp-pico = "0.7" + +embedded-alloc = "0.5.0" + +bt2x-embedded = { path = "../bt2x/bt2x-embedded" } +serde = { version = "1.0", default-features = false, features = ["derive"] } +# serde_json = { version = "1.0", default-features = false, features = ["alloc"] } +serde-json-core = { version = "0.5.0" } + +# but you can use any BSP. Uncomment this to use the pro_micro_rp2040 BSP instead +# sparkfun-pro-micro-rp2040 = "0.3" + +# If you're not going to use a Board Support Package you'll need these: +# rp2040-hal = { version="0.8", features=["rt"] } +# rp2040-boot2 = "0.2" + +# cargo build/run +[profile.dev] +codegen-units = 1 +debug = 2 +debug-assertions = true +incremental = false +opt-level = 3 +overflow-checks = true + +# cargo build/run --release +[profile.release] +codegen-units = 1 +debug = 2 +debug-assertions = false +incremental = false +lto = 'fat' +opt-level = 3 +overflow-checks = false +strip = true + +# do not optimize proc-macro crates = faster builds from scratch +[profile.dev.build-override] +codegen-units = 8 +debug = false +debug-assertions = false +opt-level = 0 +overflow-checks = false + +[profile.release.build-override] +codegen-units = 8 +debug = false +debug-assertions = false +opt-level = 0 +overflow-checks = false + +# cargo test +[profile.test] +codegen-units = 1 +debug = 2 +debug-assertions = true +incremental = false +opt-level = 3 +overflow-checks = true + +# cargo test --release +[profile.bench] +codegen-units = 1 +debug = 2 +debug-assertions = false +incremental = false +lto = 'fat' +opt-level = 3 diff --git a/bt2x-pi-pico/Embed.toml b/bt2x-pi-pico/Embed.toml new file mode 100644 index 0000000..9c91b13 --- /dev/null +++ b/bt2x-pi-pico/Embed.toml @@ -0,0 +1,39 @@ +[default.probe] +protocol = "Swd" +speed = 20000 +# If you only have one probe cargo embed will pick automatically +# Otherwise: add your probe's VID/PID/serial to filter + +## rust-dap +# usb_vid = "6666" +# usb_pid = "4444" +# serial = "test" + + +[default.flashing] +enabled = true + +[default.reset] +enabled = true +halt_afterwards = false + +[default.general] +chip = "RP2040" +log_level = "WARN" +# RP2040 does not support connect_under_reset +connect_under_reset = false + +[default.rtt] +enabled = true +up_mode = "NoBlockSkip" +channels = [ + { up = 0, down = 0, name = "name", up_mode = "NoBlockSkip", format = "Defmt" }, +] +timeout = 3000 +show_timestamps = true +log_enabled = false +log_path = "./logs" + +[default.gdb] +enabled = false +gdb_connection_string = "127.0.0.1:2345" diff --git a/bt2x-pi-pico/README.md b/bt2x-pi-pico/README.md new file mode 100644 index 0000000..d774c93 --- /dev/null +++ b/bt2x-pi-pico/README.md @@ -0,0 +1,267 @@ +# Project template for rp2040-hal + +This template is intended as a starting point for developing your own firmware based on the rp2040-hal. + +It includes all of the `knurling-rs` tooling as showcased in https://github.com/knurling-rs/app-template (`defmt`, `defmt-rtt`, `panic-probe`, `flip-link`) to make development as easy as possible. + +`probe-run` is configured as the default runner, so you can start your program as easy as +```sh +cargo run --release +``` + +If you aren't using a debugger (or want to use cargo-embed/probe-rs-debugger), check out [alternative runners](#alternative-runners) for other options + + +
+ +

Table of Contents

+
    +
  1. Requirements
  2. +
  3. Installation of development dependencies
  4. +
  5. Running
  6. +
  7. Alternative runners
  8. +
  9. Roadmap
  10. +
  11. Contributing
  12. +
  13. Code of conduct
  14. +
  15. License
  16. +
  17. Contact
  18. +
+
+ + +
+

Requirements

+ +- The standard Rust tooling (cargo, rustup) which you can install from https://rustup.rs/ + +- Toolchain support for the cortex-m0+ processors in the rp2040 (thumbv6m-none-eabi) + +- flip-link - this allows you to detect stack-overflows on the first core, which is the only supported target for now. + +- probe-run. Upstream support for RP2040 was added with version 0.3.1. + +- A CMSIS-DAP probe. (J-Link and other probes will not work with probe-run) + + You can use a second + [Pico as a CMSIS-DAP debug probe](debug_probes.md#raspberry-pi-pico). Details + on other supported debug probes can be found in + [debug_probes.md](debug_probes.md) + +
+ + +
+

Installation of development dependencies

+ +```sh +rustup target install thumbv6m-none-eabi +cargo install flip-link +# This is our suggested default 'runner' +cargo install probe-run +# If you want to use elf2uf2-rs instead of probe-run, instead do... +cargo install elf2uf2-rs --locked +``` + +
+ + + +
+

Running

+ +For a debug build +```sh +cargo run +``` +For a release build +```sh +cargo run --release +``` + +If you do not specify a DEFMT_LOG level, it will be set to `debug`. +That means `println!("")`, `info!("")` and `debug!("")` statements will be printed. +If you wish to override this, you can change it in `.cargo/config.toml` +```toml +[env] +DEFMT_LOG = "off" +``` +You can also set this inline (on Linux/MacOS) +```sh +DEFMT_LOG=trace cargo run +``` + +or set the _environment variable_ so that it applies to every `cargo run` call that follows: +#### Linux/MacOS/unix +```sh +export DEFMT_LOG=trace +``` + +Setting the DEFMT_LOG level for the current session +for bash +```sh +export DEFMT_LOG=trace +``` + +#### Windows +Windows users can only override DEFMT_LOG through `config.toml` +or by setting the environment variable as a separate step before calling `cargo run` +- cmd +```cmd +set DEFMT_LOG=trace +``` +- powershell +```ps1 +$Env:DEFMT_LOG = trace +``` + +```cmd +cargo run +``` + +
+ +
+

Alternative runners

+ +If you don't have a debug probe or if you want to do interactive debugging you can set up an alternative runner for cargo. + +Some of the options for your `runner` are listed below: + +* **cargo embed** + *Step 1* - Install [`cargo embed`](https://github.com/probe-rs/probe-rs/blob/master/cargo-embed): + + ```console + $ cargo install cargo-embed + ``` + + *Step 2* - Make sure your .cargo/config contains the following + + ```toml + [target.thumbv6m-none-eabi] + runner = "cargo embed" + ``` + + *Step 3* - Update settings in [Embed.toml](./Embed.toml) + - The defaults are to flash, reset, and start a defmt logging session + You can find all the settings and their meanings [in the cargo-embed repo](https://github.com/probe-rs/probe-rs/blob/master/cargo-embed/src/config/default.toml) + + *Step 4* - Use `cargo run`, which will compile the code and start the + specified 'runner'. As the 'runner' is cargo embed, it will flash the device + and start running immediately + + ```console + $ cargo run --release + ``` + +* **probe-rs-debugger** + + *Step 1* - Download [`probe-rs-debugger VSCode plugin 0.4.0`](https://github.com/probe-rs/vscode/releases/download/v0.4.0/probe-rs-debugger-0.4.0.vsix) + + *Step 2* - Install `probe-rs-debugger VSCode plugin` + ```console + $ code --install-extension probe-rs-debugger-0.4.0.vsix + ``` + + *Step 3* - Install `probe-rs-debugger` + ```console + $ cargo install probe-rs-debugger + ``` + + *Step 4* - Open this project in VSCode + + *Step 5* - Launch a debug session by choosing `Run`>`Start Debugging` (or press F5) + +* **Loading a UF2 over USB** + *Step 1* - Install [`elf2uf2-rs`](https://github.com/JoNil/elf2uf2-rs): + + ```console + $ cargo install elf2uf2-rs --locked + ``` + + *Step 2* - Make sure your .cargo/config contains the following + + ```toml + [target.thumbv6m-none-eabi] + runner = "elf2uf2-rs -d" + ``` + + The `thumbv6m-none-eabi` target may be replaced by the all-Arm wildcard + `'cfg(all(target_arch = "arm", target_os = "none"))'`. + + *Step 3* - Boot your RP2040 into "USB Bootloader mode", typically by rebooting + whilst holding some kind of "Boot Select" button. On Linux, you will also need + to 'mount' the device, like you would a USB Thumb Drive. + + *Step 4* - Use `cargo run`, which will compile the code and start the + specified 'runner'. As the 'runner' is the elf2uf2-rs tool, it will build a UF2 + file and copy it to your RP2040. + + ```console + $ cargo run --release + ``` + +* **Loading with picotool** + As ELF files produced by compiling Rust code are completely compatible with ELF + files produced by compiling C or C++ code, you can also use the Raspberry Pi + tool [picotool](https://github.com/raspberrypi/picotool). The only thing to be + aware of is that picotool expects your ELF files to have a `.elf` extension, and + by default Rust does not give the ELF files any extension. You can fix this by + simply renaming the file. + + This means you can't easily use it as a cargo runner - yet. + + Also of note is that the special + [pico-sdk](https://github.com/raspberrypi/pico-sdk) macros which hide + information in the ELF file in a way that `picotool info` can read it out, are + not supported in Rust. An alternative is TBC. + +
+ + + +## Roadmap + +NOTE These packages are under active development. As such, it is likely to +remain volatile until a 1.0.0 release. + +See the [open issues](https://github.com/rp-rs/rp2040-project-template/issues) for a list of +proposed features (and known issues). + +## Contributing + +Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**. + +The steps are: + +1. Fork the Project by clicking the 'Fork' button at the top of the page. +2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) +3. Make some changes to the code or documentation. +4. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) +5. Push to the Feature Branch (`git push origin feature/AmazingFeature`) +6. Create a [New Pull Request](https://github.com/rp-rs/rp-hal/pulls) +7. An admin will review the Pull Request and discuss any changes that may be required. +8. Once everyone is happy, the Pull Request can be merged by an admin, and your work is part of our project! + +## Code of Conduct + +Contribution to this crate is organized under the terms of the [Rust Code of +Conduct][CoC], and the maintainer of this crate, the [rp-rs team], promises +to intervene to uphold that code of conduct. + +[CoC]: CODE_OF_CONDUCT.md +[rp-rs team]: https://github.com/orgs/rp-rs/teams/rp-rs + +## License + +The contents of this repository are dual-licensed under the _MIT OR Apache +2.0_ License. That means you can chose either the MIT licence or the +Apache-2.0 licence when you re-use this code. See `MIT` or `APACHE2.0` for more +information on each specific licence. + +Any submissions to this project (e.g. as Pull Requests) must be made available +under these terms. + +## Contact + +Raise an issue: [https://github.com/rp-rs/rp2040-project-template/issues](https://github.com/rp-rs/rp2040-project-template/issues) +Chat to us on Matrix: [#rp-rs:matrix.org](https://matrix.to/#/#rp-rs:matrix.org) diff --git a/bt2x-pi-pico/build.rs b/bt2x-pi-pico/build.rs new file mode 100644 index 0000000..d534cc3 --- /dev/null +++ b/bt2x-pi-pico/build.rs @@ -0,0 +1,31 @@ +//! This build script copies the `memory.x` file from the crate root into +//! a directory where the linker can always find it at build time. +//! For many projects this is optional, as the linker always searches the +//! project root directory -- wherever `Cargo.toml` is. However, if you +//! are using a workspace or have a more complicated build setup, this +//! build script becomes required. Additionally, by requesting that +//! Cargo re-run the build script whenever `memory.x` is changed, +//! updating `memory.x` ensures a rebuild of the application with the +//! new memory settings. + +use std::env; +use std::fs::File; +use std::io::Write; +use std::path::PathBuf; + +fn main() { + // Put `memory.x` in our output directory and ensure it's + // on the linker search path. + let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); + File::create(out.join("memory.x")) + .unwrap() + .write_all(include_bytes!("memory.x")) + .unwrap(); + println!("cargo:rustc-link-search={}", out.display()); + + // By default, Cargo will re-run a build script whenever + // any file in the project changes. By specifying `memory.x` + // here, we ensure the build script is only re-run when + // `memory.x` is changed. + println!("cargo:rerun-if-changed=memory.x"); +} diff --git a/bt2x-pi-pico/debug_probes.md b/bt2x-pi-pico/debug_probes.md new file mode 100644 index 0000000..830446f --- /dev/null +++ b/bt2x-pi-pico/debug_probes.md @@ -0,0 +1,47 @@ +# Compatible CMSIS-DAP debug probes + +## Raspberry Pi Pico + +You can use a second Pico as your debugger. + +Download one of these firmware files: + +- [picoprobe.uf2](https://github.com/raspberrypi/picoprobe/releases/download/picoprobe-cmsis-v1.0.1/picoprobe.uf2) - + Official raspberrypi probe firmware supporting CMSIS-DAP. +- [raspberry_pi_pico-DapperMime.uf2](https://github.com/majbthrd/DapperMime/releases/download/20210225/raspberry_pi_pico-DapperMime.uf2) - + Based upon an older version of the CMSIS-DAP sources. +- [rust-dap-pico-ramexec-setclock.uf2](https://raw.githubusercontent.com/9names/binary-bits/main/rust-dap-pico-ramexec-setclock.uf2) - + If you have good wiring between your Pico's, this firmware will give faster + programming. + +Then: + +1. Put the Pico into USB Mass Storage Mode by holding the BOOTSEL button while connecting it to your computer with a USB cable +2. Open the drive RPI-RP2 when prompted +3. Copy the uf2 firmware file from Downloads into RPI-RP2 +4. Connect the debug pins of your CMSIS-DAP Pico to the target one + - Connect GP2 on the Probe to SWCLK on the Target + - Connect GP3 on the Probe to SWDIO on the Target + - Connect a ground line from the CMSIS-DAP Probe to the Target too + +## WeAct MiniF4 +https://therealprof.github.io/blog/usb-c-pill-part1/ + +## HS-Probe +https://github.com/probe-rs/hs-probe + +## ST-LINK v2 clone +It's getting harder to source these with stm32f103's as time goes on, so you might be better off choosing a stm32f103 dev board + +Firmware: https://github.com/devanlai/dap42 + +## LPC-Link2 +https://www.nxp.com/design/microcontrollers-developer-resources/lpc-link2:OM13054 + +## MCU-Link +https://www.nxp.com/part/MCU-LINK#/ + +## DAPLink +You can use DAPLink firmware with any of it's supported chips (LPC4322, LPC11U35, K20, K22, KL26). You'll need to use the 'develop' branch to use GCC to build it. You'll need to find a chip with the correct + +Firmware source: https://github.com/ARMmbed/DAPLink/tree/develop diff --git a/bt2x-pi-pico/memory.x b/bt2x-pi-pico/memory.x new file mode 100644 index 0000000..070eac7 --- /dev/null +++ b/bt2x-pi-pico/memory.x @@ -0,0 +1,15 @@ +MEMORY { + BOOT2 : ORIGIN = 0x10000000, LENGTH = 0x100 + FLASH : ORIGIN = 0x10000100, LENGTH = 2048K - 0x100 + RAM : ORIGIN = 0x20000000, LENGTH = 256K +} + +EXTERN(BOOT2_FIRMWARE) + +SECTIONS { + /* ### Boot loader */ + .boot2 ORIGIN(BOOT2) : + { + KEEP(*(.boot2)); + } > BOOT2 +} INSERT BEFORE .text; \ No newline at end of file diff --git a/bt2x-pi-pico/rust-toolchain.toml b/bt2x-pi-pico/rust-toolchain.toml new file mode 100644 index 0000000..e437953 --- /dev/null +++ b/bt2x-pi-pico/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "nightly" +targets = [ "thumbv6m-none-eabi" ] diff --git a/bt2x-pi-pico/src/main.rs b/bt2x-pi-pico/src/main.rs new file mode 100644 index 0000000..fa14df5 --- /dev/null +++ b/bt2x-pi-pico/src/main.rs @@ -0,0 +1,101 @@ +//! Blinks the LED on a Pico board +//! +//! This will blink an LED attached to GP25, which is the pin the Pico uses for the on-board LED. +#![no_std] +#![no_main] + +use embedded_alloc::Heap; + +#[global_allocator] +static HEAP: Heap = Heap::empty(); + +use bsp::entry; +use defmt::*; +use defmt_rtt as _; +use embedded_hal::digital::v2::OutputPin; +use panic_probe as _; + +// Provide an alias for our BSP so we can switch targets quickly. +// Uncomment the BSP you included in Cargo.toml, the rest of the code does not need to change. +use rp_pico as bsp; +// use sparkfun_pro_micro_rp2040 as bsp; + +use bsp::hal::{ + clocks::{init_clocks_and_plls, Clock}, + pac, + sio::Sio, + watchdog::Watchdog, +}; +use bt2x_embedded::verify_bt; + +#[entry] +fn main() -> ! { + info!("Program start"); + + let mut pac = pac::Peripherals::take().unwrap(); + let core = pac::CorePeripherals::take().unwrap(); + let mut watchdog = Watchdog::new(pac.WATCHDOG); + let sio = Sio::new(pac.SIO); + + // External high-speed crystal on the pico board is 12Mhz + let external_xtal_freq_hz = 12_000_000u32; + let clocks = init_clocks_and_plls( + external_xtal_freq_hz, + pac.XOSC, + pac.CLOCKS, + pac.PLL_SYS, + pac.PLL_USB, + &mut pac.RESETS, + &mut watchdog, + ) + .ok() + .unwrap(); + + let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().to_Hz()); + + let pins = bsp::Pins::new( + pac.IO_BANK0, + pac.PADS_BANK0, + sio.gpio_bank0, + &mut pac.RESETS, + ); + + // This is the correct pin on the Raspberry Pico board. On other boards, even if they have an + // on-board LED, it might need to be changed. + // Notably, on the Pico W, the LED is not connected to any of the RP2040 GPIOs but to the cyw43 module instead. If you have + // a Pico W and want to toggle a LED with a simple GPIO output pin, you can connect an external + // LED to one of the GPIO pins, and reference that pin here. + let mut led_pin = pins.led.into_push_pull_output(); + info!("on!"); + led_pin.set_high().unwrap(); + let result = verify_bt( + b"../../example/rekor.pem", + b"../../example/fulcio.pem", + b"../../example/hello-world.bundle.json", + b"../../example/hello-world.wasm", + &[], + ); + + led_pin.set_low().unwrap(); + let bundle = if let Ok(bundle) = result { + bundle + } else { + loop { + info!("on!"); + led_pin.set_high().unwrap(); + delay.delay_ms(500); + info!("off!"); + led_pin.set_low().unwrap(); + delay.delay_ms(500); + } + }; + for i in 0..(10) { + info!("on!"); + led_pin.set_high().unwrap(); + delay.delay_ms(1000 / 30); + info!("off!"); + led_pin.set_low().unwrap(); + delay.delay_ms(1000 / 30); + } + loop {} +} diff --git a/bt2x/.dockerignore b/bt2x/.dockerignore new file mode 100644 index 0000000..66a6354 --- /dev/null +++ b/bt2x/.dockerignore @@ -0,0 +1,16 @@ +### Rust template +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + diff --git a/bt2x/.gitignore b/bt2x/.gitignore new file mode 100644 index 0000000..fb3dec9 --- /dev/null +++ b/bt2x/.gitignore @@ -0,0 +1,19 @@ +### Rust template +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + +/.out/pi-pico-elf2 +/.out/pi-pico-elf2.canonical.json +/.out/pi-pico-elf2.json diff --git a/bt2x/Cargo.toml b/bt2x/Cargo.toml new file mode 100644 index 0000000..d1a4466 --- /dev/null +++ b/bt2x/Cargo.toml @@ -0,0 +1,76 @@ +[workspace] +resolver = "2" +members = [ + "bt2x-common", + "bt2x-server", + "bt2x-embedded", + "bt2x-cli", + "bt2x-flasher", + "bt2x-monitor", + "bt2x-ota", + "bt2x-ota-common", +] + +[workspace.dependencies] +anyhow = "1.0" +async-trait = "0.1" +axum = "0.7.5" +base64 = { version = "0.22.1", default-features = false } +base64ct = { version = "1.6.0", default-features = false } +bitfield = { version = "0.15.0", default-features = false } +cargo-audit = "0.20.0" +clap = "4.2" +crossbeam = "0.8.2" +cyclonedx-bom = "0.5.0" +defmt = { version = "0.3.5", default-features = false } +der = { version = "0.7", default-features = false } +dhat = "0.3.2" +digest = "0.10.6" +ecdsa = { version = "0.16.1", default-features = false } +embedded-io-async = { version = "0.6", default-features = false } +futures = "0.3.30" +hex = { version = "0.4.3", default-features = false } +hex-literal = "0.4.1" +humantime = "2.1.0" +itertools = "0.12.1" +oci-distribution = { version = "0.10.0", default-features = false } +olpc-cjson = "0.1" +p256 = { version = "0.13.0", default-features = false } +pem-rfc7468 = { version = "0.7.0", default-features = false } +pipe = "0.4.0" +pkcs8 = { version = "0.10.1", default-features = false } +postcard = "1.0" +probe-rs = "0.23.0" +reqwest = { version = "0.12.4", features = ["json", "rustls-tls"] } +rustsec = "0.29.2" +sct = "0.7.0" +serde = { version = "1.0", default-features = false } +serde-json-core = "0.5.0" +serde_json = { version = "1.0", default-features = false } +serde_with = "3.8.1" +serde_yaml = "0.9" +sha2 = { version = "0.10.6", default-features = false } +signature = "2.0.0" +sigstore = { git = "https://github.com/vembacher/sigstore-rs", rev = "58d3b5f1285496ef2709e50dd6e75d507700d534" } +spki = { version = "0.7.0", default-features = false } +thiserror = "1.0" +tokio = "1" +tough = "0.17" +tracing = "0.1" +tracing-core = "0.1" +tracing-subscriber = "0.3" +typed-builder = "0.18.2" +url = "2.3.1" +uuid = "1.3.3" +x509-cert = { version = "0.2.1", default-features = false } +log = "0.4" +testcontainers = "0.15" +testcontainers-modules = "0.3" +tempfile = "3.10.1" +embassy-net = { git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" } +embassy-time = { git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" } +embedded-storage = "0.3" +path-clean = "1.0" +chrono = { version = "0.4" } +rustls-pki-types = "1.8.0" +rustls-pemfile = "2.1.3" \ No newline at end of file diff --git a/bt2x/LICENSE.txt b/bt2x/LICENSE.txt new file mode 100644 index 0000000..4052ad4 --- /dev/null +++ b/bt2x/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2024 Fraunhofer AISEC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/bt2x/README.md b/bt2x/README.md new file mode 100644 index 0000000..c4590df --- /dev/null +++ b/bt2x/README.md @@ -0,0 +1,13 @@ +# BT²X + +## Building the Docs + +To view the documentation within the code (RustDocs) run the following command: + +```sh +# with dependencies +cargo doc --open + +## without dependencies (faster) +cargo doc --open --no-deps +``` \ No newline at end of file diff --git a/bt2x/bt2x-cli/Cargo.toml b/bt2x/bt2x-cli/Cargo.toml new file mode 100644 index 0000000..e660953 --- /dev/null +++ b/bt2x/bt2x-cli/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "bt2x-cli" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +clap = { workspace = true, features = ["derive"] } +oci-distribution = { workspace = true, features = ["rustls-tls"] } +url = { workspace = true } +tracing = { workspace = true } +tracing-core = { workspace = true } +tracing-subscriber = { workspace = true, features = [ + "fmt", + "std", + "env-filter", +] } +tokio = { workspace = true, features = ["rt-multi-thread"] } +sigstore = { workspace = true } +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true } +olpc-cjson = { workspace = true } +sha2 = { workspace = true, features = ["oid"] } +base64 = { workspace = true } +hex = { workspace = true } +bt2x-common = { path = "../bt2x-common" } +itertools = { workspace = true } diff --git a/bt2x/bt2x-cli/src/main.rs b/bt2x/bt2x-cli/src/main.rs new file mode 100644 index 0000000..489ecb2 --- /dev/null +++ b/bt2x/bt2x-cli/src/main.rs @@ -0,0 +1,357 @@ +use clap::Parser; +use itertools::Itertools; +use sigstore::registry::OciReference; +use std::env::set_current_dir; +use std::ops::Add; +use std::path::PathBuf; +use std::process::Command; +use std::str::FromStr; +use tracing::{debug, info}; +use tracing_subscriber::filter::Targets; +use tracing_subscriber::prelude::*; + +#[derive(Debug, Parser)] +#[clap(author, version /*, trailing_var_arg = true*/)] +struct Args { + /// tagged OCI reference to which the binary will be published + #[arg(long, value_name = "OCI IMAGE")] + tag: OciReference, + /// Rust binary target that will get published + #[arg(long, value_name = "BINARY")] + bin: Vec, + #[arg(long, value_name = "PACKAGE")] + package: Vec, + /// LLVM target (e.g. `thumbv6m-none-eabi` for a Pi Pico). + #[arg(long, value_name = "LLVM TARGET")] + target: Option, + #[arg(long)] + fulcio_url: Option, + #[arg(long)] + fulcio_public_key: Option, + #[arg(long)] + rekor_url: Option, + #[arg(long)] + rekor_public_key: Option, + #[arg(long)] + dir: Option, + #[arg(long)] + ct_log_url: Option, + #[arg(long)] + ct_log_public_key: Option, + #[arg(long)] + oidc_issuer: Option, + /// Allow HTTP to be used. + #[clap(long)] + http: bool, + /// disable compiling with `--release flag` + #[clap(long)] + debug: bool, + /// log level of this application, defaults to Info. + #[clap(long, value_enum, default_value_t = LogLevel::Info)] + log_level: LogLevel, +} + +#[tokio::main] +async fn main() { + let args = Args::parse(); + configure_logging(&args); + let mut cargo_args = vec![]; + let mut objcopy_args = vec![]; + args.bin + .iter() + .for_each(|b| cargo_args.extend(["--bin".to_string(), b.clone()])); + args.bin + .iter() + .for_each(|b| objcopy_args.extend(["--bin".to_string(), b.clone()])); + args.package + .iter() + .for_each(|b| cargo_args.extend(["--package".to_string(), b.clone()])); + if !args.debug { + cargo_args.push("--release".to_string()); + objcopy_args.push("--release".to_string()); + } + if let Some(dir) = args.dir { + set_current_dir(dir).expect("failed to change directory"); + } + if let Some(target) = &args.target { + cargo_args.extend(["--target".to_string(), target.clone()]); + objcopy_args.extend([ + "--".to_string(), + "-O".to_string(), + "binary".to_string(), + format!("target/{target}/release/{}.bin", &args.bin[0]), + ]); + } + info!("Starting `cargo build {}`", cargo_args.iter().join(" ")); + + let output = Command::new("cargo") + .arg("build") + .args(cargo_args) + //.args(args.command) + .output() + .expect("Cargo failed"); + let stdout = std::str::from_utf8(output.stdout.as_slice()).unwrap_or("OUTPUT WAS NOT UTF-8"); + let stderr = std::str::from_utf8(output.stderr.as_slice()).unwrap_or("OUTPUT WAS NOT UTF-8"); + info!("Cargo finished."); + info!("Cargo output:"); + info!("------------------------STDOUT------------------------\n{stdout}"); + info!("------------------------STDERR------------------------\n{stderr}"); + info!("------------------------------------------------------"); + + info!("Starting `cargo objcopy {}`", objcopy_args.iter().join(" ")); + let output = Command::new("cargo") + .arg("objcopy") + .args(objcopy_args) + //.args(args.command) + .output() + .expect("Cargo failed"); + let stdout = std::str::from_utf8(output.stdout.as_slice()).unwrap_or("OUTPUT WAS NOT UTF-8"); + let stderr = std::str::from_utf8(output.stderr.as_slice()).unwrap_or("OUTPUT WAS NOT UTF-8"); + info!("Cargo finished."); + info!("Cargo output:"); + info!("------------------------STDOUT------------------------\n{stdout}"); + info!("------------------------STDERR------------------------\n{stderr}"); + info!("------------------------------------------------------"); + debug!("reading input binary"); + let bin_path = if let Some(target) = &args.target { + PathBuf::from("./target").join(target.as_str()) + } else { + PathBuf::from("./target") + } + .join(if args.debug { "debug" } else { "release" }) + .join(format!("{}.bin", args.bin[0].as_str())); + + let ct_log_public_key_file = args.ct_log_public_key.unwrap(); + let root_file = args.fulcio_public_key.unwrap(); + let rekor_public_key = args.rekor_public_key.unwrap(); + let ct_log_public_key_file = ct_log_public_key_file.to_str().unwrap(); + let root_file = root_file.to_str().unwrap(); + let rekor_public_key = rekor_public_key.to_str().unwrap(); + + let mut command = Command::new("cosign"); + command + .args(["upload", "blob"]) + .args(["-f", bin_path.to_str().unwrap(), &args.tag.whole()]); + info!("running {command:?}"); + let output_tag = command + .output() + .map_err(|err| err.to_string()) + .map(|output| { + std::str::from_utf8(&output.stdout) + .map_err(|err| err.to_string()) + .and_then(|s| { + OciReference::from_str(s.trim_end_matches('\n')).map_err(|err| err.to_string()) + }) + }) + .and_then(|reference| reference) + .expect("could not get output tag from cosign output"); + + let oidc_issuer = args.oidc_issuer.unwrap().to_string(); + let rekor_url = args.rekor_url.unwrap().to_string(); + let fulcio_url = args.fulcio_url.unwrap().to_string(); + + info!("running cosign sign-blob "); + + let mut command = Command::new("cosign"); + command + .args(["sign-blob", bin_path.to_str().unwrap()]) + .args(["--oidc-issuer", oidc_issuer.as_str()]) + .args(["--rekor-url", rekor_url.as_str()]) + .args(["--fulcio-url", fulcio_url.as_str()]) + .args(["--bundle", "bundle.json"]) + .env("SIGSTORE_CT_LOG_PUBLIC_KEY_FILE", ct_log_public_key_file) + .env("SIGSTORE_ROOT_FILE", root_file) + .env("SIGSTORE_REKOR_PUBLIC_KEY", rekor_public_key) + .env("COSIGN_EXPERIMENTAL", "1"); + debug!("Running {command:?}"); + command + .spawn() + .expect("`cosign sign-blob` failed") + .wait() + .expect("could not wait on cosign child process") + .code() + .filter(|&c| c == 0) + .expect("`cosign sign-blob` failed"); + + let bundle_tag = OciReference::with_tag( + output_tag.registry().to_string(), + output_tag.repository().to_string(), + output_tag + .digest() + .unwrap() + .replace(':', "-") + .add(".bundle"), + ); + info!("uploading bundle json as blob to {bundle_tag:?}"); + let mut command = Command::new("cosign"); + command + .args(["upload", "blob"]) + .args(["-f", "bundle.json", &bundle_tag.whole()]); + debug!("Running {command:?}"); + command + .spawn() + .expect("`cosign upload blob` failed") + .wait() + .expect("could not wait on cosign child process") + .code() + .filter(|&c| c == 0) + .expect("`cosign upload blob` failed"); + info!("Completed!"); + + info!("running cosign sign "); + let mut command = Command::new("cosign"); + command + .args(["sign", &output_tag.whole()]) + .args(["--oidc-issuer", oidc_issuer.as_str()]) + .args(["--rekor-url", rekor_url.as_str()]) + .args(["--fulcio-url", fulcio_url.as_str()]) + .env("SIGSTORE_CT_LOG_PUBLIC_KEY_FILE", ct_log_public_key_file) + .env("SIGSTORE_ROOT_FILE", root_file) + .env("SIGSTORE_REKOR_PUBLIC_KEY", rekor_public_key) + .env("COSIGN_EXPERIMENTAL", "1"); + debug!("Running {command:?}"); + command + .spawn() + .expect("`cosign sign-blob` failed") + .wait() + .expect("could not wait on cosign child process") + .code() + .filter(|&c| c == 0) + .expect("`cosign sign-blob` failed"); + + // let data = fs::read(bin_path).expect("failed to read input"); + // + // let mut oci_client = oci_distribution::client::Client::new(ClientConfig { + // protocol: if args.http { Http } else { Https }, + // ..Default::default() + // }); + // let image = oci_distribution::Reference::from_str(&args.tag.whole()).expect("this should never fail"); + // let layers = [ImageLayer { + // data: data.clone(), + // media_type: "application/octet-stream".to_string(), + // annotations: None, + // }]; + // let config = oci_distribution::client::Config { + // data: r#"{}"# + // .as_bytes().to_vec(), + // media_type: "application/vnd.oci.image.config.v1+json".to_string(), + // annotations: None, + // }; + // let mut image_manifest = manifest::OciImageManifest::build(&layers, &config, None); + // image_manifest.media_type = Some("application/vnd.oci.image.manifest.v1+json".to_string()); + // debug!("Manifest: {image_manifest:#?}"); + // + // debug!("uploading to OCI registry..."); + // let res = match oci_client.push( + // &image, + // &layers, + // config, + // &Anonymous, + // Some(image_manifest), + // ).await { + // Ok(res) => { res } + // Err(err) => { + // error!("failed to push {err:?}"); + // exit(-1); + // } + // }; + // debug!("Upload completed."); + // + // debug!("Creating Fulcio client."); + // let fulcio_client = sigstore::fulcio::FulcioClient::new( + // args.fulcio_url.unwrap(), + // Oauth(sigstore::fulcio::oauth::OauthTokenProvider::default() + // .with_issuer("http://dex-idp:8888/")), + // ); + // debug!("Sending certificate request."); + // let (signer, cert) = match fulcio_client.request_cert(SigningScheme::ECDSA_P256_SHA256_ASN1).await { + // Ok((SigStoreSigner::ECDSA_P256_SHA256_ASN1(signer), cert)) => { (signer, cert) } + // Err(err) => { + // error!("requesting fulcio cert failed {err}"); + // exit(-1); + // } + // Ok((signer, cert)) => { + // error!("unexpected response {signer:?}"); + // exit(-1); + // } + // }; + // let sigining_cert = Base64Standard.encode(cert.to_string()); + // let signature = signer.sign(data.as_slice()) + // .expect("failed to create signature"); + // + // let digest = Sha256::digest(data.as_slice()); + // let hex_digest = hex::encode(digest.as_slice()); + // + // + // let proposed_entry = ProposedEntry::Hashedrekord { + // api_version: "0.0.1".to_string(), + // spec: Spec { + // signature: Signature { + // content: Base64Standard.encode(signature.as_slice()), + // public_key: PublicKey::new(sigining_cert), + // }, + // data: Data { + // hash: Hash { algorithm: AlgorithmKind::sha256, value: hex_digest }, + // }, + // }, + // }; + // + // let entry = create_log_entry( + // &RekorConfig { + // base_path: args.rekor_url.expect("please add rekor url").to_string(), + // user_agent: None, + // client: Default::default(), + // basic_auth: None, + // oauth_access_token: None, + // bearer_access_token: None, + // api_key: None, + // }, + // proposed_entry, + // ).await.expect("failed to create entry"); + // let cosign_bundle = CosignBundle::from_signing_material_and_log_entry( + // signature.as_slice(), + // cert.to_string().as_bytes(), + // &entry, + // ).expect("failed to produce cosign bundle"); + // let bundle_json = serde_json::to_string(&cosign_bundle).expect("failed to produce bundle JSON"); + // write("bundle-cli.json", bundle_json.as_bytes()).expect("failed to write"); + // let compact_bundle = CompactRekorBundle::from(cosign_bundle); + // let bundle_json = serde_json::to_string(&compact_bundle).expect("failed to produce bundle JSON"); + // write("bundle-cli-compact.json", bundle_json.as_bytes()).expect("failed to write"); + // debug!("{entry:?}"); +} + +#[derive(clap::ValueEnum, Clone, Debug)] +enum LogLevel { + Debug, + Info, + Warn, + Error, + Trace, +} + +impl From<&LogLevel> for tracing_core::LevelFilter { + fn from(value: &LogLevel) -> Self { + match value { + LogLevel::Debug => tracing_core::Level::DEBUG.into(), + LogLevel::Info => tracing_core::Level::INFO.into(), + LogLevel::Warn => tracing_core::Level::WARN.into(), + LogLevel::Error => tracing_core::Level::ERROR.into(), + LogLevel::Trace => tracing_core::Level::TRACE.into(), + } + } +} + +fn configure_logging(args: &Args) { + tracing_subscriber::registry() + .with(tracing_subscriber::fmt::layer()) + .with( + Targets::new() + .with_target(env!("CARGO_PKG_NAME").replace('-', "_"), &args.log_level) + .with_target("sigstore", tracing_core::Level::INFO) + .with_target("oci_distribution", tracing_core::Level::DEBUG) + .with_target("hyper", tracing_core::Level::INFO) + .with_target("reqwest", tracing_core::Level::INFO), + ) + .init(); +} diff --git a/bt2x/bt2x-common/Cargo.toml b/bt2x/bt2x-common/Cargo.toml new file mode 100644 index 0000000..f9f2a0b --- /dev/null +++ b/bt2x/bt2x-common/Cargo.toml @@ -0,0 +1,59 @@ +[package] +name = "bt2x-common" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" + +[features] +default = ["bt", "oci"] +oci = ["dep:oci-distribution"] +# sbom = ["dep:cyclonedx-bom", "dep:rustsec", "dep:cargo-audit"] +bt = ["dep:sigstore", "dep:url", "dep:oci-distribution"] + +[dependencies] +# bt +sigstore = { workspace = true, optional = true } +sha2 = { workspace = true, features = ["oid"] } +# oci +oci-distribution = { workspace = true, features = [ + "rustls-tls", +], optional = true } +# sbom/vulnerability scanning related +cyclonedx-bom = { workspace = true, optional = true } +rustsec = { workspace = true, optional = true } +cargo-audit = { workspace = true, optional = true } + +# misc +url = { workspace = true, optional = true } +tracing = { workspace = true } +async-trait = { workspace = true } +typed-builder = { workspace = true } +serde = { workspace = true, features = ["derive"] } +serde_with = { workspace = true, features = ["base64", "hex", "json"] } +serde_json = { workspace = true } +base64 = { workspace = true } +hex = { workspace = true } +olpc-cjson = { workspace = true } +x509-cert = { workspace = true, features = ["pem"] } +spki = { workspace = true, features = ["fingerprint"] } +p256 = { workspace = true, features = ["pem", "ecdsa"] } +anyhow = { workspace = true } +digest = { workspace = true } +itertools = { workspace = true } +thiserror = { workspace = true } +reqwest = { workspace = true } +sct = { workspace = true } +tough = { workspace = true } +futures = { workspace = true } +tuf-no-std = { path = "../../tuf-no-std/tuf-no-std", default-features = false, features = [ + "der", + "verify", + "ecdsa", + "async", +] } +chrono = { workspace = true } + +[dev-dependencies] +tokio = { workspace = true } +hex-literal = { workspace = true } +serde_yaml = { workspace = true } diff --git a/bt2x/bt2x-common/src/artifact/mod.rs b/bt2x/bt2x-common/src/artifact/mod.rs new file mode 100644 index 0000000..1779b0b --- /dev/null +++ b/bt2x/bt2x-common/src/artifact/mod.rs @@ -0,0 +1 @@ +pub mod source; diff --git a/bt2x/bt2x-common/src/artifact/source/bundle.rs b/bt2x/bt2x-common/src/artifact/source/bundle.rs new file mode 100644 index 0000000..767fe07 --- /dev/null +++ b/bt2x/bt2x-common/src/artifact/source/bundle.rs @@ -0,0 +1,54 @@ +use crate::artifact::source::ArtifactSource; +use crate::error::Bt2XError; +use async_trait::async_trait; +use sigstore::cosign::bundle::SignedArtifactBundle; +use sigstore::crypto::CosignVerificationKey; +use std::fs::read; +use url::Url; + +pub struct BundleSource {} + +#[async_trait(? Send)] +impl ArtifactSource, url::Url> for BundleSource { + async fn get_artifact(&mut self, identifier: &Url) -> Result, Bt2XError> { + self.get_blob(identifier) + } + + #[allow(unused_variables)] + async fn get_bundle(&mut self, identifier: &Url) -> Result, Bt2XError> { + unimplemented!() + } +} + +impl BundleSource { + fn get_blob(&mut self, url: &Url) -> Result, Bt2XError> { + if url.scheme() == "file" { + let data = read(url.to_file_path().expect("failed get file path from url"))?; + return Ok(data); + } + unimplemented!("only supports files for now.") + } + pub fn get_bundle( + &mut self, + url: &Url, + rekor_pub_key: &CosignVerificationKey, + ) -> Result { + let data = if url.scheme() == "file" { + read(url.to_file_path().expect("failed get file path from url"))? + } else { + unimplemented!("only supports files for now"); + }; + let bundle = SignedArtifactBundle::new_verified( + String::from_utf8(data).unwrap().as_str(), + rekor_pub_key, + ) + .unwrap(); + + Ok(bundle) + } +} + +pub struct BlobBundle { + pub data: Vec, + pub bundle: SignedArtifactBundle, +} diff --git a/bt2x/bt2x-common/src/artifact/source/mod.rs b/bt2x/bt2x-common/src/artifact/source/mod.rs new file mode 100644 index 0000000..bac5893 --- /dev/null +++ b/bt2x/bt2x-common/src/artifact/source/mod.rs @@ -0,0 +1,15 @@ +use crate::error::Bt2XError; +use async_trait::async_trait; + +#[async_trait(? Send)] +pub trait ArtifactSource { + async fn get_artifact(&mut self, identifier: &Identifier) -> Result; + + async fn get_bundle(&mut self, identifier: &Identifier) -> Result; +} + +#[cfg(feature = "oci")] +pub mod oci; + +#[cfg(feature = "bt")] +pub mod bundle; diff --git a/bt2x/bt2x-common/src/artifact/source/oci.rs b/bt2x/bt2x-common/src/artifact/source/oci.rs new file mode 100644 index 0000000..2ec6f85 --- /dev/null +++ b/bt2x/bt2x-common/src/artifact/source/oci.rs @@ -0,0 +1,115 @@ +use crate::artifact::source::ArtifactSource; +use crate::error::Bt2XError; +use async_trait::async_trait; +use oci_distribution::client::{ClientConfig, ImageData}; +use oci_distribution::secrets::RegistryAuth; +use sigstore::registry::OciReference; +use std::ops::Add; +use std::str::FromStr; +use tracing::debug; + +pub struct OciSource { + pub client: oci_distribution::Client, + pub(crate) auth: RegistryAuth, +} + +impl OciSource { + pub fn new(config: ClientConfig, auth: RegistryAuth) -> Self { + OciSource { + auth, + client: oci_distribution::Client::new(config), + } + } + + async fn pull_image(&mut self, image: &OciReference) -> Result { + debug!("pulling image at {image:?}"); + let image = oci_distribution::Reference::from_str(&image.whole()).unwrap(); + self.client + .pull( + &image, + &self.auth, + vec![ + oci_distribution::manifest::WASM_LAYER_MEDIA_TYPE, + oci_distribution::manifest::WASM_CONFIG_MEDIA_TYPE, + oci_distribution::manifest::IMAGE_MANIFEST_MEDIA_TYPE, + oci_distribution::manifest::IMAGE_MANIFEST_LIST_MEDIA_TYPE, + oci_distribution::manifest::OCI_IMAGE_INDEX_MEDIA_TYPE, + oci_distribution::manifest::OCI_IMAGE_MEDIA_TYPE, + oci_distribution::manifest::IMAGE_CONFIG_MEDIA_TYPE, + oci_distribution::manifest::IMAGE_DOCKER_CONFIG_MEDIA_TYPE, + oci_distribution::manifest::IMAGE_LAYER_MEDIA_TYPE, + oci_distribution::manifest::IMAGE_LAYER_GZIP_MEDIA_TYPE, + oci_distribution::manifest::IMAGE_DOCKER_LAYER_TAR_MEDIA_TYPE, + oci_distribution::manifest::IMAGE_DOCKER_LAYER_GZIP_MEDIA_TYPE, + oci_distribution::manifest::IMAGE_LAYER_NONDISTRIBUTABLE_MEDIA_TYPE, + oci_distribution::manifest::IMAGE_LAYER_NONDISTRIBUTABLE_GZIP_MEDIA_TYPE, + "text/plain", + "application/octet-stream", + ], + ) + .await + .map_err(|err| err.into()) + } + async fn pull_blob(&mut self, image: &OciReference) -> Result, Bt2XError> { + debug!("pulling blob at {image:?}"); + let digest = image + .digest() + .ok_or(Bt2XError::MissingDigestInOciReference(image.clone()))?; + let image = OciReference::with_digest( + image.registry().to_string(), + image.repository().to_string(), + digest.to_string(), + ); + self.pull_image(&image) + .await + .and_then(|mut image| { + image + .layers + .pop() + .ok_or(Bt2XError::MissingContainerImageLayers) + }) + .map(|layer| layer.data) + } + async fn pull_bundle(&mut self, image: &OciReference) -> Result, Bt2XError> { + debug!("pulling bundle at {image:?}"); + let digest = image + .digest() + .ok_or(Bt2XError::MissingDigestInOciReference(image.clone()))?; + let image = OciReference::with_tag( + image.registry().to_string(), + image.repository().to_string(), + digest.to_string().replace(':', "-").add(".bundle"), + ); + debug!("{image}"); + self.pull_image(&image) + .await + .and_then(|mut image| { + image + .layers + .pop() + .ok_or(Bt2XError::MissingContainerImageLayers) + }) + .map(|layer| layer.data) + } +} + +pub struct OciImage { + pub data: ImageData, +} + +#[async_trait(? Send)] +impl ArtifactSource, OciReference> for OciSource { + async fn get_artifact(&mut self, identifier: &OciReference) -> Result, Bt2XError> { + identifier + .digest() + .ok_or(Bt2XError::MissingDigestInOciReference(identifier.clone()))?; + self.pull_blob(identifier).await + } + + async fn get_bundle(&mut self, identifier: &OciReference) -> Result, Bt2XError> { + identifier + .digest() + .ok_or(Bt2XError::MissingDigestInOciReference(identifier.clone()))?; + self.pull_bundle(identifier).await + } +} diff --git a/bt2x/bt2x-common/src/error.rs b/bt2x/bt2x-common/src/error.rs new file mode 100644 index 0000000..ee44bc9 --- /dev/null +++ b/bt2x/bt2x-common/src/error.rs @@ -0,0 +1,55 @@ +use std::str::FromStr; + +use thiserror::Error; + +use crate::{gossip::Checkpoint, merkle::verify::ProofError}; + +#[derive(Error, Debug)] +pub enum Bt2XError { + #[error("failed to verify the SCT of a certificate {0:?}")] + SctValidationFailed(sct::Error), + #[error("certificate does not contain the required extensions for SCT validation")] + CertificateIsMissingCtExtensions, + #[error("failed to fetch a log info entry from the Rekor log: {0:?}")] + FailedToFetchLogInfo( + sigstore::rekor::apis::Error, + ), + #[error("could not parse the provided log checkpoint {0:?}")] + FailedToParseLogCheckpoint(::Err), + #[error("failed to verify the provided log checkpoint")] + CheckpointSignatureValidationFailed, + #[error("failed to fetch a log proof from the Rekor log: {0:?}")] + FailedToFetchLogProof( + sigstore::rekor::apis::Error, + ), + #[error("sending checkpoint failed {0:?}")] + GossipingCheckpointsFailed(reqwest::Error), + #[error("sending checkpoint failed {0:?}")] + DeserializingGossipResponseFailed(reqwest::Error), + #[error("error during I/O {0:?}")] + IoError(#[from] std::io::Error), + #[error("error while interacting with OCI registry {0:?}")] + OciError(#[from] oci_distribution::errors::OciDistributionError), + #[error("reference is required to have a digest {0:?}")] + MissingDigestInOciReference(sigstore::registry::OciReference), + #[error("container image is missing the required layers")] + MissingContainerImageLayers, + #[error("failure during TUF update {0:?}")] + TufError(tuf_no_std::TufError), + #[error("serialization to JSON failed {0:?}")] + JsonSerializationError(serde_json::Error), + #[error("deserialization from JSON failed {0:?}")] + JsonDeserializationError(serde_json::Error), + #[error("hex decode failed {0:?}")] + HexDecodingError(hex::FromHexError), + #[error("internal error {0:?}")] + InternalError(String), + #[error("hash length not equal to 32 bytes")] + InvalidHashLength, + #[error("inclusion proof failed {0:?}")] + InclusionProofFailed(ProofError), + #[error("consistency proof failed {0:?}")] + ConsistencyProofFailed(ProofError), + #[error("failed to decode PEM key")] + PemKeyDecodingError, +} diff --git a/bt2x/bt2x-common/src/gossip.rs b/bt2x/bt2x-common/src/gossip.rs new file mode 100644 index 0000000..093e77a --- /dev/null +++ b/bt2x/bt2x-common/src/gossip.rs @@ -0,0 +1,278 @@ +//! ## Example: parsing and verifying a Checkpoint +//! +//!```ignore +//! use bt2x_common::gossip::{Checkpoint, send_checkpoint}; +//! #[tokio::main] +//! async fn main() { +//! // parse a checkpoint +//! let checkpoint: Checkpoint = "rekor.sigstore.dev - 2605736670972794746\n16895256\n/pOURNyljCZ3+Se0BHOmRJfTix2FC32SbGpRcMlUdwI=\nTimestamp: 1684488982407313166\n\n— rekor.sigstore.dev wNI9ajBEAiALqNNUxhyD9Ja38iUUMWNNI7mNGZO0qGrmDsdVLhxXxwIgBqn7Dnjqr2INJJ/VAovLgNBORFa5rRIwPQUcIska7n4=\n" +//! .parse() +//! .expect("failed to parse checkpoint"); +//! +//! // send the checkpoint to a monitor +//! send_checkpoint( +//! &url::Url::parse("https://example.net").unwrap(), +//! &checkpoint, +//! ) +//! .await +//! .expect("failure during gossiping"); +//! } +//! ``` + +//! + +use crate::error::Bt2XError; +use crate::rekor::RekorClient; +use crate::verifier::bt::verify_consistency; +use anyhow::{anyhow, Context}; +use base64::prelude::BASE64_STANDARD; +use base64::Engine; +use serde::{Deserialize, Serialize}; +use sigstore::crypto::{CosignVerificationKey, Signature}; +use std::cmp::Ordering; +use std::str::FromStr; +use tracing::debug; +use url::Url; + +#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)] +pub struct Gossip { + pub checkpoint: Checkpoint, +} + +/// Data structure to represent a parsed checkpoint. +/// The following example shows a the encoding of a checkpoint, as distributed by the log. +/// ``` +/// use bt2x_common::gossip::Checkpoint; +/// +/// let checkpoint: Checkpoint = "rekor.sigstore.dev - 2605736670972794746\n16895256\n/pOURNyljCZ3+Se0BHOmRJfTix2FC32SbGpRcMlUdwI=\nTimestamp: 1684488982407313166\n\n— rekor.sigstore.dev wNI9ajBEAiALqNNUxhyD9Ja38iUUMWNNI7mNGZO0qGrmDsdVLhxXxwIgBqn7Dnjqr2INJJ/VAovLgNBORFa5rRIwPQUcIska7n4=\n" +/// .parse() +/// .expect("failed to parse checkpoint"); +/// ``` +#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)] +pub struct Checkpoint { + pub root_hash: [u8; 32], + pub tree_size: usize, + pub key_fingerprint: [u8; 4], + pub sig: Vec, + pub timestamp: i64, + pub identity: String, + pub tree_id: i64, +} + +impl FromStr for Checkpoint { + type Err = anyhow::Error; + + fn from_str(s: &str) -> std::result::Result { + let s = s.trim_start_matches('"').trim_end_matches('"'); + let checkpoint = s; + let [data, sig] = checkpoint.split("\n\n").collect::>()[..] else { + return Err(anyhow!("checkpoint did not split correctly {s:?}")); + }; + let [_, name, sig_b64] = sig.split(' ').collect::>()[..] else { + return Err(anyhow!("signature did not split correctly {s:?}")); + }; + let sig = BASE64_STANDARD + .decode(sig_b64.trim_end()) + .context("failed to decode signature")?; + // first four bytes of signature are fingerprint of key + let (key_fingerprint, sig) = sig.split_at(4); + + let [tree, size, root_hash_b64, ts] = data.split('\n').collect::>()[..] else { + return Err(anyhow!("data did not split correctly {data:?}")); + }; + let [identity, _, tree_id] = tree.split(' ').collect::>()[..] else { + return Err(anyhow!("identity did not split correctly")); + }; + let root_hash = BASE64_STANDARD + .decode(root_hash_b64) + .context("failed to decode root hash") + .and_then(|v| { + <[u8; 32]>::try_from(v).map_err(|err| anyhow!("could not convert hash {err:?}")) + })?; + + let tree_size = size.parse().context("could not parse tree size")?; + let ts = ts + .trim_start_matches("Timestamp: ") + .parse() + .context("could not parse timestamp")?; + let tree_id = tree_id.parse().context("could not parse tree_id")?; + + if name != identity { + return Err(anyhow!("mismatching information regarding identity of log")); + } + Ok(Checkpoint { + timestamp: ts, + tree_size, + root_hash, + tree_id, + identity: identity.into(), + sig: sig.into(), + key_fingerprint: key_fingerprint.try_into().expect("this should never fail"), + }) + } +} + +impl Checkpoint { + pub fn to_signed_note(&self) -> String { + let Checkpoint { + identity, + sig, + key_fingerprint, + .. + } = self; + let sig_b64 = BASE64_STANDARD.encode([key_fingerprint.as_slice(), sig.as_slice()].concat()); + let note = self.create_note(); + format!("{note}\n— {identity} {sig_b64}\n") + } +} + +impl Checkpoint { + /// Create a so called `note` from the checkpoint. + /// Which is the encoding of the checkpoint used to create signatures. + pub fn create_note(&self) -> String { + let Checkpoint { + timestamp, + identity: name, + root_hash, + tree_size, + tree_id, + .. + } = self; + let root_hash_b64 = BASE64_STANDARD.encode(root_hash); + format!("{name} - {tree_id}\n{tree_size}\n{root_hash_b64}\nTimestamp: {timestamp}\n") + } + + /// Verifies that the checkpoint was signed with the given Rekor key. + pub fn verify_signature(&self, key: &CosignVerificationKey) -> Result<(), Bt2XError> { + key.verify_signature(Signature::Raw(&self.sig), self.create_note().as_bytes()) + .map_err(|_| Bt2XError::CheckpointSignatureValidationFailed) + } +} + +#[derive(Debug, Serialize, Deserialize)] +pub enum GossipResponse { + Success(Checkpoint), + Failure(MonitorError), +} + +/// Fetch a checkpoint from the log and verify its signature. +pub async fn fetch_and_verify_signature( + rekor_client: &RekorClient, + rekor_key: &CosignVerificationKey, +) -> Result { + // Fetch log info, parse it and then verify it using the provided key. + rekor_client + .get_log_info() + .await + .map_err(Bt2XError::FailedToFetchLogInfo) + .and_then(|log_info| { + log_info + .signed_tree_head + .parse::() + .map_err(Bt2XError::FailedToParseLogCheckpoint) + }) + .and_then(|checkpoint| { + checkpoint.verify_signature(rekor_key)?; + Ok(checkpoint) + }) +} + +/// Verify that two checkpoints are consistent by requesting the corresponding consistency proof from the log. +pub async fn verify_checkpoints( + trusted_checkpoint: Checkpoint, + requested_checkpoint: Checkpoint, + rekor_client: &RekorClient, +) -> Result { + let (old, new) = match Ord::cmp( + &trusted_checkpoint.tree_size, + &requested_checkpoint.tree_size, + ) { + Ordering::Less => { + debug!("requested checkpoint is newer than trusted checkpoint"); + (trusted_checkpoint, requested_checkpoint) + } + Ordering::Equal | Ordering::Greater => { + debug!("requested checkpoint is older than trusted checkpoint"); + (requested_checkpoint, trusted_checkpoint) + } + }; + debug!( + "fetching log proof for: {:?}", + (new.tree_size, Some(old.tree_size)) + ); + let proof = rekor_client + .get_log_proof(new.tree_size, Some(old.tree_size), None) + .await + .map_err(Bt2XError::FailedToFetchLogProof)?; + debug!("successfully fetched proof from log"); + verify_consistency( + old.tree_size, + new.tree_size, + &proof, + &old.root_hash, + &new.root_hash, + ) + .map(|_| new) +} + +#[derive(Debug, Serialize, Deserialize, PartialEq, thiserror::Error)] +pub enum MonitorError { + #[error("verifying {request_data:?} using {pubkey:?} failed")] + FailedSignatureVerification { + pubkey: (), + request_data: Checkpoint, + }, + #[error("verifying consistency of {request_data:?} using {other:?} failed")] + Inconsistent { + other: Checkpoint, + request_data: Checkpoint, + }, +} + +/// Send a checkpoint to the Rekor monitor at the provided URL. +pub async fn send_checkpoint( + server_url: &Url, + current_checkpoint: &Checkpoint, +) -> Result { + let response = reqwest::Client::new() + .post(server_url.join("/listen").unwrap()) + .json(current_checkpoint) + .send() + .await + .map_err(Bt2XError::GossipingCheckpointsFailed)?; + + response + .json::() + .await + .map_err(Bt2XError::DeserializingGossipResponseFailed) +} + +#[cfg(test)] +mod test_parse { + use super::*; + use hex_literal::hex; + use sigstore::crypto::CosignVerificationKey; + + #[test] + fn test_parse_checkpoint() { + let checkpoint = "rekor.sigstore.dev - 2605736670972794746\n16895256\n/pOURNyljCZ3+Se0BHOmRJfTix2FC32SbGpRcMlUdwI=\nTimestamp: 1684488982407313166\n\n— rekor.sigstore.dev wNI9ajBEAiALqNNUxhyD9Ja38iUUMWNNI7mNGZO0qGrmDsdVLhxXxwIgBqn7Dnjqr2INJJ/VAovLgNBORFa5rRIwPQUcIska7n4=\n"; + let expected = Checkpoint { + root_hash: hex!("fe939444dca58c2677f927b40473a64497d38b1d850b7d926c6a5170c9547702"), + tree_size: 16895256, + key_fingerprint: hex!("c0d23d6a"), + timestamp: 1684488982407313166, + identity: "rekor.sigstore.dev".to_string(), + tree_id: 2605736670972794746, + sig: From::from(hex!("304402200ba8d354c61c83f496b7f2251431634d23b98d1993b4a86ae60ec7552e1c57c7022006a9fb0e78eaaf620d249fd5028bcb80d04e4456b9ad12303d051c22c91aee7e")), + }; + let rekor_key = CosignVerificationKey::from_pem( + b"-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2G2Y+2tabdTV5BcGiBIx0a9fAFwr\nkBbmLSGtks4L3qX6yYY0zufBnhC8Ur/iy55GhWP/9A/bY2LhC30M9+RYtw==\n-----END PUBLIC KEY-----", + &Default::default(), + ).expect("failed to parse rekor key"); + + let output: Checkpoint = checkpoint.parse().unwrap(); + assert_eq!(output, expected); + assert_eq!(output.to_signed_note(), checkpoint); + output.verify_signature(&rekor_key).unwrap(); + } +} diff --git a/bt2x/bt2x-common/src/lib.rs b/bt2x/bt2x-common/src/lib.rs new file mode 100644 index 0000000..cf4eb02 --- /dev/null +++ b/bt2x/bt2x-common/src/lib.rs @@ -0,0 +1,21 @@ +//! # BT²X Common +//! This crate contains functionality that is meant to be shared across different components. + +pub mod artifact; +pub mod error; +/// Gossiping primitives. +pub mod gossip; +/// Merkle proof implementations. +pub mod merkle; +/// Custom Rekor data types. +pub mod rekor; +/// SCT validation. +pub mod sct; +/// Serde data structures. +pub mod serde; +/// Data structures related to configuring Sigstore related applications. +pub mod sigstore_config; +/// TUF integration into BT²X. +pub mod tuf; +/// Verification implementation. +pub mod verifier; diff --git a/bt2x/bt2x-common/src/merkle/mod.rs b/bt2x/bt2x-common/src/merkle/mod.rs new file mode 100644 index 0000000..13bc3fd --- /dev/null +++ b/bt2x/bt2x-common/src/merkle/mod.rs @@ -0,0 +1,6 @@ +pub mod rfc6962; +pub mod tree; +pub mod verify; + +pub use rfc6962::{Rfc6269Default, Rfc6269HasherTrait}; +pub use verify::MerkleProofVerifier; diff --git a/bt2x/bt2x-common/src/merkle/rfc6962.rs b/bt2x/bt2x-common/src/merkle/rfc6962.rs new file mode 100644 index 0000000..8faa031 --- /dev/null +++ b/bt2x/bt2x-common/src/merkle/rfc6962.rs @@ -0,0 +1,103 @@ +use digest::Output; +use sha2::{Digest, Sha256}; + +#[repr(u8)] +pub enum Rfc6269HashPrefix { + RFC6962LeafHashPrefix = 0, + RFC6962NodeHashPrefix = 1, +} + +pub trait Rfc6269HasherTrait { + fn empty_root() -> O; + fn hash_leaf(leaf: &[u8]) -> O; + fn hash_children(left: &[u8], right: &[u8]) -> O; +} + +impl Rfc6269HasherTrait> for T +where + T: Digest, +{ + fn empty_root() -> Output { + T::new().finalize() + } + fn hash_leaf(leaf: &[u8]) -> Output { + T::new() + .chain_update([Rfc6269HashPrefix::RFC6962LeafHashPrefix as u8]) + .chain_update(leaf) + .finalize() + } + fn hash_children(left: &[u8], right: &[u8]) -> Output { + T::new() + .chain_update([Rfc6269HashPrefix::RFC6962NodeHashPrefix as u8]) + .chain_update(left) + .chain_update(right) + .finalize() + } +} + +pub type Rfc6269Default = Sha256; + +#[cfg(test)] +mod test_rfc6962 { + use crate::merkle::rfc6962::Rfc6269Default; + use crate::merkle::rfc6962::Rfc6269HasherTrait; + use hex_literal::hex; + + #[derive(Debug, PartialEq)] + struct TestCase { + pub desc: String, + pub got: [u8; 32], + pub want: [u8; 32], + } + + #[test] + fn test_hasher() { + let leaf_hash = Rfc6269Default::hash_leaf(b"L123456"); + let empty_leaf_hash = Rfc6269Default::hash_leaf(b""); + let test_cases: Vec<_> = [ + TestCase { + desc: "RFC6962 Empty".to_string(), + want: hex!("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"), + got: Rfc6269Default::empty_root().into(), + }, + TestCase { + desc: "RFC6962 Empty Leaf".to_string(), + want: hex!("6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d"), + got: empty_leaf_hash.into(), + }, + TestCase { + desc: "RFC6962 Leaf".to_string(), + want: hex!("395aa064aa4c29f7010acfe3f25db9485bbd4b91897b6ad7ad547639252b4d56"), + got: leaf_hash.into(), + }, + TestCase { + desc: "RFC6962 Node".to_string(), + want: hex!("aa217fe888e47007fa15edab33c2b492a722cb106c64667fc2b044444de66bbb"), + got: Rfc6269Default::hash_children(b"N123", b"N456").into(), + }, + ] + .into_iter() + .filter(|tc| tc.got != tc.want) + .collect(); + assert_eq!(test_cases.len(), 0, "failed tests: {test_cases:?}") + } + + #[test] + fn test_collisions() { + let l1 = b"Hello".to_vec(); + let l2 = b"World".to_vec(); + let hash1 = Rfc6269Default::hash_leaf(&l1); + let hash2 = Rfc6269Default::hash_leaf(&l2); + assert_ne!(hash1, hash2, "got identical hashes for different leafs"); + + let sub_hash1 = Rfc6269Default::hash_children(&l1, &l2); + let sub_hash2 = Rfc6269Default::hash_children(&l2, &l1); + assert_ne!(sub_hash1, sub_hash2, "got same hash for different order"); + + let forged_hash = Rfc6269Default::hash_leaf(&[l1, l2].concat()); + assert_ne!( + sub_hash1, forged_hash, + "hasher is not second-preimage resistant" + ); + } +} diff --git a/bt2x/bt2x-common/src/merkle/tree.rs b/bt2x/bt2x-common/src/merkle/tree.rs new file mode 100644 index 0000000..5ef5a91 --- /dev/null +++ b/bt2x/bt2x-common/src/merkle/tree.rs @@ -0,0 +1,95 @@ +use crate::merkle::rfc6962::{Rfc6269Default, Rfc6269HasherTrait}; +use digest::Output; + +pub fn calc_tree(entries: &[impl AsRef<[u8]>]) -> Output { + if entries.is_empty() { + return Rfc6269Default::empty_root(); + } + let leaf_hashes: Vec<_> = entries + .iter() + .map(|entry| Rfc6269Default::hash_leaf(entry.as_ref())) + .collect(); + tree_rec(&leaf_hashes) +} + +fn tree_rec(children: &[Output]) -> Output { + match children { + [leaf] => *leaf, + [left, right] => Rfc6269Default::hash_children(left.as_slice(), right.as_slice()), + many => { + let (left, right) = many.split_at((many.len() - 1) / 2 + 1); + tree_rec(&[tree_rec(left), tree_rec(right)]) + } + } +} + +#[cfg(test)] +mod test_tree { + use crate::merkle::rfc6962::{Rfc6269Default, Rfc6269HasherTrait}; + use crate::merkle::tree::calc_tree; + + #[test] + pub fn test_0() { + let input: Vec<&[u8]> = vec![]; + let hash = calc_tree(&input); + assert_eq!(hash, Rfc6269Default::empty_root()) + } + + #[test] + pub fn test_1() { + let input = [[0_u8]]; + let hash = calc_tree(&input); + assert_eq!(hash, Rfc6269Default::hash_leaf([0].as_slice())) + } + + #[test] + pub fn test_2() { + let input = vec![[0], [1]]; + let hash = calc_tree(&input); + assert_eq!( + hash, + Rfc6269Default::hash_children( + Rfc6269Default::hash_leaf([0].as_slice()).as_slice(), + Rfc6269Default::hash_leaf([1].as_slice()).as_slice(), + ) + ) + } + + #[test] + pub fn test_3() { + let input = vec![[0], [1], [2]]; + let hash = calc_tree(&input); + assert_eq!( + hash, + Rfc6269Default::hash_children( + Rfc6269Default::hash_children( + Rfc6269Default::hash_leaf([0].as_slice()).as_slice(), + Rfc6269Default::hash_leaf([1].as_slice()).as_slice(), + ) + .as_slice(), + Rfc6269Default::hash_leaf([2].as_slice()).as_slice(), + ) + ) + } + + #[test] + pub fn test_4() { + let input = vec![[0], [1], [2], [3]]; + let hash = calc_tree(&input); + assert_eq!( + hash, + Rfc6269Default::hash_children( + Rfc6269Default::hash_children( + Rfc6269Default::hash_leaf([0].as_slice()).as_slice(), + Rfc6269Default::hash_leaf([1].as_slice()).as_slice(), + ) + .as_slice(), + Rfc6269Default::hash_children( + Rfc6269Default::hash_leaf([2].as_slice()).as_slice(), + Rfc6269Default::hash_leaf([3].as_slice()).as_slice(), + ) + .as_slice(), + ) + ) + } +} diff --git a/bt2x/bt2x-common/src/merkle/verify.rs b/bt2x/bt2x-common/src/merkle/verify.rs new file mode 100644 index 0000000..4d4993c --- /dev/null +++ b/bt2x/bt2x-common/src/merkle/verify.rs @@ -0,0 +1,178 @@ +use crate::merkle::rfc6962::Rfc6269HasherTrait; +use crate::merkle::verify::ProofError::*; +use digest::{Digest, Output}; +use std::cmp::Ordering; +use std::fmt::Debug; + +#[derive(Debug)] +pub enum ProofError { + MismatchedRoot { expected: String, got: String }, + IndexGtTreeSize, + UnexpectedNonEmptyProof, + UnexpectedEmptyProof, + NewTreeSmaller { new: usize, old: usize }, + WrongProofSize { got: usize, want: usize }, +} + +pub trait MerkleProofVerifier: Rfc6269HasherTrait +where + O: Eq + AsRef<[u8]> + Clone + Debug, +{ + #[allow(clippy::result_unit_err)] + fn verify_match(a: &O, b: &O) -> Result<(), ()> { + (a == b).then_some(()).ok_or(()) + } + + fn verify_inclusion( + index: usize, + leaf_hash: &O, + tree_size: usize, + proof_hashes: &[O], + root_hash: &O, + ) -> Result<(), ProofError> { + if index >= tree_size { + return Err(IndexGtTreeSize); + } + Self::root_from_inclusion_proof(index, leaf_hash, tree_size, proof_hashes).and_then( + |calc_root| { + Self::verify_match(calc_root.as_ref(), root_hash).map_err(|_| MismatchedRoot { + got: hex::encode(root_hash), + expected: hex::encode(*calc_root), + }) + }, + ) + } + + fn root_from_inclusion_proof( + index: usize, + leaf_hash: &O, + tree_size: usize, + proof_hashes: &[O], + ) -> Result, ProofError> { + if index >= tree_size { + return Err(IndexGtTreeSize); + } + let (inner, border) = Self::decomp_inclusion_proof(index, tree_size); + match (proof_hashes.len(), inner + border) { + (got, want) if got != want => { + return Err(WrongProofSize { + got: proof_hashes.len(), + want: inner + border, + }) + } + _ => {} + } + + let res_left = Self::chain_inner(leaf_hash, &proof_hashes[..inner], index); + let res = Self::chain_border_right(&res_left, &proof_hashes[inner..]); + Ok(Box::new(res)) + } + + fn verify_consistency( + old_size: usize, + new_size: usize, + proof_hashes: &[O], + old_root: &O, + new_root: &O, + ) -> Result<(), ProofError> { + match Ord::cmp(&old_size, &new_size) { + Ordering::Greater => { + return Err(NewTreeSmaller { + new: new_size, + old: old_size, + }) + } + Ordering::Equal if Self::verify_match(new_root, old_root).is_err() => { + return Err(MismatchedRoot { + got: hex::encode(new_root), + expected: hex::encode(old_root), + }) + } + Ordering::Equal if old_size == new_size && proof_hashes.is_empty() => { + return Ok(()); + } + _ => {} + }; + match (new_size == old_size, proof_hashes.is_empty()) { + (true, false) => return Err(UnexpectedNonEmptyProof), + (false, true) => return Err(UnexpectedEmptyProof), + (true, true) => { + unreachable!("this should be unreachable"); + } + _ => {} + } + let (mut inner, border) = Self::decomp_inclusion_proof(old_size - 1, new_size); + let shift = old_size.trailing_zeros() as usize; + inner -= shift; + + let mut seed = &proof_hashes[0]; + let mut start = 1; + if old_size == 1 << shift { + seed = old_root; + start = 0; + } + let got = proof_hashes.len(); + let want = start + inner + border; + if got != want { + return Err(WrongProofSize { got, want }); + } + let proof = &proof_hashes[start..]; + let mask = (old_size - 1) >> shift; + let hash1 = Self::chain_inner_right(seed, &proof[..inner], mask); + let hash1 = Self::chain_border_right(&hash1, &proof[inner..]); + Self::verify_match(&hash1, old_root).map_err(|_| MismatchedRoot { + got: hex::encode(old_root), + expected: hex::encode(hash1), + })?; + let hash2 = Self::chain_inner(seed, &proof[..inner], mask); + let hash2 = Self::chain_border_right(&hash2, &proof[inner..]); + Self::verify_match(&hash2, new_root).map_err(|_| MismatchedRoot { + got: hex::encode(new_root), + expected: hex::encode(old_root), + })?; + Ok(()) + } + fn chain_inner(seed: &O, proof_hashes: &[O], index: usize) -> O { + proof_hashes + .iter() + .enumerate() + .fold(seed.clone(), |seed, (i, h)| { + if (index >> i) & 1 == 0 { + Self::hash_children(seed.as_ref(), h.as_ref()) + } else { + Self::hash_children(h.as_ref(), seed.as_ref()) + } + }) + } + + fn chain_inner_right(seed: &O, proof_hashes: &[O], index: usize) -> O { + proof_hashes + .iter() + .enumerate() + .fold(seed.clone(), |seed, (i, h)| { + if (index >> i) & 1 == 1 { + Self::hash_children(h.as_ref(), seed.as_ref()) + } else { + seed + } + }) + } + + fn chain_border_right(seed: &O, proof_hashes: &[O]) -> O { + proof_hashes.iter().fold(seed.clone(), |seed, h| { + Self::hash_children(h.as_ref(), seed.as_ref()) + }) + } + + fn decomp_inclusion_proof(index: usize, tree_size: usize) -> (usize, usize) { + let inner: usize = Self::inner_proof_size(index, tree_size); + let border = (index >> inner).count_ones() as usize; + (inner, border) + } + + fn inner_proof_size(index: usize, tree_size: usize) -> usize { + u64::BITS as usize - ((index ^ (tree_size - 1)).leading_zeros() as usize) + } +} + +impl MerkleProofVerifier> for T where T: Digest {} diff --git a/bt2x/bt2x-common/src/rekor.rs b/bt2x/bt2x-common/src/rekor.rs new file mode 100644 index 0000000..6bf00c5 --- /dev/null +++ b/bt2x/bt2x-common/src/rekor.rs @@ -0,0 +1,106 @@ +pub use sigstore::rekor::apis::configuration::Configuration; +use sigstore::rekor::apis::entries_api::{CreateLogEntryError, SearchLogQueryError}; +use sigstore::rekor::apis::index_api::SearchIndexError; +use sigstore::rekor::apis::tlog_api::{GetLogInfoError, GetLogProofError}; +use sigstore::rekor::apis::{entries_api, index_api, pubkey_api, tlog_api, Error}; +use sigstore::rekor::models::{ + ConsistencyProof, LogEntry, LogInfo, ProposedEntry, SearchIndex, SearchLogQuery, +}; + +pub enum RekorEntryIdentifier { + LogIndex(u64), + Uuid(String), +} + +impl From for RekorEntryIdentifier { + fn from(val: u64) -> RekorEntryIdentifier { + RekorEntryIdentifier::LogIndex(val) + } +} + +impl From<&str> for RekorEntryIdentifier { + fn from(val: &str) -> RekorEntryIdentifier { + RekorEntryIdentifier::Uuid(val.to_string()) + } +} + +#[derive(Debug)] +pub struct RekorClient { + config: Configuration, +} + +impl RekorClient { + pub async fn get_log_entry( + &self, + identifier: impl Into, + ) -> Result> { + match identifier.into() { + RekorEntryIdentifier::LogIndex(log_index) => { + if log_index == 0 { + return Err("log index is always > 0".to_string().into()); + } + entries_api::get_log_entry_by_index(&self.config, log_index as i32) + .await + .map_err(|err| err.into()) + } + RekorEntryIdentifier::Uuid(uiid) => { + entries_api::get_log_entry_by_uuid(&self.config, uiid.as_str()) + .await + .map_err(|err| err.into()) + } + } + } + + pub async fn create_log_entry( + &self, + proposed_entry: ProposedEntry, + ) -> Result> { + entries_api::create_log_entry(&self.config, proposed_entry).await + } + + pub async fn search_log_query( + &self, + query: SearchLogQuery, + ) -> Result> { + entries_api::search_log_query(&self.config, query).await + } + + pub async fn get_log_info(&self) -> Result> { + tlog_api::get_log_info(&self.config).await + } + + pub async fn get_log_proof( + &self, + last_size: usize, + first_size: Option, + tree_id: Option<&str>, + ) -> Result> { + let first_size = first_size.map(|i| i.to_string()); + tlog_api::get_log_proof( + &self.config, + last_size as i32, + first_size.as_deref(), + tree_id, + ) + .await + } + + pub async fn search_index( + &self, + query: SearchIndex, + ) -> Result, Error> { + index_api::search_index(&self.config, query).await + } + + pub async fn get_pubkey( + &self, + tree_id: Option<&str>, + ) -> Result> { + pubkey_api::get_public_key(&self.config, tree_id) + .await + .map_err(|err| err.into()) + } + pub fn new(config: Configuration) -> Self { + RekorClient { config } + } +} diff --git a/bt2x/bt2x-common/src/sct.rs b/bt2x/bt2x-common/src/sct.rs new file mode 100644 index 0000000..cbdc44d --- /dev/null +++ b/bt2x/bt2x-common/src/sct.rs @@ -0,0 +1,59 @@ +use digest::FixedOutput; +use p256::ecdsa::VerifyingKey as P256VerifyingKey; +use sct::{verify_sct, Log}; +use sha2::{Digest, Sha256}; +use spki::{DecodePublicKey, EncodePublicKey, ObjectIdentifier}; +use std::time::UNIX_EPOCH; +use x509_cert::der::{DecodePem, Encode}; + +use crate::error::Bt2XError; + +const CT_PRECERT_SCTS_OID: ObjectIdentifier = + ObjectIdentifier::new_unwrap("1.3.6.1.4.1.11129.2.4.2"); + +pub fn validate_sct_pem(cert_pem: &[u8], ctlog_keys: &[&[u8]]) -> Result<(), Bt2XError> { + let cert = x509_cert::Certificate::from_pem(cert_pem).expect("failed to parse cert"); + let sct = cert + .tbs_certificate + .extensions + .as_ref() + .ok_or(Bt2XError::CertificateIsMissingCtExtensions)? + .iter() + .find(|e| e.extn_id == CT_PRECERT_SCTS_OID) + .ok_or(Bt2XError::CertificateIsMissingCtExtensions)?; + let ctlog_keys = ctlog_keys + .iter() + .map(|&b| { + P256VerifyingKey::from_public_key_pem(std::str::from_utf8(b).unwrap()) + .expect("failed to parse key") + }) + .map(|key| { + let key_der = key.to_public_key_der().unwrap().as_bytes().to_vec(); + let key_id: [u8; 32] = Sha256::new().chain_update(&key_der).finalize_fixed().into(); + (key_der, key_id, "".to_string()) + }) + .collect::>(); + + let ctlogs = ctlog_keys + .iter() + .map(|(key, key_id, s)| Log { + description: s, + url: s, + operated_by: s, + key: key.as_slice(), + id: *key_id, + max_merge_delay: 0, + }) + .collect::>(); + verify_sct( + cert.to_der().unwrap().as_slice(), + sct.extn_value.as_bytes(), + std::time::SystemTime::now() + .duration_since(UNIX_EPOCH) + .unwrap() + .as_secs(), + ctlogs.iter().collect::>().as_slice(), + ) + .map(|_| ()) + .map_err(Bt2XError::SctValidationFailed) +} diff --git a/bt2x/bt2x-common/src/serde.rs b/bt2x/bt2x-common/src/serde.rs new file mode 100644 index 0000000..470969e --- /dev/null +++ b/bt2x/bt2x-common/src/serde.rs @@ -0,0 +1,225 @@ +use serde::{Deserialize, Deserializer, Serialize, Serializer}; +use serde_with::{base64::Base64, hex::Hex, serde_as}; + +use base64::{engine::general_purpose::STANDARD as B64StandardEngine, Engine}; +use olpc_cjson::CanonicalFormatter; +use serde::de::DeserializeOwned; +use sigstore::cosign::bundle::{Payload, SignedArtifactBundle}; +use sigstore::rekor::models::LogEntry; + +use crate::error::Bt2XError; + +#[serde_as] +#[derive(Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct CosignBundle { + #[serde_as(as = "Base64")] + base64_signature: Vec, + #[serde_as(as = "Base64")] + cert: Vec, + rekor_bundle: RekorBundle, +} + +#[serde_as] +#[derive(Deserialize, Serialize)] +#[serde(rename_all = "PascalCase")] +pub struct RekorBundle { + #[serde_as(as = "Base64")] + pub signed_entry_timestamp: Vec, + pub payload: BundlePayload, +} + +#[serde_as] +#[derive(Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct BundlePayload { + #[serde_as(as = "Base64")] + pub body: Vec, + pub integrated_time: u64, + pub log_index: u64, + #[serde_as(as = "Hex")] + #[serde(rename = "logID")] + pub log_id: [u8; 32], +} + +#[serde_as] +#[derive(Deserialize, Serialize)] +#[serde(rename_all = "PascalCase")] +pub struct CompactRekorBundle { + #[serde_as(as = "Base64")] + pub signed_entry_timestamp: Vec, + #[serde( + serialize_with = "serialize_b64_canonical_json", + deserialize_with = "deserialize_b64_canonical_json" + )] + pub payload: CompactBundlePayload, +} + +#[serde_as] +#[derive(Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct CompactBundlePayload { + //#[serde_as(as = "Base64")] + #[serde( + serialize_with = "serialize_b64_canonical_json", + deserialize_with = "deserialize_b64_canonical_json" + )] + pub body: CompactPayloadBody, + + pub integrated_time: u64, + pub log_index: u64, + #[serde_as(as = "Hex")] + #[serde(rename = "logID")] + pub log_id: [u8; 32], +} + +#[serde_as] +#[derive(Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct CompactPayloadBody { + pub api_version: ApiVersion, + #[serde(flatten)] + pub spec: Spec, +} + +#[derive(Deserialize, Serialize)] +#[serde(tag = "kind", content = "spec")] +pub enum Spec { + #[serde(rename = "hashedrekord")] + HashedRekord { + data: HashedRekordData, + signature: Signature, + }, +} + +#[derive(Deserialize, Serialize)] +pub struct HashedRekordData { + hash: Hash, +} + +#[serde_as] +#[derive(Debug, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Signature { + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option, + #[serde_as(as = "Base64")] + pub content: Vec, + pub public_key: PublicKey, +} + +#[serde_as] +#[derive(Debug, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct PublicKey { + #[serde_as(as = "Base64")] + pub content: Vec, +} + +#[derive(Debug, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "lowercase")] +pub enum SignatureFormat { + Pgp, + Minisign, + X509, + Ssh, +} + +#[serde_as] +#[derive(Debug, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "lowercase", tag = "algorithm", content = "value")] +pub enum Hash { + Sha256(#[serde_as(as = "Hex")] [u8; 32]), +} + +#[derive(Deserialize, Serialize)] +pub enum ApiVersion { + #[serde(rename = "0.0.1")] + ZeroZeroOne, +} + +fn serialize_b64_canonical_json(payload: &T, s: S) -> Result +where + S: Serializer, + T: Serialize, +{ + let mut buf = Vec::new(); + let mut ser = serde_json::Serializer::with_formatter(&mut buf, CanonicalFormatter::new()); + payload + .serialize(&mut ser) + .map_err(|err| serde::ser::Error::custom(format!("{err}"))) + .map(|_| B64StandardEngine.encode(buf)) + .and_then(|encoded| s.serialize_str(&encoded)) +} + +fn deserialize_b64_canonical_json<'de, D, T>(deserializer: D) -> Result +where + D: Deserializer<'de>, + T: DeserializeOwned, +{ + let buf = String::deserialize(deserializer)?; + B64StandardEngine + .decode(buf) + .map_err(|err| err.to_string()) + .and_then(|decoded| serde_json::from_slice::(&decoded).map_err(|e| e.to_string())) + .map_err(serde::de::Error::custom) +} + +impl From for CompactRekorBundle { + fn from(value: SignedArtifactBundle) -> Self { + CompactRekorBundle { + signed_entry_timestamp: B64StandardEngine + .decode(value.rekor_bundle.signed_entry_timestamp) + .expect("failed to decode the SET"), + payload: value.rekor_bundle.payload.into(), + } + } +} + +impl CosignBundle { + pub fn from_signing_material_and_log_entry( + sig: &[u8], + cert_pem: &[u8], + log_entry: &LogEntry, + ) -> Result { + Ok(CosignBundle { + base64_signature: (B64StandardEngine.encode(sig)).into_bytes(), + cert: B64StandardEngine.encode(cert_pem).into_bytes(), + rekor_bundle: RekorBundle { + signed_entry_timestamp: log_entry + .verification + .signed_entry_timestamp + .clone() + .into_bytes(), + payload: BundlePayload { + body: serde_json::to_vec(&log_entry.body) + .map_err(Bt2XError::JsonSerializationError) + .map(|v| B64StandardEngine.encode(v).into_bytes())?, + integrated_time: log_entry.integrated_time as u64, + log_index: log_entry.log_index as u64, + log_id: (hex::decode(&log_entry.log_i_d) + .map_err(Bt2XError::HexDecodingError)?) + .try_into() + .map_err(|_| { + Bt2XError::InternalError("could not convert slice to Array".to_string()) + })?, + }, + }, + }) + } +} + +impl From for CompactBundlePayload { + fn from(value: Payload) -> Self { + CompactBundlePayload { + body: serde_json::from_slice(serde_json::to_vec(&value.body).unwrap().as_slice()) + .unwrap(), + integrated_time: value.integrated_time as u64, + log_index: value.log_index as u64, + log_id: <[u8; 32]>::try_from( + hex::decode(value.log_id).expect("failed to decode the log ID"), + ) + .expect("invalid length"), + } + } +} diff --git a/bt2x/bt2x-common/src/sigstore_config.rs b/bt2x/bt2x-common/src/sigstore_config.rs new file mode 100644 index 0000000..eb6f2a4 --- /dev/null +++ b/bt2x/bt2x-common/src/sigstore_config.rs @@ -0,0 +1,137 @@ +//! ## Example YAML Configuration +//! +//! ``` +//! use bt2x_common::sigstore_config::SigstoreConfig; +//! +//! let config = r#" +//! key_config: +//! !tuf +//! root_path: "/path/to/root.json" +//! metadata_base: "https://example.org/path" +//! targets_base: "file://example.org/path/targets" +//! target_names: +//! rekor: "rekor.pub" +//! fulcio: "fulcio.crt" +//! ctlog: "ctlog.pub" +//! +//! urls: +//! rekor: http://rekor.example.org +//! fulcio: http://fulcio.example.org +//! oidc_issuer: http://fulcio.example.org +//! "#; +//! let config: SigstoreConfig = serde_yaml::from_str(config).expect("failed to parse config"); +//! ``` + +use serde::{Deserialize, Serialize}; +use std::path::PathBuf; +use url::Url; + +/// Data structure that is used to configure Sigstore with YAML files. +/// ``` +/// use bt2x_common::sigstore_config::SigstoreConfig; +/// +/// let config = r#" +/// key_config: +/// !tuf +/// root_path: "/path/to/root.json" +/// metadata_base: "https://example.org/path" +/// targets_base: "file://example.org/path/targets" +/// target_names: +/// rekor: "rekor.pub" +/// fulcio: "fulcio.crt" +/// ctlog: "ctlog.pub" +/// +/// urls: +/// rekor: http://rekor.example.org +/// fulcio: http://fulcio.example.org +/// oidc_issuer: http://fulcio.example.org +/// "#; +/// let config: SigstoreConfig = serde_yaml::from_str(config).expect("failed to parse config"); +/// ``` +#[derive(Serialize, Deserialize, Debug, PartialEq)] +pub struct SigstoreConfig { + pub urls: SigstoreUrls, + pub key_config: KeyConfig, +} + +/// Enum that is used to configure the keys that are used for Sigstore. +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] +#[serde(rename_all = "lowercase")] +pub enum KeyConfig { + /// specify a TUF repo from which the Sigstore keys are loaded + Tuf { + /// path to the INITIAL root file + root_path: PathBuf, + /// path/URL from which updates to the TUF metadata is fetched + metadata_base: Url, + /// path/URL from which updates to the TUF target files are fetched + targets_base: Url, + /// file names of the TUF target files + target_names: TufTargetNames, + }, + /// specify the Sigstore keys via file path + Keys { + rekor_key: Option, + fulcio_cert: Option, + ctlog_key: Option, + }, +} + +/// Struct used to specify the URLs of Sigstore servers. +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] +pub struct SigstoreUrls { + pub rekor: Url, + pub fulcio: Url, + pub oidc_issuer: Url, +} + +fn rekor_target_default() -> String { + "rekor.pub".to_string() +} + +fn fulcio_target_default() -> String { + "fulcio.crt".to_string() +} + +fn ctlog_target_default() -> String { + "ctfe.pub".to_string() +} + +/// Struct used to specify the file names of Sigstore targets in the TUF repo. +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] +pub struct TufTargetNames { + #[serde(default = "rekor_target_default")] + pub rekor: String, + #[serde(default = "fulcio_target_default")] + pub fulcio: String, + #[serde(default = "ctlog_target_default")] + pub ctlog: String, + //#[serde(flatten)] + //extra_targets: HashMap, +} + +#[cfg(test)] +mod test { + use crate::sigstore_config::SigstoreConfig; + + #[test] + fn test_parse_config() { + let config = r#" +key_config: + !tuf + root_path: "file://example.org/root.json" + metadata_base: "https://example.org/path" + targets_base: "file://example.org/path" + target_names: + rekor: "rekor.pub" + fulcio: "fulcio.crt" + ctlog: "ctlog.pub" + +urls: + rekor: http://rekor.example.org + fulcio: http://fulcio.example.org + oidc_issuer: http://fulcio.example.org +"#; + let _: SigstoreConfig = serde_yaml::from_str(config).expect("failed to parse config"); + } +} diff --git a/bt2x/bt2x-common/src/tuf/mod.rs b/bt2x/bt2x-common/src/tuf/mod.rs new file mode 100644 index 0000000..8ba5a80 --- /dev/null +++ b/bt2x/bt2x-common/src/tuf/mod.rs @@ -0,0 +1,142 @@ +use crate::error::Bt2XError; +use crate::sigstore_config::TufTargetNames; +use core::str; +use std::fs::OpenOptions; +use std::io::Read; +use std::path::{Path, PathBuf}; +use tuf_no_std::remote::TransportError; +use tuf_no_std::utils::MemoryStorage; +use tuf_no_std::TufTransport; +use url::Url; + +#[derive(Debug)] +pub struct SigstoreKeys { + pub rekor_key: Vec, + pub fulcio_cert: Vec, + pub ctlog_key: Vec, +} + +pub async fn load_tuf_filesystem( + root: &Path, + metadata_base_path: &Url, + _targets_base_path: &Url, + target_names: &TufTargetNames, +) -> Result { + let root = std::fs::read(root).expect("failed to read a root file at the providedd path"); + let mut storage = MemoryStorage { + root: tuf_no_std::heapless::Vec::from_slice(&root).expect("root file > 2048 bytes"), + snapshot: None, + targets: None, + timestamp: None, + uncommitted_root: None, + }; + let repository_path = metadata_base_path + .to_file_path() + .expect("did not provide a file path"); + let mut transport = FilesystemTransport { repository_path }; + let update_start = chrono::Utc::now().signed_duration_since(chrono::DateTime::UNIX_EPOCH); + let update_start = update_start + .to_std() + .expect("failed to convert update start to std data type"); + let update_start = tuf_no_std::UtcTime::from_unix_duration(update_start) + .expect("could not create update start timestamp"); + tuf_no_std::update_repo(&mut storage, &mut transport, 100, update_start) + .map_err(Bt2XError::TufError)?; + + let mut rekor_buf = [0u8; 1024]; + let mut fulcio_buf = [0u8; 1024]; + let mut ctlog_buf = [0u8; 1024]; + let rekor_key = tuf_no_std::fetch_and_verify_target_file( + &mut storage, + &mut transport, + target_names.rekor.as_bytes(), + &mut rekor_buf, + ) + .map_err(Bt2XError::TufError)?; + let fulcio_crt = tuf_no_std::fetch_and_verify_target_file( + &mut storage, + &mut transport, + target_names.fulcio.as_bytes(), + &mut fulcio_buf, + ) + .map_err(Bt2XError::TufError)?; + let ctlog_key = tuf_no_std::fetch_and_verify_target_file( + &mut storage, + &mut transport, + target_names.ctlog.as_bytes(), + &mut ctlog_buf, + ) + .map_err(Bt2XError::TufError)?; + + Ok(SigstoreKeys { + ctlog_key: ctlog_key.to_vec(), + fulcio_cert: fulcio_crt.to_vec(), + rekor_key: rekor_key.to_vec(), + }) +} + +#[derive(Debug)] +pub struct FilesystemTransport { + repository_path: PathBuf, +} + +impl FilesystemTransport { + fn fetch_impl<'o>( + &self, + path: &PathBuf, + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std::remote::TransportError> { + OpenOptions::new() + .read(true) + .open(path) + .map_err(|_| TransportError::FetchError) + .and_then(|mut f| f.read(out).map_err(|_| TransportError::FetchError)) + .map(|n| &out[..n]) + } +} + +impl TufTransport for FilesystemTransport { + fn fetch_root<'o>( + &self, + version: std::num::NonZeroU64, + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std::remote::TransportError> { + self.fetch_impl( + &self.repository_path.join(format!("{version}.root.der")), + out, + ) + } + + fn fetch_timestamp<'o>( + &self, + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std::remote::TransportError> { + self.fetch_impl(&self.repository_path.join("1.timestamp.der"), out) + } + + fn fetch_snapshot<'o>( + &self, + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std::remote::TransportError> { + self.fetch_impl(&self.repository_path.join("1.snapshot.der"), out) + } + + fn fetch_targets<'o>( + &self, + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std::remote::TransportError> { + self.fetch_impl(&self.repository_path.join("1.targets.der"), out) + } + + fn fetch_target_file<'o>( + &self, + metapath: &[u8], + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std::remote::TransportError> { + let metapath = PathBuf::from(str::from_utf8(metapath).unwrap()); + if metapath.is_absolute() { + panic!("provided absolute path") + } + self.fetch_impl(&self.repository_path.join("targets").join(metapath), out) + } +} diff --git a/bt2x/bt2x-common/src/verifier/bt.rs b/bt2x/bt2x-common/src/verifier/bt.rs new file mode 100644 index 0000000..c98a4df --- /dev/null +++ b/bt2x/bt2x-common/src/verifier/bt.rs @@ -0,0 +1,370 @@ +#[cfg(feature = "oci")] +use crate::artifact::source::oci::OciSource; +use crate::error::Bt2XError; +use anyhow::{anyhow, Context}; +use async_trait::async_trait; +use oci_distribution::secrets::RegistryAuth; +use sigstore::cosign::verification_constraint::{ + VerificationConstraint, VerificationConstraintVec, +}; +use sigstore::cosign::{ + verify_constraints, Client as CosignClient, CosignCapabilities, SignatureLayer, +}; +use sigstore::registry::OciReference; +use std::fmt::Debug; +use tracing::debug; +use url::Url; + +use crate::merkle::{MerkleProofVerifier, Rfc6269Default, Rfc6269HasherTrait}; +use crate::verifier::{Artifact, Verifier}; + +use typed_builder::TypedBuilder as Builder; + +use sigstore::crypto::{CosignVerificationKey, SigningScheme}; +use sigstore::registry::Auth; + +use anyhow::Result; + +use digest::Output; + +use crate::artifact::source::ArtifactSource; +use crate::gossip::send_checkpoint; +use crate::rekor::RekorClient; +use crate::verifier::Artifact::{Binary, BundledBinary}; +use olpc_cjson::CanonicalFormatter; +use serde::Serialize; +use sigstore::cosign::bundle::{PayloadBody, SignedArtifactBundle}; +use sigstore::rekor::models::log_entry::{Body, InclusionProof}; +use sigstore::rekor::models::{ConsistencyProof, LogEntry}; + +/// Runs verification based on the given Sigstore keys. +#[derive(Builder)] +pub struct BinaryTransparencyVerifier { + rekor_client: RekorClient, + cosign_client: CosignClient, + keys: SigstoreKeys, + monitors: Vec, +} + +#[derive(Builder, Debug)] +pub struct SigstoreKeys { + rekor_pub_key: String, + #[builder(default, setter(strip_option))] + fulcio_cert: Option, + #[builder(default, setter(strip_option))] + ct_log_key: Option, +} + +#[async_trait(? Send)] +#[cfg(feature = "oci")] +impl Verifier, OciSource, OciReference, VerificationConstraintVec> + for BinaryTransparencyVerifier +{ + async fn verify( + &mut self, + source: &mut OciSource, + identifier: &OciReference, + constraints: &VerificationConstraintVec, + ) -> Result>> { + let target = identifier; + debug!("attempting to verify: {target}"); + let auth = match &source.auth { + RegistryAuth::Anonymous => Auth::Anonymous, + RegistryAuth::Basic(s1, s2) => Auth::Basic(s1.clone(), s2.clone()), + }; + let (cosign_image, source_digest) = + match self.cosign_client.triangulate(target, &auth).await { + Ok((cosign_image, source_digest)) => (cosign_image, source_digest), + Err(err) => return Err(anyhow!("failed to get cosign image for {target} ({err})")), + }; + let source_image_with_digest = OciReference::with_digest( + target.registry().to_string(), + target.repository().to_string(), + source_digest.to_string(), + ); + + debug!("source image is: {source_image_with_digest}"); + debug!("cosign image is: {cosign_image}"); + + let signature_layers = match self + .cosign_client + .trusted_signature_layers(&auth, &source_digest, &cosign_image) + .await + { + Ok(layers) => layers, + Err(err) => return Err(anyhow!("Failed to get signature layers {err}")), + }; + + verify_constraints(&signature_layers, constraints.iter()).map_err(|err| { + debug!("verifying contraints failed {err}"); + anyhow!("verification of constraint(s) failed {err}") + })?; + debug!("pulling artifact"); + let rekor_bundle = if let [SignatureLayer { + bundle: Some(bundle), + .. + }] = &signature_layers[..] + { + Ok(bundle) + } else { + Err(anyhow!( + "failed to extract bundle and signature from signature layerslayers" + )) + }?; + + debug!("successfully passed all checks providing by signature layers ..."); + // needs log id of first entry + let online_entry = self + .rekor_client + .get_log_entry(rekor_bundle.payload.log_index as u64) + .await + .map_err(|err| anyhow!("failed to get online entry {err}"))?; + + // Gossip entry to monitor + let checkpoint = online_entry + .verification + .inclusion_proof + .as_ref() + .ok_or(anyhow!("missing inclusion proof")) + .and_then(|ip| ip.checkpoint.parse().context("failed to parse checkpoint"))?; + + for url in &self.monitors { + send_checkpoint(url, &checkpoint).await.map_err(|err| { + anyhow!("failed to get consistency confirmation from monitor {err:?}") + })?; + } + + let constraints: VerificationConstraintVec = + vec![Box::new(InclusionVerifier { online_entry })]; + verify_constraints(&signature_layers, constraints.iter()) + .map_err(|err| anyhow!("online verification failed {err}"))?; + debug!( + "online check succeeded for entry with id: {}", + rekor_bundle.payload.log_index + ); + let image_data = source.get_artifact(&source_image_with_digest).await?; + let cosign_bundle = match source.get_bundle(&source_image_with_digest).await { + Ok(bundle) => bundle, + Err(_) => { + return Ok(Binary(image_data)); + } + }; + let rekor_key = CosignVerificationKey::from_pem( + self.keys.rekor_pub_key.as_bytes(), + &SigningScheme::default(), + ) + .map_err(|err| anyhow!("Failed to parse Rekor key {err}"))?; + + let signed_bundle = SignedArtifactBundle::new_verified( + std::str::from_utf8(&cosign_bundle).context("bundle had invalid UTF-8")?, + &rekor_key, + ) + .map_err(|err| anyhow!("failed to produce signed artifact bundle {err}"))?; + + let entry = self + .rekor_client + .get_log_entry(signed_bundle.rekor_bundle.payload.log_index as u64) + .await + .map_err(|err| anyhow!("failed to get online entry {err}"))?; + + // Verify inclusion + let inclusion_proof = entry + .verification + .inclusion_proof + .context("online entry did contain inclusion proof")?; + verify_inclusion_bundle(&signed_bundle.rekor_bundle.payload.body, &inclusion_proof) + .map_err(|_| anyhow!("inclusion proof failed"))?; + + // Gossip entry to monitor + let checkpoint = inclusion_proof + .checkpoint + .parse() + .context("failed to parse checkpoint")?; + + for url in &self.monitors { + send_checkpoint(url, &checkpoint).await.map_err(|err| { + anyhow!("failed to get consistency confirmation from monitor {err:?}") + })?; + } + + self.cosign_client + .verify_blob_with_bundle(image_data.as_slice(), &signed_bundle.rekor_bundle) + .map_err(|err| anyhow!("failed to verify blob with bundle {err:?}"))?; + + Ok(BundledBinary { + binary: image_data, + bundle: cosign_bundle, + }) + } +} + +#[derive(Debug)] +pub struct InclusionVerifier { + pub(crate) online_entry: LogEntry, +} + +impl VerificationConstraint for InclusionVerifier { + fn verify(&self, signature_layer: &SignatureLayer) -> sigstore::errors::Result { + let Some(inclusion_proof) = self.online_entry.verification.inclusion_proof.as_ref() else { + return Ok(false); + }; + use sigstore::cosign::bundle::{Bundle, Payload}; + if let SignatureLayer { + bundle: + Some(Bundle { + payload: Payload { body, .. }, + .. + }), + .. + } = signature_layer + { + match verify_inclusion_bundle(body, inclusion_proof) { + Ok(_) => Ok(true), + Err(_) => Ok(false), + } + } else { + Ok(false) + } + } +} + +pub fn verify_inclusion_rekor_entry( + body: &Body, + inclusion_proof: &InclusionProof, +) -> Result<(), Bt2XError> { + let mut body_serialized = Vec::new(); + let mut ser = + serde_json::Serializer::with_formatter(&mut body_serialized, CanonicalFormatter::new()); + body.serialize(&mut ser).unwrap(); + verify_inclusion_raw(&body_serialized, inclusion_proof) +} + +pub fn verify_inclusion_bundle( + body: &PayloadBody, + inclusion_proof: &InclusionProof, +) -> Result<(), Bt2XError> { + let mut body_serialized = Vec::new(); + let mut ser = + serde_json::Serializer::with_formatter(&mut body_serialized, CanonicalFormatter::new()); + body.serialize(&mut ser).unwrap(); + verify_inclusion_raw(&body_serialized, inclusion_proof) +} + +pub(crate) fn verify_inclusion_raw( + body: &[u8], + inclusion_proof: &InclusionProof, +) -> Result<(), Bt2XError> { + let leaf_hash = Rfc6269Default::hash_leaf(body); + let proof_hashes: Vec> = inclusion_proof + .hashes + .iter() + .map(|h| { + hex::decode(h) + .map_err(Bt2XError::HexDecodingError) + .and_then(|h| { + <[u8; 32]>::try_from(h.as_slice()).map_err(|_| Bt2XError::InvalidHashLength) + }) + .map(Output::::from) + }) + .collect::, Bt2XError>>()?; + + let root_hash = hex::decode(&inclusion_proof.root_hash) + .map_err(Bt2XError::HexDecodingError) + .and_then(|h| <[u8; 32]>::try_from(h.as_slice()).map_err(|_| Bt2XError::InvalidHashLength)) + .map(Output::::from)?; + + Rfc6269Default::verify_inclusion( + inclusion_proof.log_index as usize, + &leaf_hash, + inclusion_proof.tree_size as usize, + &proof_hashes, + &root_hash, + ) + .map_err(Bt2XError::InclusionProofFailed)?; + Ok(()) +} + +pub fn verify_consistency( + old_size: usize, + new_size: usize, + proof: &ConsistencyProof, + old_root: &[u8; 32], + new_root: &[u8; 32], +) -> Result<(), Bt2XError> { + let proof_hashes: Vec<_> = proof + .hashes + .iter() + .map(|s| { + hex::decode(s) + .map_err(Bt2XError::HexDecodingError) + .and_then(|v| { + <[u8; 32]>::try_from(v.as_slice()).map_err(|_| Bt2XError::InvalidHashLength) + }) + .map(Output::::from) + }) + .collect::, Bt2XError>>()?; + + Rfc6269Default::verify_consistency( + old_size, + new_size, + &proof_hashes, + old_root.into(), + new_root.into(), + ) + .map_err(Bt2XError::ConsistencyProofFailed) +} + +#[cfg(feature = "bt")] +pub mod constraints { + use sigstore::cosign::verification_constraint::VerificationConstraint; + use sigstore::cosign::SignatureLayer; + + #[derive(Debug)] + pub struct KeylessSigningEnforcer {} + + impl VerificationConstraint for KeylessSigningEnforcer { + fn verify(&self, signature_layer: &SignatureLayer) -> sigstore::errors::Result { + Ok(signature_layer.certificate_signature.is_some()) + } + } +} + +#[cfg(test)] +mod test { + use crate::verifier::bt::verify_inclusion_rekor_entry; + + #[tokio::test] + async fn test_verify_inclusion() { + let rekor_config = sigstore::rekor::apis::configuration::Configuration::default(); + let entry = + sigstore::rekor::apis::entries_api::get_log_entry_by_index(&rekor_config, 16056995) + .await + .expect("could not fetch entry"); + + assert!(verify_inclusion_rekor_entry( + &entry.body, + &entry.verification.inclusion_proof.unwrap() + ) + .is_ok()); + } + + #[tokio::test] + async fn test_verify_inclusion_fail() { + let rekor_config = sigstore::rekor::apis::configuration::Configuration::default(); + let mut entry = + sigstore::rekor::apis::entries_api::get_log_entry_by_index(&rekor_config, 16056995) + .await + .expect("could not fetch entry"); + entry + .verification + .inclusion_proof + .as_mut() + .unwrap() + .log_index += 1; + assert!(verify_inclusion_rekor_entry( + &entry.body, + &entry.verification.inclusion_proof.unwrap() + ) + .is_err()); + } +} diff --git a/bt2x/bt2x-common/src/verifier/mod.rs b/bt2x/bt2x-common/src/verifier/mod.rs new file mode 100644 index 0000000..6025600 --- /dev/null +++ b/bt2x/bt2x-common/src/verifier/mod.rs @@ -0,0 +1,30 @@ +use crate::artifact::source::ArtifactSource; +use anyhow::Result; +use async_trait::async_trait; + +/// Abstraction trait of a verifier. +#[async_trait(? Send)] // this is to avoid issues with Box, not sure if this the correct way to do this +pub trait Verifier { + /// Verify the the artifact specified by the identifier fetched from the source under the given constraints. + /// Returns a verified [[Artifact]]. + async fn verify( + &mut self, + source: &mut S, + identifier: &I, + constraints: &C, + ) -> Result> + where + S: ArtifactSource; +} + +/// There are different kinds of artifacts that can be verified. +#[derive(Debug)] +pub enum Artifact { + /// Raw binary without a bundled signature. + Binary(T), + /// Binary that is bundled with a signature. + BundledBinary { binary: T, bundle: T }, +} + +#[cfg(feature = "bt")] +pub mod bt; diff --git a/bt2x/bt2x-embedded/.gitignore b/bt2x/bt2x-embedded/.gitignore new file mode 100644 index 0000000..4fffb2f --- /dev/null +++ b/bt2x/bt2x-embedded/.gitignore @@ -0,0 +1,2 @@ +/target +/Cargo.lock diff --git a/bt2x/bt2x-embedded/Cargo.toml b/bt2x/bt2x-embedded/Cargo.toml new file mode 100644 index 0000000..449a1fc --- /dev/null +++ b/bt2x/bt2x-embedded/Cargo.toml @@ -0,0 +1,42 @@ +[package] +name = "bt2x-embedded" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" + +[lib] +# crate-type = ["dylib", "staticlib"] + +[features] +default = ["no_std"] +no_std = [] + + +[dependencies] +serde = { workspace = true, features = ["derive"] } +# serde_with = { path = "../vendor/serde_with/serde_with", version = "2.2", default-features = false, features = [ +# "hex", +# "base64", +# "macros", +# "alloc", +# ] } +#heapless = "0.7" +serde-json-core = { workspace = true } +base64 = { workspace = true, features = [] } +hex = { workspace = true, features = ["serde"] } + +sha2 = { workspace = true, features = [] } +der = { workspace = true, features = [] } +signature = { workspace = true, features = [] } +ecdsa = { workspace = true, features = ["der", "verifying", "arithmetic", "pkcs8"] } +spki = { workspace = true, features = [] } +pkcs8 = { workspace = true, features = [] } +p256 = { workspace = true, features = ["ecdsa", "ecdsa-core", "pem"] } +x509-cert = { workspace = true, features = [] } +pem-rfc7468 = { workspace = true, features = [] } + +base64ct = { workspace = true, features = [] } +[dev-dependencies] +serde_json = { workspace = true, features = ["alloc"] } +postcard = { workspace = true, features = ["alloc"] } +dhat = { workspace = true } diff --git a/bt2x/bt2x-embedded/src/bundle/mod.rs b/bt2x/bt2x-embedded/src/bundle/mod.rs new file mode 100644 index 0000000..e69de29 diff --git a/bt2x/bt2x-embedded/src/lib.rs b/bt2x/bt2x-embedded/src/lib.rs new file mode 100644 index 0000000..ddb3b45 --- /dev/null +++ b/bt2x/bt2x-embedded/src/lib.rs @@ -0,0 +1,627 @@ +#![no_std] +//! A `no-std` implementation to run verification of Sigstore/Cosign style signatures. +//! +//! ## Signature Format +//! +//! At a top level the signature has the following modification to the [Cosign format](https://github.com/sigstore/cosign/blob/8defb0e72baa6c0385f4097723a3574e6d0406d0/specs/SIGNATURE_SPEC.md). +//! ```json +//! { +//! "SignedEntryTimestamp": "", +//! "Payload": "" +//! } +//! ``` +//! +//! This has the following benefits: +//! - We can separate the parsing into multiple steps, +//! and do not have to deserialize and re-serialize multiple times to verify signatures. +//! - Decoding the B64 strings gives us the strings we need to verify signatures on, we can do so and then parse it. +//! +//! +//! The [BundlePayload] follows the regular format, meaning we only use a very minor modification to the original specification. +//! ## Example +//! +//! This example verifies: +//! - that the binary was correctly signed with a Fulcio signing certificate, +//! - it was entered into the Rekor log within 10 minutes, +//! - the signing certificate was issued to `foo@example.org` based on being authenticated by the OIDC provider `issuer.example.org`. +//! +//! ```ignore +//! let signature = include_bytes!("bundle.json"); +//! let binary = include_bytes!("example.bin"); +//! let rekor_pub_key = include_bytes!("rekor_pub.pem"); +//! let fulcio_crt = include_bytes!("fulcio_crt.pem"); +//! +//! bt2x_embedded::verify_bt( +//! rekor_pub_key, +//! fulcio_crt, +//! signature, +//! binary, +//! &[("foo@example.org", "issuer.example.org")], +//! ).expect("failed to verify binary"); +//! ``` + +// #[cfg(test)] +// #[macro_use] +// extern crate std; +// extern crate alloc; + +// use embedded_alloc::Heap; +// +// #[global_allocator] +// static HEAP: Heap = Heap::empty(); + +//pub mod models; + +const MAX_CERT_SIZE: usize = 4096; +const MAX_SIGNATURE_SIZE: usize = 128; +const MAX_PAYLOAD_SIZE: usize = 4096; +const MAX_PUBKEY_SIZE: usize = 1024; + +/// 'Compact' version of a cosign bundle, which is optimized to eliminate the need for a JSON encoder. +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct Bundle<'a> { + /// Base64 encoded SET. + pub signed_entry_timestamp: &'a str, + /// Base64 encoded [BundlePayload]. + pub payload: &'a str, +} + +/// Cosign Bundle Payload. +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct BundlePayload<'a> { + /// Base64 encoded [BundleBody]. + pub body: &'a str, + /// The timestamp of when the bundle was presented to the log. Has to be within ten minutes of the creation of a Fulcio signing cert. + pub integrated_time: u64, + /// The index of the entry in the log. + pub log_index: u32, + /// The ID of the log entry. + #[serde(rename = "logID")] + pub log_id: &'a str, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +#[serde(bound(deserialize = "'de: 'a"))] +pub struct BundleBody<'a> { + pub kind: Kind, + pub api_version: &'a str, + pub spec: HashedRekordObj<'a>, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +#[serde(bound(deserialize = "'de: 'a"))] +pub struct HashedRekordObj<'a> { + pub data: HashRekordData<'a>, + pub signature: Signature<'a>, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(bound(deserialize = "'de: 'a"))] +pub struct HashRekordData<'a> { + pub hash: Hash<'a>, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Hash<'a> { + pub algorithm: HashAlgorithm, + pub value: &'a str, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "lowercase")] +pub enum HashAlgorithm { + Sha256, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Signature<'a> { + pub format: Option, + pub content: &'a str, + pub public_key: PublicKey<'a>, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct PublicKey<'a> { + pub content: &'a str, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub enum SignatureFormat { + //Pgp, + //Minisign, + X509, + //Ssh, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "lowercase")] +pub enum Kind { + HashedRekord, +} + +pub struct FuncResult<'a> { + pub integrated_time: u32, + pub log_index: u32, + pub log_id: &'a str, + pub body: BundleBody<'a>, +} + +pub type EcdsaP256Sha256Asn1Signature = p256::ecdsa::Signature; +pub type EcdsaP256Key = p256::ecdsa::VerifyingKey; + +use core::fmt::Debug; +use p256::ecdsa::signature::DigestVerifier; +pub use serde_json_core::de::Error as SerdeDeserializationError; +pub use sha2::{Digest, Sha256}; + +#[derive(Debug)] +pub enum VerificationError { + /// Failed to deserialize the [Bundle] + DeserializationFailedBundle(serde_json_core::de::Error), + /// Failed to deserialize the [BundlePayload]. + DeserializationFailedBundlePayload, + /// Failed to deserialize the [BundleBody]. + DeserializationFailedBundleBody, + SetVerificationFailed, + ParsingPubKeyFailed, + ParsingSignatureFailed, + DecodingB64Failed, + DecodingHexFailed, + /// Hash in the bundle does not matched the calculated hash. + HashDifferent, + /// The signing cert is not trusted. + UntrustedCert, + /// Failed to PEM decode a certificate. + ParsingCertFailedPem(pem_rfc7468::Error), + /// Failed to DER decode a certificate. + ParsingCertFailedDer(der::Error), + /// Log timestamp is not within the validity period. + TimestampNotInValidity, + /// Pubkey type is not supported. + UnsupportedPubKey, + InvalidSignatureSet, + InvalidSignatureCertificate, + InvalidSignature, + ErrorThatIndicatesImplementationError, + OutOfBufferSpace, + /// Signing certificate identity is does not match a trusted identity. + SubjectIdentityMismatch, +} + +#[derive(Debug)] +pub enum SignedObject<'a, H: Digest + Debug> { + Blob(&'a [u8]), + Digest(H), +} + +impl<'a, H: Digest + Debug> From<&'a [u8]> for SignedObject<'a, H> { + fn from(value: &'a [u8]) -> Self { + SignedObject::Blob(value) + } +} + +impl<'a> From for SignedObject<'a, Sha256> { + fn from(value: Sha256) -> Self { + SignedObject::Digest(value) + } +} + +fn parse_cert<'a>( + pem: &[u8], + output: &'a mut [u8], +) -> Result, VerificationError> { + let (_, decoded) = + pem_rfc7468::decode(pem, output).map_err(VerificationError::ParsingCertFailedPem)?; + + ::from_der(decoded).map_err(VerificationError::ParsingCertFailedDer) +} + +/// Verify that PEM encoded signing certificate was signed by the root CA. +fn verify_signing_cert<'a>( + root_cert: &[u8], + pem_signing: &[u8], + output_buf: &'a mut [u8], +) -> Result, VerificationError> { + // Load root cert. + let mut root_cert_buf = [0_u8; MAX_CERT_SIZE]; + let root_cert = parse_cert(root_cert, root_cert_buf.as_mut_slice())?; + + // Load signing cert. + let signing_cert = parse_cert(pem_signing, output_buf)?; + let mut tbs_encoding_buf = [0_u8; MAX_CERT_SIZE]; + + // Encode the signing cert as a TBS, which is the part of the certificate that is signed. + let tbs_encoded = signing_cert + .tbs_certificate + .encode_to_slice(tbs_encoding_buf.as_mut_slice()) + .map_err(|_| VerificationError::ErrorThatIndicatesImplementationError)?; + + // Load the CA key. + let spki = root_cert.tbs_certificate.subject_public_key_info; + let pubkey = + ecdsa::VerifyingKey::try_from(spki).map_err(|_| VerificationError::ParsingPubKeyFailed)?; + + // Verify that the certificate was signed by the CA. + verify_signature( + signing_cert.signature.raw_bytes(), + tbs_encoded.into(), + &pubkey, + ) + .map_err(|_| VerificationError::InvalidSignatureCertificate)?; + + Ok(signing_cert) +} + +fn verify_signature( + signature: &[u8], + msg: SignedObject<'_, Sha256>, + verifying_key: &VerifyingKey, +) -> Result<(), VerificationError> { + // create a Sha256 object + let hasher = match msg { + SignedObject::Blob(blob) => ::new().chain_update(blob), + SignedObject::Digest(hasher) => hasher, + }; + + let signature = ecdsa::Signature::from_der(signature) + .map_err(|_| VerificationError::ParsingSignatureFailed)?; + verifying_key + .verify_digest(hasher, &signature) + .map(|_| ()) + .map_err(|_| VerificationError::InvalidSignature) +} + +/// Verifies the binary in `msg`, which can be either a &[u8] or calculated `Sha256` hash. +/// The `rekor_pub_key` is PEM encoded key of the Rekor server that signed the entry timestamp. +/// The parameter `root_cert` is the PEM encoded root certificate of the Fulcio CA that issues the signing certificates. +/// The signature is provided via the `bundle` parameter, it has to be formatted in a modified cosign bundle format, refer to the [Bundle struct](Bundle) for more information. +pub fn verify_bt<'a, 'b>( + rekor_pub_key: &[u8], + root_cert: &[u8], + bundle: &'a [u8], + msg: impl Into>, + subject_identities: &[(&str, &str)], +) -> Result, VerificationError> { + // decode the bundle + let (bundle, _) = serde_json_core::from_slice::(bundle) + .map_err(VerificationError::DeserializationFailedBundle)?; + + // Decode the SET from Base64 to the raw signature. + let mut set_buf = [0_u8; MAX_SIGNATURE_SIZE]; + let set_decoded = Base64::decode( + bundle.signed_entry_timestamp.as_bytes(), + set_buf.as_mut_slice(), + ) + .map_err(|_| VerificationError::ErrorThatIndicatesImplementationError)?; + + // Decode the payload of the bundle from Base64 to JSOn. + let mut payload_buf = [0_u8; MAX_PAYLOAD_SIZE]; + let payload_decoded = Base64::decode(bundle.payload.as_bytes(), payload_buf.as_mut_slice()) + .map_err(|_| VerificationError::DecodingB64Failed)?; + + // Decode the Rekor public key. + let mut pem_decode_buf = [0_u8; MAX_PUBKEY_SIZE]; + let (_, decoded) = pem_rfc7468::decode(rekor_pub_key, pem_decode_buf.as_mut_slice()) + .map_err(|_| VerificationError::ParsingPubKeyFailed)?; + let spki = spki::SubjectPublicKeyInfoRef::from_der(decoded) + .map_err(|_| VerificationError::ParsingPubKeyFailed)?; + let rekor_pub_key = + ecdsa::VerifyingKey::try_from(spki).map_err(|_| VerificationError::ParsingPubKeyFailed)?; + + // Verify that the signature was presented to the Rekor log by verifying that the payload was signed by the log with its public key. + verify_signature(set_decoded, payload_decoded.into(), &rekor_pub_key) + .map_err(|_| InvalidSignatureSet)?; + + // Decode the payload JSON. + let (payload, _) = serde_json_core::from_slice::(payload_decoded) + .map_err(|_| VerificationError::DeserializationFailedBundlePayload)?; + + // Extract the Base64 encoded body of the bundle. + let mut body_buf = [0_u8; 4096]; + let body_decoded = Base64::decode(payload.body.as_bytes(), body_buf.as_mut_slice()) + .map_err(|_| VerificationError::DecodingB64Failed)?; + + // Decode the JSON bundle body. + let (body, _) = serde_json_core::from_slice::(body_decoded) + .map_err(|_| VerificationError::DeserializationFailedBundleBody)?; + + // Decode hash from Rekor Entry + let mut given_digest = [0_u8; 32]; + hex::decode_to_slice(body.spec.data.hash.value, &mut given_digest) + .map_err(|_| VerificationError::DecodingHexFailed)?; + + // Base64 decode the signing cert. + let mut cert_buf = [0_u8; MAX_CERT_SIZE]; + let cert_decoded = Base64::decode( + body.spec.signature.public_key.content.as_bytes(), + cert_buf.as_mut_slice(), + ) + .map_err(|_| VerificationError::DecodingB64Failed)?; + + // Load the certificate and verify that it was issued by the trusted Fulcio instance. + let mut cert_pem_decode_buf = [0_u8; MAX_CERT_SIZE]; + let signing_cert = + verify_signing_cert(root_cert, cert_decoded, cert_pem_decode_buf.as_mut_slice())?; + if signing_cert + .tbs_certificate + .validity + .not_after + .to_unix_duration() + .as_secs() + < payload.integrated_time + || signing_cert + .tbs_certificate + .validity + .not_before + .to_unix_duration() + .as_secs() + > payload.integrated_time + { + return Err(VerificationError::TimestampNotInValidity); + } + // Verify that the subject that requested the signing certificate is trusted. + verify_subject_identities(&signing_cert, subject_identities) + .map_err(|_| VerificationError::SubjectIdentityMismatch)?; + + // Extract the public key from the signing certificate. + let spki = signing_cert.tbs_certificate.subject_public_key_info; + let pubkey = + ecdsa::VerifyingKey::try_from(spki).map_err(|_| VerificationError::ParsingPubKeyFailed)?; + + // Decode the signature. + let mut signature_buf = [0_u8; MAX_SIGNATURE_SIZE]; + let signature_decoded = Base64::decode( + body.spec.signature.content.as_bytes(), + signature_buf.as_mut_slice(), + ) + .map_err(|_| VerificationError::DecodingB64Failed)?; + + // Verify the signature of the binary. + verify_signature(signature_decoded, msg.into(), &pubkey) + .map_err(|_| VerificationError::InvalidSignature)?; + Ok(bundle) +} + +use base64ct::{Base64, Encoding}; +use der::asn1::{BitStringRef, IntRef, ObjectIdentifier, OctetStringRef, SequenceOf, SetOf}; +//use base64::{Engine as _, alphabet, engine::{self, general_purpose}}; +use der::{ + AnyRef, Decode, DecodeValue, Encode, EncodeValue, ErrorKind, FixedTag, Header, Length, Reader, + Sequence, Tag, ValueOrd, Writer, +}; + +use p256::ecdsa; +use p256::ecdsa::VerifyingKey; +//use p256::ecdsa::VerifyingKey; +use crate::VerificationError::InvalidSignatureSet; +use pkcs8::SubjectPublicKeyInfoRef; +use spki::AlgorithmIdentifierRef; +use x509_cert::time::Validity; +use x509_cert::Version; +//use spki::DecodePublicKey; + +#[derive(Clone, Debug, Sequence, ValueOrd)] +struct CertificateRef<'a> { + pub tbs_certificate: TbsCertificateRef<'a>, + pub signature_algorithm: AlgorithmIdentifierRef<'a>, + pub signature: BitStringRef<'a>, +} + +const N_TBS_EXT: usize = 10; +const N_TBS_RDN_SEQ: usize = 10; +const N_TBS_RDN: usize = 5; + +#[derive(Clone, Debug, Sequence, ValueOrd)] +#[allow(missing_docs)] +struct TbsCertificateRef<'a> { + /// The certificate version + /// + /// Note that this value defaults to Version 1 per the RFC. However, + /// fields such as `issuer_unique_id`, `subject_unique_id` and `extensions` + /// require later versions. Care should be taken in order to ensure + /// standards compliance. + #[asn1(context_specific = "0", default = "Default::default")] + pub version: Version, + + pub serial_number: SerialNumberRef<'a>, + pub signature: AlgorithmIdentifierRef<'a>, + pub issuer: NameRef<'a, N_TBS_RDN, N_TBS_RDN_SEQ>, + pub validity: Validity, + pub subject: NameRef<'a, N_TBS_RDN, N_TBS_RDN_SEQ>, + pub subject_public_key_info: SubjectPublicKeyInfoRef<'a>, + + #[asn1(context_specific = "1", tag_mode = "IMPLICIT", optional = "true")] + pub issuer_unique_id: Option>, + + #[asn1(context_specific = "2", tag_mode = "IMPLICIT", optional = "true")] + pub subject_unique_id: Option>, + + #[asn1(context_specific = "3", tag_mode = "EXPLICIT", optional = "true")] + pub extensions: Option>, +} + +type NameRef<'a, const N_RDN: usize, const N_RDN_SEQ: usize> = RdnSequence<'a, N_RDN, N_RDN_SEQ>; + +#[derive(Clone, Debug, Default)] +struct RdnSequence<'a, const N_RDN: usize, const N_RDN_SEQ: usize>( + pub SequenceOf, N_RDN_SEQ>, +); +impl_newtype_generics!( + RdnSequence<'a, N_IMPL1, N_IMPL2>, + SequenceOf, N_IMPL2>, + N_IMPL1, + N_IMPL2 +); + +#[derive(Clone, Debug, Default)] +struct RelativeDistinguishedName<'a, const N: usize>(pub SetOf, N>); +impl_newtype_generics!( + RelativeDistinguishedName<'a, N_IMPL1>, + SetOf, N_IMPL1>, + N_IMPL1 +); + +type Extensions<'a, const N: usize> = SequenceOf, N>; + +#[derive(Clone, Debug, Sequence, ValueOrd)] +pub struct ExtensionRef<'a> { + pub extn_id: ObjectIdentifier, + + #[asn1(default = "bool::default")] + pub critical: bool, + + pub extn_value: OctetStringRef<'a>, +} + +#[derive(Clone, Debug, Sequence, ValueOrd)] +#[allow(missing_docs)] +struct AttributeTypeAndValue<'a> { + pub oid: AttributeType, + pub value: AttributeValue<'a>, +} + +type AttributeType = ObjectIdentifier; + +type AttributeValue<'a> = AnyRef<'a>; + +#[derive(Clone, Debug, ValueOrd)] +struct SerialNumberRef<'a> { + inner: IntRef<'a>, +} + +impl<'a> SerialNumberRef<'a> { + const MAX_DECODE_LEN: Length = Length::new(21); +} + +impl<'a> EncodeValue for SerialNumberRef<'a> { + fn value_len(&self) -> DerResult { + self.inner.value_len() + } + + fn encode_value(&self, writer: &mut impl Writer) -> DerResult<()> { + self.inner.encode_value(writer) + } +} + +impl<'a> DecodeValue<'a> for SerialNumberRef<'a> { + fn decode_value>(reader: &mut R, header: Header) -> DerResult { + let inner = IntRef::<'a>::decode_value(reader, header)?; + + if inner.len() > SerialNumberRef::MAX_DECODE_LEN { + return Err(ErrorKind::Overlength.into()); + } + + Ok(Self { inner }) + } +} + +impl<'a> FixedTag for SerialNumberRef<'a> { + const TAG: Tag = as FixedTag>::TAG; +} + +type DerResult = Result; + +fn verify_subject_identities( + cert: &CertificateRef<'_>, + subject_identities: &[(&str, &str)], +) -> Result<(), ()> { + let extensions = cert.tbs_certificate.extensions.as_ref().ok_or(())?; + let issuer_ext = extensions + .iter() + .find(|&ext| ext.extn_id == ISSUER_OID) + .ok_or(())?; + let subject_ext = extensions + .iter() + .find(|&ext| ext.extn_id == SUBJECT_ALT_NAME_OID) + .ok_or(())?; + subject_identities + .iter() + .find(|(subject, issuer)| { + let issuer = OctetStringRef::new(issuer.as_bytes()).expect("failed to parse"); + // first 4 bytes contain encoding specific data, skip them + issuer == issuer_ext.extn_value + && &subject_ext.extn_value.as_bytes()[4..] == subject.as_bytes() + }) + .ok_or(())?; + Ok(()) +} + +pub const ISSUER_OID: ObjectIdentifier = ObjectIdentifier::new_unwrap("1.3.6.1.4.1.57264.1.1"); +pub const SUBJECT_ALT_NAME_OID: ObjectIdentifier = ObjectIdentifier::new_unwrap("2.5.29.17"); +#[macro_export] +macro_rules! impl_newtype_generics { + ($newtype:ty, $inner:ty, $( $i:ident ),+) => { + #[allow(unused_lifetimes)] + impl<'a, $( const $i: usize ),*> From<$inner> for $newtype { + #[inline] + fn from(value: $inner) -> Self { + Self(value) + } + } + + #[allow(unused_lifetimes)] + impl<'a, $( const $i: usize ),*> From<$newtype> for $inner { + #[inline] + fn from(value: $newtype) -> Self { + value.0 + } + } + + #[allow(unused_lifetimes)] + impl<'a, $( const $i: usize ),*> AsRef<$inner> for $newtype { + #[inline] + fn as_ref(&self) -> &$inner { + &self.0 + } + } + + #[allow(unused_lifetimes)] + impl<'a, $( const $i: usize ),*> AsMut<$inner> for $newtype { + #[inline] + fn as_mut(&mut self) -> &mut $inner { + &mut self.0 + } + } + + #[allow(unused_lifetimes)] + impl<'a, $( const $i: usize ),*> ::der::FixedTag for $newtype { + const TAG: ::der::Tag = <$inner as ::der::FixedTag>::TAG; + } + + impl<'a, $( const $i: usize ),*> ::der::DecodeValue<'a> for $newtype { + fn decode_value>( + decoder: &mut R, + header: ::der::Header, + ) -> ::der::Result { + Ok(Self(<$inner as ::der::DecodeValue>::decode_value( + decoder, header, + )?)) + } + } + + #[allow(unused_lifetimes)] + impl<'a, $( const $i: usize ),*> ::der::EncodeValue for $newtype { + fn encode_value(&self, encoder: &mut impl ::der::Writer) -> ::der::Result<()> { + self.0.encode_value(encoder) + } + + fn value_len(&self) -> ::der::Result<::der::Length> { + self.0.value_len() + } + } + + #[allow(unused_lifetimes)] + impl<'a, $( const $i: usize ),*> ::der::ValueOrd for $newtype { + fn value_cmp(&self, other: &Self) -> ::der::Result<::core::cmp::Ordering> { + self.0.value_cmp(&other.0) + } + } + }; +} diff --git a/bt2x/bt2x-embedded/src/models/alpine.rs b/bt2x/bt2x-embedded/src/models/alpine.rs new file mode 100644 index 0000000..82d42bb --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/alpine.rs @@ -0,0 +1,39 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +#[cfg(feature = "no_std")] +use alloc::string::String; + +#[cfg(feature = "no_std")] +use alloc::collections::BTreeMap as Map; + +#[cfg(feature = "std")] +use HashMap as Map; +use crate::models::log_entry_value::{Hash, PublicKey}; + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct AlpineObj { + pub package: AlpinePackage, + pub public_key: PublicKey, + pub content: String, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct AlpinePackage { + pub pkginfo: Map, + pub hash: Hash, + pub content: String, +} + + + + diff --git a/bt2x/bt2x-embedded/src/models/alpine_all_of.rs b/bt2x/bt2x-embedded/src/models/alpine_all_of.rs new file mode 100644 index 0000000..b2fecc7 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/alpine_all_of.rs @@ -0,0 +1,32 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct AlpineAllOf { + #[serde(rename = "apiVersion")] + pub api_version: alloc::string::String, + /// Schema for Alpine package objects + #[serde(rename = "spec")] + pub spec: serde_json::Value, +} + +impl AlpineAllOf { + pub fn new(api_version: &str, spec: serde_json::Value) -> AlpineAllOf { + AlpineAllOf { + api_version: api_version.into(), + spec, + } + } +} + + diff --git a/bt2x/bt2x-embedded/src/models/consistency_proof.rs b/bt2x/bt2x-embedded/src/models/consistency_proof.rs new file mode 100644 index 0000000..04c2dfe --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/consistency_proof.rs @@ -0,0 +1,41 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[cfg(feature = "no_std")] +use alloc::vec::Vec; + +use serde_with::serde_as; +use serde_with::hex::Hex; + +#[serde_as] +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ConsistencyProof { + /// The hash value stored at the root of the merkle tree at the time the proof was generated + #[serde_as(as = "Hex")] + pub root_hash: [u8; 32], + //String, + #[serde_as(as = "Vec")] + pub hashes: Vec<[u8; 32]>, +} + +impl ConsistencyProof { + pub fn new(root_hash: [u8; 32], hashes: Vec<[u8; 32]>) -> ConsistencyProof { + ConsistencyProof { + root_hash: root_hash.into(), + hashes, + } + } +} + + diff --git a/bt2x/bt2x-embedded/src/models/cose.rs b/bt2x/bt2x-embedded/src/models/cose.rs new file mode 100644 index 0000000..70ee4b3 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/cose.rs @@ -0,0 +1,36 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +#[cfg(feature = "no_std")] +use alloc::string::String; + + +#[cfg(feature = "std")] +use HashMap as Map; +use crate::models::log_entry_value::{Hash}; + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct CoseObj { + pub message: String, + pub public_key: String, + pub data: CoseData, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct CoseData { + pub payload_hash: Hash, + pub envelope_hash: Hash, + pub aad: String, +} + + diff --git a/bt2x/bt2x-embedded/src/models/cose_all_of.rs b/bt2x/bt2x-embedded/src/models/cose_all_of.rs new file mode 100644 index 0000000..be50fcc --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/cose_all_of.rs @@ -0,0 +1,32 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct CoseAllOf { + #[serde(rename = "apiVersion")] + pub api_version: alloc::string::String, + /// COSE for Rekord objects + #[serde(rename = "spec")] + pub spec: serde_json::Value, +} + +impl CoseAllOf { + pub fn new(api_version: &str, spec: serde_json::Value) -> CoseAllOf { + CoseAllOf { + api_version: api_version.into(), + spec, + } + } +} + + diff --git a/bt2x/bt2x-embedded/src/models/error.rs b/bt2x/bt2x-embedded/src/models/error.rs new file mode 100644 index 0000000..bd1eae9 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/error.rs @@ -0,0 +1,31 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct Error { + #[serde(rename = "code", skip_serializing_if = "Option::is_none")] + pub code: Option, + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, +} + +impl Error { + pub fn new() -> Error { + Error { + code: Option::<_>::None, + message: Option::<_>::None, + } + } +} + + diff --git a/bt2x/bt2x-embedded/src/models/hashedrekord.rs b/bt2x/bt2x-embedded/src/models/hashedrekord.rs new file mode 100644 index 0000000..7286bff --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/hashedrekord.rs @@ -0,0 +1,28 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +use crate::models::log_entry_value::{Hash, Signature}; + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HashedRekordObj { + pub data: HashRekordData, + pub signature: Signature, +} + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct HashRekordData { + pub hash: Hash, +} + + diff --git a/bt2x/bt2x-embedded/src/models/hashedrekord_all_of.rs b/bt2x/bt2x-embedded/src/models/hashedrekord_all_of.rs new file mode 100644 index 0000000..2e4356c --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/hashedrekord_all_of.rs @@ -0,0 +1,32 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct HashedrekordAllOf { + #[serde(rename = "apiVersion")] + pub api_version: alloc::string::String, + /// Schema for Rekord objects + #[serde(rename = "spec")] + pub spec: serde_json::Value, +} + +impl HashedrekordAllOf { + pub fn new(api_version: &str, spec: serde_json::Value) -> HashedrekordAllOf { + HashedrekordAllOf { + api_version: api_version.into(), + spec, + } + } +} + + diff --git a/bt2x/bt2x-embedded/src/models/helm.rs b/bt2x/bt2x-embedded/src/models/helm.rs new file mode 100644 index 0000000..5fecded --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/helm.rs @@ -0,0 +1,48 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +#[cfg(feature = "no_std")] +use alloc::string::String; + + + +#[cfg(feature = "std")] +use HashMap as Map; +use crate::models::log_entry_value::{Hash, PublicKey}; + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HelmObj { + pub public_key: PublicKey, + pub chart: HelmChart, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HelmChart { + pub hash: Hash, + pub provenance: Provenance, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Provenance { + pub signature: ProvenanceSignature, + pub content: String, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ProvenanceSignature { + pub content: String, +} + + diff --git a/bt2x/bt2x-embedded/src/models/helm_all_of.rs b/bt2x/bt2x-embedded/src/models/helm_all_of.rs new file mode 100644 index 0000000..e86c652 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/helm_all_of.rs @@ -0,0 +1,32 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct HelmAllOf { + #[serde(rename = "apiVersion")] + pub api_version: alloc::string::String, + /// Schema for Helm objects + #[serde(rename = "spec")] + pub spec: serde_json::Value, +} + +impl HelmAllOf { + pub fn new(api_version: &str, spec: serde_json::Value) -> HelmAllOf { + HelmAllOf { + api_version: api_version.into(), + spec, + } + } +} + + diff --git a/bt2x/bt2x-embedded/src/models/inactive_shard_log_info.rs b/bt2x/bt2x-embedded/src/models/inactive_shard_log_info.rs new file mode 100644 index 0000000..3ff3e59 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/inactive_shard_log_info.rs @@ -0,0 +1,44 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +#[cfg(feature = "no_std")] +use alloc::string::String; + +use serde_with::serde_as; +use serde_with::hex::Hex; + +#[serde_as] +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all="camelCase")] +pub struct InactiveShardLogInfo { + /// The current hash value stored at the root of the merkle tree + #[serde_as(as = "Hex")] + pub root_hash: [u8; 32], /// The current number of nodes in the merkle tree + pub tree_size: u64, + /// The current signed tree head + pub signed_tree_head: String, + /// The current treeID + #[serde(rename = "treeID")] + pub tree_id: String, +} + +impl InactiveShardLogInfo { + pub fn new(root_hash: [u8; 32], tree_size: u64, signed_tree_head: String, tree_id: String) -> InactiveShardLogInfo { + InactiveShardLogInfo { + root_hash, + tree_size, + signed_tree_head, + tree_id, + } + } +} + + diff --git a/bt2x/bt2x-embedded/src/models/inclusion_proof.rs b/bt2x/bt2x-embedded/src/models/inclusion_proof.rs new file mode 100644 index 0000000..454067d --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/inclusion_proof.rs @@ -0,0 +1,54 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +#[cfg(feature = "no_std")] +use alloc::vec::Vec; +#[cfg(feature = "no_std")] +use alloc::string::String; + + +use serde_with::serde_as; +use serde_with::hex::Hex; + +#[serde_as] +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct InclusionProof { + /// The index of the entry in the transparency log + #[serde(rename = "logIndex")] + pub log_index: i32, + /// The hash value stored at the root of the merkle tree at the time the proof was generated + #[serde_as(as = "Hex")] + pub root_hash: [u8; 32], + /// The size of the merkle tree at the time the inclusion proof was generated + #[serde(rename = "treeSize")] + pub tree_size: u64, + /// A list of hashes required to compute the inclusion proof, sorted in order from leaf to root + #[serde_as(as = "Vec")] + pub hashes: Vec<[u8; 32]>, + /// The checkpoint (signed tree head) that the inclusion proof is based on + #[serde(rename = "checkpoint")] + pub checkpoint: String, +} + +impl InclusionProof { + pub fn new(log_index: i32, root_hash: [u8; 32], tree_size: u64, hashes: Vec<[u8; 32]>, checkpoint: String) -> InclusionProof { + InclusionProof { + log_index, + root_hash, + tree_size, + hashes, + checkpoint, + } + } +} + + diff --git a/bt2x/bt2x-embedded/src/models/intoto.rs b/bt2x/bt2x-embedded/src/models/intoto.rs new file mode 100644 index 0000000..adad171 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/intoto.rs @@ -0,0 +1,36 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +#[cfg(feature = "no_std")] +use alloc::string::String; + + + +#[cfg(feature = "std")] +use HashMap as Map; +use crate::models::log_entry_value::{Hash}; + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct InTotoObj { + pub content: InTotoContent, + pub public_key: String, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct InTotoContent { + pub envelope: String, + pub hash: Hash, + pub payload_hash: Hash, +} + + diff --git a/bt2x/bt2x-embedded/src/models/intoto_all_of.rs b/bt2x/bt2x-embedded/src/models/intoto_all_of.rs new file mode 100644 index 0000000..6ebb850 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/intoto_all_of.rs @@ -0,0 +1,32 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct IntotoAllOf { + #[serde(rename = "apiVersion")] + pub api_version: alloc::string::String, + /// Intoto for Rekord objects + #[serde(rename = "spec")] + pub spec: serde_json::Value, +} + +impl IntotoAllOf { + pub fn new(api_version: &str, spec: serde_json::Value) -> IntotoAllOf { + IntotoAllOf { + api_version: api_version.into(), + spec, + } + } +} + + diff --git a/bt2x/bt2x-embedded/src/models/jar.rs b/bt2x/bt2x-embedded/src/models/jar.rs new file mode 100644 index 0000000..a717781 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/jar.rs @@ -0,0 +1,34 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +#[cfg(feature = "no_std")] +use alloc::string::String; + + +#[cfg(feature = "std")] +use HashMap as Map; +use crate::models::log_entry_value::{Hash, Signature}; + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct JarObj { + pub signature: Signature, + pub archive: JarArchive, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct JarArchive { + pub hash: Hash, + pub content: String, +} + + diff --git a/bt2x/bt2x-embedded/src/models/jar_all_of.rs b/bt2x/bt2x-embedded/src/models/jar_all_of.rs new file mode 100644 index 0000000..b0344fa --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/jar_all_of.rs @@ -0,0 +1,32 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct JarAllOf { + #[serde(rename = "apiVersion")] + pub api_version: alloc::string::String, + /// Schema for JAR objects + #[serde(rename = "spec")] + pub spec: serde_json::Value, +} + +impl JarAllOf { + pub fn new(api_version: &str, spec: serde_json::Value) -> JarAllOf { + JarAllOf { + api_version: api_version.into(), + spec, + } + } +} + + diff --git a/bt2x/bt2x-embedded/src/models/log_entry_value.rs b/bt2x/bt2x-embedded/src/models/log_entry_value.rs new file mode 100644 index 0000000..8ab7a0c --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/log_entry_value.rs @@ -0,0 +1,176 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[cfg(feature = "no_std")] +use alloc::string::String; +#[cfg(feature = "no_std")] +use alloc::vec::Vec; +#[cfg(feature = "no_std")] +use alloc::collections::BTreeMap as Map; + +#[cfg(feature = "std")] +use HashMap as Map; + +#[cfg(feature = "no_std")] +use alloc::boxed::Box; + +use serde_with::serde_as; +use serde_with::hex::Hex; + +use serde_with::base64::{Base64, Standard}; +use serde_with::formats::{Padded}; + +use crate::models::alpine::AlpineObj; +use crate::models::cose::CoseObj; +use crate::models::hashedrekord::HashedRekordObj; +use crate::models::helm::HelmObj; +use crate::models::intoto::InTotoObj; +use crate::models::JarObj; +use crate::models::rekord::RekordObj; +use crate::models::rfc3161::Rfc3161Obj; +use crate::models::rpm::RpmObj; +use crate::models::tuf::TufObj; + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct LogEntryValue { + /// This is the SHA256 hash of the DER-encoded public key for the log at the time the entry was included in the log + #[serde(rename = "LogID")] + pub log_id: String, + //String, + #[serde(rename = "LogIndex")] + pub log_index: i32, + #[serde(rename = "Body")] + pub body: LogEntryBody, + #[serde(rename = "IntegratedTime")] + pub integrated_time: i32, + #[serde(rename = "attestation", skip_serializing_if = "Option::is_none")] + pub attestation: Option>, + #[serde(rename = "verification", skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub enum LogEntryBody { + #[serde(rename = "HashedRekordObj")] + HashedRekord(HashedRekordObj), + #[serde(rename = "Rfc3161Obj")] + Rfc3161(Rfc3161Obj), + #[serde(rename = "AlpineObj")] + Alpine(AlpineObj), + #[serde(rename = "CoseObj")] + Cose(CoseObj), + #[serde(rename = "HelmObj")] + Helm(HelmObj), + #[serde(rename = "InTotoObj")] + InToto(InTotoObj), + #[serde(rename = "JarObj")] + Jar(JarObj), + #[serde(rename = "RekordObj")] + Rekord(RekordObj), + #[serde(rename = "RpmObj")] + Rpm(RpmObj), + #[serde(rename = "TufObj")] + Tuf(TufObj), +} + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct PgpKey { + pub content: String, +} + + +#[serde_as] +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "lowercase", tag = "algorithm", content = "value")] +pub enum Hash { + Sha256( + #[serde_as(as = "Hex")] + [u8; 32] + ), +} + +#[serde_as] +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Signature { + pub format: Option, + #[serde_as(as = "Base64")] + pub content: Vec, + pub public_key: PublicKey, +} + +#[serde_as] +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct PublicKey { + #[serde_as(as = "Base64")] + pub content: Vec, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub enum SignatureFormat { + Pgp, + Minisign, + X509, + Ssh, +} + + +impl LogEntryValue { + pub fn new(log_id: &str, log_index: i32, body: LogEntryBody, integrated_time: i32) -> LogEntryValue { + LogEntryValue { + log_id: log_id.into(), + log_index, + body, + integrated_time, + attestation: Option::<_>::None, + verification: Option::<_>::None, + } + } +} + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct LogEntryValueAttestation { + #[serde(rename = "data", skip_serializing_if = "Option::is_none")] + pub data: Option>, +} + +impl LogEntryValueAttestation { + pub fn new() -> LogEntryValueAttestation { + LogEntryValueAttestation { + data: Option::<_>::None, + } + } +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct LogEntryValueVerification { + #[serde(rename = "inclusionProof", skip_serializing_if = "Option::is_none")] + pub inclusion_proof: Option>, + /// Signature over the logID, logIndex, body and integratedTime. + #[serde(rename = "signedEntryTimestamp", skip_serializing_if = "Option::is_none")] + pub signed_entry_timestamp: Option, +} + +impl LogEntryValueVerification { + pub fn new() -> LogEntryValueVerification { + LogEntryValueVerification { + inclusion_proof: Option::<_>::None, + signed_entry_timestamp: Option::<_>::None, + } + } +} \ No newline at end of file diff --git a/bt2x/bt2x-embedded/src/models/log_entry_value_attestation.rs b/bt2x/bt2x-embedded/src/models/log_entry_value_attestation.rs new file mode 100644 index 0000000..aef93fb --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/log_entry_value_attestation.rs @@ -0,0 +1,28 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct LogEntryValueAttestation { + #[serde(rename = "data", skip_serializing_if = "Option::is_none")] + pub data: Option, +} + +impl LogEntryValueAttestation { + pub fn new() -> LogEntryValueAttestation { + LogEntryValueAttestation { + data: Option::<_>::None, + } + } +} + + diff --git a/bt2x/bt2x-embedded/src/models/log_entry_value_verification.rs b/bt2x/bt2x-embedded/src/models/log_entry_value_verification.rs new file mode 100644 index 0000000..683f1fe --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/log_entry_value_verification.rs @@ -0,0 +1,32 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct LogEntryValueVerification { + #[serde(rename = "inclusionProof", skip_serializing_if = "Option::is_none")] + pub inclusion_proof: Option>, + /// Signature over the logID, logIndex, body and integratedTime. + #[serde(rename = "signedEntryTimestamp", skip_serializing_if = "Option::is_none")] + pub signed_entry_timestamp: Option, +} + +impl LogEntryValueVerification { + pub fn new() -> LogEntryValueVerification { + LogEntryValueVerification { + inclusion_proof: Option::<_>::None, + signed_entry_timestamp: Option::<_>::None, + } + } +} + + diff --git a/bt2x/bt2x-embedded/src/models/log_info.rs b/bt2x/bt2x-embedded/src/models/log_info.rs new file mode 100644 index 0000000..1c8d001 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/log_info.rs @@ -0,0 +1,51 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + +#[cfg(feature = "no_std")] +use alloc::string::String; +#[cfg(feature = "no_std")] +use alloc::vec::Vec; + +use serde_with::serde_as; +use serde_with::hex::Hex; + +#[serde_as] +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct LogInfo { + /// The current hash value stored at the root of the merkle tree + #[serde_as(as = "Hex")] + pub root_hash: [u8; 32], + /// The current number of nodes in the merkle tree + pub tree_size: u64, + /// The current signed tree head + pub signed_tree_head: String, + /// The current treeID + #[serde(rename = "treeID")] + pub tree_id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub inactive_shards: Option>, +} + +impl LogInfo { + pub fn new(root_hash: [u8; 32], tree_size: u64, signed_tree_head: String, tree_id: String) -> LogInfo { + LogInfo { + root_hash, + tree_size, + signed_tree_head, + tree_id, + inactive_shards: Option::<_>::None, + } + } +} + + diff --git a/bt2x/bt2x-embedded/src/models/mod.rs b/bt2x/bt2x-embedded/src/models/mod.rs new file mode 100644 index 0000000..af3a6a0 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/mod.rs @@ -0,0 +1,45 @@ +//pub mod alpine; +//pub use self::alpine::AlpineObj; +// pub mod consistency_proof; +//pub use self::consistency_proof::ConsistencyProof; +//pub mod cose; +//pub use self::cose::CoseObj; +//pub mod error; +//pub use self::error::Error; +//pub mod hashedrekord; +//pub use self::hashedrekord::HashedRekordObj; +//pub mod helm; +//pub use self::helm::HelmObj; +//pub mod inactive_shard_log_info; +//pub use self::inactive_shard_log_info::InactiveShardLogInfo; +//pub mod inclusion_proof; +//pub use self::inclusion_proof::InclusionProof; +//pub mod intoto; +//pub use self::intoto::InTotoObj; +//pub mod jar; +//pub use self::jar::JarObj; +//pub mod log_entry_value; +//pub use self::log_entry_value::{ +// LogEntryValue, +// LogEntryValueAttestation, +// LogEntryValueVerification, +//}; +//pub mod log_info; +//pub use self::log_info::LogInfo; +//pub mod proposed_entry; +//pub use self::proposed_entry::ProposedEntry; +//pub mod rekord; +//pub use self::rekord::RekordObj; +//pub mod rfc3161; +//pub use self::rfc3161::Rfc3161Obj; +//pub mod rpm; +//pub use self::rpm::RpmObj; +//pub mod search_index; +//pub use self::search_index::SearchIndex; +//pub mod search_index_public_key; +//pub use self::search_index_public_key::SearchIndexPublicKey; +//pub mod search_log_query; +//pub use self::search_log_query::SearchLogQuery; +//pub mod tuf; +//pub use self::tuf::TufObj; +// \ No newline at end of file diff --git a/bt2x/bt2x-embedded/src/models/proposed_entry.rs b/bt2x/bt2x-embedded/src/models/proposed_entry.rs new file mode 100644 index 0000000..dc80ccd --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/proposed_entry.rs @@ -0,0 +1,109 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +#[cfg(feature = "no_std")] +use alloc::string::String; + + +#[cfg(feature = "std")] +use HashMap as Map; +use crate::models::alpine::AlpineObj; +use crate::models::cose::CoseObj; +use crate::models::{HashedRekordObj, HelmObj, InTotoObj, JarObj, RekordObj, Rfc3161Obj, RpmObj, TufObj}; + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(tag = "kind")] +pub enum ProposedEntry { + #[serde(rename = "alpine")] + Alpine { + #[serde(rename = "apiVersion")] + api_version: String, + /// Schema for Alpine package objects + #[serde(rename = "spec")] + spec: AlpineObj, + }, + #[serde(rename = "cose")] + Cose { + #[serde(rename = "apiVersion")] + api_version: String, + /// COSE for Rekord objects + #[serde(rename = "spec")] + spec: CoseObj, + }, + #[serde(rename = "hashedrekord")] + HashedRekord { + #[serde(rename = "apiVersion")] + api_version: String, + /// Schema for Rekord objects + #[serde(rename = "spec")] + spec: HashedRekordObj, + }, + #[serde(rename = "helm")] + Helm { + #[serde(rename = "apiVersion")] + api_version: String, + /// Schema for Helm objects + #[serde(rename = "spec")] + spec: HelmObj, + }, + #[serde(rename = "intoto")] + InToto { + #[serde(rename = "apiVersion")] + api_version: String, + /// Intoto for Rekord objects + #[serde(rename = "spec")] + spec: InTotoObj, + }, + #[serde(rename = "jar")] + Jar { + #[serde(rename = "apiVersion")] + api_version: String, + /// Schema for JAR objects + #[serde(rename = "spec")] + spec: JarObj, + }, + #[serde(rename = "rekord")] + Rekord { + #[serde(rename = "apiVersion")] + api_version: String, + /// Schema for Rekord objects + #[serde(rename = "spec")] + spec: RekordObj, + }, + #[serde(rename = "rfc3161")] + Rfc3161 { + #[serde(rename = "apiVersion")] + api_version: String, + /// Schema for RFC 3161 timestamp objects + #[serde(rename = "spec")] + spec: Rfc3161Obj, + }, + #[serde(rename = "rpm")] + Rpm { + #[serde(rename = "apiVersion")] + api_version: String, + /// Schema for RPM objects + #[serde(rename = "spec")] + spec: RpmObj, + }, + #[serde(rename = "tuf")] + Tuf { + #[serde(rename = "apiVersion")] + api_version: String, + /// Schema for TUF metadata objects + #[serde(rename = "spec")] + spec: TufObj, + }, +} + + + + diff --git a/bt2x/bt2x-embedded/src/models/rekord.rs b/bt2x/bt2x-embedded/src/models/rekord.rs new file mode 100644 index 0000000..9e700d7 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/rekord.rs @@ -0,0 +1,34 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +#[cfg(feature = "no_std")] +use alloc::string::String; + + + +#[cfg(feature = "std")] +use HashMap as Map; +use crate::models::log_entry_value::{Hash, Signature}; + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct RekordObj { + data: RekordData, + signature: Signature, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct RekordData { + pub content: String, + pub hash: Hash, +} + + diff --git a/bt2x/bt2x-embedded/src/models/rekord_all_of.rs b/bt2x/bt2x-embedded/src/models/rekord_all_of.rs new file mode 100644 index 0000000..47fd759 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/rekord_all_of.rs @@ -0,0 +1,32 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct RekordAllOf { + #[serde(rename = "apiVersion")] + pub api_version: alloc::string::String, + /// Schema for Rekord objects + #[serde(rename = "spec")] + pub spec: serde_json::Value, +} + +impl RekordAllOf { + pub fn new(api_version: &str, spec: serde_json::Value) -> RekordAllOf { + RekordAllOf { + api_version: api_version.into(), + spec, + } + } +} + + diff --git a/bt2x/bt2x-embedded/src/models/rfc3161.rs b/bt2x/bt2x-embedded/src/models/rfc3161.rs new file mode 100644 index 0000000..8592690 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/rfc3161.rs @@ -0,0 +1,31 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +#[cfg(feature = "no_std")] +use alloc::string::String; + + +#[cfg(feature = "std")] +use HashMap as Map; + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Rfc3161Obj { + pub tsr: Rfc3161Tsr, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct Rfc3161Tsr { + pub content: String, +} + + diff --git a/bt2x/bt2x-embedded/src/models/rfc3161_all_of.rs b/bt2x/bt2x-embedded/src/models/rfc3161_all_of.rs new file mode 100644 index 0000000..b8a192f --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/rfc3161_all_of.rs @@ -0,0 +1,32 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct Rfc3161AllOf { + #[serde(rename = "apiVersion")] + pub api_version: alloc::string::String, + /// Schema for RFC 3161 timestamp objects + #[serde(rename = "spec")] + pub spec: serde_json::Value, +} + +impl Rfc3161AllOf { + pub fn new(api_version: &str, spec: serde_json::Value) -> Rfc3161AllOf { + Rfc3161AllOf { + api_version: api_version.into(), + spec, + } + } +} + + diff --git a/bt2x/bt2x-embedded/src/models/rpm.rs b/bt2x/bt2x-embedded/src/models/rpm.rs new file mode 100644 index 0000000..acecbe4 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/rpm.rs @@ -0,0 +1,37 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +#[cfg(feature = "no_std")] +use alloc::string::String; + +#[cfg(feature = "no_std")] +use alloc::collections::BTreeMap as Map; + +#[cfg(feature = "std")] +use HashMap as Map; +use crate::models::log_entry_value::{Hash, PgpKey}; + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct RpmObj { + pub public_key: PgpKey, + pub package: RpmPackage, +} + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct RpmPackage { + pub headers: Map, + pub hash: Hash, + pub content: String, + +} + + diff --git a/bt2x/bt2x-embedded/src/models/rpm_all_of.rs b/bt2x/bt2x-embedded/src/models/rpm_all_of.rs new file mode 100644 index 0000000..4246704 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/rpm_all_of.rs @@ -0,0 +1,32 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct RpmAllOf { + #[serde(rename = "apiVersion")] + pub api_version: alloc::string::String, + /// Schema for RPM objects + #[serde(rename = "spec")] + pub spec: serde_json::Value, +} + +impl RpmAllOf { + pub fn new(api_version: &str, spec: serde_json::Value) -> RpmAllOf { + RpmAllOf { + api_version: api_version.into(), + spec, + } + } +} + + diff --git a/bt2x/bt2x-embedded/src/models/schema/alpine_v0_0_1_schema.json b/bt2x/bt2x-embedded/src/models/schema/alpine_v0_0_1_schema.json new file mode 100644 index 0000000..2aa73a0 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/schema/alpine_v0_0_1_schema.json @@ -0,0 +1,67 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://rekor.sigstore.dev/types/alpine/alpine_v0_0_1_schema.json", + "title": "Alpine v0.0.1 Schema", + "description": "Schema for Alpine Package entries", + "type": "object", + "properties": { + "publicKey" : { + "description": "The public key that can verify the package signature", + "type": "object", + "properties": { + "content": { + "description": "Specifies the content of the public key inline within the document", + "type": "string", + "format": "byte" + } + }, + "required": [ "content" ] + }, + "package": { + "description": "Information about the package associated with the entry", + "type": "object", + "properties": { + "pkginfo": { + "description": "Values of the .PKGINFO key / value pairs", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, + "hash": { + "description": "Specifies the hash algorithm and value for the package", + "type": "object", + "properties": { + "algorithm": { + "description": "The hashing function used to compute the hash value", + "type": "string", + "enum": [ "sha256" ] + }, + "value": { + "description": "The hash value for the package", + "type": "string" + } + }, + "readOnly": true, + "required": [ "algorithm", "value" ] + }, + "content": { + "description": "Specifies the package inline within the document", + "type": "string", + "format": "byte", + "writeOnly": true + } + }, + "oneOf": [ + { + "required": [ "hash" ] + }, + { + "required": [ "content" ] + } + ] + } + }, + "required": [ "publicKey", "package" ] +} diff --git a/bt2x/bt2x-embedded/src/models/schema/cose_v0_0_1_schema.json b/bt2x/bt2x-embedded/src/models/schema/cose_v0_0_1_schema.json new file mode 100644 index 0000000..cfc917d --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/schema/cose_v0_0_1_schema.json @@ -0,0 +1,81 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://rekor.sigstore.dev/types/cose/cose_v0_0_1_schema.json", + "title": "cose v0.0.1 Schema", + "description": "Schema for cose object", + "type": "object", + "properties": { + "message": { + "description": "The COSE Sign1 Message", + "type": "string", + "format": "byte", + "writeOnly": true + }, + "publicKey": { + "description": "The public key that can verify the signature", + "type": "string", + "format": "byte" + }, + "data": { + "description": "Information about the content associated with the entry", + "type": "object", + "properties": { + "payloadHash": { + "description": "Specifies the hash algorithm and value for the content", + "type": "object", + "readOnly": true, + "properties": { + "algorithm": { + "description": "The hashing function used to compute the hash value", + "type": "string", + "enum": [ + "sha256" + ] + }, + "value": { + "description": "The hash value for the content", + "type": "string" + } + }, + "required": [ + "algorithm", + "value" + ] + }, + "envelopeHash": { + "description": "Specifies the hash algorithm and value for the COSE envelope", + "type": "object", + "readOnly": true, + "properties": { + "algorithm": { + "description": "The hashing function used to compute the hash value", + "type": "string", + "enum": [ + "sha256" + ] + }, + "value": { + "description": "The hash value for the envelope", + "type": "string" + } + }, + "required": [ + "algorithm", + "value" + ] + }, + "aad": { + "description": "Specifies the additional authenticated data required to verify the signature", + "type": "string", + "format": "byte", + "writeOnly": true + } + }, + "required": [] + } + }, + "required": [ + "publicKey", + "data" + ] +} diff --git a/bt2x/bt2x-embedded/src/models/schema/hashedrekord_v0_0_1_schema.json b/bt2x/bt2x-embedded/src/models/schema/hashedrekord_v0_0_1_schema.json new file mode 100644 index 0000000..8752ae6 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/schema/hashedrekord_v0_0_1_schema.json @@ -0,0 +1,54 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://rekor.sigstore.dev/types/rekord/rekord_v0_0_1_schema.json", + "title": "Hashed Rekor v0.0.1 Schema", + "description": "Schema for Hashed Rekord object", + "type": "object", + "properties": { + "signature": { + "description": "Information about the detached signature associated with the entry", + "type": "object", + "properties": { + "content": { + "description": "Specifies the content of the signature inline within the document", + "type": "string", + "format": "byte" + }, + "publicKey" : { + "description": "The public key that can verify the signature; this can also be an X509 code signing certificate that contains the raw public key information", + "type": "object", + "properties": { + "content": { + "description": "Specifies the content of the public key or code signing certificate inline within the document", + "type": "string", + "format": "byte" + } + } + } + } + }, + "data": { + "description": "Information about the content associated with the entry", + "type": "object", + "properties": { + "hash": { + "description": "Specifies the hash algorithm and value for the content", + "type": "object", + "properties": { + "algorithm": { + "description": "The hashing function used to compute the hash value", + "type": "string", + "enum": [ "sha256" ] + }, + "value": { + "description": "The hash value for the content", + "type": "string" + } + }, + "required": [ "algorithm", "value" ] + } + } + } + }, + "required": [ "signature", "data" ] +} diff --git a/bt2x/bt2x-embedded/src/models/schema/helm_v0_0_1_schema.json b/bt2x/bt2x-embedded/src/models/schema/helm_v0_0_1_schema.json new file mode 100644 index 0000000..f48db2a --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/schema/helm_v0_0_1_schema.json @@ -0,0 +1,82 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://rekor.sigstore.dev/types/helm/helm_v0_0_1_schema.json", + "title": "Helm v0.0.1 Schema", + "description": "Schema for Helm object", + "type": "object", + "properties": { + "publicKey": { + "description": "The public key that can verify the package signature", + "type": "object", + "properties": { + "content": { + "description": "Specifies the content of the public key inline within the document", + "type": "string", + "format": "byte" + } + }, + "required": [ "content" ] + }, + "chart": { + "description": "Information about the Helm chart associated with the entry", + "type": "object", + "properties": { + "hash": { + "description": "Specifies the hash algorithm and value for the chart", + "type": "object", + "properties": { + "algorithm": { + "description": "The hashing function used to compute the hash value", + "type": "string", + "enum": [ + "sha256" + ] + }, + "value": { + "description": "The hash value for the chart", + "type": "string" + } + }, + "required": [ "algorithm", "value" ], + "readOnly": true + }, + "provenance": { + "description": "The provenance entry associated with the signed Helm Chart", + "type": "object", + "properties": { + "signature": { + "description": "Information about the included signature in the provenance file", + "type": "object", + "properties": { + "content": { + "description": "Specifies the signature embedded within the provenance file ", + "type": "string", + "format": "byte", + "readOnly": true + } + }, + "required": [ "content" ], + "readOnly": true + }, + "content": { + "description": "Specifies the content of the provenance file inline within the document", + "type": "string", + "format": "byte", + "writeOnly": true + } + }, + "oneOf": [ + { + "required": [ "signature" ] + }, + { + "required": [ "content" ] + } + ] + } + }, + "required": [ "provenance" ] + } + }, + "required": [ "publicKey", "chart" ] +} diff --git a/bt2x/bt2x-embedded/src/models/schema/intoto_v0_0_1_schema.json b/bt2x/bt2x-embedded/src/models/schema/intoto_v0_0_1_schema.json new file mode 100644 index 0000000..814f98e --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/schema/intoto_v0_0_1_schema.json @@ -0,0 +1,70 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://rekor.sigstore.dev/types/intoto/intoto_v0_0_1_schema.json", + "title": "intoto v0.0.1 Schema", + "description": "Schema for intoto object", + "type": "object", + "properties": { + "content": { + "type": "object", + "properties": { + "envelope": { + "description": "envelope", + "type": "string", + "writeOnly": true + }, + "hash": { + "description": "Specifies the hash algorithm and value encompassing the entire signed envelope; this is computed by the rekor server, client-provided values are ignored", + "type": "object", + "properties": { + "algorithm": { + "description": "The hashing function used to compute the hash value", + "type": "string", + "enum": [ + "sha256" + ] + }, + "value": { + "description": "The hash value for the archive", + "type": "string" + } + }, + "required": [ + "algorithm", + "value" + ], + "readOnly": true + }, + "payloadHash": { + "description": "Specifies the hash algorithm and value covering the payload within the DSSE envelope; this is computed by the rekor server, client-provided values are ignored", + "type": "object", + "properties": { + "algorithm": { + "description": "The hashing function used to compute the hash value", + "type": "string", + "enum": [ "sha256" ] + }, + "value": { + "description": "The hash value for the envelope's payload", + "type": "string" + } + }, + "required": [ + "algorithm", + "value" + ], + "readOnly": true + } + } + }, + "publicKey": { + "description": "The public key that can verify the signature", + "type": "string", + "format": "byte" + } + }, + "required": [ + "publicKey", + "content" + ] +} \ No newline at end of file diff --git a/bt2x/bt2x-embedded/src/models/schema/jar_v0_0_1_schema.json b/bt2x/bt2x-embedded/src/models/schema/jar_v0_0_1_schema.json new file mode 100644 index 0000000..f5d06ed --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/schema/jar_v0_0_1_schema.json @@ -0,0 +1,72 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://rekor.sigstore.dev/types/jar/jar_v0_0_1_schema.json", + "title": "JAR v0.0.1 Schema", + "description": "Schema for JAR entries", + "type": "object", + "properties": { + "signature": { + "description": "Information about the included signature in the JAR file", + "type": "object", + "properties": { + "content": { + "description": "Specifies the PKCS7 signature embedded within the JAR file ", + "type": "string", + "format": "byte", + "readOnly": true + }, + "publicKey" : { + "description": "The X509 certificate containing the public key JAR which verifies the signature of the JAR", + "type": "object", + "properties": { + "content": { + "description": "Specifies the content of the X509 certificate containing the public key used to verify the signature", + "type": "string", + "format": "byte" + } + }, + "required": [ "content" ], + "readOnly": true + } + }, + "required": [ "publicKey", "content" ] + }, + "archive": { + "description": "Information about the archive associated with the entry", + "type": "object", + "properties": { + "hash": { + "description": "Specifies the hash algorithm and value encompassing the entire signed archive", + "type": "object", + "properties": { + "algorithm": { + "description": "The hashing function used to compute the hash value", + "type": "string", + "enum": [ "sha256" ] + }, + "value": { + "description": "The hash value for the archive", + "type": "string" + } + }, + "required": [ "algorithm", "value" ] + }, + "content": { + "description": "Specifies the archive inline within the document", + "type": "string", + "format": "byte", + "writeOnly": true + } + }, + "oneOf": [ + { + "required": [ "hash" ] + }, + { + "required": [ "content" ] + } + ] + } + }, + "required": [ "archive" ] +} \ No newline at end of file diff --git a/bt2x/bt2x-embedded/src/models/schema/rekord_v0_0_1_schema.json b/bt2x/bt2x-embedded/src/models/schema/rekord_v0_0_1_schema.json new file mode 100644 index 0000000..aa809c6 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/schema/rekord_v0_0_1_schema.json @@ -0,0 +1,76 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://rekor.sigstore.dev/types/rekord/rekord_v0_0_1_schema.json", + "title": "Rekor v0.0.1 Schema", + "description": "Schema for Rekord object", + "type": "object", + "properties": { + "signature": { + "description": "Information about the detached signature associated with the entry", + "type": "object", + "properties": { + "format": { + "description": "Specifies the format of the signature", + "type": "string", + "enum": [ "pgp", "minisign", "x509", "ssh" ] + }, + "content": { + "description": "Specifies the content of the signature inline within the document", + "type": "string", + "format": "byte" + }, + "publicKey" : { + "description": "The public key that can verify the signature", + "type": "object", + "properties": { + "content": { + "description": "Specifies the content of the public key inline within the document", + "type": "string", + "format": "byte" + } + }, + "required": [ "content" ] + } + }, + "required": [ "format", "publicKey", "content" ] + }, + "data": { + "description": "Information about the content associated with the entry", + "type": "object", + "properties": { + "hash": { + "description": "Specifies the hash algorithm and value for the content", + "type": "object", + "properties": { + "algorithm": { + "description": "The hashing function used to compute the hash value", + "type": "string", + "enum": [ "sha256" ] + }, + "value": { + "description": "The hash value for the content", + "type": "string" + } + }, + "required": [ "algorithm", "value" ], + "readOnly": true + }, + "content": { + "description": "Specifies the content inline within the document", + "type": "string", + "format": "byte", + "writeOnly": true + } + }, + "oneOf": [ + { + "required": [ "hash" ] + }, + { + "required": [ "content" ] + } + ] + } + }, + "required": [ "signature", "data" ] +} diff --git a/bt2x/bt2x-embedded/src/models/schema/rfc3161_v0_0_1_schema.json b/bt2x/bt2x-embedded/src/models/schema/rfc3161_v0_0_1_schema.json new file mode 100644 index 0000000..de9e2f9 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/schema/rfc3161_v0_0_1_schema.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://rekor.sigstore.dev/types/timestamp/timestamp_v0_0_1_schema.json", + "title": "Timestamp v0.0.1 Schema", + "description": "Schema for RFC3161 entries", + "type": "object", + "properties": { + "tsr": { + "description": "Information about the tsr file associated with the entry", + "type": "object", + "properties" : { + "content": { + "description": "Specifies the tsr file content inline within the document", + "type": "string", + "format": "byte" + } + }, + "required": [ "content" ] + } + }, + "required": [ "tsr" ] +} diff --git a/bt2x/bt2x-embedded/src/models/schema/rpm_v0_0_1_schema.json b/bt2x/bt2x-embedded/src/models/schema/rpm_v0_0_1_schema.json new file mode 100644 index 0000000..f6e2c45 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/schema/rpm_v0_0_1_schema.json @@ -0,0 +1,66 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://rekor.sigstore.dev/types/rpm/rpm_v0_0_1_schema.json", + "title": "RPM v0.0.1 Schema", + "description": "Schema for RPM entries", + "type": "object", + "properties": { + "publicKey" : { + "description": "The PGP public key that can verify the RPM signature", + "type": "object", + "properties": { + "content": { + "description": "Specifies the content of the public key inline within the document", + "type": "string", + "format": "byte" + } + }, + "required": [ "content" ] + }, + "package": { + "description": "Information about the package associated with the entry", + "type": "object", + "properties": { + "headers": { + "description": "Values of the RPM headers", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, + "hash": { + "description": "Specifies the hash algorithm and value for the package", + "type": "object", + "properties": { + "algorithm": { + "description": "The hashing function used to compute the hash value", + "type": "string", + "enum": [ "sha256" ] + }, + "value": { + "description": "The hash value for the package", + "type": "string" + } + }, + "required": [ "algorithm", "value" ] + }, + "content": { + "description": "Specifies the package inline within the document", + "type": "string", + "format": "byte", + "writeOnly": true + } + }, + "oneOf": [ + { + "required": [ "hash" ] + }, + { + "required": [ "content" ] + } + ] + } + }, + "required": [ "publicKey", "package" ] +} diff --git a/bt2x/bt2x-embedded/src/models/schema/tuf_v0_0_1_schema.json b/bt2x/bt2x-embedded/src/models/schema/tuf_v0_0_1_schema.json new file mode 100644 index 0000000..f1a6cd3 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/schema/tuf_v0_0_1_schema.json @@ -0,0 +1,39 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://rekor.sigstore.dev/types/tuf/tuf_v0_0_1_schema.json", + "title": "TUF v0.0.1 Schema", + "description": "Schema for TUF metadata entries", + "type": "object", + "properties": { + "spec_version": { + "description": "TUF specification version", + "type": "string", + "readOnly": true + }, + "metadata": { + "description": "TUF metadata", + "type": "object", + "properties": { + "content": { + "description": "Specifies the metadata inline within the document", + "type": "object", + "additionalProperties": true + } + }, + "required": [ "metadata" ] + }, + "root" : { + "description": "root metadata containing about the public keys used to sign the manifest", + "type": "object", + "properties": { + "content": { + "description": "Specifies the metadata inline within the document", + "type": "object", + "additionalProperties": true + } + }, + "required": [ "content" ] + } + }, + "required": [ "metadata" , "root"] +} diff --git a/bt2x/bt2x-embedded/src/models/search_index.rs b/bt2x/bt2x-embedded/src/models/search_index.rs new file mode 100644 index 0000000..e012f43 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/search_index.rs @@ -0,0 +1,62 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + + +#[cfg(feature = "no_std")] +use alloc::string::String; +#[cfg(feature = "no_std")] +use alloc::boxed::Box; +use serde_with::serde_as; +use serde_with::hex::Hex; + +#[serde_as] +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SearchIndex { + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub public_key: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + #[serde_as(as = "Option>")] + pub hash: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub operator: Option, +} + +impl SearchIndex { + pub fn new() -> SearchIndex { + SearchIndex { + email: Option::<_>::None, + public_key: Option::<_>::None, + hash: Option::<_>::None, + operator: Option::<_>::None, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, serde::Serialize, serde::Deserialize)] +pub enum Operator { + #[serde(rename = "and")] + And, + #[serde(rename = "or")] + Or, +} + +impl Default for Operator { + fn default() -> Operator { + Self::And + } +} + diff --git a/bt2x/bt2x-embedded/src/models/search_index_public_key.rs b/bt2x/bt2x-embedded/src/models/search_index_public_key.rs new file mode 100644 index 0000000..801f5bc --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/search_index_public_key.rs @@ -0,0 +1,55 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + +#[cfg(feature = "no_std")] +use alloc::string::String; + + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all="camelCase")] +pub struct SearchIndexPublicKey { + #[serde(rename = "format")] + pub format: Format, + #[serde(skip_serializing_if = "Option::is_none")] + pub content: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl SearchIndexPublicKey { + pub fn new(format: Format) -> SearchIndexPublicKey { + SearchIndexPublicKey { + format, + content: Option::<_>::None, + url: Option::<_>::None, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, serde::Serialize, serde::Deserialize)] +#[serde(rename_all="camelCase")] +pub enum Format { + Pgp, + X509, + Minisign, + Ssh, + Tuf, +} + +impl Default for Format { + fn default() -> Format { + Self::Pgp + } +} + diff --git a/bt2x/bt2x-embedded/src/models/search_log_query.rs b/bt2x/bt2x-embedded/src/models/search_log_query.rs new file mode 100644 index 0000000..0611bb7 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/search_log_query.rs @@ -0,0 +1,39 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +#[cfg(feature = "no_std")] +use alloc::vec::Vec; +#[cfg(feature = "no_std")] +use alloc::string::String; + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SearchLogQuery { + #[serde(rename = "entryUUIDs", skip_serializing_if = "Option::is_none")] + pub entry_uuids: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub log_indexes: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub entries: Option>, +} + +impl SearchLogQuery { + pub fn new() -> SearchLogQuery { + SearchLogQuery { + entry_uuids: Option::>::None, + log_indexes: Option::<_>::None, + entries: Option::<_>::None, + } + } +} + + diff --git a/bt2x/bt2x-embedded/src/models/tuf.rs b/bt2x/bt2x-embedded/src/models/tuf.rs new file mode 100644 index 0000000..6c8c657 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/tuf.rs @@ -0,0 +1,34 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +#[cfg(feature = "no_std")] +use alloc::string::String; + +#[cfg(feature = "no_std")] +use alloc::collections::BTreeMap as Map; + +#[cfg(feature = "std")] +use HashMap as Map; + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct TufObj { + #[serde(rename = "snake_case")] //https://github.com/sigstore/rekor/blob/ee83776f8b3b3c44829521d36472f4cac5c81f4d/pkg/types/tuf/v0.0.1/tuf_v0_0_1_schema.json#L8 + pub spec_version: String, + pub metadata: TufMetaData, + pub root: TufRoot, +} + +pub type TufRoot = Map; +pub type TufMetaData = Map; + + + diff --git a/bt2x/bt2x-embedded/src/models/tuf_all_of.rs b/bt2x/bt2x-embedded/src/models/tuf_all_of.rs new file mode 100644 index 0000000..76cd487 --- /dev/null +++ b/bt2x/bt2x-embedded/src/models/tuf_all_of.rs @@ -0,0 +1,32 @@ +/* + * Rekor + * + * Rekor is a cryptographically secure, immutable transparency log for signed software releases. + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct TufAllOf { + #[serde(rename = "apiVersion")] + pub api_version: alloc::string::String, //String, + /// Schema for TUF metadata objects + #[serde(rename = "spec")] + pub spec: serde_json::Value, +} + +impl TufAllOf { + pub fn new(api_version: &str, spec: serde_json::Value) -> TufAllOf { + TufAllOf { + api_version: api_version.into(), + spec, + } + } +} + + diff --git a/bt2x/bt2x-flasher/Cargo.toml b/bt2x/bt2x-flasher/Cargo.toml new file mode 100644 index 0000000..db36230 --- /dev/null +++ b/bt2x/bt2x-flasher/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "bt2x-flasher" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +probe-rs = { workspace = true } +bt2x-common = { path = "../bt2x-common" } +sigstore = { workspace = true } +tokio = { workspace = true, features = ["full"] } +futures = { workspace = true } +clap = { workspace = true, features = ["derive"] } +oci-distribution = { workspace = true, features = ["rustls-tls"] } +url = { workspace = true } +tracing-subscriber = { workspace = true, features = ["fmt", "std", "env-filter"] } +tracing = { workspace = true } +tracing-core = { workspace = true } +humantime = { workspace = true } +serde = { workspace = true } +anyhow = { workspace = true } +serde_yaml = { workspace = true } +serde_json = { workspace = true } +base64 = { workspace = true } +thiserror = { workspace = true } +rustls-pki-types = { workspace = true } +rustls-pemfile = { workspace = true } diff --git a/bt2x/bt2x-flasher/src/args.rs b/bt2x/bt2x-flasher/src/args.rs new file mode 100644 index 0000000..6c2144a --- /dev/null +++ b/bt2x/bt2x-flasher/src/args.rs @@ -0,0 +1,57 @@ +use clap::Parser; +use sigstore::registry::OciReference; +use std::path::PathBuf; + +#[derive(Debug, Parser)] +#[clap(author, version /*, trailing_var_arg = true*/)] +pub struct Args { + #[arg(long)] + pub image: OciReference, + #[arg(long)] + pub target: String, + #[arg(long)] + pub subject: String, + #[arg(long)] + pub oidc_issuer: url::Url, + #[arg(long)] + pub format: probe_rs::flashing::Format, + #[arg(long)] + pub do_not_flash: bool, + #[arg(long)] + pub log_level: LogLevel, + #[arg(long)] + pub check_inclusion: bool, + #[arg(long)] + pub tuf_root: PathBuf, + #[arg(long)] + pub tuf_meta: PathBuf, + #[arg(long)] + pub(crate) fulcio_url: url::Url, + #[arg(long)] + pub(crate) rekor_url: url::Url, + #[arg(long)] + pub(crate) http: bool, + #[arg(long)] + pub(crate) base_address: Option, +} + +#[derive(clap::ValueEnum, Clone, Debug)] +pub enum LogLevel { + Debug, + Info, + Warn, + Error, + Trace, +} + +impl From<&LogLevel> for tracing_core::LevelFilter { + fn from(value: &LogLevel) -> Self { + match value { + LogLevel::Debug => tracing_core::Level::DEBUG.into(), + LogLevel::Info => tracing_core::Level::INFO.into(), + LogLevel::Warn => tracing_core::Level::WARN.into(), + LogLevel::Error => tracing_core::Level::ERROR.into(), + LogLevel::Trace => tracing_core::Level::TRACE.into(), + } + } +} diff --git a/bt2x/bt2x-flasher/src/main.rs b/bt2x/bt2x-flasher/src/main.rs new file mode 100644 index 0000000..8d9c197 --- /dev/null +++ b/bt2x/bt2x-flasher/src/main.rs @@ -0,0 +1,244 @@ +mod args; + +use anyhow::anyhow; +use bt2x_common::artifact::source::oci::OciSource; +use bt2x_common::error::Bt2XError; +use bt2x_common::rekor::Configuration as RekorConfig; +use bt2x_common::rekor::RekorClient; +use bt2x_common::sigstore_config::{KeyConfig, SigstoreConfig, TufTargetNames}; +use bt2x_common::tuf::load_tuf_filesystem; +use bt2x_common::verifier::bt::BinaryTransparencyVerifier; +use bt2x_common::verifier::bt::SigstoreKeys; +use bt2x_common::verifier::Artifact; +use bt2x_common::verifier::Verifier; +use clap::Parser; +use oci_distribution::client as oci_client; +use oci_distribution::secrets::RegistryAuth; +use probe_rs::Permissions; +use probe_rs::Session; +use rustls_pemfile::{read_one, Item}; +use sigstore::cosign::bundle::SignedArtifactBundle; +use sigstore::cosign::verification_constraint::CertSubjectEmailVerifier; +use sigstore::cosign::verification_constraint::VerificationConstraintVec; +use sigstore::cosign::CosignCapabilities; +use sigstore::crypto::{CosignVerificationKey, SigningScheme}; +use sigstore::registry::{ClientConfig, ClientProtocol, OciReference}; +use sigstore::rekor::apis::configuration::Configuration; +use sigstore::trust::ManualTrustRoot; +use std::fs; +use std::fs::OpenOptions; +use std::io::Write; +use std::io::{BufReader, Cursor}; +use std::panic; +use std::path::Path; +use std::path::PathBuf; +use thiserror::Error; +use tracing::error; +use tracing::{debug, info, warn}; +use tracing_subscriber::filter::Targets; +use tracing_subscriber::prelude::*; +use url::Url; + +#[derive(Debug, Error)] +pub enum FlasherError { + #[error("could not attach to probe {0}")] + AttachToProbeFailed(#[from] probe_rs::Error), + #[error("failed to flash {0}")] + FlashFailed(#[from] probe_rs::flashing::FileDownloadError), + #[error("failed to open sigstore config file {0}")] + FailedToOpenSigstoreConfig(std::io::Error), + #[error("failed to open bundle {0}")] + FailedToOpenBundle(std::io::Error), + #[error("failed to open binary {0}")] + FailedToOpenBinary(std::io::Error), + #[error("failed to open rekor public key {0}")] + FailedToOpenRekorPublicKey(std::io::Error), + #[error("failed to open CT log public key {0}")] + FailedToOpenCtLogPublicKey(std::io::Error), + #[error("failed to open fulcio root cert {0}")] + FailedToOpenFulcioRootCert(std::io::Error), + #[error("sigstore config file is invalid{0}")] + InvalidSigstoreConfig(#[from] serde_yaml::Error), + #[error("sigstore internal error {0}")] + InternalSigstoreError(#[from] sigstore::errors::SigstoreError), + #[error("bundle verification failed {0}")] + VerificationFailed(sigstore::errors::SigstoreError), + #[error("failed to fetch log entry")] + FetchLogEntryError, + #[error("inclusion proof failed")] + InclusionProofFailed, + #[error("{0:?}")] + TufError(Bt2XError), +} + +#[tokio::main] +async fn main() -> Result<(), FlasherError> { + let args = args::Args::parse(); + configure_logging(&args); + let sigstore_keys = load_tuf_filesystem( + &args.tuf_root, + &url::Url::from_file_path(&args.tuf_meta.canonicalize().unwrap()).unwrap(), + &url::Url::from_file_path(args.tuf_meta.join("/tmp")).unwrap(), + &TufTargetNames { + ctlog: String::from("ctlog.pub"), + rekor: String::from("rekor.pub"), + fulcio: String::from("fulcio.crt.pem"), + }, + ) + .await + .map_err(FlasherError::TufError)?; + + // setup clients and configs for clients + let rekor_client = RekorClient::new(RekorConfig { + base_path: args.rekor_url.to_string(), + ..Default::default() + }); + + let registry_config = ClientConfig { + protocol: if args.http { + ClientProtocol::Http + } else { + ClientProtocol::Https + }, + accept_invalid_certificates: false, + extra_root_certificates: vec![], + accept_invalid_hostnames: true, + }; + let mut reader = BufReader::new(Cursor::new(&sigstore_keys.fulcio_cert)); + let Some(Item::X509Certificate(fulcio_cert_der)) = + read_one(&mut reader).expect("failed to decode PEM") + else { + panic!("error converting parsing fulcio cert") + }; + let mut reader = BufReader::new(Cursor::new(&sigstore_keys.rekor_key)); + let Some(Item::SubjectPublicKeyInfo(rekor_key_der)) = + read_one(&mut reader).expect("failed to decode PEM") + else { + panic!("error converting parsing rekor key") + }; + let mut reader = BufReader::new(Cursor::new(&sigstore_keys.ctlog_key)); + let Some(Item::SubjectPublicKeyInfo(ctlog_key_der)) = + read_one(&mut reader).expect("failed to decode PEM") + else { + panic!("error converting parsing the CT log key") + }; + + let cosign_client = sigstore::cosign::ClientBuilder::default() + .with_trust_repository(&ManualTrustRoot { + ctfe_keys: vec![ctlog_key_der.to_vec()], + rekor_keys: vec![rekor_key_der.to_vec()], + fulcio_certs: vec![fulcio_cert_der], + }) + .expect("failed to add trust repo") + .with_oci_client_config(registry_config) + .build() + .expect("Unexpected failure while building Client"); + + let oci_client_config = oci_client::ClientConfig { + protocol: if args.http { + oci_client::ClientProtocol::Http + } else { + oci_client::ClientProtocol::Https + }, + ..Default::default() + }; + + // configure verifier + let mut verifier = BinaryTransparencyVerifier::builder() + .monitors(vec![Url::parse("http://localhost:3132").unwrap()]) + .rekor_client(rekor_client) + .cosign_client(cosign_client) + .keys( + SigstoreKeys::builder() + .rekor_pub_key(String::from_utf8(sigstore_keys.rekor_key).unwrap()) + .fulcio_cert(String::from_utf8(sigstore_keys.fulcio_cert).unwrap()) + .ct_log_key(String::from_utf8(sigstore_keys.ctlog_key).unwrap()) + .build(), + ) + .build(); + + // configure source from which images are downloaded + let mut oci_source = OciSource::new(oci_client_config, RegistryAuth::Anonymous); + let mut constraints: VerificationConstraintVec = vec![Box::new(CertSubjectEmailVerifier { + email: args.subject, + issuer: Some(args.oidc_issuer.to_string()), + })]; + + let binary = match verifier + .verify(&mut oci_source, &args.image, &constraints) + .await + { + Ok(Artifact::Binary(binary)) => binary, + Ok(Artifact::BundledBinary { binary, bundle: _ }) => binary, + Err(err) => panic!("{err:?}"), + }; + let flasher_directory = PathBuf::from(".flasher"); + let file_path = + build_path(&flasher_directory, &args.image).expect("failed to build output path"); + std::fs::create_dir_all(flasher_directory).expect("failed to create flasher directory"); + let mut f = OpenOptions::new() + .create(true) + .write(true) + .truncate(true) + .open(&file_path) + .expect("failed to open output file"); + f.write_all(&binary) + .expect("failed to write binary to disk"); + + if args.do_not_flash { + warn!("skipping flashing due to `--do-not-flash` flag"); + return Ok(()); + } + let mut session = Session::auto_attach(args.target, Permissions::default())?; + debug!("{session:?}"); + info!("flashing binary"); + let probe_rs::flashing::Format::Bin(mut options) = args.format else { + panic!("only supports bin formats"); + }; + options.base_address = args.base_address.or(Some(0x10000000)); + probe_rs::flashing::download_file( + &mut session, + &file_path, + probe_rs::flashing::Format::Bin(options), + )?; + info!("flashing complete"); + Ok(()) +} + +fn configure_logging(cli: &args::Args) { + tracing_subscriber::registry() + .with(tracing_subscriber::fmt::layer()) + .with( + Targets::new() + .with_target(env!("CARGO_PKG_NAME").replace('-', "_"), &cli.log_level) + .with_target("bt2x_common", &cli.log_level) + .with_target("sigstore", tracing_core::Level::INFO), + ) + .init(); +} + +/// Builds a file path from the OCI reference at which the output file is stored. +fn build_path(base_path: &Path, reference: &OciReference) -> anyhow::Result { + let out_path = PathBuf::from(reference.repository()); + let out_path = format!( + "{}-{}.{}", + out_path + .file_stem() + .ok_or(anyhow!("could not create file name from reference")) + .and_then(|s| s + .to_str() + .ok_or(anyhow!("could not get unicode string from path")))?, + reference + .digest() + .or(reference.tag()) + .ok_or(anyhow!("OCI reference requires tag or digest")) + .map(|s| s.trim_start_matches("sha256:"))?, + out_path + .extension() + .unwrap_or("".as_ref()) + .to_str() + .unwrap() + ); + let out_path = out_path.trim_start_matches('/').trim_end_matches('.'); + Ok(base_path.join(out_path)) +} diff --git a/bt2x/bt2x-monitor/Cargo.toml b/bt2x/bt2x-monitor/Cargo.toml new file mode 100644 index 0000000..169ec39 --- /dev/null +++ b/bt2x/bt2x-monitor/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "bt2x-monitor" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +tokio = { workspace = true, features = ["full"] } +axum = { workspace = true } +serde = { workspace = true, features = ["derive"] } +crossbeam = { workspace = true } +tracing = { workspace = true } +tracing-core = { workspace = true } +tracing-subscriber = { workspace = true, features = ["fmt", "std", "env-filter"] } +url = { workspace = true, features = ["serde"] } +uuid = { workspace = true, features = ["v4", "fast-rng", "serde"] } +anyhow = { workspace = true } +thiserror = { workspace = true } +reqwest = { workspace = true } +sigstore = { workspace = true } +bt2x-common = { path = "../bt2x-common" } +base64 = { workspace = true } +futures = { workspace = true } +clap = { workspace = true, features = ["derive"] } +humantime = { workspace = true } +serde_yaml = { workspace = true } + +[dev-dependencies] +hex-literal = { workspace = true } diff --git a/bt2x/bt2x-monitor/README.md b/bt2x/bt2x-monitor/README.md new file mode 100644 index 0000000..922591b --- /dev/null +++ b/bt2x/bt2x-monitor/README.md @@ -0,0 +1,26 @@ +# BT²X Monitor + +This directory consists of a monitor application as well as a monitor library, which can be used to include a monitor in other applications. +The gossiping "primitives" are implemented in the `bt2x-common` library in the the `bt2x-common::gossip` module. + +## HTTP Interface + +The gossiping protocol uses a HTTP interface. There are two kinds of actions: **listen** (server) and **speak** (client). +Listening is the act of providing an endpoint (at `/listen`) where checkpoints can be sent to as part of the speak act. +Incoming gossip is verified against the most recent known checkpoint and verified using an inclusion proof provided by the log. +When successful, the request is then replied with the most freshest checkpoint. +In case of failure an error is returned. + +## Verification + +Two checkpoints are verified for consistency in the following way: + +1. Verify that the incoming checkpoint was signed by the BT log Rekor. +2. Determine which checkpoint is the newest one +3. Request a consistency proof from the older tree size to the newer tree size. +4. Run a consistency proof with the proof hashes provided by the log. +5. Reply with a response indicating the result. + +## Federation + +The monitor can be federated with other instances of itself by adding the URL of the other monitor to the command. \ No newline at end of file diff --git a/bt2x/bt2x-monitor/src/cli.rs b/bt2x/bt2x-monitor/src/cli.rs new file mode 100644 index 0000000..9a5ade6 --- /dev/null +++ b/bt2x/bt2x-monitor/src/cli.rs @@ -0,0 +1,27 @@ +use clap::Parser; +use std::path::PathBuf; +use url::Url; + +/// Simple program to greet a person +#[derive(Parser, Debug)] +#[command(author, version, about, long_about = None)] +pub struct Args { + /// path to a Sigstore configuration file, consult [bt2x_common::sigstore_config::SigstoreConfig] for more information. + #[arg(long)] + pub sigstore_config: PathBuf, + #[arg(long)] + /// actively gossip to the monitor at the specified URL + pub monitor: Vec, + #[arg(long)] + /// use the checkpoint at this path as the initial checkpoint + pub current_checkpoint: Option, + /// port for the gossiping HTTP server of this monitor + #[arg(long, default_value_t = 3131)] + pub port: u16, + /// interval at which the Rekor log is queried for new checkpoints + #[arg(long)] + pub log_interval: humantime::Duration, + /// interval at which checkpoints are sent to other monitors + #[arg(long)] + pub gossip_interval: humantime::Duration, +} diff --git a/bt2x/bt2x-monitor/src/lib.rs b/bt2x/bt2x-monitor/src/lib.rs new file mode 100644 index 0000000..8a00337 --- /dev/null +++ b/bt2x/bt2x-monitor/src/lib.rs @@ -0,0 +1,286 @@ +use std::fs; +use std::fs::read_to_string; +use std::str::FromStr; +use std::sync::Arc; +use std::time::Duration; + +use anyhow::{anyhow, Context, Result}; +use axum::extract::Json; +use axum::http::StatusCode; +use axum::response::IntoResponse; +use axum::{extract::State, routing::get, Router}; +use futures::{stream, StreamExt}; +use sigstore::crypto::CosignVerificationKey; +use sigstore::rekor::apis::configuration::Configuration; +use tokio::sync::RwLock; +use tokio::time::sleep; +use tracing::{debug, info, warn}; + +use bt2x_common::gossip::*; +use bt2x_common::rekor::RekorClient; +use bt2x_common::sigstore_config::{KeyConfig, SigstoreConfig}; +use bt2x_common::tuf::load_tuf_filesystem; + +use crate::cli::Args; + +pub mod cli; + +#[derive(Debug)] +struct AppState { + pub current_checkpoint: Arc>, + pub rekor_key: Arc, + pub rekor_config: Arc, +} + +async fn get_err() -> impl IntoResponse { + (StatusCode::BAD_REQUEST, "Use POST.") +} + +async fn listen( + State(state): State>, + Json(checkpoint): Json, +) -> impl IntoResponse { + debug!("got request {checkpoint:?}"); + let mut current_checkpoint = state.current_checkpoint.write().await; + let rekor_client = RekorClient::new((*state.rekor_config).clone()); + + if let Err(err) = checkpoint.verify_signature(&state.rekor_key) { + debug!("{err:?}"); + return ( + StatusCode::OK, + Json(GossipResponse::Failure( + MonitorError::FailedSignatureVerification { + request_data: checkpoint, + pubkey: (), + }, + )), + ); + } + debug!("signature verified successfully"); + match verify_checkpoints( + (*current_checkpoint).clone(), + checkpoint.clone(), + &rekor_client, + ) + .await + { + Ok(new_checkpoint) => { + debug!("consistency verified successfully"); + *current_checkpoint = new_checkpoint.clone(); + ( + StatusCode::OK, + Json(GossipResponse::Success(new_checkpoint.clone())), + ) + } + Err(err) => { + warn!("failed to verify consistency: {err:?}"); + ( + StatusCode::OK, + Json(GossipResponse::Failure(MonitorError::Inconsistent { + request_data: checkpoint, + other: current_checkpoint.clone(), + })), + ) + } + } +} + +pub async fn main_impl(args: Args) -> Result<()> { + info!("starting monitor ..."); + let sigstore_config: SigstoreConfig = fs::read(&args.sigstore_config) + .context("failed to open sigstore config file") + .and_then(|config| { + serde_yaml::from_slice(&config).context("failed to parse sigstore config") + })?; + debug!("using config: {sigstore_config:?}"); + let rekor_key = match sigstore_config.key_config { + KeyConfig::Tuf { + metadata_base, + targets_base, + root_path, + target_names, + } => { + debug!("loading Sigstore keys from TUF repo via the file system ..."); + load_tuf_filesystem(&root_path, &metadata_base, &targets_base, &target_names) + .await + .map_err(|_| anyhow!("failed to load TUF from file system"))? + .rekor_key + } + KeyConfig::Keys { + rekor_key: Some(rekor_key), + .. + } => { + debug!("loading rekor key at {rekor_key:?}"); + fs::read(rekor_key).context("failed to read rekor key")? + } + _ => panic!("rekor key required, update config"), + }; + let rekor_key = CosignVerificationKey::from_pem(&rekor_key, &Default::default()) + .context("failed to parse rekor key")?; + let rekor_config = Arc::new(Configuration { + base_path: sigstore_config.urls.rekor.to_string(), + ..Default::default() + }); + + let current_checkpoint: Checkpoint = match args.current_checkpoint { + Some(current_checkpoint) => { + debug!("loading checkpoint from {current_checkpoint:?} ..."); + read_to_string(current_checkpoint) + .context("failed to read checkpoint at path: {current_checkpoint:?}") + .and_then(|data| data.parse().context("failed to parse checkpoint")) + .context("failed to load current checkpoint")? + } + None => { + debug!("no checkpoint provided, fetching log info using {rekor_config:?} ..."); + loop { + let res = sigstore::rekor::apis::tlog_api::get_log_info(&rekor_config) + .await + .context("failed to get log info") + .and_then(|log_info| { + Checkpoint::from_str(&log_info.signed_tree_head) + .context("failed to parse checkpoint from log info") + })?; + if res.tree_size > 0 { + break res; + } + info!("log provided checkpoint with tree_size == 0, fetching again later"); + sleep(Duration::from_secs(5)).await + } + } + }; + debug!("verifying the initial checkpoint ..."); + current_checkpoint + .verify_signature(&rekor_key) + .context("failed to verify signature")?; + debug!("successfully verified {current_checkpoint:?}"); + let rekor_key = Arc::new(rekor_key); + let current_checkpoint = Arc::new(RwLock::new(current_checkpoint)); + + let listeners = args.monitor.clone(); + + let shared_state = Arc::new(AppState { + rekor_config: rekor_config.clone(), + rekor_key: rekor_key.clone(), + current_checkpoint: current_checkpoint.clone(), + }); + + info!("starting speaker"); + let rekor_config_arc = rekor_config.clone(); + let rekor_key_arc = rekor_key.clone(); + let current_checkpoint_arc = current_checkpoint.clone(); + + let speaker = tokio::spawn(async move { + info!("speaker task spawned"); + let interval = tokio::time::interval(args.gossip_interval.into()); + let rekor_client = RekorClient::new((*rekor_config_arc).clone()); + let forever = stream::unfold(interval, |mut interval| async { + interval.tick().await; + debug!("speaker is active ..."); + for url in listeners.iter() { + let mut current_checkpoint = current_checkpoint_arc.write().await; + let Ok(response_data) = send_checkpoint(url, ¤t_checkpoint).await else { + warn!("sending checkpoint failed"); + continue; + }; + + let new_checkpoint = match response_data { + GossipResponse::Success(new) => new, + GossipResponse::Failure(err) => { + warn!("got failure response {err:#?}"); + continue; + } + }; + if let Err(err) = new_checkpoint.verify_signature(&rekor_key_arc) { + warn!("could not verify checkpoint {new_checkpoint:?} because of {err:?}"); + continue; + } + match verify_checkpoints( + (*current_checkpoint).clone(), + new_checkpoint, + &rekor_client, + ) + .await + { + Ok(new) => *current_checkpoint = new, + Err(err) => { + warn!("could not verify consistency {err:?}"); + continue; + } + } + } + debug!("speaker finished gossiping"); + Some(((), interval)) + }); + forever.for_each(|_| async {}).await; + }); + info!("starting poller task"); + let poller = tokio::spawn(async move { + info!("poller task has started"); + let interval = tokio::time::interval(args.log_interval.into()); + let rekor_client = RekorClient::new((*rekor_config).clone()); + let forever = stream::unfold(interval, |mut interval| async { + interval.tick().await; + debug!("poller is active ..."); + match fetch_and_verify_signature(&rekor_client, &rekor_key).await { + Ok(checkpoint) => { + let mut current_checkpoint = current_checkpoint.write().await; + let new = verify_checkpoints( + (*current_checkpoint).clone(), + checkpoint, + &rekor_client, + ) + .await + .expect("poller failed to verify checkpoint, received from the log"); + info!("using new checkpoint {new:?}"); + *current_checkpoint = new; + } + Err(err) => { + warn!("{err:?}") + } + } + Some(((), interval)) + }); + forever.for_each(|_| async {}).await; + }); + + info!("starting listener"); + let listener = tokio::spawn(async move { + info!("listener task spawned"); + let app = Router::new() + .route("/listen", get(get_err).post(listen)) + .with_state(shared_state); + + let listener = tokio::net::TcpListener::bind(&format!("0.0.0.0:{}", args.port)) + .await + .expect("failed to bind to socket"); + axum::serve(listener, app.into_make_service()) + .await + .unwrap(); + }); + info!("main thread waiting"); + listener.await.context("failed to join listening server")?; + speaker.await.context("failed to join speaker loop")?; + poller.await.context("failed to join polling loop")?; + + info!("exiting ..."); + Ok(()) +} + +pub fn configure_logging(_args: &Args) { + use tracing_subscriber::filter::Targets; + use tracing_subscriber::prelude::*; + tracing_subscriber::registry() + .with(tracing_subscriber::fmt::layer()) + .with( + Targets::new() + .with_target( + env!("CARGO_PKG_NAME").replace('-', "_"), + tracing_core::Level::DEBUG, + ) + .with_target("sigstore", tracing_core::Level::INFO) + .with_target("oci_distribution", tracing_core::Level::DEBUG) + .with_target("hyper", tracing_core::Level::INFO) + .with_target("reqwest", tracing_core::Level::INFO), + ) + .init(); +} diff --git a/bt2x/bt2x-monitor/src/main.rs b/bt2x/bt2x-monitor/src/main.rs new file mode 100644 index 0000000..5faf6bd --- /dev/null +++ b/bt2x/bt2x-monitor/src/main.rs @@ -0,0 +1,9 @@ +use anyhow::Result; +use clap::Parser; + +#[tokio::main] +async fn main() -> Result<()> { + let args = bt2x_monitor::cli::Args::parse(); + bt2x_monitor::configure_logging(&args); + bt2x_monitor::main_impl(args).await +} diff --git a/bt2x/bt2x-ota-common/Cargo.toml b/bt2x/bt2x-ota-common/Cargo.toml new file mode 100644 index 0000000..c4212a0 --- /dev/null +++ b/bt2x/bt2x-ota-common/Cargo.toml @@ -0,0 +1,36 @@ +[package] +name = "bt2x-ota-common" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" + +[features] +default = ["tracing"] +defmt = ["dep:defmt", "embedded-io-async/defmt-03"] +tracing = ["dep:tracing"] +log = ["dep:log"] +mock_flash = [] + +[dependencies] +embedded-io-async = { workspace = true, features = [] } +embassy-net = { workspace = true, features = ["tcp", "udp", "dhcpv4", "medium-ethernet"] } +embassy-time = { workspace = true, features = [] } +tuf-no-std = { path = "../../tuf-no-std/tuf-no-std", default-features = false, features = [ + "der", + "verify", + "ecdsa", + "async", +] } +defmt = { workspace = true, features = [], optional = true } +bitfield = { workspace = true, features = [] } +tracing = { workspace = true, default-features = false, optional = true, features = [] } +log = { workspace = true, default-features = false, optional = true, features = ["serde"] } +embedded-storage = { workspace = true } +sha2 = { workspace = true, default-features = false, features = [] } + +[dev-dependencies] +pipe = { workspace = true } +embedded-io-async = { workspace = true, features = ["std"] } +tokio = { workspace = true, features = ["full"] } +tempfile = { workspace = true } + diff --git a/bt2x/bt2x-ota-common/src/flash.rs b/bt2x/bt2x-ota-common/src/flash.rs new file mode 100644 index 0000000..c75e826 --- /dev/null +++ b/bt2x/bt2x-ota-common/src/flash.rs @@ -0,0 +1,75 @@ +pub use embedded_storage::nor_flash::NorFlash; +/// File-system-backed "flash" implementation for testing purposes. +#[cfg(any(feature = "mock_flash", test))] +pub mod mock_flash { + use alloc::vec; + pub use embedded_storage::nor_flash::{ + ErrorType, NorFlash, NorFlashError, NorFlashErrorKind, ReadNorFlash, + }; + use std::os::unix::fs::FileExt; + + #[derive(Debug)] + pub struct FsWriter(pub std::path::PathBuf); + + impl ReadNorFlash for FsWriter { + const READ_SIZE: usize = 0; + + fn read(&mut self, offset: u32, bytes: &mut [u8]) -> Result<(), Self::Error> { + let f = std::fs::OpenOptions::new() + .read(true) + .open(&self.0) + .map_err(|_| FsWriterError(NorFlashErrorKind::Other))?; + f.read_exact_at(bytes, offset as u64) + .map_err(|_| FsWriterError(NorFlashErrorKind::Other))?; + Ok(()) + } + + fn capacity(&self) -> usize { + 0x4096 * 1024 * 1024 + } + } + + #[derive(Debug)] + pub struct FsWriterError(NorFlashErrorKind); + + impl NorFlashError for FsWriterError { + fn kind(&self) -> NorFlashErrorKind { + self.0 + } + } + + impl ErrorType for FsWriter { + type Error = FsWriterError; + } + + impl NorFlash for FsWriter { + const ERASE_SIZE: usize = 0; + const WRITE_SIZE: usize = 0; + + fn erase(&mut self, from: u32, to: u32) -> Result<(), Self::Error> { + let data = vec![1; (to - from) as usize]; + let f = std::fs::OpenOptions::new() + .read(true) + .open(&self.0) + .map_err(|_| FsWriterError(NorFlashErrorKind::Other))?; + f.write_at(&data, from as u64) + .map_err(|_| FsWriterError(NorFlashErrorKind::Other))?; + Ok(()) + } + + fn write(&mut self, offset: u32, bytes: &[u8]) -> Result<(), Self::Error> { + let f = std::fs::OpenOptions::new() + .write(true) + .create(true) + .truncate(true) + //.truncate(true) + .open(&self.0) + .expect("failed to open file"); + f.write_at(bytes, offset as u64).expect("failed to write"); + Ok(()) + } + } +} + +#[cfg(test)] +pub(crate) mod test {} diff --git a/bt2x/bt2x-ota-common/src/lib.rs b/bt2x/bt2x-ota-common/src/lib.rs new file mode 100644 index 0000000..3cc67ed --- /dev/null +++ b/bt2x/bt2x-ota-common/src/lib.rs @@ -0,0 +1,683 @@ +#![cfg_attr(all(not(test), not(feature = "mock_flash")), no_std)] +//! This crate contains the client side implementation for the OTA updates. +//! It is implemented using a custom TCP-based request-response protocol. +//! It works roughly in the following way: +//! - general structure of a message is `
[]`, +//! - handling the segmentation is left to TCP, +//! - the header specifies what type of message it is and what the rest of the header and message contains. +//! +//! Refer to the [Header] and the code for more information. +//! +//! ## Example +//! +//! ```ignore +//! use tuf_no_std::TufTransportAsync; +//! +//! // initialize_stack is not a real function, set up your network stack accordingly. +//! let stack = initialize_stack(); +//! let mut transport = Transport { +//! network_stack: &stack, +//! server: IpEndpoint::new( +//! "192.168.1.2", +//! 50000, +//! ), +//! }; +//! +//! let mut buf = [0u8; 4096]; +//! let binary = transport.fetch_binary( +//! b"binary-identifer", +//! &mut buf, +//! ).expect("failed to fetch binary"); +//! +//! ``` + +extern crate alloc; + +pub mod flash; +pub mod net; +/// TufTransportAsync implementation for `embassy_net` network stacks. +pub use net::Transport; + +use bitfield::bitfield; +use core::num::NonZeroU64; +#[cfg(feature = "defmt")] +use defmt::{debug, warn}; +#[cfg(feature = "log")] +use log::{debug, error, info, warn}; +#[cfg(feature = "tracing")] +use tracing::{debug, warn}; + +use embedded_io_async::{Read, Write}; +use embedded_storage::nor_flash::NorFlash; +use sha2::Digest; + +#[repr(u8)] +#[derive(Debug, Clone, Copy)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub enum TufMessage { + Root = 0, + Timestamp = 1, + Snapshot = 2, + Targets = 3, + TargetFile = 4, +} + +#[repr(u8)] +#[derive(Debug, Clone, Copy)] +pub enum MessageClass { + Request = 0, + Response = 1, + Error = 2, + Ok = 3, +} + +#[repr(u8)] +#[derive(Debug, Clone, Copy)] +pub enum MessageType { + Binary = 0, + Signature = 1, + Tuf = 2, + Rfc3161 = 3, +} + +#[repr(u8)] +#[derive(Debug, Clone, Copy)] +pub enum ErrorType { + NotEnoughSpace = 1, +} + +#[derive(Debug, Clone, Copy)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub enum Error { + Write, + Read, + Flush, + WrongMsgType { + expected: TufMessage, + got: TufMessage, + }, + InvalidVarIntLen(u8), + FailedToDecodeVarInt, + FailedToEncodeVarInt, + OutBufTooSmall { + supplied: usize, + required: usize, + }, + RemoteClosed, + ReceivedInvalidMessage, + InvalidMessageClass(u128), + InvalidMessageType(u128), + InvalidContentType(u128), +} + +pub async fn fetch_tuf_role( + reader: impl Read, + writer: impl Write, + out: &mut [u8], + role: TufMessage, + version: Option, +) -> Result { + let version = version.unwrap_or(NonZeroU64::new(1).unwrap()); + //debug!("fetching {role:?}"); + + fetch_file( + reader, + writer, + out, + MessageClass::Request, + MessageType::Tuf, + role as u128, + Some(version.get() as u128), + None, + ) + .await +} + +pub async fn fetch_file( + mut reader: impl Read, + mut writer: impl Write, + out: &mut [u8], + message_class: MessageClass, + message_type: MessageType, + content_type: u128, + header_data: Option, + body: Option<&[u8]>, +) -> Result { + let mut header = Header(0); + header.set_message_class(message_class as u128); + header.set_message_type(message_type as u128); + header.set_content_type(content_type); + if let Some(header_data) = header_data { + header.set_header_data(header_data); + } + header.set_content_len(body.map(|b| b.len()).unwrap_or_default() as u128); + debug!("content len: {}", header.content_len()); + + debug!("writing request header to socket"); + writer.write(&header.0.to_be_bytes()).await.map_err(|_| { + //error!("had error while writing: {:?}", err); + Error::Write + })?; + + if let Some(body) = body { + debug!("writing request data to socket"); + writer.write(body).await.map_err(|_| { + //error!("had error while writing: {:?}", err); + Error::Write + })?; + } + + writer.flush().await.map_err(|_| { + //error!("had error while flushing: {:?}", err); + Error::Flush + })?; + debug!("flushed socket"); + let mut header = [0u8; 16]; + debug!("reading response header"); + reader.read_exact(&mut header).await.map_err(|_| { + //error!("error while reading: {:?}", err); + Error::Read + })?; + + let header_response = Header(u128::from_be_bytes(header)); + match ( + header_response.message_class(), + header_response.message_type(), + header_response.content_type(), + ) { + (message_class, _, _) if message_class != MessageClass::Response as u128 => { + return Err(Error::InvalidMessageClass(message_class)); + } + (_, message_type_got, _) if message_type_got != message_type as u128 => { + return Err(Error::InvalidMessageType(message_type_got)); + } + (_, _, content_type_got) if content_type_got != content_type => { + return Err(Error::InvalidContentType(content_type_got)); + } + _ => {} + } + debug!("successfully extracted header"); + let content_len = header_response.content_len() as usize; + let mut header_status_response = Header(0); + if content_len > out.len() { + header_status_response.set_message_class(MessageClass::Error as u128); + writer + .write(&header_status_response.0.to_be_bytes()) + .await + .or(Err(Error::Write))?; + writer.flush().await.or(Err(Error::Flush))?; + return Err(Error::OutBufTooSmall { + required: content_len, + supplied: out.len(), + }); + } + header_status_response.set_message_class(MessageClass::Ok as u128); + writer + .write(&header_status_response.0.to_be_bytes()) + .await + .or(Err(Error::Write))?; + writer.flush().await.or(Err(Error::Flush))?; + debug!("successfully sent OK"); + debug!("attemtping to receive data"); + //let mut read_buf = [0u8; 1024]; + let mut bytes_received = 0; + loop { + let (from, to) = ( + bytes_received, + core::cmp::min(out.len(), bytes_received + 1024), + ); + let read_slice = &mut out[from..to]; + match reader.read(read_slice).await { + Ok(0) => { + warn!("read EOF"); + return Ok(bytes_received); + } + Ok(n) => { + debug!("read {} bytes", n); + bytes_received += n; + } + Err(_) => { + //warn!("read error: {:?}", e); + return Err(Error::Read); + } + } + } +} + +pub async fn fetch_file_flash( + mut reader: impl Read, + mut writer: impl Write, + mut out: impl NorFlash, + message_class: MessageClass, + message_type: MessageType, + content_type: u128, + header_data: Option, + body: Option<&[u8]>, +) -> Result<(usize, H), Error> { + let mut header = Header(0); + header.set_message_class(message_class as u128); + header.set_message_type(message_type as u128); + header.set_content_type(content_type); + if let Some(header_data) = header_data { + header.set_header_data(header_data); + } + header.set_content_len(body.map(|b| b.len()).unwrap_or_default() as u128); + debug!("content len: {}", header.content_len()); + + debug!("writing request header to socket"); + writer.write(&header.0.to_be_bytes()).await.map_err(|_| { + //error!("had error while writing: {:?}", err); + Error::Write + })?; + + if let Some(body) = body { + debug!("writing request data to socket"); + writer.write(body).await.map_err(|_| { + //error!("had error while writing: {:?}", err); + Error::Write + })?; + } + + writer.flush().await.map_err(|_| { + //error!("had error while flushing: {:?}", err); + Error::Flush + })?; + debug!("flushed socket"); + let mut header = [0u8; 16]; + debug!("reading response header"); + reader.read_exact(&mut header).await.map_err(|_| { + //error!("error while reading: {:?}", err); + Error::Read + })?; + + let header_response = Header(u128::from_be_bytes(header)); + match ( + header_response.message_class(), + header_response.message_type(), + header_response.content_type(), + ) { + (message_class, _, _) if message_class != MessageClass::Response as u128 => { + return Err(Error::InvalidMessageClass(message_class)); + } + (_, message_type_got, _) if message_type_got != message_type as u128 => { + return Err(Error::InvalidMessageType(message_type_got)); + } + (_, _, content_type_got) if content_type_got != content_type => { + return Err(Error::InvalidContentType(content_type_got)); + } + _ => {} + } + debug!("successfully extracted header"); + let content_len = header_response.content_len() as usize; + let mut header_status_response = Header(0); + if content_len > out.capacity() { + header_status_response.set_message_class(MessageClass::Error as u128); + writer + .write(&header_status_response.0.to_be_bytes()) + .await + .or(Err(Error::Write))?; + writer.flush().await.or(Err(Error::Flush))?; + return Err(Error::OutBufTooSmall { + required: content_len, + supplied: out.capacity(), + }); + } + header_status_response.set_message_class(MessageClass::Ok as u128); + writer + .write(&header_status_response.0.to_be_bytes()) + .await + .or(Err(Error::Write))?; + writer.flush().await.or(Err(Error::Flush))?; + + let mut bytes_received = 0; + let mut read_buf = [0u8; 1024]; + let mut hasher = H::new(); + loop { + match reader.read(&mut read_buf).await { + Ok(0) => { + warn!("read EOF"); + return Ok((bytes_received, hasher)); + } + Ok(n) => { + debug!("read {} bytes", n); + hasher.update(&read_buf[..n]); + out.write(bytes_received as u32, &read_buf[..n]) + .map_err(|_| Error::Write)?; + bytes_received += n; + } + Err(_) => { + //warn!("read error: {:?}", e); + return Err(Error::Read); + } + } + } +} + +pub async fn fetch_tuf_file( + reader: impl Read, + writer: impl Write, + out: &mut [u8], + metapath: &[u8], +) -> Result { + debug!( + "fetching tuf file at path {:?}", + core::str::from_utf8(metapath).unwrap_or("INVALID UTF-8 PATH") + ); + fetch_file( + reader, + writer, + out, + MessageClass::Request, + MessageType::Tuf, + TufMessage::TargetFile as u128, + None, + Some(metapath), + ) + .await +} + +pub async fn fetch_binary( + reader: impl Read, + writer: impl Write, + out: &mut [u8], + identifier: &[u8], +) -> Result { + debug!( + "fetching binary with identifier {:?}", + core::str::from_utf8(identifier).unwrap_or("INVALID UTF-8 PATH") + ); + fetch_file( + reader, + writer, + out, + MessageClass::Request, + MessageType::Binary, + 0, + None, + Some(identifier), + ) + .await +} + +pub async fn fetch_binary_flash( + reader: impl Read, + writer: impl Write, + out: impl NorFlash, + identifier: &[u8], +) -> Result<(usize, H), Error> { + debug!( + "fetching binary with identifier {:?}", + core::str::from_utf8(identifier).unwrap_or("INVALID UTF-8 PATH") + ); + fetch_file_flash( + reader, + writer, + out, + MessageClass::Request, + MessageType::Binary, + 0, + None, + Some(identifier), + ) + .await +} + +pub async fn fetch_signature( + reader: impl Read, + writer: impl Write, + out: &mut [u8], + identifier: &[u8], +) -> Result { + debug!( + "fetching binary with identifier {:?}", + core::str::from_utf8(identifier).unwrap_or("INVALID UTF-8 PATH") + ); + fetch_file( + reader, + writer, + out, + MessageClass::Request, + MessageType::Signature, + 0, + None, + Some(identifier), + ) + .await +} + +pub async fn send(mut reader: impl Read, mut writer: impl Write, data: &[u8]) -> Result<(), Error> { + let mut header_out = Header(0); + header_out.set_message_class(MessageClass::Response as u128); + header_out.set_message_type(MessageType::Tuf as u128); + header_out.set_content_type(TufMessage::Root as u128); + header_out.set_content_len(data.len() as u128); + + writer + .write(&header_out.0.to_be_bytes()) + .await + .or(Err(Error::Write))?; + writer.flush().await.or(Err(Error::Flush))?; + + let mut buf = [0u8; 16]; + reader.read_exact(&mut buf).await.or(Err(Error::Read))?; + let header_in = Header(u128::from_be_bytes(buf)); + if header_in.message_class() != MessageClass::Ok as u128 { + unimplemented!("handling error cases handling is not implemented") + } + + for bytes in data.chunks(1024) { + writer.write(bytes).await.or(Err(Error::Write))?; + writer.flush().await.or(Err(Error::Flush))?; + } + Ok(()) +} + +bitfield! { + pub struct Header(u128); + impl Debug; + pub message_class, set_message_class: 7, 0; + pub message_type, set_message_type : 15, 8; + pub content_type, set_content_type : 31, 16; + pub header_data, set_header_data : 63, 32; + pub content_len, set_content_len : 127, 64; +} + +#[cfg(test)] +mod test { + use alloc::borrow::ToOwned; + use alloc::vec; + use sha2::Sha256; + + use crate::{ + fetch_file_flash, fetch_tuf_file, fetch_tuf_role, send, Header, MessageClass, MessageType, + TufMessage, + }; + use embedded_storage::nor_flash::ReadNorFlash; + use tempfile::NamedTempFile; + + async fn test_send_impl(data: &str) { + let mut reader = vec![]; + + let mut header = Header(0); + header.set_message_class(MessageClass::Ok as u128); + reader.extend(header.0.to_be_bytes()); + + let mut writer = vec![0; data.len() + 16]; + + send(reader.as_slice(), writer.as_mut_slice(), data.as_bytes()) + .await + .expect("failed"); + eprintln!("{writer:?}"); + let header_got = Header(u128::from_be_bytes(writer[0..16].try_into().unwrap())); + + assert_eq!( + header_got.message_class(), + MessageClass::Response as u128, + "wrong message class" + ); + assert_eq!( + header_got.message_type(), + MessageType::Tuf as u128, + "wrong message type" + ); + assert_eq!( + header_got.content_type(), + TufMessage::Root as u128, + "wrong content type" + ); + let content_len = header_got.content_len() as usize; + assert_eq!(content_len, data.len()); + assert_eq!(std::str::from_utf8(&writer[16..]).unwrap(), data); + } + + #[tokio::test] + async fn test_send() { + test_send_impl("hello world").await; + } + + async fn test_fetch_impl(data: &str) { + let mut reader = vec![]; + let mut header = Header(0); + header.set_message_class(MessageClass::Response as u128); + header.set_message_type(MessageType::Tuf as u128); + header.set_content_type(TufMessage::Root as u128); + header.set_content_len(data.len() as u128); + reader.extend(header.0.to_be_bytes()); + reader.extend(data.bytes()); + let mut writer = [0u8; 1024]; + + let mut out_buf = [0u8; 1024]; + let n = fetch_tuf_role( + reader.as_slice(), + writer.as_mut_slice(), + &mut out_buf, + TufMessage::Root, + None, + ) + .await + .expect("failed"); + let first_header = Header(u128::from_be_bytes(writer[0..16].try_into().unwrap())); + let second_header = Header(u128::from_be_bytes(writer[16..32].try_into().unwrap())); + + eprintln!("{first_header:?}"); + assert_eq!( + first_header.message_class(), + MessageClass::Request as u128, + "wrong message class" + ); + assert_eq!( + first_header.message_type(), + MessageType::Tuf as u128, + "wrong message type" + ); + assert_eq!( + first_header.content_type(), + TufMessage::Root as u128, + "wrong content type" + ); + assert_eq!( + second_header.message_class(), + MessageClass::Ok as u128, + "wrong message class" + ); + assert_eq!(std::str::from_utf8(&out_buf[..n]).unwrap(), data); + } + + #[tokio::test] + async fn test_fetch() { + test_fetch_impl("hello world").await + } + + #[tokio::test] + async fn test_fetch_target_file() { + test_fetch_target_file_impl("hello.txt", "hello world").await + } + + async fn test_fetch_target_file_impl(path: &str, data: &str) { + let mut reader = vec![]; + let mut header = Header(0); + header.set_message_class(MessageClass::Response as u128); + header.set_message_type(MessageType::Tuf as u128); + header.set_content_type(TufMessage::TargetFile as u128); + header.set_content_len(data.len() as u128); + reader.extend(header.0.to_be_bytes()); + reader.extend(data.bytes()); + let mut writer = [0u8; 1024]; + + let mut out_buf = [0u8; 1024]; + let n = fetch_tuf_file( + reader.as_slice(), + writer.as_mut_slice(), + &mut out_buf, + path.as_bytes(), + ) + .await + .expect("failed"); + let first_header = Header(u128::from_be_bytes(writer[0..16].try_into().unwrap())); + let first_content = std::str::from_utf8(&writer[16..16 + path.len()]).unwrap(); + + let second_header = Header(u128::from_be_bytes( + writer[16 + path.len()..32 + path.len()].try_into().unwrap(), + )); + + eprintln!("{first_header:?}"); + assert_eq!( + first_header.message_class(), + MessageClass::Request as u128, + "wrong message class" + ); + assert_eq!( + first_header.message_type(), + MessageType::Tuf as u128, + "wrong message type" + ); + assert_eq!( + first_header.content_type(), + TufMessage::TargetFile as u128, + "wrong content type" + ); + assert_eq!( + first_header.content_len(), + path.len() as u128, + "wrong content len" + ); + assert_eq!(first_content, path, "wrong content"); + assert_eq!( + second_header.message_class(), + MessageClass::Ok as u128, + "wrong message class" + ); + assert_eq!(std::str::from_utf8(&out_buf[..n]).unwrap(), data); + } + + #[tokio::test] + async fn test_fetch_flash() { + let writer = vec![]; + let mut header = Header(0); + let file_content = b"Hello World!"; + header.set_message_class(MessageClass::Response as u128); + header.set_message_type(MessageType::Binary as u128); + header.set_header_data(file_content.len() as u128); + let reader = [header.0.to_be_bytes().as_slice(), file_content].concat(); + let file = dbg!(NamedTempFile::new().expect("failed to create tempfile")); + let mut flash_writer = crate::flash::mock_flash::FsWriter(file.path().to_owned()); + let path = b"hello-world.txt"; + fetch_file_flash::( + reader.as_slice(), + writer, + &mut flash_writer, + MessageClass::Request, + MessageType::Binary, + 0, + Some(path.len() as u128), + Some(path), + ) + .await + .expect("should succeed"); + let mut out_buf = [0u8; 12]; + flash_writer + .read(0, out_buf.as_mut_slice()) + .expect("failed to read bytes"); + assert_eq!(&out_buf, file_content); + } +} diff --git a/bt2x/bt2x-ota-common/src/net.rs b/bt2x/bt2x-ota-common/src/net.rs new file mode 100644 index 0000000..8f0ef8c --- /dev/null +++ b/bt2x/bt2x-ota-common/src/net.rs @@ -0,0 +1,184 @@ +use embassy_net::driver::Driver; +use embassy_net::tcp::TcpSocket; +use embassy_net::{IpEndpoint, Stack}; + +#[cfg(feature = "defmt")] +use defmt::error; +use embassy_time::Duration; +use embedded_storage::nor_flash::NorFlash; +#[cfg(feature = "log")] +use log::{debug, error, info, warn}; +use sha2::Digest; +#[cfg(feature = "tracing")] +use tracing::error; +use tuf_no_std::common::remote::{TransportError, TufTransportAsync}; + +use crate::TufMessage; + +/// Implementation for the networking functionality required for TUF and BT²X for embassy_net implementations. +pub struct Transport<'a, D: Driver> { + /// The address of the remote server. + pub server: IpEndpoint, + /// The network stack that is used to communicate with the remote host. + pub network_stack: &'a Stack, +} + +impl<'a, D: Driver> Transport<'a, D> { + /// Fetch the TUF role with the specified version number. + async fn fetch_role<'o>( + &self, + version: Option, + out: &'o mut [u8], + role: TufMessage, + ) -> Result<&'o [u8], TransportError> { + let mut rx_buffer = [0; 4096]; + let mut tx_buffer = [0; 4096]; + let mut socket = TcpSocket::new(self.network_stack, &mut rx_buffer, &mut tx_buffer); + socket.set_timeout(Some(Duration::from_secs(10))); + socket + .connect(self.server) + .await + .map_err(|_| TransportError::ConnectError)?; + let (reader, writer) = socket.split(); + let bytes_received = crate::fetch_tuf_role(reader, writer, out, role, version) + .await + .map_err(|err| { + error!("had error while fetching: {:?}", err); + TransportError::FetchError + })?; + socket.close(); + Ok(&out[..bytes_received]) + } +} + +impl<'a, D: Driver> TufTransportAsync for Transport<'a, D> { + async fn fetch_root<'o>( + &self, + version: core::num::NonZeroU64, + out: &'o mut [u8], + ) -> Result<&'o [u8], TransportError> { + self.fetch_role(Some(version), out, TufMessage::Root).await + } + + async fn fetch_timestamp<'o>( + &self, + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std::common::remote::TransportError> { + self.fetch_role(None, out, TufMessage::Timestamp).await + } + + async fn fetch_snapshot<'o>( + &self, + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std::common::remote::TransportError> { + self.fetch_role(None, out, TufMessage::Snapshot).await + } + + async fn fetch_targets<'o>( + &self, + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std::common::remote::TransportError> { + self.fetch_role(None, out, TufMessage::Targets).await + } + + async fn fetch_target_file<'o>( + &self, + metapath: &[u8], + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std::common::remote::TransportError> { + let mut rx_buffer = [0; 4096]; + let mut tx_buffer = [0; 4096]; + let mut socket = TcpSocket::new(self.network_stack, &mut rx_buffer, &mut tx_buffer); + socket.set_timeout(Some(Duration::from_secs(10))); + socket + .connect(self.server) + .await + .map_err(|_| TransportError::ConnectError)?; + let (reader, writer) = socket.split(); + let bytes_received = crate::fetch_tuf_file(reader, writer, out, metapath) + .await + .map_err(|err| { + error!("had error while fetching: {:?}", err); + TransportError::FetchError + })?; + Ok(&out[..bytes_received]) + } +} + +impl<'a, D: Driver> Transport<'a, D> { + /// Fetch the binary with the given identifier and write it to memory. + /// This is only feasible for small binaries that fit into the RAM. + /// In most cases you should prefer the `fetch_binary_flash` function. + pub async fn fetch_binary<'o>( + &self, + identifier: &[u8], + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std::common::remote::TransportError> { + let mut rx_buffer = [0; 4096]; + let mut tx_buffer = [0; 4096]; + let mut socket = TcpSocket::new(self.network_stack, &mut rx_buffer, &mut tx_buffer); + socket.set_timeout(Some(Duration::from_secs(10))); + socket + .connect(self.server) + .await + .map_err(|_| TransportError::ConnectError)?; + let (reader, writer) = socket.split(); + let bytes_received = crate::fetch_binary(reader, writer, out, identifier) + .await + .map_err(|err| { + error!("had error while fetching: {:?}", err); + TransportError::FetchError + })?; + Ok(&out[..bytes_received]) + } + + /// Fetch the binary with the given identifier and write it to the flash storage. + /// This also calculates a digest of the binary during download with the algorithm specified in `H`. + /// On success it returns the number of bytes that were written and the digest. + pub async fn fetch_binary_flash( + &self, + identifier: &[u8], + out: impl NorFlash, + ) -> Result<(usize, H), tuf_no_std::common::remote::TransportError> { + let mut rx_buffer = [0; 4096]; + let mut tx_buffer = [0; 4096]; + let mut socket = TcpSocket::new(self.network_stack, &mut rx_buffer, &mut tx_buffer); + socket.set_timeout(Some(Duration::from_secs(10))); + socket + .connect(self.server) + .await + .map_err(|_| TransportError::ConnectError)?; + let (reader, writer) = socket.split(); + let bytes_received = crate::fetch_binary_flash(reader, writer, out, identifier) + .await + .map_err(|err| { + error!("had error while fetching: {:?}", err); + TransportError::FetchError + })?; + Ok(bytes_received) + } + + /// Fetches the signature for the given identifier. + pub async fn fetch_signature<'o>( + &self, + identifier: &[u8], + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std::common::remote::TransportError> { + let mut rx_buffer = [0; 4096]; + let mut tx_buffer = [0; 4096]; + let mut socket = TcpSocket::new(self.network_stack, &mut rx_buffer, &mut tx_buffer); + socket.set_timeout(Some(Duration::from_secs(10))); + socket + .connect(self.server) + .await + .map_err(|_| TransportError::ConnectError)?; + let (reader, writer) = socket.split(); + let bytes_received = crate::fetch_signature(reader, writer, out, identifier) + .await + .map_err(|err| { + error!("had error while fetching: {:?}", err); + TransportError::FetchError + })?; + Ok(&out[..bytes_received]) + } +} diff --git a/bt2x/bt2x-ota/Cargo.toml b/bt2x/bt2x-ota/Cargo.toml new file mode 100644 index 0000000..089ce5d --- /dev/null +++ b/bt2x/bt2x-ota/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "bt2x-ota" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +clap = { workspace = true, features = ["derive"] } +bt2x-ota-common = { path = "../bt2x-ota-common", default-features = false, features = ["tracing"] } +tokio = { workspace = true, features = ["full"] } +anyhow = { workspace = true } +tracing = { workspace = true } +tracing-core = { workspace = true } +tracing-subscriber = { workspace = true } +path-clean = { workspace = true } diff --git a/bt2x/bt2x-ota/src/cli.rs b/bt2x/bt2x-ota/src/cli.rs new file mode 100644 index 0000000..ffa2bd7 --- /dev/null +++ b/bt2x/bt2x-ota/src/cli.rs @@ -0,0 +1,13 @@ +use clap::Parser; +use std::path::PathBuf; + +#[derive(Parser, Debug)] +#[command(author, version, about, long_about = None)] +pub struct Args { + #[arg(long)] + pub repo_path: PathBuf, + #[arg(long)] + pub binaries: PathBuf, + #[arg(long)] + pub signatures: PathBuf, +} diff --git a/bt2x/bt2x-ota/src/main.rs b/bt2x/bt2x-ota/src/main.rs new file mode 100644 index 0000000..a118b3c --- /dev/null +++ b/bt2x/bt2x-ota/src/main.rs @@ -0,0 +1,329 @@ +mod cli; + +use crate::cli::Args; +use anyhow::{anyhow, Context, Result}; +use bt2x_ota_common::{Header, MessageClass, MessageType, TufMessage}; +use clap::Parser; +use path_clean::PathClean; +use std::error::Error; +use std::fs::OpenOptions; +use std::os::unix::fs::MetadataExt; +use std::path::PathBuf; +use tokio::io::{AsyncReadExt, AsyncWriteExt, BufReader, BufWriter}; +use tokio::net::{TcpListener, TcpStream}; +use tracing::{debug, info}; +use tracing_subscriber::filter::Targets; +use tracing_subscriber::prelude::*; + +#[derive(Debug, Clone)] +struct Storage { + pub(crate) repository_path: PathBuf, + pub(crate) binaries_path: PathBuf, + pub(crate) signatures_path: PathBuf, +} + +impl Storage { + pub fn tuf_root(&self, version: u64) -> Result> { + info!("handling fetching root with version {version:?}"); + std::fs::read(self.repository_path.join(format!("{version}.root.der"))) + .context("failed to read file") + } + pub fn tuf_timestamp(&self, version: Option) -> Result> { + let version = version.unwrap_or(1); + info!("handling fetching timestamp with version {version:?}"); + std::fs::read( + self.repository_path + .join(format!("{version}.timestamp.der")), + ) + .context("failed to read file") + } + pub fn tuf_snapshot(&self, version: Option) -> Result> { + let version = version.unwrap_or(1); + info!("handling fetching snapshot with version {version:?}"); + std::fs::read(self.repository_path.join(format!("{version}.snapshot.der"))) + .context("failed to read file") + } + pub fn tuf_targets(&self, version: Option) -> Result> { + let version = version.unwrap_or(1); + info!("handling fetching targets with version {version:?}"); + std::fs::read(self.repository_path.join(format!("{version}.targets.der"))) + .context("failed to read file") + } + pub fn tuf_target(&self, metapath: &str) -> Result> { + info!("handling fetching target with path {metapath:?}"); + let metapath_clean = PathBuf::from(metapath).clean(); + let file_path = self.repository_path.join("targets").join(metapath_clean); + if !file_path.starts_with(&self.repository_path) { + return Err(anyhow!( + "requested path {file_path:?}is not within directory" + )); + } + std::fs::read(file_path).context("failed to read file") + } + + pub fn binary(&self, metapath: &str) -> Result<(u64, impl std::io::Read)> { + let metapath_clean = PathBuf::from(metapath).clean(); + OpenOptions::new() + .read(true) + .open(self.binaries_path.join(metapath_clean)) + .context("failed to open binary") + .map(|f| { + let size = f.metadata().as_ref().unwrap().size(); + (size, std::io::BufReader::new(f)) + }) + } + pub fn signature(&self, metapath: &str) -> Result<(u64, impl std::io::Read)> { + OpenOptions::new() + .read(true) + .open(self.signatures_path.join(metapath)) + .context("failed to open signature") + .map(|f| { + let size = f.metadata().as_ref().unwrap().size(); + (size, std::io::BufReader::new(f)) + }) + } +} + +async fn handle_client( + sock: &mut TcpStream, + storage: &Storage, +) -> Result<(), Box> { + let mut buf = [0u8; 16]; + sock.read_exact(&mut buf).await?; + let header = Header(u128::from_be_bytes(buf)); + debug!("got header: {header:?}"); + match (header.message_class(), header.message_type()) { + (c_class, m_type) + if (c_class, m_type) == (MessageClass::Request as u128, MessageType::Tuf as u128) => + { + debug!("handling tuf"); + handle_tuf(sock, header, storage).await? + } + + (c_class, m_type) + if (c_class, m_type) + == (MessageClass::Request as u128, MessageType::Binary as u128) => + { + debug!("handling binary"); + handle_binary(sock, header, storage).await? + } + (c_class, m_type) + if (c_class, m_type) + == ( + MessageClass::Request as u128, + MessageType::Signature as u128, + ) => + { + debug!("handling signature"); + handle_signature(sock, header, storage).await? + } + (c_class, m_type) + if (c_class, m_type) + == (MessageClass::Request as u128, MessageType::Rfc3161 as u128) => + { + debug!("handling tuf"); + handle_rfc3161(sock, header, storage).await? + } + _ => { + unimplemented!(); + } + } + Ok(()) +} + +async fn handle_tuf(stream: &mut TcpStream, header: Header, storage: &Storage) -> Result<()> { + let (data, role) = match header.content_type() { + c_type if c_type == TufMessage::Root as u128 => ( + storage.tuf_root(header.header_data() as u64)?, + TufMessage::Root, + ), + c_type if c_type == TufMessage::Targets as u128 => { + (storage.tuf_targets(None)?, TufMessage::Targets) + } + c_type if c_type == TufMessage::Snapshot as u128 => { + (storage.tuf_snapshot(None)?, TufMessage::Snapshot) + } + c_type if c_type == TufMessage::Timestamp as u128 => { + (storage.tuf_timestamp(None)?, TufMessage::Timestamp) + } + c_type if c_type == TufMessage::TargetFile as u128 => { + let mut buf = vec![0; header.content_len() as usize]; + stream + .read_exact(&mut buf) + .await + .context("could not read path from socket")?; + debug!("{buf:x?}"); + let path = std::str::from_utf8(&buf).context("provided path was not valid UTF-8")?; + debug!("got path: {path:?}"); + (storage.tuf_target(path)?, TufMessage::TargetFile) + } + _ => unimplemented!(), + }; + debug!("handling {role:?}"); + send(stream, &data, role).await +} + +async fn handle_signature(stream: &mut TcpStream, header: Header, storage: &Storage) -> Result<()> { + let (read, write) = stream.split(); + let mut reader = BufReader::new(read); + let mut writer = BufWriter::new(write); + + let mut path = [0u8; 256]; + let content_len = header.content_len() as usize; + reader.read_exact(&mut path[..content_len]).await?; + let path = std::str::from_utf8(&path[..content_len])?; + let (data_len, mut data) = storage.signature(path)?; + + let mut header_out = Header(0); + header_out.set_message_class(MessageClass::Response as u128); + header_out.set_message_type(MessageType::Signature as u128); + header_out.set_content_len(data_len as u128); + + writer.write_all(&header_out.0.to_be_bytes()).await?; + writer.flush().await?; + info!("sent header"); + let mut buf = [0u8; 16]; + reader.read_exact(&mut buf).await?; + let header_in = Header(u128::from_be_bytes(buf)); + if header_in.message_class() != MessageClass::Ok as u128 { + return Err(anyhow!("got message != Ok from remote")); + } + info!("sending data"); + loop { + use std::io::Read; + let mut buf = [0u8; 1024]; + let bytes_read = data.read(&mut buf)?; + if bytes_read == 0 { + break; + } + let mut buf = &buf[..bytes_read]; + debug!("sending {} bytes", buf.len()); + loop { + if buf.is_empty() { + break; + } + let bytes_sent = writer.write(buf).await?; + debug!("sent {bytes_sent} bytes"); + buf = &buf[bytes_sent..]; + writer.flush().await?; + } + } + info!("sending data finished"); + Ok(()) +} + +async fn handle_binary(stream: &mut TcpStream, header: Header, storage: &Storage) -> Result<()> { + let (read, write) = stream.split(); + let mut reader = BufReader::new(read); + let mut writer = BufWriter::new(write); + + let mut path = [0u8; 256]; + let content_len = header.content_len() as usize; + reader.read_exact(&mut path[..content_len]).await?; + let path = std::str::from_utf8(&path[..content_len])?; + info!("client requested binary at: {path}"); + let (data_len, mut data) = storage.binary(path)?; + + let mut header_out = Header(0); + header_out.set_message_class(MessageClass::Response as u128); + header_out.set_message_type(MessageType::Binary as u128); + header_out.set_content_len(data_len as u128); + + writer.write_all(&header_out.0.to_be_bytes()).await?; + writer.flush().await?; + info!("sent header"); + let mut buf = [0u8; 16]; + reader.read_exact(&mut buf).await?; + let header_in = Header(u128::from_be_bytes(buf)); + if header_in.message_class() != MessageClass::Ok as u128 { + return Err(anyhow!("got message != Ok from remote")); + } + info!("sending data"); + loop { + use std::io::Read; + let mut buf = [0u8; 1024]; + let bytes_read = data.read(&mut buf)?; + if bytes_read == 0 { + break; + } + let mut buf = &buf[..bytes_read]; + debug!("sending {} bytes", buf.len()); + loop { + if buf.is_empty() { + break; + } + let bytes_sent = writer.write(buf).await?; + debug!("sent {bytes_sent} bytes"); + buf = &buf[bytes_sent..]; + writer.flush().await?; + } + } + info!("sending data finished"); + Ok(()) +} + +#[allow(unused_variables)] +async fn handle_rfc3161(stream: &mut TcpStream, header: Header, storage: &Storage) -> Result<()> { + unimplemented!() +} + +async fn send(stream: &mut TcpStream, data: &[u8], role: TufMessage) -> Result<()> { + let mut header_out = Header(0); + header_out.set_message_class(MessageClass::Response as u128); + header_out.set_message_type(MessageType::Tuf as u128); + header_out.set_content_type(role as u128); + header_out.set_content_len(data.len() as u128); + let (read, write) = stream.split(); + let mut reader = BufReader::new(read); + let mut writer = BufWriter::new(write); + writer.write_all(&header_out.0.to_be_bytes()).await?; + writer.flush().await?; + info!("sent header"); + let mut buf = [0u8; 16]; + reader.read_exact(&mut buf).await?; + let header_in = Header(u128::from_be_bytes(buf)); + if header_in.message_class() != MessageClass::Ok as u128 { + return Err(anyhow!("got message != Ok from remote")); + } + info!("sending data"); + for bytes in data.chunks(1024) { + debug!("sending {} bytes", bytes.len()); + let n = writer.write(bytes).await?; + writer.flush().await?; + debug!("sent {n} bytes"); + } + info!("sending data finished"); + Ok(()) +} + +#[tokio::main] +async fn main() -> Result<(), Box> { + tracing_subscriber::registry() + .with(tracing_subscriber::fmt::layer()) + .with(Targets::new().with_target( + env!("CARGO_PKG_NAME").replace('-', "_"), + tracing_core::Level::INFO, + )) + .init(); + let args = Args::parse(); + + let storage = Storage { + repository_path: args.repo_path, + signatures_path: args.signatures, + binaries_path: args.binaries, + }; + debug!("starting TCP listener"); + let sockaddr = ("0.0.0.0", 50000); + let listener = TcpListener::bind(sockaddr) + .await + .expect("failed to bind to socket"); + debug!("successfully bound to {sockaddr:?}"); + loop { + let (mut socket, addr) = listener.accept().await?; + debug!("got client: {addr:?}"); + match handle_client(&mut socket, &storage).await { + Ok(_) => continue, + Err(err) => println!("encountered error: {err:?}"), + } + } +} diff --git a/bt2x/bt2x-server/Cargo.toml b/bt2x/bt2x-server/Cargo.toml new file mode 100644 index 0000000..57e9a1a --- /dev/null +++ b/bt2x/bt2x-server/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "bt2x-server" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +bt2x-common = { path = "../bt2x-common" } +sigstore = { workspace = true } +tokio = { workspace = true, features = ["full"] } +futures = { workspace = true } +clap = { workspace = true, features = ["derive"] } +oci-distribution = { workspace = true, features = ["rustls-tls"] } +url = { workspace = true } +tracing-subscriber = { workspace = true, features = [ + "fmt", + "std", + "env-filter", +] } +tracing = { workspace = true } +tracing-core = { workspace = true } +humantime = { workspace = true } +serde = { workspace = true } +anyhow = { workspace = true } +serde_yaml = { workspace = true } +serde_json = { workspace = true } +base64 = { workspace = true } +rustls-pki-types = { workspace = true } +rustls-pemfile = { workspace = true } diff --git a/bt2x/bt2x-server/src/cli.rs b/bt2x/bt2x-server/src/cli.rs new file mode 100644 index 0000000..a8ca93e --- /dev/null +++ b/bt2x/bt2x-server/src/cli.rs @@ -0,0 +1,53 @@ +use clap::Parser; +use sigstore::registry::OciReference; +use std::path::PathBuf; + +#[derive(Parser, Debug, Clone)] +#[command(author, version, about, long_about = None)] +pub(crate) struct Args { + /// OCI image references + #[arg(long, value_name = "OCI REFERENCE")] + pub(crate) image: Vec, + #[arg(long)] + pub(crate) fulcio_url: Option, + #[arg(long)] + pub(crate) rekor_url: Option, + #[arg(long)] + pub(crate) ct_log_url: Option, + /// allow HTTP connections + #[clap(long)] + pub(crate) http: bool, + /// application logging level + #[clap(long, value_enum, default_value_t = LogLevel::Info)] + pub(crate) log_level: LogLevel, + /// interval at which OCI images are checked + #[clap(long)] + pub(crate) interval: Option, + /// path to the configuration file, consult [crate::config::Config] for more information. + #[clap(long, value_name = "PATH")] + pub(crate) config: Option, + /// directory to which audited files and signatures are written to + #[clap(long)] + pub(crate) outdir: PathBuf, +} + +#[derive(clap::ValueEnum, Clone, Debug)] +pub(crate) enum LogLevel { + Debug, + Info, + Warn, + Error, + Trace, +} + +impl From<&LogLevel> for tracing_core::LevelFilter { + fn from(value: &LogLevel) -> Self { + match value { + LogLevel::Debug => tracing_core::Level::DEBUG.into(), + LogLevel::Info => tracing_core::Level::INFO.into(), + LogLevel::Warn => tracing_core::Level::WARN.into(), + LogLevel::Error => tracing_core::Level::ERROR.into(), + LogLevel::Trace => tracing_core::Level::TRACE.into(), + } + } +} diff --git a/bt2x/bt2x-server/src/config.rs b/bt2x/bt2x-server/src/config.rs new file mode 100644 index 0000000..34be648 --- /dev/null +++ b/bt2x/bt2x-server/src/config.rs @@ -0,0 +1,83 @@ +use bt2x_common::sigstore_config::SigstoreConfig; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; +use sigstore::cosign::verification_constraint::{ + CertSubjectEmailVerifier, CertSubjectUrlVerifier, VerificationConstraint, +}; +use sigstore::registry::OciReference; +use std::collections::HashMap; +use std::str::FromStr; +use url::Url; + +/// Data structure to configure this application. +#[derive(Debug, Serialize, Deserialize, PartialEq)] +pub struct Config { + /// list of [[References]] to OCI images that will be monitored + pub references: Vec, + /// Sigstore configuration, for more details refer to [[bt2x_common::sigstore_config::SigstoreConfig]] + pub sigstore_config: SigstoreConfig, + /// URLs of monitors to which gossip is sent + pub monitors: Vec, +} + +/// function to handle [[serde]] serialization for OCI references +fn serialize_oci_ref(reference: &OciReference, s: S) -> Result +where + S: Serializer, +{ + s.serialize_str(reference.whole().as_str()) +} + +/// function to handle [[serde]] deserialization for OCI references +fn deserialize_oci_ref<'de, D>(deserializer: D) -> Result +where + D: Deserializer<'de>, +{ + let buf = String::deserialize(deserializer)?; + + OciReference::from_str(&buf).map_err(serde::de::Error::custom) +} + +/// data structure to configure images that will be audited/verified +#[derive(Debug, Serialize, Deserialize, PartialEq)] +pub struct References { + /// tag that is used to identify the image + #[serde( + serialize_with = "serialize_oci_ref", + deserialize_with = "deserialize_oci_ref" + )] + pub tag: OciReference, + /// subject identities that are trusted as signers for this image + pub subjects: Option>, + /// optional: annotations are are verified on this image + pub annotations: Option>, +} + +/// This enum can be used to configure the subject that signed the artifact. +#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[serde(untagged)] +pub enum Subject { + /// the subject is identified by an (E-Mail, OIDC issuer) tuple. + Email { + email: String, + /// The issuer, this is an `Option` for compatibility with the Sigstore library. + /// However, leaving the issuer unspecified is probably not desirable in case the same E-Mail is registered with multiple issuers. + issuer: Option, + }, + /// The subject is identified by a (URL, OIDC issuer) tuple. + Url { url: url::Url, issuer: url::Url }, +} + +impl From for Box { + fn from(value: Subject) -> Self { + match value { + Subject::Email { email, issuer } => Box::new(CertSubjectEmailVerifier { + email, + issuer: issuer.map(|url| url.to_string()), + }), + Subject::Url { url, issuer } => Box::new(CertSubjectUrlVerifier { + url: url.to_string(), + issuer: issuer.to_string(), + }), + } + } +} diff --git a/bt2x/bt2x-server/src/main.rs b/bt2x/bt2x-server/src/main.rs new file mode 100644 index 0000000..76e5024 --- /dev/null +++ b/bt2x/bt2x-server/src/main.rs @@ -0,0 +1,328 @@ +mod cli; +mod config; + +use sigstore::registry::{ClientConfig, ClientProtocol, OciReference}; +use sigstore::trust::ManualTrustRoot; +use std::collections::HashMap; +use url::Url; + +use bt2x_common::rekor::Configuration as RekorConfig; +use bt2x_common::rekor::RekorClient; +use clap::Parser; +use sigstore::cosign::verification_constraint::{AnnotationVerifier, VerificationConstraintVec}; +use std::fs; +use std::fs::{read_to_string, OpenOptions}; +use std::io::{BufReader, Cursor, Write}; +use std::path::{Path, PathBuf}; + +use oci_distribution::client as oci_client; +use oci_distribution::secrets::RegistryAuth; +use tracing::{debug, error, info}; + +use tracing_subscriber::filter::Targets; + +use crate::config::References; +use anyhow::{anyhow, Result}; +use bt2x_common::artifact::source::oci::OciSource; +use bt2x_common::verifier::bt::{BinaryTransparencyVerifier, SigstoreKeys}; +use bt2x_common::verifier::Artifact::{Binary, BundledBinary}; +use bt2x_common::verifier::{Artifact, Verifier}; +use sigstore::cosign::bundle::SignedArtifactBundle; +use tracing_subscriber::prelude::*; + +use base64::engine::{general_purpose::STANDARD as BASE64_STANDARD, Engine}; +use bt2x_common::sigstore_config::KeyConfig; +use bt2x_common::tuf::load_tuf_filesystem; +use rustls_pemfile::{read_one, Item}; + +fn configure_logging(cli: &cli::Args) { + tracing_subscriber::registry() + .with(tracing_subscriber::fmt::layer()) + .with( + Targets::new() + .with_target(env!("CARGO_PKG_NAME").replace('-', "_"), &cli.log_level) + .with_target("bt2x_common", &cli.log_level) + .with_target("sigstore", tracing_core::Level::INFO) + .with_target("oci_distribution", tracing_core::Level::INFO) + .with_target("hyper", tracing_core::Level::INFO) + .with_target("reqwest", tracing_core::Level::INFO), + ) + .init(); +} + +#[tokio::main] +pub async fn main() { + // parse args and read config + let cli = crate::cli::Args::parse(); + let config = cli + .config + .as_ref() + .map(|path| read_to_string(path).expect("config file not found")) + .map(|s| serde_yaml::from_str::(&s).expect("invalid config file")) + .unwrap(); + configure_logging(&cli.clone()); + + // either load keys from filesystem or load them from a TUF repo stored in the filesystem + let (rekor_key, fulcio_cert, ctlog_key) = match config.sigstore_config.key_config { + KeyConfig::Tuf { + metadata_base, + targets_base, + root_path, + target_names, + } => { + let repo = + load_tuf_filesystem(&root_path, &metadata_base, &targets_base, &target_names) + .await + .expect(""); + (repo.rekor_key, repo.fulcio_cert, repo.ctlog_key) + } + KeyConfig::Keys { + rekor_key: Some(rekor_key), + ctlog_key: Some(ctlog_key), + fulcio_cert: Some(fulcio_cert), + } => ( + fs::read(rekor_key).expect("failed to read rekor key"), + fs::read(fulcio_cert).expect("failed to read fulcio cert"), + fs::read(ctlog_key).expect("failed to read rekor key"), + ), + _ => panic!("rekor key required, update config"), + }; + + // setup clients and configs for clients + let rekor_client = RekorClient::new(RekorConfig { + base_path: config.sigstore_config.urls.rekor.to_string(), + ..Default::default() + }); + + let registry_config = ClientConfig { + protocol: if cli.http { + ClientProtocol::Http + } else { + ClientProtocol::Https + }, + accept_invalid_certificates: false, + extra_root_certificates: vec![], + accept_invalid_hostnames: true, + }; + let mut reader = BufReader::new(Cursor::new(fulcio_cert.clone())); + let Some(Item::X509Certificate(fulcio_cert_der)) = + read_one(&mut reader).expect("failed to decode PEM") + else { + panic!("error converting parsing fulcio cert") + }; + let mut reader = BufReader::new(Cursor::new(rekor_key.clone())); + let Some(Item::SubjectPublicKeyInfo(rekor_key_der)) = + read_one(&mut reader).expect("failed to decode PEM") + else { + panic!("error converting parsing rekor key") + }; + let mut reader = BufReader::new(Cursor::new(ctlog_key.clone())); + let Some(Item::SubjectPublicKeyInfo(ctlog_key_der)) = + read_one(&mut reader).expect("failed to decode PEM") + else { + panic!("error converting parsing the CT log key") + }; + + let cosign_client = sigstore::cosign::ClientBuilder::default() + .with_trust_repository(&ManualTrustRoot { + ctfe_keys: vec![ctlog_key_der.to_vec()], + rekor_keys: vec![rekor_key_der.to_vec()], + fulcio_certs: vec![fulcio_cert_der], + }) + .expect("failed to add trust repo") + .with_oci_client_config(registry_config) + .build() + .expect("Unexpected failure while building Client"); + + let oci_client_config = oci_client::ClientConfig { + protocol: if cli.http { + oci_client::ClientProtocol::Http + } else { + oci_client::ClientProtocol::Https + }, + ..Default::default() + }; + + // configure verifier + let mut verifier = BinaryTransparencyVerifier::builder() + .monitors(config.monitors) + .rekor_client(rekor_client) + .cosign_client(cosign_client) + .keys( + SigstoreKeys::builder() + .rekor_pub_key(String::from_utf8(rekor_key.to_vec()).unwrap()) + .fulcio_cert(String::from_utf8(fulcio_cert.to_vec()).unwrap()) + .ct_log_key(String::from_utf8(fulcio_cert.to_vec()).unwrap()) + .build(), + ) + .build(); + + // configure source from which images are downloaded + let mut oci_source = OciSource::new(oci_client_config, RegistryAuth::Anonymous); + let references: Vec<(OciReference, VerificationConstraintVec)> = config + .references + .into_iter() + .chain(cli.image.into_iter().map(|r| References { + tag: r, + subjects: None, + annotations: None, + })) + .map(|r| { + let mut constraints = VerificationConstraintVec::new(); + constraints.extend(r.subjects.unwrap_or_default().into_iter().map(|s| s.into())); + constraints.push(Box::new(AnnotationVerifier { + annotations: r.annotations.unwrap_or_default(), + })); + (r.tag, constraints) + }) + .collect(); + debug!("{:#?}", references); + + // server loop + loop { + debug!("running loop"); + // loop over references + for (reference, constraints) in references.iter() { + debug!("checking {}", &reference); + // verify that each reference is valid under the given constraints + // on success it writes the image to the file system + match run_verify(&mut oci_source, reference, constraints, &mut verifier).await { + // raw binary + Ok(Binary(artifact)) => { + info!("Image successfully verified"); + let bytes = artifact; + fs::create_dir_all(&cli.outdir).expect("failed to create output dir"); + + let out_path = match build_path(cli.outdir.as_path(), reference) { + Ok(path) => path, + Err(err) => { + error!( + "could not create path for {reference:?} output because of {err:?}" + ); + continue; + } + }; + debug!("Path is {out_path:?}"); + if !out_path.exists() { + debug!("Writing to {out_path:?}"); + OpenOptions::new() + .write(true) + .create(true) + .truncate(true) + .open(out_path) + .expect("failed to create output file") + .write_all(&bytes) + .expect("failed to write output file"); + } + } + Err(err) => { + info!("{:?}", err); + continue; + } + // binary that is bundled with a signature + Ok(BundledBinary { binary, bundle }) => { + info!("Image AND Bundle successfully verified"); + let bytes = binary; + fs::create_dir_all(&cli.outdir).expect("failed to create output dir"); + + let out_path = match build_path(cli.outdir.as_path(), reference) { + Ok(path) => path, + Err(err) => { + error!( + "could not create path for {reference:?} output because of {err:?}" + ); + continue; + } + }; + debug!("Path is {out_path:?}"); + debug!("Writing to {out_path:?}"); + OpenOptions::new() + .write(true) + .create(true) + .truncate(true) + .open(&out_path) + .expect("failed to create output file") + .write_all(&bytes) + .expect("failed to write output file"); + let mut out_path_bundle = out_path.clone(); + out_path_bundle.set_extension("json"); + debug!("Bundle path is {out_path_bundle:?}"); + debug!("Writing to {out_path_bundle:?}"); + OpenOptions::new() + .write(true) + .create(true) + .truncate(true) + .open(out_path_bundle) + .expect("failed to create output file") + .write_all(&bundle) + .expect("failed to write output file"); + let mut out_path_bundle = out_path.clone(); + out_path_bundle.set_extension("canonical.json"); + debug!("Bundle path is {out_path_bundle:?}"); + let bundle: SignedArtifactBundle = + serde_json::from_slice(bundle.as_slice()).expect("failed to parse bundle"); + let canonical_json = BASE64_STANDARD + .encode(bundle.rekor_bundle.payload.to_canonical_json().unwrap()); + let encoded_set = BASE64_STANDARD + .encode(bundle.rekor_bundle.signed_entry_timestamp.as_slice()); + let canonical_bundle = HashMap::from([ + ("SignedEntryTimestamp", &encoded_set), + ("Payload", &canonical_json), + ]); + debug!("Writing to {out_path_bundle:?}"); + OpenOptions::new() + .write(true) + .create(true) + .truncate(true) + .open(out_path_bundle) + .expect("failed to create output file") + .write_all(&serde_json::to_vec(&canonical_bundle).unwrap()) + .expect("failed to write output file"); + } + } + } + + if let Some(interval) = cli.interval { + tokio::time::sleep(interval.into()).await + } else { + debug!("Exiting..."); + break; + } + } +} + +/// Builds a file path from the OCI reference at which the output file is stored. +fn build_path(base_path: &Path, reference: &OciReference) -> Result { + let out_path = PathBuf::from(reference.repository()); + let out_path = format!( + "{}-{}.{}", + out_path + .file_stem() + .ok_or(anyhow!("could not create file name from reference")) + .and_then(|s| s + .to_str() + .ok_or(anyhow!("could not get unicode string from path")))?, + reference + .digest() + .or(reference.tag()) + .ok_or(anyhow!("OCI reference requires tag or digest")) + .map(|s| s.trim_start_matches("sha256:"))?, + out_path + .extension() + .unwrap_or("".as_ref()) + .to_str() + .unwrap() + ); + let out_path = out_path.trim_start_matches('/').trim_end_matches('.'); + Ok(base_path.join(out_path)) +} + +async fn run_verify( + oci_source: &mut OciSource, + reference: &OciReference, + constraints: &VerificationConstraintVec, + verifier: &mut BinaryTransparencyVerifier, +) -> Result>> { + debug!("checking {}", &reference); + verifier.verify(oci_source, reference, constraints).await +} diff --git a/bt2x/deny.toml b/bt2x/deny.toml new file mode 100644 index 0000000..5f4e24e --- /dev/null +++ b/bt2x/deny.toml @@ -0,0 +1,230 @@ +# This template contains all of the possible sections and their default values + +# Note that all fields that take a lint level have these possible values: +# * deny - An error will be produced and the check will fail +# * warn - A warning will be produced, but the check will not fail +# * allow - No warning or error will be produced, though in some cases a note +# will be + +# The values provided in this template are the default values that will be used +# when any section or field is not specified in your own configuration + +# Root options + +# The graph table configures how the dependency graph is constructed and thus +# which crates the checks are performed against +[graph] +# If 1 or more target triples (and optionally, target_features) are specified, +# only the specified targets will be checked when running `cargo deny check`. +# This means, if a particular package is only ever used as a target specific +# dependency, such as, for example, the `nix` crate only being used via the +# `target_family = "unix"` configuration, that only having windows targets in +# this list would mean the nix crate, as well as any of its exclusive +# dependencies not shared by any other crates, would be ignored, as the target +# list here is effectively saying which targets you are building for. +targets = [ + # The triple can be any string, but only the target triples built in to + # rustc (as of 1.40) can be checked against actual config expressions + #"x86_64-unknown-linux-musl", + # You can also specify which target_features you promise are enabled for a + # particular target. target_features are currently not validated against + # the actual valid features supported by the target architecture. + #{ triple = "wasm32-unknown-unknown", features = ["atomics"] }, +] +# When creating the dependency graph used as the source of truth when checks are +# executed, this field can be used to prune crates from the graph, removing them +# from the view of cargo-deny. This is an extremely heavy hammer, as if a crate +# is pruned from the graph, all of its dependencies will also be pruned unless +# they are connected to another crate in the graph that hasn't been pruned, +# so it should be used with care. The identifiers are [Package ID Specifications] +# (https://doc.rust-lang.org/cargo/reference/pkgid-spec.html) +#exclude = [] +# If true, metadata will be collected with `--all-features`. Note that this can't +# be toggled off if true, if you want to conditionally enable `--all-features` it +# is recommended to pass `--all-features` on the cmd line instead +all-features = false +# If true, metadata will be collected with `--no-default-features`. The same +# caveat with `all-features` applies +no-default-features = false +# If set, these feature will be enabled when collecting metadata. If `--features` +# is specified on the cmd line they will take precedence over this option. +#features = [] + +# The output table provides options for how/if diagnostics are outputted +[output] +# When outputting inclusion graphs in diagnostics that include features, this +# option can be used to specify the depth at which feature edges will be added. +# This option is included since the graphs can be quite large and the addition +# of features from the crate(s) to all of the graph roots can be far too verbose. +# This option can be overridden via `--feature-depth` on the cmd line +feature-depth = 1 + +# This section is considered when running `cargo deny check advisories` +# More documentation for the advisories section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html +[advisories] +# The path where the advisory databases are cloned/fetched into +#db-path = "$CARGO_HOME/advisory-dbs" +# The url(s) of the advisory databases to use +#db-urls = ["https://github.com/rustsec/advisory-db"] +# A list of advisory IDs to ignore. Note that ignored advisories will still +# output a note when they are encountered. +ignore = [ + #"RUSTSEC-0000-0000", + #{ id = "RUSTSEC-0000-0000", reason = "you can specify a reason the advisory is ignored" }, + #"a-crate-that-is-yanked@0.1.1", # you can also ignore yanked crate versions if you wish + #{ crate = "a-crate-that-is-yanked@0.1.1", reason = "you can specify why you are ignoring the yanked crate" }, +] +# If this is true, then cargo deny will use the git executable to fetch advisory database. +# If this is false, then it uses a built-in git library. +# Setting this to true can be helpful if you have special authentication requirements that cargo-deny does not support. +# See Git Authentication for more information about setting up git authentication. +#git-fetch-with-cli = true + +# This section is considered when running `cargo deny check licenses` +# More documentation for the licenses section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html +[licenses] +# List of explicitly allowed licenses +# See https://spdx.org/licenses/ for list of possible licenses +# [possible values: any SPDX 3.11 short identifier (+ optional exception)]. +allow = [ + "MIT", + "Apache-2.0", + "Apache-2.0 WITH LLVM-exception", + "MPL-2.0", + "ISC", + "Unicode-DFS-2016", + "BSD-3-Clause", + "0BSD", +] +# The confidence threshold for detecting a license from license text. +# The higher the value, the more closely the license text must be to the +# canonical license text of a valid SPDX license file. +# [possible values: any between 0.0 and 1.0]. +confidence-threshold = 0.8 +# Allow 1 or more licenses on a per-crate basis, so that particular licenses +# aren't accepted for every possible crate as with the normal allow list +exceptions = [ + # Each entry is the crate and version constraint, and its specific allow + # list + # { allow = ["Zlib"], crate = "adler32" }, +] + +# Some crates don't have (easily) machine readable licensing information, +# adding a clarification entry for it allows you to manually specify the +# licensing information +[[licenses.clarify]] +crate = "ring" +expression = "MIT AND ISC AND OpenSSL" +license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }] + +[licenses.private] +# If true, ignores workspace crates that aren't published, or are only +# published to private registries. +# To see how to mark a crate as unpublished (to the official registry), +# visit https://doc.rust-lang.org/cargo/reference/manifest.html#the-publish-field. +ignore = false +# One or more private registries that you might publish crates to, if a crate +# is only published to private registries, and ignore is true, the crate will +# not have its license(s) checked +registries = [ + #"https://sekretz.com/registry +] + +# This section is considered when running `cargo deny check bans`. +# More documentation about the 'bans' section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html +[bans] +# Lint level for when multiple versions of the same crate are detected +multiple-versions = "warn" +# Lint level for when a crate version requirement is `*` +wildcards = "allow" +# The graph highlighting used when creating dotgraphs for crates +# with multiple versions +# * lowest-version - The path to the lowest versioned duplicate is highlighted +# * simplest-path - The path to the version with the fewest edges is highlighted +# * all - Both lowest-version and simplest-path are used +highlight = "all" +# The default lint level for `default` features for crates that are members of +# the workspace that is being checked. This can be overridden by allowing/denying +# `default` on a crate-by-crate basis if desired. +workspace-default-features = "allow" +# The default lint level for `default` features for external crates that are not +# members of the workspace. This can be overridden by allowing/denying `default` +# on a crate-by-crate basis if desired. +external-default-features = "allow" +# List of crates that are allowed. Use with care! +allow = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason it is allowed" }, +] +# List of crates to deny +deny = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason it is banned" }, + # Wrapper crates can optionally be specified to allow the crate when it + # is a direct dependency of the otherwise banned crate + #{ crate = "ansi_term@0.11.0", wrappers = ["this-crate-directly-depends-on-ansi_term"] }, +] + +# List of features to allow/deny +# Each entry the name of a crate and a version range. If version is +# not specified, all versions will be matched. +#[[bans.features]] +#crate = "reqwest" +# Features to not allow +#deny = ["json"] +# Features to allow +#allow = [ +# "rustls", +# "__rustls", +# "__tls", +# "hyper-rustls", +# "rustls", +# "rustls-pemfile", +# "rustls-tls-webpki-roots", +# "tokio-rustls", +# "webpki-roots", +#] +# If true, the allowed features must exactly match the enabled feature set. If +# this is set there is no point setting `deny` +#exact = true + +# Certain crates/versions that will be skipped when doing duplicate detection. +skip = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason why it can't be updated/removed" }, +] +# Similarly to `skip` allows you to skip certain crates during duplicate +# detection. Unlike skip, it also includes the entire tree of transitive +# dependencies starting at the specified crate, up to a certain depth, which is +# by default infinite. +skip-tree = [ + #"ansi_term@0.11.0", # will be skipped along with _all_ of its direct and transitive dependencies + #{ crate = "ansi_term@0.11.0", depth = 20 }, +] + +# This section is considered when running `cargo deny check sources`. +# More documentation about the 'sources' section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html +[sources] +# Lint level for what to happen when a crate from a crate registry that is not +# in the allow list is encountered +unknown-registry = "warn" +# Lint level for what to happen when a crate from a git repository that is not +# in the allow list is encountered +unknown-git = "warn" +# List of URLs for allowed crate registries. Defaults to the crates.io index +# if not specified. If it is specified but empty, no registries are allowed. +allow-registry = ["https://github.com/rust-lang/crates.io-index"] +# List of URLs for allowed Git repositories +allow-git = [] + +[sources.allow-org] +# github.com organizations to allow git sources for +github = ["embassy-rs"] +# gitlab.com organizations to allow git sources for +gitlab = [] +# bitbucket.org organizations to allow git sources for +bitbucket = [] diff --git a/bt2x/rust-toolchain.toml b/bt2x/rust-toolchain.toml new file mode 100644 index 0000000..271800c --- /dev/null +++ b/bt2x/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "nightly" \ No newline at end of file diff --git a/build-docs.sh b/build-docs.sh new file mode 100755 index 0000000..4453f6e --- /dev/null +++ b/build-docs.sh @@ -0,0 +1,208 @@ +#"" +# Apache License +# Version 2.0, January 2004 +# http://www.apache.org/licenses/ +# +# TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +# +# 1. Definitions. +# +# "License" shall mean the terms and conditions for use, reproduction, +# and distribution as defined by Sections 1 through 9 of this document. +# +# "Licensor" shall mean the copyright owner or entity authorized by +# the copyright owner that is granting the License. +# +# "Legal Entity" shall mean the union of the acting entity and all +# other entities that control, are controlled by, or are under common +# control with that entity. For the purposes of this definition, +# "control" means (i) the power, direct or indirect, to cause the +# direction or management of such entity, whether by contract or +# otherwise, or (ii) ownership of fifty percent (50%) or more of the +# outstanding shares, or (iii) beneficial ownership of such entity. +# +# "You" (or "Your") shall mean an individual or Legal Entity +# exercising permissions granted by this License. +# +# "Source" form shall mean the preferred form for making modifications, +# including but not limited to software source code, documentation +# source, and configuration files. +# +# "Object" form shall mean any form resulting from mechanical +# transformation or translation of a Source form, including but +# not limited to compiled object code, generated documentation, +# and conversions to other media types. +# +# "Work" shall mean the work of authorship, whether in Source or +# Object form, made available under the License, as indicated by a +# copyright notice that is included in or attached to the work +# (an example is provided in the Appendix below). +# +# "Derivative Works" shall mean any work, whether in Source or Object +# form, that is based on (or derived from) the Work and for which the +# editorial revisions, annotations, elaborations, or other modifications +# represent, as a whole, an original work of authorship. For the purposes +# of this License, Derivative Works shall not include works that remain +# separable from, or merely link (or bind by name) to the interfaces of, +# the Work and Derivative Works thereof. +# +# "Contribution" shall mean any work of authorship, including +# the original version of the Work and any modifications or additions +# to that Work or Derivative Works thereof, that is intentionally +# submitted to Licensor for inclusion in the Work by the copyright owner +# or by an individual or Legal Entity authorized to submit on behalf of +# the copyright owner. For the purposes of this definition, "submitted" +# means any form of electronic, verbal, or written communication sent +# to the Licensor or its representatives, including but not limited to +# communication on electronic mailing lists, source code control systems, +# and issue tracking systems that are managed by, or on behalf of, the +# Licensor for the purpose of discussing and improving the Work, but +# excluding communication that is conspicuously marked or otherwise +# designated in writing by the copyright owner as "Not a Contribution." +# +# "Contributor" shall mean Licensor and any individual or Legal Entity +# on behalf of whom a Contribution has been received by Licensor and +# subsequently incorporated within the Work. +# +# 2. Grant of Copyright License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# copyright license to reproduce, prepare Derivative Works of, +# publicly display, publicly perform, sublicense, and distribute the +# Work and such Derivative Works in Source or Object form. +# +# 3. Grant of Patent License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# (except as stated in this section) patent license to make, have made, +# use, offer to sell, sell, import, and otherwise transfer the Work, +# where such license applies only to those patent claims licensable +# by such Contributor that are necessarily infringed by their +# Contribution(s) alone or by combination of their Contribution(s) +# with the Work to which such Contribution(s) was submitted. If You +# institute patent litigation against any entity (including a +# cross-claim or counterclaim in a lawsuit) alleging that the Work +# or a Contribution incorporated within the Work constitutes direct +# or contributory patent infringement, then any patent licenses +# granted to You under this License for that Work shall terminate +# as of the date such litigation is filed. +# +# 4. Redistribution. You may reproduce and distribute copies of the +# Work or Derivative Works thereof in any medium, with or without +# modifications, and in Source or Object form, provided that You +# meet the following conditions: +# +# (a) You must give any other recipients of the Work or +# Derivative Works a copy of this License; and +# +# (b) You must cause any modified files to carry prominent notices +# stating that You changed the files; and +# +# (c) You must retain, in the Source form of any Derivative Works +# that You distribute, all copyright, patent, trademark, and +# attribution notices from the Source form of the Work, +# excluding those notices that do not pertain to any part of +# the Derivative Works; and +# +# (d) If the Work includes a "NOTICE" text file as part of its +# distribution, then any Derivative Works that You distribute must +# include a readable copy of the attribution notices contained +# within such NOTICE file, excluding those notices that do not +# pertain to any part of the Derivative Works, in at least one +# of the following places: within a NOTICE text file distributed +# as part of the Derivative Works; within the Source form or +# documentation, if provided along with the Derivative Works; or, +# within a display generated by the Derivative Works, if and +# wherever such third-party notices normally appear. The contents +# of the NOTICE file are for informational purposes only and +# do not modify the License. You may add Your own attribution +# notices within Derivative Works that You distribute, alongside +# or as an addendum to the NOTICE text from the Work, provided +# that such additional attribution notices cannot be construed +# as modifying the License. +# +# You may add Your own copyright statement to Your modifications and +# may provide additional or different license terms and conditions +# for use, reproduction, or distribution of Your modifications, or +# for any such Derivative Works as a whole, provided Your use, +# reproduction, and distribution of the Work otherwise complies with +# the conditions stated in this License. +# +# 5. Submission of Contributions. Unless You explicitly state otherwise, +# any Contribution intentionally submitted for inclusion in the Work +# by You to the Licensor shall be under the terms and conditions of +# this License, without any additional terms or conditions. +# Notwithstanding the above, nothing herein shall supersede or modify +# the terms of any separate license agreement you may have executed +# with Licensor regarding such Contributions. +# +# 6. Trademarks. This License does not grant permission to use the trade +# names, trademarks, service marks, or product names of the Licensor, +# except as required for reasonable and customary use in describing the +# origin of the Work and reproducing the content of the NOTICE file. +# +# 7. Disclaimer of Warranty. Unless required by applicable law or +# agreed to in writing, Licensor provides the Work (and each +# Contributor provides its Contributions) on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied, including, without limitation, any warranties or conditions +# of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +# PARTICULAR PURPOSE. You are solely responsible for determining the +# appropriateness of using or redistributing the Work and assume any +# risks associated with Your exercise of permissions under this License. +# +# 8. Limitation of Liability. In no event and under no legal theory, +# whether in tort (including negligence), contract, or otherwise, +# unless required by applicable law (such as deliberate and grossly +# negligent acts) or agreed to in writing, shall any Contributor be +# liable to You for damages, including any direct, indirect, special, +# incidental, or consequential damages of any character arising as a +# result of this License or out of the use or inability to use the +# Work (including but not limited to damages for loss of goodwill, +# work stoppage, computer failure or malfunction, or any and all +# other commercial damages or losses), even if such Contributor +# has been advised of the possibility of such damages. +# +# 9. Accepting Warranty or Additional Liability. While redistributing +# the Work or Derivative Works thereof, You may choose to offer, +# and charge a fee for, acceptance of support, warranty, indemnity, +# or other liability obligations and/or rights consistent with this +# License. However, in accepting such obligations, You may act only +# on Your own behalf and on Your sole responsibility, not on behalf +# of any other Contributor, and only if You agree to indemnify, +# defend, and hold each Contributor harmless for any liability +# incurred by, or claims asserted against, such Contributor by reason +# of your accepting any such warranty or additional liability. +# +# END OF TERMS AND CONDITIONS +# +# APPENDIX: How to apply the Apache License to your work. +# +# To apply the Apache License to your work, attach the following +# boilerplate notice, with the fields enclosed by brackets "[]" +# replaced with your own identifying information. (Don't include +# the brackets!) The text should be enclosed in the appropriate +# comment syntax for the file format. We also recommend that a +# file or class name and description of purpose be included on the +# same "printed page" as the copyright notice for easier +# identification within third-party archives. +# +# Copyright 2024 Fraunhofer AISEC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +echo "Building docs for tuf-no-std" +cd tuf-no-std && cargo doc --open --no-deps && cd .. + +echo "Building docs for BT2X" +cd bt2x && cargo doc --open --no-deps && cd .. diff --git a/configs/bt2x-monitor/sigstore-config.yaml b/configs/bt2x-monitor/sigstore-config.yaml new file mode 100644 index 0000000..bd0debd --- /dev/null +++ b/configs/bt2x-monitor/sigstore-config.yaml @@ -0,0 +1,9 @@ +key_config: + !keys + rekor_key: "/etc/monitor/rekor_key.pub" + fulcio_cert: "" + ctlog_key: "" +urls: + rekor: http://rekor:3000 + fulcio: http://fulcio:5555 + oidc_issuer: http://dex-idp:8888/ \ No newline at end of file diff --git a/configs/bt2x-server/config.yaml b/configs/bt2x-server/config.yaml new file mode 100644 index 0000000..15e4b9c --- /dev/null +++ b/configs/bt2x-server/config.yaml @@ -0,0 +1,17 @@ +references: + - tag: container-registry:1338/bt2x/pi-pico:bin + subjects: + - email: add@github-email.here + issuer: http://dex-idp:8888/ +sigstore_config: + key_config: + !keys + rekor_key: "/tuf-repo/targets/rekor.pub" + fulcio_cert: "/tuf-repo/targets/fulcio.crt.pem" + ctlog_key: "/tuf-repo/targets/ctlog.pub" + urls: + rekor: http://rekor:3000 + fulcio: http://fulcio:5555 + oidc_issuer: http://dex-idp:8888/ +monitors: + - http://bt2x-monitor-1:3132 \ No newline at end of file diff --git a/configs/dex/dex.yaml b/configs/dex/dex.yaml new file mode 100644 index 0000000..565b5f1 --- /dev/null +++ b/configs/dex/dex.yaml @@ -0,0 +1,55 @@ +# +# Copyright 2021 The Sigstore Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +issuer: http://dex-idp:8888/ + +storage: + type: memory + +web: + http: 0.0.0.0:8888 + +frontend: + issuer: Fulcio in Docker Compose + +expiry: + signingKeys: "24h" + idTokens: "1m" + authRequests: "24h" + +oauth2: + responseTypes: [ "code" ] + alwaysShowLoginScreen: true + skipApprovalScreen: true + +connectors: + - type: mockCallback + id: https://any.valid.url/ + name: AlwaysApprovesOIDCProvider + - type: github + id: github-sigstore-test + name: GitHub + config: + clientID: $GITHUB_CLIENT_ID + clientSecret: $GITHUB_CLIENT_SECRET + redirectURI: http://dex-idp:8888/callback + +staticClients: + - id: sigstore + public: true + name: 'Fulcio in Docker Compose' + +# Dex's issuer URL + "/callback" +redirectURI: http://dex-idp:8888/callback diff --git a/configs/sigstore/fulcio/config/cert-gen.sh b/configs/sigstore/fulcio/config/cert-gen.sh new file mode 100755 index 0000000..6233d2e --- /dev/null +++ b/configs/sigstore/fulcio/config/cert-gen.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +echo "Generating key..." +openssl ecparam -genkey \ + -name prime256v1 \ + -noout \ + -out fulcio_key_unencrypted.pem +echo "Completed." +echo "Generating encrypted private key..." +openssl ec \ + -in fulcio_key_unencrypted.pem \ + -out fulcio_key.pem -aes256 +echo "Generating CA Certificate..." +openssl req -x509 \ + -key fulcio_key_unencrypted.pem \ + -out fulcio.pem -sha256 \ + -days 365 \ + -subj "/C=DE/ST=Bayern/L=Garching bei Muenchen/O=bt2x/CN=fulcio" \ + -addext basicConstraints=critical,CA:TRUE,pathlen:1 \ + -addext keyUsage=critical,keyCertSign,cRLSign +chmod o+r fulcio_key.pem +echo "Completed." diff --git a/configs/sigstore/fulcio/config/config.json b/configs/sigstore/fulcio/config/config.json new file mode 100644 index 0000000..821252e --- /dev/null +++ b/configs/sigstore/fulcio/config/config.json @@ -0,0 +1,9 @@ +{ + "OIDCIssuers": { + "http://dex-idp:8888/": { + "IssuerURL": "http://dex-idp:8888/", + "ClientID": "sigstore", + "Type": "email" + } + } +} \ No newline at end of file diff --git a/configs/sigstore/fulcio/config/dex/docker-compose-config.yaml b/configs/sigstore/fulcio/config/dex/docker-compose-config.yaml new file mode 100644 index 0000000..3865532 --- /dev/null +++ b/configs/sigstore/fulcio/config/dex/docker-compose-config.yaml @@ -0,0 +1,55 @@ +# +# Copyright 2021 The Sigstore Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +issuer: http://dex-idp:8888/auth + +storage: + type: memory + +web: + http: 0.0.0.0:8888 + +frontend: + issuer: Fulcio in Docker Compose + +expiry: + signingKeys: "24h" + idTokens: "1m" + authRequests: "24h" + +oauth2: + responseTypes: [ "code" ] + alwaysShowLoginScreen: true + skipApprovalScreen: true + +connectors: +- type: mockCallback + id: https://any.valid.url/ + name: AlwaysApprovesOIDCProvider +- type: github + id: github-sigstore-test + name: GitHub + config: + clientID: $GITHUB_CLIENT_ID + clientSecret: $GITHUB_CLIENT_SECRET + redirectURI: http://localhost:5556/callback + +staticClients: + - id: fulcio + public: true + name: 'Fulcio in Docker Compose' + +# Dex's issuer URL + "/callback" +redirectURI: http://dex-idp:8888/auth/callback diff --git a/configs/sigstore/fulcio/config/fulcio-config.yaml b/configs/sigstore/fulcio/config/fulcio-config.yaml new file mode 100644 index 0000000..097e301 --- /dev/null +++ b/configs/sigstore/fulcio/config/fulcio-config.yaml @@ -0,0 +1,75 @@ +# +# Copyright 2021 The Sigstore Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +apiVersion: v1 +data: + config.json: |- + { + "OIDCIssuers": { + "https://accounts.google.com": { + "IssuerURL": "https://accounts.google.com", + "ClientID": "sigstore", + "Type": "email" + }, + "https://allow.pub": { + "IssuerURL": "https://allow.pub", + "ClientID": "sigstore", + "Type": "spiffe", + "SPIFFETrustDomain": "allow.pub" + }, + "https://oauth2.sigstore.dev/auth": { + "IssuerURL": "https://oauth2.sigstore.dev/auth", + "ClientID": "sigstore", + "Type": "email", + "IssuerClaim": "$.federated_claims.connector_id" + }, + "https://oidc.dlorenc.dev": { + "IssuerURL": "https://oidc.dlorenc.dev", + "ClientID": "sigstore", + "Type": "spiffe", + "SPIFFETrustDomain": "oidc.dlorenc.dev" + }, + "https://token.actions.githubusercontent.com": { + "IssuerURL": "https://token.actions.githubusercontent.com", + "ClientID": "sigstore", + "Type": "github-workflow" + } + }, + "MetaIssuers": { + "https://container.googleapis.com/v1/projects/*/locations/*/clusters/*": { + "ClientID": "sigstore", + "Type": "kubernetes" + }, + "https://oidc.eks.*.amazonaws.com/id/*": { + "ClientID": "sigstore", + "Type": "kubernetes" + }, + "https://oidc.prod-aks.azure.com/*": { + "ClientID": "sigstore", + "Type": "kubernetes" + } + } + } + server.yaml: |- + host: 0.0.0.0 + port: 5555 + grpc-port: 5554 + ca: googleca + ct-log-url: http://ct-log/test + log_type: prod + metrics-port: 2113 +kind: ConfigMap +metadata: + name: fulcio-config + namespace: fulcio-system diff --git a/configs/sigstore/fulcio/ctfe-init/Dockerfile b/configs/sigstore/fulcio/ctfe-init/Dockerfile new file mode 100644 index 0000000..e9f05cd --- /dev/null +++ b/configs/sigstore/fulcio/ctfe-init/Dockerfile @@ -0,0 +1,25 @@ +# +# Copyright 2021 The Sigstore Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM golang:1.19.2@sha256:25de7b6b28219279a409961158c547aadd0960cf2dcbc533780224afa1157fd4 AS builder + +WORKDIR /root/ + +RUN go install github.com/google/trillian/cmd/createtree@v1.3.10 +ADD ./logid.sh /root/ +ADD ./config /root/ctfe +RUN chmod +x /root/logid.sh + +CMD /root/logid.sh diff --git a/configs/sigstore/fulcio/ctfe-init/config/ct_server.cfg b/configs/sigstore/fulcio/ctfe-init/config/ct_server.cfg new file mode 100644 index 0000000..1f33b6a --- /dev/null +++ b/configs/sigstore/fulcio/ctfe-init/config/ct_server.cfg @@ -0,0 +1,12 @@ +config { + log_id: %LOGID% + prefix: "sigstore" + roots_pem_file: "/etc/config/root.pem" + private_key: { + [type.googleapis.com/keyspb.PEMKeyFile] { + path: "/etc/config/privkey.pem" + password: "foobar" + } + } + ext_key_usages: [ "CodeSigning" ] +} diff --git a/configs/sigstore/fulcio/ctfe-init/logid.sh b/configs/sigstore/fulcio/ctfe-init/logid.sh new file mode 100644 index 0000000..e0a0cff --- /dev/null +++ b/configs/sigstore/fulcio/ctfe-init/logid.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# +# Copyright 2021 The Sigstore Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +function get_log_id() { + curl -s --retry-connrefused --retry 10 http://ct-trillian-log-server:8091/metrics |grep "^quota_acquired_tokens{spec=\"trees"|head -1|awk ' { print $1 } '|sed -e 's/[^0-9]*//g' > /tmp/logid +} + +function create_log () { + /go/bin/createtree -admin_server ct-trillian-log-server:8090 > /tmp/logid + echo -n "Created log ID " && cat /tmp/logid +} + +function update_config() { + cat /root/ctfe/ct_server.cfg | sed -e "s/%LOGID%/"`cat /tmp/logid`"/g" > /etc/config/ct_server.cfg + cp /root/ctfe/*.pem /etc/config/ +} + +# check to see if log id exists; if so, use that +echo -n "Checking for existing configuration..." +if ! [[ -s /etc/config/ct_server.cfg ]]; then + echo " none found." + echo "Checking for preexisting logs..." + get_log_id + # else create one + if ! [[ -s /tmp/logid ]]; then + echo "No log found; let's create one..." + create_log + # update config file accordingly + update_config + else + echo "Log ID known but config not found" + update_config + fi +else + echo " found." + configid=`cat /etc/config/ct_server.cfg|grep log_id|awk ' { print $2 } '` + echo "Existing configuration uses log ID $configid" +fi +curl -s --retry-connrefused --retry 10 http://fulcio:5555/api/v1/rootCert -o tmpchain.pem +csplit -s -f tmpcert- tmpchain.pem '/-----BEGIN CERTIFICATE-----/' '{*}' +mv $(ls tmpcert-* | tail -1) /etc/config/root.pem +rm tmpcert-* tmpchain.pem +cat /etc/config/root.pem +echo "Fetched valid root certificate from Fulcio to limit entries in CTFE instance" diff --git a/configs/sigstore/rekor/key-gen.sh b/configs/sigstore/rekor/key-gen.sh new file mode 100755 index 0000000..3d604e0 --- /dev/null +++ b/configs/sigstore/rekor/key-gen.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +echo "Generating EC key for P256..." +openssl ecparam -genkey \ + -name prime256v1 \ + -out rekor_key.pem -noout +echo "Completed... (rekor_key.pem)" + +echo "Extracting pubkey..." +openssl ec -in=rekor_key.pem -pubout > rekor_pub_key.pem +echo "Completed... (rekor_pub_key.pem)" \ No newline at end of file diff --git a/configs/tuf/tuf-cli-config.yaml b/configs/tuf/tuf-cli-config.yaml new file mode 100644 index 0000000..f2df7b9 --- /dev/null +++ b/configs/tuf/tuf-cli-config.yaml @@ -0,0 +1,34 @@ +out: "./build" +roles: + root: + keys: + - kind: ecdsa + - kind: ecdsa + - kind: ecdsa + threshold: 2 + version: 1 + timestamp: + keys: + - kind: ecdsa + threshold: 1 + version: 1 + snapshot: + keys: + - kind: ecdsa + threshold: 1 + version: 1 + targets: + keys: + - kind: ecdsa + threshold: 1 + version: 1 +targets: + rekor: + name: "rekor.pub" + filepath: "configs/sigstore/rekor/rekor_pub_key.pem" + fulcio: + name: "fulcio.crt.pem" + filepath: "configs/sigstore/fulcio/config/fulcio.pem" + ctlog: + name: "ctlog.pub" + filepath: "configs/sigstore/fulcio/ctfe-init/config/pubkey.pem" diff --git a/docker-compose.bt4ot.yml b/docker-compose.bt4ot.yml new file mode 100644 index 0000000..a77321b --- /dev/null +++ b/docker-compose.bt4ot.yml @@ -0,0 +1,291 @@ +#"" +# Apache License +# Version 2.0, January 2004 +# http://www.apache.org/licenses/ +# +# TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +# +# 1. Definitions. +# +# "License" shall mean the terms and conditions for use, reproduction, +# and distribution as defined by Sections 1 through 9 of this document. +# +# "Licensor" shall mean the copyright owner or entity authorized by +# the copyright owner that is granting the License. +# +# "Legal Entity" shall mean the union of the acting entity and all +# other entities that control, are controlled by, or are under common +# control with that entity. For the purposes of this definition, +# "control" means (i) the power, direct or indirect, to cause the +# direction or management of such entity, whether by contract or +# otherwise, or (ii) ownership of fifty percent (50%) or more of the +# outstanding shares, or (iii) beneficial ownership of such entity. +# +# "You" (or "Your") shall mean an individual or Legal Entity +# exercising permissions granted by this License. +# +# "Source" form shall mean the preferred form for making modifications, +# including but not limited to software source code, documentation +# source, and configuration files. +# +# "Object" form shall mean any form resulting from mechanical +# transformation or translation of a Source form, including but +# not limited to compiled object code, generated documentation, +# and conversions to other media types. +# +# "Work" shall mean the work of authorship, whether in Source or +# Object form, made available under the License, as indicated by a +# copyright notice that is included in or attached to the work +# (an example is provided in the Appendix below). +# +# "Derivative Works" shall mean any work, whether in Source or Object +# form, that is based on (or derived from) the Work and for which the +# editorial revisions, annotations, elaborations, or other modifications +# represent, as a whole, an original work of authorship. For the purposes +# of this License, Derivative Works shall not include works that remain +# separable from, or merely link (or bind by name) to the interfaces of, +# the Work and Derivative Works thereof. +# +# "Contribution" shall mean any work of authorship, including +# the original version of the Work and any modifications or additions +# to that Work or Derivative Works thereof, that is intentionally +# submitted to Licensor for inclusion in the Work by the copyright owner +# or by an individual or Legal Entity authorized to submit on behalf of +# the copyright owner. For the purposes of this definition, "submitted" +# means any form of electronic, verbal, or written communication sent +# to the Licensor or its representatives, including but not limited to +# communication on electronic mailing lists, source code control systems, +# and issue tracking systems that are managed by, or on behalf of, the +# Licensor for the purpose of discussing and improving the Work, but +# excluding communication that is conspicuously marked or otherwise +# designated in writing by the copyright owner as "Not a Contribution." +# +# "Contributor" shall mean Licensor and any individual or Legal Entity +# on behalf of whom a Contribution has been received by Licensor and +# subsequently incorporated within the Work. +# +# 2. Grant of Copyright License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# copyright license to reproduce, prepare Derivative Works of, +# publicly display, publicly perform, sublicense, and distribute the +# Work and such Derivative Works in Source or Object form. +# +# 3. Grant of Patent License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# (except as stated in this section) patent license to make, have made, +# use, offer to sell, sell, import, and otherwise transfer the Work, +# where such license applies only to those patent claims licensable +# by such Contributor that are necessarily infringed by their +# Contribution(s) alone or by combination of their Contribution(s) +# with the Work to which such Contribution(s) was submitted. If You +# institute patent litigation against any entity (including a +# cross-claim or counterclaim in a lawsuit) alleging that the Work +# or a Contribution incorporated within the Work constitutes direct +# or contributory patent infringement, then any patent licenses +# granted to You under this License for that Work shall terminate +# as of the date such litigation is filed. +# +# 4. Redistribution. You may reproduce and distribute copies of the +# Work or Derivative Works thereof in any medium, with or without +# modifications, and in Source or Object form, provided that You +# meet the following conditions: +# +# (a) You must give any other recipients of the Work or +# Derivative Works a copy of this License; and +# +# (b) You must cause any modified files to carry prominent notices +# stating that You changed the files; and +# +# (c) You must retain, in the Source form of any Derivative Works +# that You distribute, all copyright, patent, trademark, and +# attribution notices from the Source form of the Work, +# excluding those notices that do not pertain to any part of +# the Derivative Works; and +# +# (d) If the Work includes a "NOTICE" text file as part of its +# distribution, then any Derivative Works that You distribute must +# include a readable copy of the attribution notices contained +# within such NOTICE file, excluding those notices that do not +# pertain to any part of the Derivative Works, in at least one +# of the following places: within a NOTICE text file distributed +# as part of the Derivative Works; within the Source form or +# documentation, if provided along with the Derivative Works; or, +# within a display generated by the Derivative Works, if and +# wherever such third-party notices normally appear. The contents +# of the NOTICE file are for informational purposes only and +# do not modify the License. You may add Your own attribution +# notices within Derivative Works that You distribute, alongside +# or as an addendum to the NOTICE text from the Work, provided +# that such additional attribution notices cannot be construed +# as modifying the License. +# +# You may add Your own copyright statement to Your modifications and +# may provide additional or different license terms and conditions +# for use, reproduction, or distribution of Your modifications, or +# for any such Derivative Works as a whole, provided Your use, +# reproduction, and distribution of the Work otherwise complies with +# the conditions stated in this License. +# +# 5. Submission of Contributions. Unless You explicitly state otherwise, +# any Contribution intentionally submitted for inclusion in the Work +# by You to the Licensor shall be under the terms and conditions of +# this License, without any additional terms or conditions. +# Notwithstanding the above, nothing herein shall supersede or modify +# the terms of any separate license agreement you may have executed +# with Licensor regarding such Contributions. +# +# 6. Trademarks. This License does not grant permission to use the trade +# names, trademarks, service marks, or product names of the Licensor, +# except as required for reasonable and customary use in describing the +# origin of the Work and reproducing the content of the NOTICE file. +# +# 7. Disclaimer of Warranty. Unless required by applicable law or +# agreed to in writing, Licensor provides the Work (and each +# Contributor provides its Contributions) on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied, including, without limitation, any warranties or conditions +# of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +# PARTICULAR PURPOSE. You are solely responsible for determining the +# appropriateness of using or redistributing the Work and assume any +# risks associated with Your exercise of permissions under this License. +# +# 8. Limitation of Liability. In no event and under no legal theory, +# whether in tort (including negligence), contract, or otherwise, +# unless required by applicable law (such as deliberate and grossly +# negligent acts) or agreed to in writing, shall any Contributor be +# liable to You for damages, including any direct, indirect, special, +# incidental, or consequential damages of any character arising as a +# result of this License or out of the use or inability to use the +# Work (including but not limited to damages for loss of goodwill, +# work stoppage, computer failure or malfunction, or any and all +# other commercial damages or losses), even if such Contributor +# has been advised of the possibility of such damages. +# +# 9. Accepting Warranty or Additional Liability. While redistributing +# the Work or Derivative Works thereof, You may choose to offer, +# and charge a fee for, acceptance of support, warranty, indemnity, +# or other liability obligations and/or rights consistent with this +# License. However, in accepting such obligations, You may act only +# on Your own behalf and on Your sole responsibility, not on behalf +# of any other Contributor, and only if You agree to indemnify, +# defend, and hold each Contributor harmless for any liability +# incurred by, or claims asserted against, such Contributor by reason +# of your accepting any such warranty or additional liability. +# +# END OF TERMS AND CONDITIONS +# +# APPENDIX: How to apply the Apache License to your work. +# +# To apply the Apache License to your work, attach the following +# boilerplate notice, with the fields enclosed by brackets "[]" +# replaced with your own identifying information. (Don't include +# the brackets!) The text should be enclosed in the appropriate +# comment syntax for the file format. We also recommend that a +# file or class name and description of purpose be included on the +# same "printed page" as the copyright notice for easier +# identification within third-party archives. +# +# Copyright 2024 Fraunhofer AISEC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +version: '3.8' +services: + bt2x-server: + build: + context: . + dockerfile: dockerfiles/bt2x.Dockerfile + args: + BINARY_NAME: "bt2x-server" + volumes: + - "./configs/bt2x-server:/etc/configs:ro" + - "assisting_auditor:/assisting_auditor" + - "./build:/tuf-repo:ro" + command: [ + "bt2x-server", + "--http", + "--config=/etc/configs/config.yaml", + "--outdir=/assisting_auditor", + "--log-level=debug", + "--interval=1m" + ] + bt2x-ota: + build: + context: . + dockerfile: dockerfiles/bt2x.Dockerfile + args: + BINARY_NAME: "bt2x-ota" + volumes: + - "./configs/bt2x-ota:/etc/configs/config.yaml:ro" + - "assisting_auditor:/assisting_auditor:ro" + - "./build:/tuf-repo:ro" + ports: + - "50000:50000" + command: [ + "bt2x-ota", + "--repo-path=/tuf-repo", + "--signatures=/assisting_auditor", + "--binaries=/assisting_auditor", + ] + bt2x-monitor-1: + build: + context: . + dockerfile: dockerfiles/bt2x.Dockerfile + args: + BINARY_NAME: "bt2x-monitor" + volumes: + - "./configs/bt2x-monitor:/etc/configs:ro" + - "./build/targets/rekor.pub:/etc/monitor/rekor_key.pub" + ports: + - "3132:3132" + command: [ + "bt2x-monitor", + "--sigstore-config=/etc/configs/sigstore-config.yaml", + "--log-interval=1m", + "--gossip-interval=30s", + "--port=3132", + "--monitor=http://bt2x-monitor-2:3131/", + ] + restart: always + + bt2x-monitor-2: + build: + context: . + dockerfile: dockerfiles/bt2x.Dockerfile + args: + BINARY_NAME: "bt2x-monitor" + volumes: + - "./configs/bt2x-monitor/:/etc/configs:ro" + - "./build/targets/rekor.pub:/etc/monitor/rekor_key.pub" + ports: + - "3131:3131" + command: [ + "bt2x-monitor", + "--sigstore-config=/etc/configs/sigstore-config.yaml", + "--log-interval=1m", + "--gossip-interval=30s", + "--port=3131", + "--monitor=http://bt2x-monitor-1:3132/", + ] + restart: always + populate-rekor: + build: + context: . + dockerfile: dockerfiles/populate-rekor.Dockerfile + depends_on: + - rekor + +volumes: + assisting_auditor: { } diff --git a/docker-compose.monitor.yml b/docker-compose.monitor.yml new file mode 100644 index 0000000..5336b44 --- /dev/null +++ b/docker-compose.monitor.yml @@ -0,0 +1,30 @@ +# Copyright 2022 The Sigstore Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +version: '3.8' +services: + rekor-monitor: + build: + context: https://github.com/sigstore/rekor-monitor.git#58b026baada42eb78db8448bf6cc986d4b64e83b + dockerfile: Dockerfile + target: "deploy" + command: [ + "mirroring", + "--file=/etc/rekor-monitor/logInfo.txt" + # uncomment for more frequent polling + # "--interval=1m", + ] + restart: always # keep the server running + volumes: + - ./logInfo.txt:/etc/rekor-monitor/logInfo.txt:z \ No newline at end of file diff --git a/docker-compose.sigstore.yml b/docker-compose.sigstore.yml new file mode 100644 index 0000000..bdcc371 --- /dev/null +++ b/docker-compose.sigstore.yml @@ -0,0 +1,462 @@ +#"" +# Apache License +# Version 2.0, January 2004 +# http://www.apache.org/licenses/ +# +# TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +# +# 1. Definitions. +# +# "License" shall mean the terms and conditions for use, reproduction, +# and distribution as defined by Sections 1 through 9 of this document. +# +# "Licensor" shall mean the copyright owner or entity authorized by +# the copyright owner that is granting the License. +# +# "Legal Entity" shall mean the union of the acting entity and all +# other entities that control, are controlled by, or are under common +# control with that entity. For the purposes of this definition, +# "control" means (i) the power, direct or indirect, to cause the +# direction or management of such entity, whether by contract or +# otherwise, or (ii) ownership of fifty percent (50%) or more of the +# outstanding shares, or (iii) beneficial ownership of such entity. +# +# "You" (or "Your") shall mean an individual or Legal Entity +# exercising permissions granted by this License. +# +# "Source" form shall mean the preferred form for making modifications, +# including but not limited to software source code, documentation +# source, and configuration files. +# +# "Object" form shall mean any form resulting from mechanical +# transformation or translation of a Source form, including but +# not limited to compiled object code, generated documentation, +# and conversions to other media types. +# +# "Work" shall mean the work of authorship, whether in Source or +# Object form, made available under the License, as indicated by a +# copyright notice that is included in or attached to the work +# (an example is provided in the Appendix below). +# +# "Derivative Works" shall mean any work, whether in Source or Object +# form, that is based on (or derived from) the Work and for which the +# editorial revisions, annotations, elaborations, or other modifications +# represent, as a whole, an original work of authorship. For the purposes +# of this License, Derivative Works shall not include works that remain +# separable from, or merely link (or bind by name) to the interfaces of, +# the Work and Derivative Works thereof. +# +# "Contribution" shall mean any work of authorship, including +# the original version of the Work and any modifications or additions +# to that Work or Derivative Works thereof, that is intentionally +# submitted to Licensor for inclusion in the Work by the copyright owner +# or by an individual or Legal Entity authorized to submit on behalf of +# the copyright owner. For the purposes of this definition, "submitted" +# means any form of electronic, verbal, or written communication sent +# to the Licensor or its representatives, including but not limited to +# communication on electronic mailing lists, source code control systems, +# and issue tracking systems that are managed by, or on behalf of, the +# Licensor for the purpose of discussing and improving the Work, but +# excluding communication that is conspicuously marked or otherwise +# designated in writing by the copyright owner as "Not a Contribution." +# +# "Contributor" shall mean Licensor and any individual or Legal Entity +# on behalf of whom a Contribution has been received by Licensor and +# subsequently incorporated within the Work. +# +# 2. Grant of Copyright License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# copyright license to reproduce, prepare Derivative Works of, +# publicly display, publicly perform, sublicense, and distribute the +# Work and such Derivative Works in Source or Object form. +# +# 3. Grant of Patent License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# (except as stated in this section) patent license to make, have made, +# use, offer to sell, sell, import, and otherwise transfer the Work, +# where such license applies only to those patent claims licensable +# by such Contributor that are necessarily infringed by their +# Contribution(s) alone or by combination of their Contribution(s) +# with the Work to which such Contribution(s) was submitted. If You +# institute patent litigation against any entity (including a +# cross-claim or counterclaim in a lawsuit) alleging that the Work +# or a Contribution incorporated within the Work constitutes direct +# or contributory patent infringement, then any patent licenses +# granted to You under this License for that Work shall terminate +# as of the date such litigation is filed. +# +# 4. Redistribution. You may reproduce and distribute copies of the +# Work or Derivative Works thereof in any medium, with or without +# modifications, and in Source or Object form, provided that You +# meet the following conditions: +# +# (a) You must give any other recipients of the Work or +# Derivative Works a copy of this License; and +# +# (b) You must cause any modified files to carry prominent notices +# stating that You changed the files; and +# +# (c) You must retain, in the Source form of any Derivative Works +# that You distribute, all copyright, patent, trademark, and +# attribution notices from the Source form of the Work, +# excluding those notices that do not pertain to any part of +# the Derivative Works; and +# +# (d) If the Work includes a "NOTICE" text file as part of its +# distribution, then any Derivative Works that You distribute must +# include a readable copy of the attribution notices contained +# within such NOTICE file, excluding those notices that do not +# pertain to any part of the Derivative Works, in at least one +# of the following places: within a NOTICE text file distributed +# as part of the Derivative Works; within the Source form or +# documentation, if provided along with the Derivative Works; or, +# within a display generated by the Derivative Works, if and +# wherever such third-party notices normally appear. The contents +# of the NOTICE file are for informational purposes only and +# do not modify the License. You may add Your own attribution +# notices within Derivative Works that You distribute, alongside +# or as an addendum to the NOTICE text from the Work, provided +# that such additional attribution notices cannot be construed +# as modifying the License. +# +# You may add Your own copyright statement to Your modifications and +# may provide additional or different license terms and conditions +# for use, reproduction, or distribution of Your modifications, or +# for any such Derivative Works as a whole, provided Your use, +# reproduction, and distribution of the Work otherwise complies with +# the conditions stated in this License. +# +# 5. Submission of Contributions. Unless You explicitly state otherwise, +# any Contribution intentionally submitted for inclusion in the Work +# by You to the Licensor shall be under the terms and conditions of +# this License, without any additional terms or conditions. +# Notwithstanding the above, nothing herein shall supersede or modify +# the terms of any separate license agreement you may have executed +# with Licensor regarding such Contributions. +# +# 6. Trademarks. This License does not grant permission to use the trade +# names, trademarks, service marks, or product names of the Licensor, +# except as required for reasonable and customary use in describing the +# origin of the Work and reproducing the content of the NOTICE file. +# +# 7. Disclaimer of Warranty. Unless required by applicable law or +# agreed to in writing, Licensor provides the Work (and each +# Contributor provides its Contributions) on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied, including, without limitation, any warranties or conditions +# of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +# PARTICULAR PURPOSE. You are solely responsible for determining the +# appropriateness of using or redistributing the Work and assume any +# risks associated with Your exercise of permissions under this License. +# +# 8. Limitation of Liability. In no event and under no legal theory, +# whether in tort (including negligence), contract, or otherwise, +# unless required by applicable law (such as deliberate and grossly +# negligent acts) or agreed to in writing, shall any Contributor be +# liable to You for damages, including any direct, indirect, special, +# incidental, or consequential damages of any character arising as a +# result of this License or out of the use or inability to use the +# Work (including but not limited to damages for loss of goodwill, +# work stoppage, computer failure or malfunction, or any and all +# other commercial damages or losses), even if such Contributor +# has been advised of the possibility of such damages. +# +# 9. Accepting Warranty or Additional Liability. While redistributing +# the Work or Derivative Works thereof, You may choose to offer, +# and charge a fee for, acceptance of support, warranty, indemnity, +# or other liability obligations and/or rights consistent with this +# License. However, in accepting such obligations, You may act only +# on Your own behalf and on Your sole responsibility, not on behalf +# of any other Contributor, and only if You agree to indemnify, +# defend, and hold each Contributor harmless for any liability +# incurred by, or claims asserted against, such Contributor by reason +# of your accepting any such warranty or additional liability. +# +# END OF TERMS AND CONDITIONS +# +# APPENDIX: How to apply the Apache License to your work. +# +# To apply the Apache License to your work, attach the following +# boilerplate notice, with the fields enclosed by brackets "[]" +# replaced with your own identifying information. (Don't include +# the brackets!) The text should be enclosed in the appropriate +# comment syntax for the file format. We also recommend that a +# file or class name and description of purpose be included on the +# same "printed page" as the copyright notice for easier +# identification within third-party archives. +# +# Copyright 2024 Fraunhofer AISEC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +version: '3.8' +services: + container-registry: + build: + context: . + dockerfile: dockerfiles/oci-registry.Dockerfile + ports: + - "1338:1338" + + dex-idp: + image: dexidp/dex:v2.30.0 + user: root + environment: + - GITHUB_CLIENT_ID + - GITHUB_CLIENT_SECRET + + command: [ + "dex", + "serve", + "/etc/config/dex.yaml", + ] + restart: always # keep the server running + ports: + - "8888:8888" + volumes: + - ./configs/dex:/etc/config/:ro + + + fulcio: + build: + context: https://github.com/sigstore/fulcio.git#main + target: "deploy" + # image: gcr.io/projectsigstore/fulcio@sha256:27c6e4fe64a72a537c133452d9c8e0518944d1d69aeee5e7ef8a9fbe70b8b5d3 + command: [ + "serve", + "--host=0.0.0.0", # The host on which to serve requests for HTTP; --http-host is alias (default "0.0.0.0") + "--port=5555", # The port on which to serve requests for HTTP; --http-port is alias (default "8080") + "--grpc-port=5554", # The port on which to serve requests for GRPC (default "8081") + "--ca=fileca", # googleca | tinkca | pkcs11ca | fileca | kmsca | ephemeralca (for testing) + "--fileca-cert=/etc/fulcio-config/fulcio.pem", # Path to CA certificate + "--fileca-key=/etc/fulcio-config/fulcio_key.pem", # Path to CA encrypted private key + "--fileca-key-passwd=$PRIV_KEY_PASSWORD", # Password to decrypt CA private key + "--config-path=/etc/fulcio-config/config.json", # path to fulcio config json (default "/etc/fulcio-config/config.json") + "--ct-log-public-key-path=/etc/fulcio-config/ct_log_pub_key.pem", # Path to a PEM-encoded public key of the CT log, used to verify SCTs + "--ct-log-url=http://ct-log:6962/sigstore", # host and path (with log prefix at the end) to the ct log (default "http://localhost:6962/test") + "--log_type=dev", # logger type to use (dev/prod) (default "dev") + "--metrics-port=2112", # The port on which to serve prometheus metrics endpoint (default "2112") + ] + ports: + - "5555:5555" + - "5554:5554" + environment: + - PRIV_KEY_PASSWORD + volumes: + - ./configs/sigstore/fulcio/config/config.json:/etc/fulcio-config/config.json:z + - ./configs/sigstore/fulcio/config/fulcio.pem:/etc/fulcio-config/fulcio.pem + - ./configs/sigstore/fulcio/config/fulcio_key.pem:/etc/fulcio-config/fulcio_key.pem + - ./configs/sigstore/fulcio/ctfe-init/config/pubkey.pem:/etc/fulcio-config/ct_log_pub_key.pem:ro + restart: always # keep the server running + healthcheck: + test: [ "CMD", "curl", "-f", "http://fulcio:5555/api/v2/configuration" ] + interval: 10s + timeout: 3s + retries: 3 + start_period: 5s + depends_on: + - ct-log + read_only: true + + ctfe-init: + build: + context: ./configs/sigstore/fulcio/ctfe-init/ + dockerfile: Dockerfile + depends_on: + - ct-trillian-log-server + volumes: + - ctfe-config:/etc/config/:rw + + ct-log: + image: gcr.io/trillian-opensource-ci/ctfe@sha256:198767025a3e6c591b3d94c06456512150f01b2e88d9b866a9c96bcae29f490f + volumes: + - ctfe-config:/etc/config/:ro + command: [ + "--log_config" ,"/etc/config/ct_server.cfg", + "--log_rpc_server", "ct-trillian-log-server:8090", + "--http_endpoint", "0.0.0.0:6962", + "--alsologtostderr", + ] + restart: always # retry while ctfe-init is running + depends_on: + - ct-trillian-log-server + - ct-trillian-log-signer + - ctfe-init + ports: + - "6962:6962" + + redis-server: + image: docker.io/redis:5.0.10 + command: [ "--bind", "0.0.0.0", "--appendonly", "yes" ] + ports: + - "6379:6379" + hostname: rekor-redis + restart: always # keep the redis server running + healthcheck: + test: [ "CMD", "redis-cli", "ping" ] + interval: 10s + timeout: 3s + retries: 3 + start_period: 5s + + mysql: + image: gcr.io/trillian-opensource-ci/db_server@sha256:3037aa063d8f9d1a4e4df90f65b2b37c2b2a2902acf4b47bfb5af0fd150100d9 + environment: + - MYSQL_ROOT_PASSWORD + - MYSQL_DATABASE=sigstore + - MYSQL_USER + - MYSQL_PASSWORD + restart: always # keep the MySQL server running + healthcheck: + test: [ "CMD", "/etc/init.d/mysql", "status" ] + interval: 30s + timeout: 3s + retries: 3 + start_period: 10s + + mysql-bt: + image: gcr.io/trillian-opensource-ci/db_server@sha256:3037aa063d8f9d1a4e4df90f65b2b37c2b2a2902acf4b47bfb5af0fd150100d9 + environment: + - MYSQL_ROOT_PASSWORD + - MYSQL_DATABASE=sigstore + - MYSQL_USER + - MYSQL_PASSWORD + restart: always # keep the MySQL server running + healthcheck: + test: [ "CMD", "/etc/init.d/mysql", "status" ] + interval: 30s + timeout: 3s + retries: 3 + start_period: 10s + + ct-trillian-log-server: + image: gcr.io/projectsigstore/trillian_log_server@sha256:60b1a1cbbb8c58524a60eb748de3be1b4ae03e1c1bf5131a626cec6db785f85b + command: + [ + "--storage_system=mysql", + "--mysql_uri=${MYSQL_USER}:${MYSQL_PASSWORD}@tcp(mysql:3306)/sigstore", + "--mysql_max_idle_conns=2", + "--rpc_endpoint=0.0.0.0:8090", + "--http_endpoint=0.0.0.0:8091", + "--alsologtostderr" + ] + restart: always # retry while mysql is starting up + ports: + - "8090:8090" + - "8091:8091" + depends_on: + - mysql + + ct-trillian-log-signer: + image: gcr.io/projectsigstore/trillian_log_signer@sha256:b2eab2a7ffcb558c827b69fb7c1a7e8bc201dbe9f161b2717c539b8a7d1d8388 + command: + [ + "--storage_system=mysql", + "--mysql_uri=${MYSQL_USER}:${MYSQL_PASSWORD}@tcp(mysql:3306)/sigstore", + "--mysql_max_idle_conns=2", + "--rpc_endpoint=0.0.0.0:8090", + "--http_endpoint=0.0.0.0:8091", + "--force_master", + "--alsologtostderr" + ] + restart: always # retry while mysql is starting up + ports: + - "8092:8091" + depends_on: + - mysql + bt-trillian-log-server: + image: gcr.io/projectsigstore/trillian_log_server@sha256:60b1a1cbbb8c58524a60eb748de3be1b4ae03e1c1bf5131a626cec6db785f85b + command: + [ + "--storage_system=mysql", + "--mysql_uri=${MYSQL_USER}:${MYSQL_PASSWORD}@tcp(mysql-bt:3306)/sigstore", + "--mysql_max_idle_conns=2", + "--rpc_endpoint=0.0.0.0:8090", + "--http_endpoint=0.0.0.0:8091", + "--alsologtostderr" + ] + restart: always # retry while mysql is starting up + # ports: + # - "8090:8090" + # - "8091:8091" + depends_on: + - mysql-bt + + bt-trillian-log-signer: + image: gcr.io/projectsigstore/trillian_log_signer@sha256:b2eab2a7ffcb558c827b69fb7c1a7e8bc201dbe9f161b2717c539b8a7d1d8388 + command: + [ + "--storage_system=mysql", + "--mysql_uri=${MYSQL_USER}:${MYSQL_PASSWORD}@tcp(mysql-bt:3306)/sigstore", + "--mysql_max_idle_conns=2", + "--rpc_endpoint=0.0.0.0:8090", + "--http_endpoint=0.0.0.0:8091", + "--force_master", + "--alsologtostderr" + ] + restart: always # retry while mysql is starting up + # ports: + # - "8093:8091" + depends_on: + - mysql-bt + + rekor: + image: gcr.io/projectsigstore/rekor-server@sha256:f7e6975041b9b6f3afdc7d6a1a87de43098ce8d83eb1958ea097ebfcb5537658 + command: + [ + "serve", + "--trillian_log_server.address=bt-trillian-log-server", + "--trillian_log_server.port=8090", + "--redis_server.address=redis-server", + "--redis_server.port=6379", + "--rekor_server.address=0.0.0.0", + # "--rekor_server.signer=memory", + "--rekor_server.signer=/rekor/rekor_key.pem", + "--enable_attestation_storage", + "--attestation_storage_bucket=file:///var/run/attestations" + ] + volumes: + - "rekor-attestations:/var/run/attestations:z" + - "./configs/sigstore/rekor/rekor_key.pem:/rekor/rekor_key.pem" + restart: always # keep the server running + ports: + - "3000:3000" + depends_on: + - mysql-bt + - redis-server + - bt-trillian-log-server + + rekor-monitor: + build: + context: https://github.com/sigstore/rekor-monitor.git#c24efaf5fab6c82a62b5f5a83a622a10c6aa8466 + dockerfile: Dockerfile + target: "deploy" + command: [ + "mirroring", + #"--file=/etc/rekor-monitor/logInfo.txt" + "--url=http://rekor:3000", + "--interval=5m", + ] + depends_on: + - rekor + restart: always # keep the server running + # volumes: + # - ./logInfo.txt:/etc/rekor-monitor/logInfo.txt:z + + +volumes: + ctfe-config: { } + rekor-attestations: { } diff --git a/dockerfiles/bt2x-monitor.Dockerfile b/dockerfiles/bt2x-monitor.Dockerfile new file mode 100644 index 0000000..2b39b4f --- /dev/null +++ b/dockerfiles/bt2x-monitor.Dockerfile @@ -0,0 +1,213 @@ +#"" +# Apache License +# Version 2.0, January 2004 +# http://www.apache.org/licenses/ +# +# TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +# +# 1. Definitions. +# +# "License" shall mean the terms and conditions for use, reproduction, +# and distribution as defined by Sections 1 through 9 of this document. +# +# "Licensor" shall mean the copyright owner or entity authorized by +# the copyright owner that is granting the License. +# +# "Legal Entity" shall mean the union of the acting entity and all +# other entities that control, are controlled by, or are under common +# control with that entity. For the purposes of this definition, +# "control" means (i) the power, direct or indirect, to cause the +# direction or management of such entity, whether by contract or +# otherwise, or (ii) ownership of fifty percent (50%) or more of the +# outstanding shares, or (iii) beneficial ownership of such entity. +# +# "You" (or "Your") shall mean an individual or Legal Entity +# exercising permissions granted by this License. +# +# "Source" form shall mean the preferred form for making modifications, +# including but not limited to software source code, documentation +# source, and configuration files. +# +# "Object" form shall mean any form resulting from mechanical +# transformation or translation of a Source form, including but +# not limited to compiled object code, generated documentation, +# and conversions to other media types. +# +# "Work" shall mean the work of authorship, whether in Source or +# Object form, made available under the License, as indicated by a +# copyright notice that is included in or attached to the work +# (an example is provided in the Appendix below). +# +# "Derivative Works" shall mean any work, whether in Source or Object +# form, that is based on (or derived from) the Work and for which the +# editorial revisions, annotations, elaborations, or other modifications +# represent, as a whole, an original work of authorship. For the purposes +# of this License, Derivative Works shall not include works that remain +# separable from, or merely link (or bind by name) to the interfaces of, +# the Work and Derivative Works thereof. +# +# "Contribution" shall mean any work of authorship, including +# the original version of the Work and any modifications or additions +# to that Work or Derivative Works thereof, that is intentionally +# submitted to Licensor for inclusion in the Work by the copyright owner +# or by an individual or Legal Entity authorized to submit on behalf of +# the copyright owner. For the purposes of this definition, "submitted" +# means any form of electronic, verbal, or written communication sent +# to the Licensor or its representatives, including but not limited to +# communication on electronic mailing lists, source code control systems, +# and issue tracking systems that are managed by, or on behalf of, the +# Licensor for the purpose of discussing and improving the Work, but +# excluding communication that is conspicuously marked or otherwise +# designated in writing by the copyright owner as "Not a Contribution." +# +# "Contributor" shall mean Licensor and any individual or Legal Entity +# on behalf of whom a Contribution has been received by Licensor and +# subsequently incorporated within the Work. +# +# 2. Grant of Copyright License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# copyright license to reproduce, prepare Derivative Works of, +# publicly display, publicly perform, sublicense, and distribute the +# Work and such Derivative Works in Source or Object form. +# +# 3. Grant of Patent License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# (except as stated in this section) patent license to make, have made, +# use, offer to sell, sell, import, and otherwise transfer the Work, +# where such license applies only to those patent claims licensable +# by such Contributor that are necessarily infringed by their +# Contribution(s) alone or by combination of their Contribution(s) +# with the Work to which such Contribution(s) was submitted. If You +# institute patent litigation against any entity (including a +# cross-claim or counterclaim in a lawsuit) alleging that the Work +# or a Contribution incorporated within the Work constitutes direct +# or contributory patent infringement, then any patent licenses +# granted to You under this License for that Work shall terminate +# as of the date such litigation is filed. +# +# 4. Redistribution. You may reproduce and distribute copies of the +# Work or Derivative Works thereof in any medium, with or without +# modifications, and in Source or Object form, provided that You +# meet the following conditions: +# +# (a) You must give any other recipients of the Work or +# Derivative Works a copy of this License; and +# +# (b) You must cause any modified files to carry prominent notices +# stating that You changed the files; and +# +# (c) You must retain, in the Source form of any Derivative Works +# that You distribute, all copyright, patent, trademark, and +# attribution notices from the Source form of the Work, +# excluding those notices that do not pertain to any part of +# the Derivative Works; and +# +# (d) If the Work includes a "NOTICE" text file as part of its +# distribution, then any Derivative Works that You distribute must +# include a readable copy of the attribution notices contained +# within such NOTICE file, excluding those notices that do not +# pertain to any part of the Derivative Works, in at least one +# of the following places: within a NOTICE text file distributed +# as part of the Derivative Works; within the Source form or +# documentation, if provided along with the Derivative Works; or, +# within a display generated by the Derivative Works, if and +# wherever such third-party notices normally appear. The contents +# of the NOTICE file are for informational purposes only and +# do not modify the License. You may add Your own attribution +# notices within Derivative Works that You distribute, alongside +# or as an addendum to the NOTICE text from the Work, provided +# that such additional attribution notices cannot be construed +# as modifying the License. +# +# You may add Your own copyright statement to Your modifications and +# may provide additional or different license terms and conditions +# for use, reproduction, or distribution of Your modifications, or +# for any such Derivative Works as a whole, provided Your use, +# reproduction, and distribution of the Work otherwise complies with +# the conditions stated in this License. +# +# 5. Submission of Contributions. Unless You explicitly state otherwise, +# any Contribution intentionally submitted for inclusion in the Work +# by You to the Licensor shall be under the terms and conditions of +# this License, without any additional terms or conditions. +# Notwithstanding the above, nothing herein shall supersede or modify +# the terms of any separate license agreement you may have executed +# with Licensor regarding such Contributions. +# +# 6. Trademarks. This License does not grant permission to use the trade +# names, trademarks, service marks, or product names of the Licensor, +# except as required for reasonable and customary use in describing the +# origin of the Work and reproducing the content of the NOTICE file. +# +# 7. Disclaimer of Warranty. Unless required by applicable law or +# agreed to in writing, Licensor provides the Work (and each +# Contributor provides its Contributions) on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied, including, without limitation, any warranties or conditions +# of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +# PARTICULAR PURPOSE. You are solely responsible for determining the +# appropriateness of using or redistributing the Work and assume any +# risks associated with Your exercise of permissions under this License. +# +# 8. Limitation of Liability. In no event and under no legal theory, +# whether in tort (including negligence), contract, or otherwise, +# unless required by applicable law (such as deliberate and grossly +# negligent acts) or agreed to in writing, shall any Contributor be +# liable to You for damages, including any direct, indirect, special, +# incidental, or consequential damages of any character arising as a +# result of this License or out of the use or inability to use the +# Work (including but not limited to damages for loss of goodwill, +# work stoppage, computer failure or malfunction, or any and all +# other commercial damages or losses), even if such Contributor +# has been advised of the possibility of such damages. +# +# 9. Accepting Warranty or Additional Liability. While redistributing +# the Work or Derivative Works thereof, You may choose to offer, +# and charge a fee for, acceptance of support, warranty, indemnity, +# or other liability obligations and/or rights consistent with this +# License. However, in accepting such obligations, You may act only +# on Your own behalf and on Your sole responsibility, not on behalf +# of any other Contributor, and only if You agree to indemnify, +# defend, and hold each Contributor harmless for any liability +# incurred by, or claims asserted against, such Contributor by reason +# of your accepting any such warranty or additional liability. +# +# END OF TERMS AND CONDITIONS +# +# APPENDIX: How to apply the Apache License to your work. +# +# To apply the Apache License to your work, attach the following +# boilerplate notice, with the fields enclosed by brackets "[]" +# replaced with your own identifying information. (Don't include +# the brackets!) The text should be enclosed in the appropriate +# comment syntax for the file format. We also recommend that a +# file or class name and description of purpose be included on the +# same "printed page" as the copyright notice for easier +# identification within third-party archives. +# +# Copyright 2024 Fraunhofer AISEC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM rust:1.67 AS builder +WORKDIR /usr/src/bt2x +RUN apt-get update && apt-get install --yes libudev-dev +COPY . .. +RUN cargo build --release +RUN cargo install --path bt2x-monitor --locked + +FROM debian:bullseye-slim +COPY --from=builder /usr/local/cargo/bin/bt2x-monitor /usr/local/bin/bt2x-monitor +CMD ["bt2x-monitor"] \ No newline at end of file diff --git a/dockerfiles/bt2x-ota.Dockerfile b/dockerfiles/bt2x-ota.Dockerfile new file mode 100644 index 0000000..fec474d --- /dev/null +++ b/dockerfiles/bt2x-ota.Dockerfile @@ -0,0 +1,213 @@ +#"" +# Apache License +# Version 2.0, January 2004 +# http://www.apache.org/licenses/ +# +# TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +# +# 1. Definitions. +# +# "License" shall mean the terms and conditions for use, reproduction, +# and distribution as defined by Sections 1 through 9 of this document. +# +# "Licensor" shall mean the copyright owner or entity authorized by +# the copyright owner that is granting the License. +# +# "Legal Entity" shall mean the union of the acting entity and all +# other entities that control, are controlled by, or are under common +# control with that entity. For the purposes of this definition, +# "control" means (i) the power, direct or indirect, to cause the +# direction or management of such entity, whether by contract or +# otherwise, or (ii) ownership of fifty percent (50%) or more of the +# outstanding shares, or (iii) beneficial ownership of such entity. +# +# "You" (or "Your") shall mean an individual or Legal Entity +# exercising permissions granted by this License. +# +# "Source" form shall mean the preferred form for making modifications, +# including but not limited to software source code, documentation +# source, and configuration files. +# +# "Object" form shall mean any form resulting from mechanical +# transformation or translation of a Source form, including but +# not limited to compiled object code, generated documentation, +# and conversions to other media types. +# +# "Work" shall mean the work of authorship, whether in Source or +# Object form, made available under the License, as indicated by a +# copyright notice that is included in or attached to the work +# (an example is provided in the Appendix below). +# +# "Derivative Works" shall mean any work, whether in Source or Object +# form, that is based on (or derived from) the Work and for which the +# editorial revisions, annotations, elaborations, or other modifications +# represent, as a whole, an original work of authorship. For the purposes +# of this License, Derivative Works shall not include works that remain +# separable from, or merely link (or bind by name) to the interfaces of, +# the Work and Derivative Works thereof. +# +# "Contribution" shall mean any work of authorship, including +# the original version of the Work and any modifications or additions +# to that Work or Derivative Works thereof, that is intentionally +# submitted to Licensor for inclusion in the Work by the copyright owner +# or by an individual or Legal Entity authorized to submit on behalf of +# the copyright owner. For the purposes of this definition, "submitted" +# means any form of electronic, verbal, or written communication sent +# to the Licensor or its representatives, including but not limited to +# communication on electronic mailing lists, source code control systems, +# and issue tracking systems that are managed by, or on behalf of, the +# Licensor for the purpose of discussing and improving the Work, but +# excluding communication that is conspicuously marked or otherwise +# designated in writing by the copyright owner as "Not a Contribution." +# +# "Contributor" shall mean Licensor and any individual or Legal Entity +# on behalf of whom a Contribution has been received by Licensor and +# subsequently incorporated within the Work. +# +# 2. Grant of Copyright License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# copyright license to reproduce, prepare Derivative Works of, +# publicly display, publicly perform, sublicense, and distribute the +# Work and such Derivative Works in Source or Object form. +# +# 3. Grant of Patent License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# (except as stated in this section) patent license to make, have made, +# use, offer to sell, sell, import, and otherwise transfer the Work, +# where such license applies only to those patent claims licensable +# by such Contributor that are necessarily infringed by their +# Contribution(s) alone or by combination of their Contribution(s) +# with the Work to which such Contribution(s) was submitted. If You +# institute patent litigation against any entity (including a +# cross-claim or counterclaim in a lawsuit) alleging that the Work +# or a Contribution incorporated within the Work constitutes direct +# or contributory patent infringement, then any patent licenses +# granted to You under this License for that Work shall terminate +# as of the date such litigation is filed. +# +# 4. Redistribution. You may reproduce and distribute copies of the +# Work or Derivative Works thereof in any medium, with or without +# modifications, and in Source or Object form, provided that You +# meet the following conditions: +# +# (a) You must give any other recipients of the Work or +# Derivative Works a copy of this License; and +# +# (b) You must cause any modified files to carry prominent notices +# stating that You changed the files; and +# +# (c) You must retain, in the Source form of any Derivative Works +# that You distribute, all copyright, patent, trademark, and +# attribution notices from the Source form of the Work, +# excluding those notices that do not pertain to any part of +# the Derivative Works; and +# +# (d) If the Work includes a "NOTICE" text file as part of its +# distribution, then any Derivative Works that You distribute must +# include a readable copy of the attribution notices contained +# within such NOTICE file, excluding those notices that do not +# pertain to any part of the Derivative Works, in at least one +# of the following places: within a NOTICE text file distributed +# as part of the Derivative Works; within the Source form or +# documentation, if provided along with the Derivative Works; or, +# within a display generated by the Derivative Works, if and +# wherever such third-party notices normally appear. The contents +# of the NOTICE file are for informational purposes only and +# do not modify the License. You may add Your own attribution +# notices within Derivative Works that You distribute, alongside +# or as an addendum to the NOTICE text from the Work, provided +# that such additional attribution notices cannot be construed +# as modifying the License. +# +# You may add Your own copyright statement to Your modifications and +# may provide additional or different license terms and conditions +# for use, reproduction, or distribution of Your modifications, or +# for any such Derivative Works as a whole, provided Your use, +# reproduction, and distribution of the Work otherwise complies with +# the conditions stated in this License. +# +# 5. Submission of Contributions. Unless You explicitly state otherwise, +# any Contribution intentionally submitted for inclusion in the Work +# by You to the Licensor shall be under the terms and conditions of +# this License, without any additional terms or conditions. +# Notwithstanding the above, nothing herein shall supersede or modify +# the terms of any separate license agreement you may have executed +# with Licensor regarding such Contributions. +# +# 6. Trademarks. This License does not grant permission to use the trade +# names, trademarks, service marks, or product names of the Licensor, +# except as required for reasonable and customary use in describing the +# origin of the Work and reproducing the content of the NOTICE file. +# +# 7. Disclaimer of Warranty. Unless required by applicable law or +# agreed to in writing, Licensor provides the Work (and each +# Contributor provides its Contributions) on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied, including, without limitation, any warranties or conditions +# of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +# PARTICULAR PURPOSE. You are solely responsible for determining the +# appropriateness of using or redistributing the Work and assume any +# risks associated with Your exercise of permissions under this License. +# +# 8. Limitation of Liability. In no event and under no legal theory, +# whether in tort (including negligence), contract, or otherwise, +# unless required by applicable law (such as deliberate and grossly +# negligent acts) or agreed to in writing, shall any Contributor be +# liable to You for damages, including any direct, indirect, special, +# incidental, or consequential damages of any character arising as a +# result of this License or out of the use or inability to use the +# Work (including but not limited to damages for loss of goodwill, +# work stoppage, computer failure or malfunction, or any and all +# other commercial damages or losses), even if such Contributor +# has been advised of the possibility of such damages. +# +# 9. Accepting Warranty or Additional Liability. While redistributing +# the Work or Derivative Works thereof, You may choose to offer, +# and charge a fee for, acceptance of support, warranty, indemnity, +# or other liability obligations and/or rights consistent with this +# License. However, in accepting such obligations, You may act only +# on Your own behalf and on Your sole responsibility, not on behalf +# of any other Contributor, and only if You agree to indemnify, +# defend, and hold each Contributor harmless for any liability +# incurred by, or claims asserted against, such Contributor by reason +# of your accepting any such warranty or additional liability. +# +# END OF TERMS AND CONDITIONS +# +# APPENDIX: How to apply the Apache License to your work. +# +# To apply the Apache License to your work, attach the following +# boilerplate notice, with the fields enclosed by brackets "[]" +# replaced with your own identifying information. (Don't include +# the brackets!) The text should be enclosed in the appropriate +# comment syntax for the file format. We also recommend that a +# file or class name and description of purpose be included on the +# same "printed page" as the copyright notice for easier +# identification within third-party archives. +# +# Copyright 2024 Fraunhofer AISEC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM rust:1.67 AS builder +WORKDIR /usr/src/bt2x +RUN apt-get update && apt-get install --yes libudev-dev +COPY . .. +RUN cargo build --release +RUN cargo install --path bt2x-ota --locked + +FROM debian:bullseye-slim +COPY --from=builder /usr/local/cargo/bin/bt2x-ota /usr/local/bin/bt2x-ota +CMD ["bt2x-ota"] \ No newline at end of file diff --git a/dockerfiles/bt2x.Dockerfile b/dockerfiles/bt2x.Dockerfile new file mode 100644 index 0000000..063c3d7 --- /dev/null +++ b/dockerfiles/bt2x.Dockerfile @@ -0,0 +1,213 @@ +#"" +# Apache License +# Version 2.0, January 2004 +# http://www.apache.org/licenses/ +# +# TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +# +# 1. Definitions. +# +# "License" shall mean the terms and conditions for use, reproduction, +# and distribution as defined by Sections 1 through 9 of this document. +# +# "Licensor" shall mean the copyright owner or entity authorized by +# the copyright owner that is granting the License. +# +# "Legal Entity" shall mean the union of the acting entity and all +# other entities that control, are controlled by, or are under common +# control with that entity. For the purposes of this definition, +# "control" means (i) the power, direct or indirect, to cause the +# direction or management of such entity, whether by contract or +# otherwise, or (ii) ownership of fifty percent (50%) or more of the +# outstanding shares, or (iii) beneficial ownership of such entity. +# +# "You" (or "Your") shall mean an individual or Legal Entity +# exercising permissions granted by this License. +# +# "Source" form shall mean the preferred form for making modifications, +# including but not limited to software source code, documentation +# source, and configuration files. +# +# "Object" form shall mean any form resulting from mechanical +# transformation or translation of a Source form, including but +# not limited to compiled object code, generated documentation, +# and conversions to other media types. +# +# "Work" shall mean the work of authorship, whether in Source or +# Object form, made available under the License, as indicated by a +# copyright notice that is included in or attached to the work +# (an example is provided in the Appendix below). +# +# "Derivative Works" shall mean any work, whether in Source or Object +# form, that is based on (or derived from) the Work and for which the +# editorial revisions, annotations, elaborations, or other modifications +# represent, as a whole, an original work of authorship. For the purposes +# of this License, Derivative Works shall not include works that remain +# separable from, or merely link (or bind by name) to the interfaces of, +# the Work and Derivative Works thereof. +# +# "Contribution" shall mean any work of authorship, including +# the original version of the Work and any modifications or additions +# to that Work or Derivative Works thereof, that is intentionally +# submitted to Licensor for inclusion in the Work by the copyright owner +# or by an individual or Legal Entity authorized to submit on behalf of +# the copyright owner. For the purposes of this definition, "submitted" +# means any form of electronic, verbal, or written communication sent +# to the Licensor or its representatives, including but not limited to +# communication on electronic mailing lists, source code control systems, +# and issue tracking systems that are managed by, or on behalf of, the +# Licensor for the purpose of discussing and improving the Work, but +# excluding communication that is conspicuously marked or otherwise +# designated in writing by the copyright owner as "Not a Contribution." +# +# "Contributor" shall mean Licensor and any individual or Legal Entity +# on behalf of whom a Contribution has been received by Licensor and +# subsequently incorporated within the Work. +# +# 2. Grant of Copyright License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# copyright license to reproduce, prepare Derivative Works of, +# publicly display, publicly perform, sublicense, and distribute the +# Work and such Derivative Works in Source or Object form. +# +# 3. Grant of Patent License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# (except as stated in this section) patent license to make, have made, +# use, offer to sell, sell, import, and otherwise transfer the Work, +# where such license applies only to those patent claims licensable +# by such Contributor that are necessarily infringed by their +# Contribution(s) alone or by combination of their Contribution(s) +# with the Work to which such Contribution(s) was submitted. If You +# institute patent litigation against any entity (including a +# cross-claim or counterclaim in a lawsuit) alleging that the Work +# or a Contribution incorporated within the Work constitutes direct +# or contributory patent infringement, then any patent licenses +# granted to You under this License for that Work shall terminate +# as of the date such litigation is filed. +# +# 4. Redistribution. You may reproduce and distribute copies of the +# Work or Derivative Works thereof in any medium, with or without +# modifications, and in Source or Object form, provided that You +# meet the following conditions: +# +# (a) You must give any other recipients of the Work or +# Derivative Works a copy of this License; and +# +# (b) You must cause any modified files to carry prominent notices +# stating that You changed the files; and +# +# (c) You must retain, in the Source form of any Derivative Works +# that You distribute, all copyright, patent, trademark, and +# attribution notices from the Source form of the Work, +# excluding those notices that do not pertain to any part of +# the Derivative Works; and +# +# (d) If the Work includes a "NOTICE" text file as part of its +# distribution, then any Derivative Works that You distribute must +# include a readable copy of the attribution notices contained +# within such NOTICE file, excluding those notices that do not +# pertain to any part of the Derivative Works, in at least one +# of the following places: within a NOTICE text file distributed +# as part of the Derivative Works; within the Source form or +# documentation, if provided along with the Derivative Works; or, +# within a display generated by the Derivative Works, if and +# wherever such third-party notices normally appear. The contents +# of the NOTICE file are for informational purposes only and +# do not modify the License. You may add Your own attribution +# notices within Derivative Works that You distribute, alongside +# or as an addendum to the NOTICE text from the Work, provided +# that such additional attribution notices cannot be construed +# as modifying the License. +# +# You may add Your own copyright statement to Your modifications and +# may provide additional or different license terms and conditions +# for use, reproduction, or distribution of Your modifications, or +# for any such Derivative Works as a whole, provided Your use, +# reproduction, and distribution of the Work otherwise complies with +# the conditions stated in this License. +# +# 5. Submission of Contributions. Unless You explicitly state otherwise, +# any Contribution intentionally submitted for inclusion in the Work +# by You to the Licensor shall be under the terms and conditions of +# this License, without any additional terms or conditions. +# Notwithstanding the above, nothing herein shall supersede or modify +# the terms of any separate license agreement you may have executed +# with Licensor regarding such Contributions. +# +# 6. Trademarks. This License does not grant permission to use the trade +# names, trademarks, service marks, or product names of the Licensor, +# except as required for reasonable and customary use in describing the +# origin of the Work and reproducing the content of the NOTICE file. +# +# 7. Disclaimer of Warranty. Unless required by applicable law or +# agreed to in writing, Licensor provides the Work (and each +# Contributor provides its Contributions) on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied, including, without limitation, any warranties or conditions +# of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +# PARTICULAR PURPOSE. You are solely responsible for determining the +# appropriateness of using or redistributing the Work and assume any +# risks associated with Your exercise of permissions under this License. +# +# 8. Limitation of Liability. In no event and under no legal theory, +# whether in tort (including negligence), contract, or otherwise, +# unless required by applicable law (such as deliberate and grossly +# negligent acts) or agreed to in writing, shall any Contributor be +# liable to You for damages, including any direct, indirect, special, +# incidental, or consequential damages of any character arising as a +# result of this License or out of the use or inability to use the +# Work (including but not limited to damages for loss of goodwill, +# work stoppage, computer failure or malfunction, or any and all +# other commercial damages or losses), even if such Contributor +# has been advised of the possibility of such damages. +# +# 9. Accepting Warranty or Additional Liability. While redistributing +# the Work or Derivative Works thereof, You may choose to offer, +# and charge a fee for, acceptance of support, warranty, indemnity, +# or other liability obligations and/or rights consistent with this +# License. However, in accepting such obligations, You may act only +# on Your own behalf and on Your sole responsibility, not on behalf +# of any other Contributor, and only if You agree to indemnify, +# defend, and hold each Contributor harmless for any liability +# incurred by, or claims asserted against, such Contributor by reason +# of your accepting any such warranty or additional liability. +# +# END OF TERMS AND CONDITIONS +# +# APPENDIX: How to apply the Apache License to your work. +# +# To apply the Apache License to your work, attach the following +# boilerplate notice, with the fields enclosed by brackets "[]" +# replaced with your own identifying information. (Don't include +# the brackets!) The text should be enclosed in the appropriate +# comment syntax for the file format. We also recommend that a +# file or class name and description of purpose be included on the +# same "printed page" as the copyright notice for easier +# identification within third-party archives. +# +# Copyright 2024 Fraunhofer AISEC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM rust:1.67 AS builder +WORKDIR /usr/src/bt2x +RUN apt-get update && apt-get install --yes libudev-dev +COPY . .. +RUN cargo build --release + +FROM debian:bullseye-slim +ARG BINARY_NAME +COPY --from=builder /usr/src/bt2x/target/release/${BINARY_NAME} /usr/local/bin/${BINARY_NAME} +CMD ["${BINARY_NAME}"] \ No newline at end of file diff --git a/dockerfiles/oci-registry.Dockerfile b/dockerfiles/oci-registry.Dockerfile new file mode 100644 index 0000000..6ca3b3d --- /dev/null +++ b/dockerfiles/oci-registry.Dockerfile @@ -0,0 +1,206 @@ +#"" +# Apache License +# Version 2.0, January 2004 +# http://www.apache.org/licenses/ +# +# TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +# +# 1. Definitions. +# +# "License" shall mean the terms and conditions for use, reproduction, +# and distribution as defined by Sections 1 through 9 of this document. +# +# "Licensor" shall mean the copyright owner or entity authorized by +# the copyright owner that is granting the License. +# +# "Legal Entity" shall mean the union of the acting entity and all +# other entities that control, are controlled by, or are under common +# control with that entity. For the purposes of this definition, +# "control" means (i) the power, direct or indirect, to cause the +# direction or management of such entity, whether by contract or +# otherwise, or (ii) ownership of fifty percent (50%) or more of the +# outstanding shares, or (iii) beneficial ownership of such entity. +# +# "You" (or "Your") shall mean an individual or Legal Entity +# exercising permissions granted by this License. +# +# "Source" form shall mean the preferred form for making modifications, +# including but not limited to software source code, documentation +# source, and configuration files. +# +# "Object" form shall mean any form resulting from mechanical +# transformation or translation of a Source form, including but +# not limited to compiled object code, generated documentation, +# and conversions to other media types. +# +# "Work" shall mean the work of authorship, whether in Source or +# Object form, made available under the License, as indicated by a +# copyright notice that is included in or attached to the work +# (an example is provided in the Appendix below). +# +# "Derivative Works" shall mean any work, whether in Source or Object +# form, that is based on (or derived from) the Work and for which the +# editorial revisions, annotations, elaborations, or other modifications +# represent, as a whole, an original work of authorship. For the purposes +# of this License, Derivative Works shall not include works that remain +# separable from, or merely link (or bind by name) to the interfaces of, +# the Work and Derivative Works thereof. +# +# "Contribution" shall mean any work of authorship, including +# the original version of the Work and any modifications or additions +# to that Work or Derivative Works thereof, that is intentionally +# submitted to Licensor for inclusion in the Work by the copyright owner +# or by an individual or Legal Entity authorized to submit on behalf of +# the copyright owner. For the purposes of this definition, "submitted" +# means any form of electronic, verbal, or written communication sent +# to the Licensor or its representatives, including but not limited to +# communication on electronic mailing lists, source code control systems, +# and issue tracking systems that are managed by, or on behalf of, the +# Licensor for the purpose of discussing and improving the Work, but +# excluding communication that is conspicuously marked or otherwise +# designated in writing by the copyright owner as "Not a Contribution." +# +# "Contributor" shall mean Licensor and any individual or Legal Entity +# on behalf of whom a Contribution has been received by Licensor and +# subsequently incorporated within the Work. +# +# 2. Grant of Copyright License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# copyright license to reproduce, prepare Derivative Works of, +# publicly display, publicly perform, sublicense, and distribute the +# Work and such Derivative Works in Source or Object form. +# +# 3. Grant of Patent License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# (except as stated in this section) patent license to make, have made, +# use, offer to sell, sell, import, and otherwise transfer the Work, +# where such license applies only to those patent claims licensable +# by such Contributor that are necessarily infringed by their +# Contribution(s) alone or by combination of their Contribution(s) +# with the Work to which such Contribution(s) was submitted. If You +# institute patent litigation against any entity (including a +# cross-claim or counterclaim in a lawsuit) alleging that the Work +# or a Contribution incorporated within the Work constitutes direct +# or contributory patent infringement, then any patent licenses +# granted to You under this License for that Work shall terminate +# as of the date such litigation is filed. +# +# 4. Redistribution. You may reproduce and distribute copies of the +# Work or Derivative Works thereof in any medium, with or without +# modifications, and in Source or Object form, provided that You +# meet the following conditions: +# +# (a) You must give any other recipients of the Work or +# Derivative Works a copy of this License; and +# +# (b) You must cause any modified files to carry prominent notices +# stating that You changed the files; and +# +# (c) You must retain, in the Source form of any Derivative Works +# that You distribute, all copyright, patent, trademark, and +# attribution notices from the Source form of the Work, +# excluding those notices that do not pertain to any part of +# the Derivative Works; and +# +# (d) If the Work includes a "NOTICE" text file as part of its +# distribution, then any Derivative Works that You distribute must +# include a readable copy of the attribution notices contained +# within such NOTICE file, excluding those notices that do not +# pertain to any part of the Derivative Works, in at least one +# of the following places: within a NOTICE text file distributed +# as part of the Derivative Works; within the Source form or +# documentation, if provided along with the Derivative Works; or, +# within a display generated by the Derivative Works, if and +# wherever such third-party notices normally appear. The contents +# of the NOTICE file are for informational purposes only and +# do not modify the License. You may add Your own attribution +# notices within Derivative Works that You distribute, alongside +# or as an addendum to the NOTICE text from the Work, provided +# that such additional attribution notices cannot be construed +# as modifying the License. +# +# You may add Your own copyright statement to Your modifications and +# may provide additional or different license terms and conditions +# for use, reproduction, or distribution of Your modifications, or +# for any such Derivative Works as a whole, provided Your use, +# reproduction, and distribution of the Work otherwise complies with +# the conditions stated in this License. +# +# 5. Submission of Contributions. Unless You explicitly state otherwise, +# any Contribution intentionally submitted for inclusion in the Work +# by You to the Licensor shall be under the terms and conditions of +# this License, without any additional terms or conditions. +# Notwithstanding the above, nothing herein shall supersede or modify +# the terms of any separate license agreement you may have executed +# with Licensor regarding such Contributions. +# +# 6. Trademarks. This License does not grant permission to use the trade +# names, trademarks, service marks, or product names of the Licensor, +# except as required for reasonable and customary use in describing the +# origin of the Work and reproducing the content of the NOTICE file. +# +# 7. Disclaimer of Warranty. Unless required by applicable law or +# agreed to in writing, Licensor provides the Work (and each +# Contributor provides its Contributions) on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied, including, without limitation, any warranties or conditions +# of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +# PARTICULAR PURPOSE. You are solely responsible for determining the +# appropriateness of using or redistributing the Work and assume any +# risks associated with Your exercise of permissions under this License. +# +# 8. Limitation of Liability. In no event and under no legal theory, +# whether in tort (including negligence), contract, or otherwise, +# unless required by applicable law (such as deliberate and grossly +# negligent acts) or agreed to in writing, shall any Contributor be +# liable to You for damages, including any direct, indirect, special, +# incidental, or consequential damages of any character arising as a +# result of this License or out of the use or inability to use the +# Work (including but not limited to damages for loss of goodwill, +# work stoppage, computer failure or malfunction, or any and all +# other commercial damages or losses), even if such Contributor +# has been advised of the possibility of such damages. +# +# 9. Accepting Warranty or Additional Liability. While redistributing +# the Work or Derivative Works thereof, You may choose to offer, +# and charge a fee for, acceptance of support, warranty, indemnity, +# or other liability obligations and/or rights consistent with this +# License. However, in accepting such obligations, You may act only +# on Your own behalf and on Your sole responsibility, not on behalf +# of any other Contributor, and only if You agree to indemnify, +# defend, and hold each Contributor harmless for any liability +# incurred by, or claims asserted against, such Contributor by reason +# of your accepting any such warranty or additional liability. +# +# END OF TERMS AND CONDITIONS +# +# APPENDIX: How to apply the Apache License to your work. +# +# To apply the Apache License to your work, attach the following +# boilerplate notice, with the fields enclosed by brackets "[]" +# replaced with your own identifying information. (Don't include +# the brackets!) The text should be enclosed in the appropriate +# comment syntax for the file format. We also recommend that a +# file or class name and description of purpose be included on the +# same "printed page" as the copyright notice for easier +# identification within third-party archives. +# +# Copyright 2024 Fraunhofer AISEC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM golang:alpine3.17 +RUN go install github.com/google/go-containerregistry/cmd/registry@v0.13.0 +CMD [ "/go/bin/registry" ] \ No newline at end of file diff --git a/dockerfiles/populate-rekor.Dockerfile b/dockerfiles/populate-rekor.Dockerfile new file mode 100644 index 0000000..d58137f --- /dev/null +++ b/dockerfiles/populate-rekor.Dockerfile @@ -0,0 +1,209 @@ +#"" +# Apache License +# Version 2.0, January 2004 +# http://www.apache.org/licenses/ +# +# TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +# +# 1. Definitions. +# +# "License" shall mean the terms and conditions for use, reproduction, +# and distribution as defined by Sections 1 through 9 of this document. +# +# "Licensor" shall mean the copyright owner or entity authorized by +# the copyright owner that is granting the License. +# +# "Legal Entity" shall mean the union of the acting entity and all +# other entities that control, are controlled by, or are under common +# control with that entity. For the purposes of this definition, +# "control" means (i) the power, direct or indirect, to cause the +# direction or management of such entity, whether by contract or +# otherwise, or (ii) ownership of fifty percent (50%) or more of the +# outstanding shares, or (iii) beneficial ownership of such entity. +# +# "You" (or "Your") shall mean an individual or Legal Entity +# exercising permissions granted by this License. +# +# "Source" form shall mean the preferred form for making modifications, +# including but not limited to software source code, documentation +# source, and configuration files. +# +# "Object" form shall mean any form resulting from mechanical +# transformation or translation of a Source form, including but +# not limited to compiled object code, generated documentation, +# and conversions to other media types. +# +# "Work" shall mean the work of authorship, whether in Source or +# Object form, made available under the License, as indicated by a +# copyright notice that is included in or attached to the work +# (an example is provided in the Appendix below). +# +# "Derivative Works" shall mean any work, whether in Source or Object +# form, that is based on (or derived from) the Work and for which the +# editorial revisions, annotations, elaborations, or other modifications +# represent, as a whole, an original work of authorship. For the purposes +# of this License, Derivative Works shall not include works that remain +# separable from, or merely link (or bind by name) to the interfaces of, +# the Work and Derivative Works thereof. +# +# "Contribution" shall mean any work of authorship, including +# the original version of the Work and any modifications or additions +# to that Work or Derivative Works thereof, that is intentionally +# submitted to Licensor for inclusion in the Work by the copyright owner +# or by an individual or Legal Entity authorized to submit on behalf of +# the copyright owner. For the purposes of this definition, "submitted" +# means any form of electronic, verbal, or written communication sent +# to the Licensor or its representatives, including but not limited to +# communication on electronic mailing lists, source code control systems, +# and issue tracking systems that are managed by, or on behalf of, the +# Licensor for the purpose of discussing and improving the Work, but +# excluding communication that is conspicuously marked or otherwise +# designated in writing by the copyright owner as "Not a Contribution." +# +# "Contributor" shall mean Licensor and any individual or Legal Entity +# on behalf of whom a Contribution has been received by Licensor and +# subsequently incorporated within the Work. +# +# 2. Grant of Copyright License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# copyright license to reproduce, prepare Derivative Works of, +# publicly display, publicly perform, sublicense, and distribute the +# Work and such Derivative Works in Source or Object form. +# +# 3. Grant of Patent License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# (except as stated in this section) patent license to make, have made, +# use, offer to sell, sell, import, and otherwise transfer the Work, +# where such license applies only to those patent claims licensable +# by such Contributor that are necessarily infringed by their +# Contribution(s) alone or by combination of their Contribution(s) +# with the Work to which such Contribution(s) was submitted. If You +# institute patent litigation against any entity (including a +# cross-claim or counterclaim in a lawsuit) alleging that the Work +# or a Contribution incorporated within the Work constitutes direct +# or contributory patent infringement, then any patent licenses +# granted to You under this License for that Work shall terminate +# as of the date such litigation is filed. +# +# 4. Redistribution. You may reproduce and distribute copies of the +# Work or Derivative Works thereof in any medium, with or without +# modifications, and in Source or Object form, provided that You +# meet the following conditions: +# +# (a) You must give any other recipients of the Work or +# Derivative Works a copy of this License; and +# +# (b) You must cause any modified files to carry prominent notices +# stating that You changed the files; and +# +# (c) You must retain, in the Source form of any Derivative Works +# that You distribute, all copyright, patent, trademark, and +# attribution notices from the Source form of the Work, +# excluding those notices that do not pertain to any part of +# the Derivative Works; and +# +# (d) If the Work includes a "NOTICE" text file as part of its +# distribution, then any Derivative Works that You distribute must +# include a readable copy of the attribution notices contained +# within such NOTICE file, excluding those notices that do not +# pertain to any part of the Derivative Works, in at least one +# of the following places: within a NOTICE text file distributed +# as part of the Derivative Works; within the Source form or +# documentation, if provided along with the Derivative Works; or, +# within a display generated by the Derivative Works, if and +# wherever such third-party notices normally appear. The contents +# of the NOTICE file are for informational purposes only and +# do not modify the License. You may add Your own attribution +# notices within Derivative Works that You distribute, alongside +# or as an addendum to the NOTICE text from the Work, provided +# that such additional attribution notices cannot be construed +# as modifying the License. +# +# You may add Your own copyright statement to Your modifications and +# may provide additional or different license terms and conditions +# for use, reproduction, or distribution of Your modifications, or +# for any such Derivative Works as a whole, provided Your use, +# reproduction, and distribution of the Work otherwise complies with +# the conditions stated in this License. +# +# 5. Submission of Contributions. Unless You explicitly state otherwise, +# any Contribution intentionally submitted for inclusion in the Work +# by You to the Licensor shall be under the terms and conditions of +# this License, without any additional terms or conditions. +# Notwithstanding the above, nothing herein shall supersede or modify +# the terms of any separate license agreement you may have executed +# with Licensor regarding such Contributions. +# +# 6. Trademarks. This License does not grant permission to use the trade +# names, trademarks, service marks, or product names of the Licensor, +# except as required for reasonable and customary use in describing the +# origin of the Work and reproducing the content of the NOTICE file. +# +# 7. Disclaimer of Warranty. Unless required by applicable law or +# agreed to in writing, Licensor provides the Work (and each +# Contributor provides its Contributions) on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied, including, without limitation, any warranties or conditions +# of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +# PARTICULAR PURPOSE. You are solely responsible for determining the +# appropriateness of using or redistributing the Work and assume any +# risks associated with Your exercise of permissions under this License. +# +# 8. Limitation of Liability. In no event and under no legal theory, +# whether in tort (including negligence), contract, or otherwise, +# unless required by applicable law (such as deliberate and grossly +# negligent acts) or agreed to in writing, shall any Contributor be +# liable to You for damages, including any direct, indirect, special, +# incidental, or consequential damages of any character arising as a +# result of this License or out of the use or inability to use the +# Work (including but not limited to damages for loss of goodwill, +# work stoppage, computer failure or malfunction, or any and all +# other commercial damages or losses), even if such Contributor +# has been advised of the possibility of such damages. +# +# 9. Accepting Warranty or Additional Liability. While redistributing +# the Work or Derivative Works thereof, You may choose to offer, +# and charge a fee for, acceptance of support, warranty, indemnity, +# or other liability obligations and/or rights consistent with this +# License. However, in accepting such obligations, You may act only +# on Your own behalf and on Your sole responsibility, not on behalf +# of any other Contributor, and only if You agree to indemnify, +# defend, and hold each Contributor harmless for any liability +# incurred by, or claims asserted against, such Contributor by reason +# of your accepting any such warranty or additional liability. +# +# END OF TERMS AND CONDITIONS +# +# APPENDIX: How to apply the Apache License to your work. +# +# To apply the Apache License to your work, attach the following +# boilerplate notice, with the fields enclosed by brackets "[]" +# replaced with your own identifying information. (Don't include +# the brackets!) The text should be enclosed in the appropriate +# comment syntax for the file format. We also recommend that a +# file or class name and description of purpose be included on the +# same "printed page" as the copyright notice for easier +# identification within third-party archives. +# +# Copyright 2024 Fraunhofer AISEC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM bitnami/cosign +USER root +RUN apt-get update && apt-get install --yes curl jq +USER 1001 +COPY populate-rekor.sh . +ENTRYPOINT ["./populate-rekor.sh", "http://rekor:3000"] \ No newline at end of file diff --git a/generate-benchmark-data.py b/generate-benchmark-data.py new file mode 100644 index 0000000..8b6c66e --- /dev/null +++ b/generate-benchmark-data.py @@ -0,0 +1,255 @@ +""" + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2024 Fraunhofer AISEC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" +import subprocess +import os +import json + + +def run_size_benchmarks( + src_path: str, + bin_names: list[str], + outpath: str, +): + print("========== Running size benchmarks ==========") + os.chdir(src_path) + bins = " ".join(f"--bin={b}" for b in bin_names) + print("============ Building artifacts =============") + subprocess.run(f"cargo build --release {bins}".split(" ")) + results = {} + for b in bin_names: + results[b] = {} + subprocess.run(f"cargo objcopy --release --bin={b} -- -O binary target/thumbv6m-none-eabi/release/{b}.bin".split(" ")) + results[b]["raw_size"] = os.stat(f"target/thumbv6m-none-eabi/release/{b}.bin").st_size + bloat_output = subprocess.run( + f"cargo bloat --release --message-format=json -n=0 --bin={b}".split(" "), + capture_output=True, + ).stdout + results[b]["cargo_bloat"] = json.loads(bloat_output) + bloat_output = subprocess.run( + f"cargo bloat --release --message-format=json -n=0 --bin={b} --crates".split(" "), + capture_output=True, + ).stdout + results[b]["cargo_bloat_crates"] = json.loads(bloat_output) + os.chdir("..") + with open(f"{outpath}/benchmarks-size.json", "w+") as f: + json.dump(results, f) + +def run_benchmarks( + outpath: str ="benchmark-output", +): + os.makedirs(outpath, exist_ok=True) + run_size_benchmarks( + src_path="bt2x-pi-pico-w", + bin_names=[ + "benchmark-code-size-full", + "benchmark-code-size-no-tuf", + "benchmark-code-size-signature-only", + "benchmark-code-size-update-only", + ], + outpath="benchmark-output", + ) + + +if __name__ == "__main__": + run_benchmarks() \ No newline at end of file diff --git a/images/development-setup.svg b/images/development-setup.svg new file mode 100644 index 0000000..039d655 --- /dev/null +++ b/images/development-setup.svg @@ -0,0 +1,3 @@ + + +
Rekor
enter
Certificates
to CT Log
Fulcio
CT Log
authenticate Certificate requests
dex-idp
fetch
Binary + Signature Bundles
gossip
BT²X Audit Server
BT²X OTA Server
BT²X Monitor
ID Provider
(e.g. GitHub)
WiFi
Pi Pico W
WiFi
USB
Development
Computer
UART
Pi with
Picoprobe
Firmware
publish Binary + Signature Bundle
request
Signing Certificate
enter Signature
to BT Log
login
BT²X CLI
Docker
Network
container-registry
Target Binary
+
Signature Bundle
Initial Binary
cargo-flash
gossip
\ No newline at end of file diff --git a/images/docker-setup.svg b/images/docker-setup.svg new file mode 100644 index 0000000..3b6b94b --- /dev/null +++ b/images/docker-setup.svg @@ -0,0 +1,3 @@ + + +
rekor
Fulcio
CT Log
dex-idp
BT²X Audit Server
BT²X OTA Server
BT²X Monitor
ID Provider
(e.g. GitHub)
ctfe-init
ct-trillian-log-server
ct-trillian-log-signer
bt-trillian-log-server
bt-trillian-log-signer
redis-server
ct-mysql
bt-mysql
Rekor
CT Log
Sigstore
BT²X
OIDC 
\ No newline at end of file diff --git a/images/general-operation.svg b/images/general-operation.svg new file mode 100644 index 0000000..80573b8 --- /dev/null +++ b/images/general-operation.svg @@ -0,0 +1,3 @@ + + +
timestamps
snapshot
targets
tuf-no-sdt-cli
distribute TUF root
distribute TUF root
root
Rekor
Fulcio
CTLog
run TUF CLI
generate
Sigstore Keys
setup
shell script
issue signing certificate
OIDC flow
Fulcio
CT
Log
Rekor
upload
binary + signatures
upload log entry
BT²X
CLI
authenticate for Fulcio (ODIC)
dex-id
download
binary and signatures
OCI
registry
request inclusion proofs
gossip
BT²X
Auditing Server
BT²X
OTA Server
TUF
Repo
download
TUF files + binary + signature
Pi Pico W
verify and update
request
consistency proofs
Monitor
generate keys
and metafiles
distribute TUF repo
initialization
operation
compile
binary
\ No newline at end of file diff --git a/images/src/development-setup.drawio b/images/src/development-setup.drawio new file mode 100644 index 0000000..35e2cae --- /dev/null +++ b/images/src/development-setup.drawio @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/src/docker-setup.drawio b/images/src/docker-setup.drawio new file mode 100644 index 0000000..b02496a --- /dev/null +++ b/images/src/docker-setup.drawio @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/src/general-operation.drawio b/images/src/general-operation.drawio new file mode 100644 index 0000000..92e591b --- /dev/null +++ b/images/src/general-operation.drawio @@ -0,0 +1,296 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/performance_benchmarks.py b/performance_benchmarks.py new file mode 100644 index 0000000..4b4e372 --- /dev/null +++ b/performance_benchmarks.py @@ -0,0 +1,318 @@ +""" + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2024 Fraunhofer AISEC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +""" +import matplotlib.pyplot as plt +import numpy as np +import datetime +from benchmark_server import BenchmarkData +from matplotlib.patches import Polygon +import os +from datetime import timedelta +from itertools import product +from functools import reduce + +if __name__ == "__main__": + plt.style.use("Solarize_Light2") + files = [f for f in os.listdir("../benchmark-output") if f.startswith("performance-benchmark")] + data = [BenchmarkData.parse_file(f"../benchmark-output/{f}") for f in files] + data.sort(key=lambda x: x.binary_size) + data_fetch_targets = [m.fetch_target_files for m in data] + data_update_repo = [m.update_repo for m in data] + data_fetch_signature = [m.fetch_signature for m in data] + data_fetch_binary = [m.fetch_binary for m in data] + print(data_fetch_binary) + def helper(acc: dict, a): + if a.binary_size not in acc: + acc[a.binary_size] = [] + acc[a.binary_size].append(a) + return acc + data_by_size = reduce(helper, data, {}) + data_fetch_binary_by_size = {k:[d.fetch_binary for d in vals] for (k,vals) in data_by_size.items()} + data_fetch_binary_by_size = {k: [timedelta(seconds=d["secs"] + d["nanos"]*1e-9).total_seconds() for d in vals] for (k,vals) in data_fetch_binary_by_size.items()} + print(data_fetch_binary_by_size) + data_verify_binary = [m.verify_binary for m in data] + data_fetch_targets = [timedelta(seconds=d["secs"] + d["nanos"]*1e-9).total_seconds() for d in data_fetch_targets] + data_update_repo = [timedelta(seconds=d["secs"] + d["nanos"]*1e-9).total_seconds() for d in data_update_repo] + data_fetch_signature = [timedelta(seconds=d["secs"] + d["nanos"]*1e-9).total_seconds() for d in data_fetch_signature] + data_fetch_binary = [timedelta(seconds=d["secs"] + d["nanos"]*1e-9).total_seconds() for d in data_fetch_binary] + data_verify_binary_full = [timedelta(seconds=d["secs"] + d["nanos"]*1e-9).total_seconds() for d in data_verify_binary] + data_verify_binary = {k:[d.verify_binary for d in vals] for (k,vals) in data_by_size.items()} + data_verify_binary = {k: [timedelta(seconds=d["secs"] + d["nanos"]*1e-9).total_seconds() for d in vals] for (k,vals) in data_verify_binary.items()} + + # of each data type for the addition + data_full = {k:[ + (timedelta(seconds=d.fetch_target_files["secs"] + d.fetch_target_files["nanos"] * 1e-9) + + timedelta(seconds=d.update_repo["secs"] + d.update_repo["nanos"] * 1e-9) + + timedelta(seconds=d.fetch_signature["secs"] + d.fetch_signature["nanos"] * 1e-9) + + timedelta(seconds=d.fetch_binary["secs"] + d.fetch_binary["nanos"] * 1e-9) + + timedelta(seconds=d.verify_binary["secs"] + d.verify_binary["nanos"] * 1e-9) + ).total_seconds() + for d in vals + ] for (k,vals) in data_by_size.items()} + data_no_tuf = {k:[ + (timedelta(seconds=d.fetch_signature["secs"] + d.fetch_signature["nanos"] * 1e-9) + + timedelta(seconds=d.fetch_binary["secs"] + d.fetch_binary["nanos"] * 1e-9) + + timedelta(seconds=d.verify_binary["secs"] + d.verify_binary["nanos"] * 1e-9) + ).total_seconds() + for d in vals + ] for (k,vals) in data_by_size.items()} + # data_full_synthetic = [sum(t for t in d) for d in product(data_fetch_targets,data_update_repo,data_fetch_signature,data_fetch_binary,data_verify_binary)] + # data_no_tuf_synthetic = [sum(t for t in d) for d in product(data_fetch_signature, data_fetch_binary, data_verify_binary)] + # basic plot + fig, axs = plt.subplots(3, 2) + + + axs[0, 0].boxplot(data_fetch_targets) + axs[0, 0].set_title("Fetch TUF Targets") + axs[0, 0].set_ylabel("time (s)") + axs[1, 0].set_ylabel("time (s)") + axs[0, 1].boxplot(data_update_repo) + axs[0, 1].set_title("TUF Repo Update") + axs[1, 0].boxplot(data_fetch_signature) + axs[1, 0].set_title("Signature Fetching") + axs[1, 1].set_title("Verification Duration by size") + axs[2, 0].set_title("Binary fetch duration by size") + axs[1, 1].boxplot( + [data_verify_binary_full] + list(data_verify_binary.values()), + tick_labels=["all samples"] + [f"{k/1024:.1f} KiB" for k in data_verify_binary.keys()] + ) + + + axs[2, 0].plot( + [0, 1] + [f"{k/1024:.1f} KiB" for k in data_fetch_binary_by_size.keys()], + [None, None] + [np.average(v) for v in data_fetch_binary_by_size.values()], + linestyle="--" + ) + axs[2, 0].boxplot( + [data_fetch_binary] + list(data_fetch_binary_by_size.values()), + tick_labels=["all samples"] + [f"{k/1024:.1f} KiB" for k in data_fetch_binary_by_size.keys()] + ) + axs[2, 1].plot( + [0] + [f"{k/1024:.1f} KiB" for k in data_full.keys()], + [None] + [np.average(v) for v in data_full.values()], + label="TUF + BT", + linestyle="dotted", + ) + axs[2, 1].plot( + [0] + [f"{k/1024:.1f} KiB" for k in data_no_tuf.keys()], + [None] + [np.average(v) for v in data_no_tuf.values()], + label="BT only", + linestyle="dashed", + ) + axs[2, 1].boxplot( + data_full.values(), + tick_labels=[f"{k/1024:.1f} KiB" for k in data_full.keys()], + ) + axs[2, 0].set_ylabel("time (s)") + + axs[2, 1].boxplot( + data_no_tuf.values(), + tick_labels=[f"{k/1024:.1f} KiB" for k in data_no_tuf.keys()] + ) + + axs[2, 1].legend() + axs[2, 1].set_title("Cumulative Duration by size") + + fig.subplots_adjust(left=0.08, right=0.98, bottom=0.05, top=0.9, + hspace=0.4, wspace=0.3) + plt.show() \ No newline at end of file diff --git a/pico-w-bootloader/.cargo/config.toml b/pico-w-bootloader/.cargo/config.toml new file mode 100644 index 0000000..9d48ecd --- /dev/null +++ b/pico-w-bootloader/.cargo/config.toml @@ -0,0 +1,8 @@ +[target.'cfg(all(target_arch = "arm", target_os = "none"))'] +runner = "probe-rs run --chip RP2040" + +[build] +target = "thumbv6m-none-eabi" + +[env] +DEFMT_LOG = "trace" diff --git a/pico-w-bootloader/.dockerignore b/pico-w-bootloader/.dockerignore new file mode 100644 index 0000000..66a6354 --- /dev/null +++ b/pico-w-bootloader/.dockerignore @@ -0,0 +1,16 @@ +### Rust template +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + diff --git a/pico-w-bootloader/.gitignore b/pico-w-bootloader/.gitignore new file mode 100644 index 0000000..a9d37c5 --- /dev/null +++ b/pico-w-bootloader/.gitignore @@ -0,0 +1,2 @@ +target +Cargo.lock diff --git a/pico-w-bootloader/Cargo.toml b/pico-w-bootloader/Cargo.toml new file mode 100644 index 0000000..60a5969 --- /dev/null +++ b/pico-w-bootloader/Cargo.toml @@ -0,0 +1,33 @@ +[package] +edition = "2021" +name = "rp-bootloader-example" +version = "0.1.0" +description = "Example bootloader for RP2040 chips" +license = "MIT OR Apache-2.0" + +[dependencies] +defmt = { version = "0.3", optional = true } +defmt-rtt = { version = "0.4", optional = true } + +embassy-rp = { version = "0.1", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180", features = [] } +embassy-boot-rp = { version = "0.2", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" } +embassy-sync = { version = "0.6", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180" } +embassy-time = { version = "0.3", git = "https://github.com/embassy-rs/embassy", rev = "a2acb3e3dceddb4752f8fb1c17aa65e1959a2180", features = [] } + +cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } +cortex-m-rt = { version = "0.7" } +embedded-storage = "0.3.1" +embedded-storage-async = "0.4.0" +cfg-if = "1.0.0" + +[features] +defmt = [ + "dep:defmt", + "dep:defmt-rtt", + "embassy-boot-rp/defmt", + "embassy-rp/defmt", +] + +[profile.release] +debug = true +opt-level = 's' diff --git a/pico-w-bootloader/LICENSE-APACHE b/pico-w-bootloader/LICENSE-APACHE new file mode 100644 index 0000000..8f7956e --- /dev/null +++ b/pico-w-bootloader/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright (c) Embassy project contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/pico-w-bootloader/LICENSE-CC-BY-SA b/pico-w-bootloader/LICENSE-CC-BY-SA new file mode 100644 index 0000000..a73481c --- /dev/null +++ b/pico-w-bootloader/LICENSE-CC-BY-SA @@ -0,0 +1,428 @@ +Attribution-ShareAlike 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution-ShareAlike 4.0 International Public +License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution-ShareAlike 4.0 International Public License ("Public +License"). To the extent this Public License may be interpreted as a +contract, You are granted the Licensed Rights in consideration of Your +acceptance of these terms and conditions, and the Licensor grants You +such rights in consideration of benefits the Licensor receives from +making the Licensed Material available under these terms and +conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. BY-SA Compatible License means a license listed at + creativecommons.org/compatiblelicenses, approved by Creative + Commons as essentially the equivalent of this Public License. + + d. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + e. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + f. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + g. License Elements means the license attributes listed in the name + of a Creative Commons Public License. The License Elements of this + Public License are Attribution and ShareAlike. + + h. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + i. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + j. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + k. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + l. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + m. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. Additional offer from the Licensor -- Adapted Material. + Every recipient of Adapted Material from You + automatically receives an offer from the Licensor to + exercise the Licensed Rights in the Adapted Material + under the conditions of the Adapter's License You apply. + + c. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + b. ShareAlike. + + In addition to the conditions in Section 3(a), if You Share + Adapted Material You produce, the following conditions also apply. + + 1. The Adapter's License You apply must be a Creative Commons + license with the same License Elements, this version or + later, or a BY-SA Compatible License. + + 2. You must include the text of, or the URI or hyperlink to, the + Adapter's License You apply. You may satisfy this condition + in any reasonable manner based on the medium, means, and + context in which You Share Adapted Material. + + 3. You may not offer or impose any additional or different terms + or conditions on, or apply any Effective Technological + Measures to, Adapted Material that restrict exercise of the + rights granted under the Adapter's License You apply. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material, + + including for purposes of Section 3(b); and + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. + diff --git a/pico-w-bootloader/LICENSE-MIT b/pico-w-bootloader/LICENSE-MIT new file mode 100644 index 0000000..1fe5730 --- /dev/null +++ b/pico-w-bootloader/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright (c) Embassy project contributors + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/pico-w-bootloader/README.md b/pico-w-bootloader/README.md new file mode 100644 index 0000000..406dc2f --- /dev/null +++ b/pico-w-bootloader/README.md @@ -0,0 +1,4 @@ +# Bootloader for RP2040 + +- [Refer to the Embassy repository](https://github.com/embassy-rs/embassy/tree/main/examples/boot/bootloader/rp) from which this code was copied. +- The original licenses are included in this folder. diff --git a/pico-w-bootloader/build.rs b/pico-w-bootloader/build.rs new file mode 100644 index 0000000..c201704 --- /dev/null +++ b/pico-w-bootloader/build.rs @@ -0,0 +1,28 @@ +use std::env; +use std::fs::File; +use std::io::Write; +use std::path::PathBuf; + +fn main() { + // Put `memory.x` in our output directory and ensure it's + // on the linker search path. + let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); + File::create(out.join("memory.x")) + .unwrap() + .write_all(include_bytes!("memory.x")) + .unwrap(); + println!("cargo:rustc-link-search={}", out.display()); + + // By default, Cargo will re-run a build script whenever + // any file in the project changes. By specifying `memory.x` + // here, we ensure the build script is only re-run when + // `memory.x` is changed. + println!("cargo:rerun-if-changed=memory.x"); + + println!("cargo:rustc-link-arg-bins=--nmagic"); + println!("cargo:rustc-link-arg-bins=-Tlink.x"); + println!("cargo:rustc-link-arg-bins=-Tlink-rp.x"); + if env::var("CARGO_FEATURE_DEFMT").is_ok() { + println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); + } +} diff --git a/pico-w-bootloader/main.rs b/pico-w-bootloader/main.rs new file mode 100644 index 0000000..a329728 --- /dev/null +++ b/pico-w-bootloader/main.rs @@ -0,0 +1,54 @@ +#![no_std] +#![no_main] + +use core::cell::RefCell; + +use cortex_m_rt::{entry, exception}; +#[cfg(feature = "defmt")] +use defmt_rtt as _; +use embassy_boot_rp::*; +use embassy_sync::blocking_mutex::Mutex; +use embassy_time::Duration; + +const FLASH_SIZE: usize = 2 * 1024 * 1024; + +#[entry] +fn main() -> ! { + let p = embassy_rp::init(Default::default()); + + // Uncomment this if you are debugging the bootloader with debugger/RTT attached, + // as it prevents a hard fault when accessing flash 'too early' after boot. + + for i in 0..10000000 { + cortex_m::asm::nop(); + } + + + let flash = WatchdogFlash::::start(p.FLASH, p.WATCHDOG, Duration::from_secs(8)); + let flash = Mutex::new(RefCell::new(flash)); + + let config = BootLoaderConfig::from_linkerfile_blocking(&flash, &flash, &flash); + let active_offset = config.active.offset(); + let bl: BootLoader = BootLoader::prepare(config); + + unsafe { bl.load(embassy_rp::flash::FLASH_BASE as u32 + active_offset) } +} + +#[no_mangle] +#[cfg_attr(target_os = "none", link_section = ".HardFault.user")] +unsafe extern "C" fn HardFault() { + cortex_m::peripheral::SCB::sys_reset(); +} + +#[exception] +unsafe fn DefaultHandler(_: i16) -> ! { + const SCB_ICSR: *const u32 = 0xE000_ED04 as *const u32; + let irqn = core::ptr::read_volatile(SCB_ICSR) as u8 as i16 - 16; + + panic!("DefaultHandler #{:?}", irqn); +} + +#[panic_handler] +fn panic(_info: &core::panic::PanicInfo) -> ! { + cortex_m::asm::udf(); +} diff --git a/pico-w-bootloader/memory.x b/pico-w-bootloader/memory.x new file mode 100644 index 0000000..c3b5497 --- /dev/null +++ b/pico-w-bootloader/memory.x @@ -0,0 +1,31 @@ +MEMORY +{ + /* NOTE 1 K = 1 KiBi = 1024 bytes */ + BOOT2 : ORIGIN = 0x10000000, LENGTH = 0x100 + FLASH : ORIGIN = 0x10000100, LENGTH = 24K + BOOTLOADER_STATE : ORIGIN = 0x10006000, LENGTH = 4K + ACTIVE : ORIGIN = 0x10007000, LENGTH = 512K + DFU : ORIGIN = 0x10087000, LENGTH = 516K + + /* Pick one of the two options for RAM layout */ + + /* OPTION A: Use all RAM banks as one big block */ + /* Reasonable, unless you are doing something */ + /* really particular with DMA or other concurrent */ + /* access that would benefit from striping */ + RAM : ORIGIN = 0x20000000, LENGTH = 264K + + /* OPTION B: Keep the unstriped sections separate */ + /* RAM: ORIGIN = 0x20000000, LENGTH = 256K */ + /* SCRATCH_A: ORIGIN = 0x20040000, LENGTH = 4K */ + /* SCRATCH_B: ORIGIN = 0x20041000, LENGTH = 4K */ +} + +__bootloader_state_start = ORIGIN(BOOTLOADER_STATE) - ORIGIN(BOOT2); +__bootloader_state_end = ORIGIN(BOOTLOADER_STATE) + LENGTH(BOOTLOADER_STATE) - ORIGIN(BOOT2); + +__bootloader_active_start = ORIGIN(ACTIVE) - ORIGIN(BOOT2); +__bootloader_active_end = ORIGIN(ACTIVE) + LENGTH(ACTIVE) - ORIGIN(BOOT2); + +__bootloader_dfu_start = ORIGIN(DFU) - ORIGIN(BOOT2); +__bootloader_dfu_end = ORIGIN(DFU) + LENGTH(DFU) - ORIGIN(BOOT2); diff --git a/pico-w-bootloader/src/main.rs b/pico-w-bootloader/src/main.rs new file mode 100644 index 0000000..a329728 --- /dev/null +++ b/pico-w-bootloader/src/main.rs @@ -0,0 +1,54 @@ +#![no_std] +#![no_main] + +use core::cell::RefCell; + +use cortex_m_rt::{entry, exception}; +#[cfg(feature = "defmt")] +use defmt_rtt as _; +use embassy_boot_rp::*; +use embassy_sync::blocking_mutex::Mutex; +use embassy_time::Duration; + +const FLASH_SIZE: usize = 2 * 1024 * 1024; + +#[entry] +fn main() -> ! { + let p = embassy_rp::init(Default::default()); + + // Uncomment this if you are debugging the bootloader with debugger/RTT attached, + // as it prevents a hard fault when accessing flash 'too early' after boot. + + for i in 0..10000000 { + cortex_m::asm::nop(); + } + + + let flash = WatchdogFlash::::start(p.FLASH, p.WATCHDOG, Duration::from_secs(8)); + let flash = Mutex::new(RefCell::new(flash)); + + let config = BootLoaderConfig::from_linkerfile_blocking(&flash, &flash, &flash); + let active_offset = config.active.offset(); + let bl: BootLoader = BootLoader::prepare(config); + + unsafe { bl.load(embassy_rp::flash::FLASH_BASE as u32 + active_offset) } +} + +#[no_mangle] +#[cfg_attr(target_os = "none", link_section = ".HardFault.user")] +unsafe extern "C" fn HardFault() { + cortex_m::peripheral::SCB::sys_reset(); +} + +#[exception] +unsafe fn DefaultHandler(_: i16) -> ! { + const SCB_ICSR: *const u32 = 0xE000_ED04 as *const u32; + let irqn = core::ptr::read_volatile(SCB_ICSR) as u8 as i16 - 16; + + panic!("DefaultHandler #{:?}", irqn); +} + +#[panic_handler] +fn panic(_info: &core::panic::PanicInfo) -> ! { + cortex_m::asm::udf(); +} diff --git a/populate-rekor.sh b/populate-rekor.sh new file mode 100755 index 0000000..6e2918f --- /dev/null +++ b/populate-rekor.sh @@ -0,0 +1,219 @@ +#"" +# Apache License +# Version 2.0, January 2004 +# http://www.apache.org/licenses/ +# +# TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +# +# 1. Definitions. +# +# "License" shall mean the terms and conditions for use, reproduction, +# and distribution as defined by Sections 1 through 9 of this document. +# +# "Licensor" shall mean the copyright owner or entity authorized by +# the copyright owner that is granting the License. +# +# "Legal Entity" shall mean the union of the acting entity and all +# other entities that control, are controlled by, or are under common +# control with that entity. For the purposes of this definition, +# "control" means (i) the power, direct or indirect, to cause the +# direction or management of such entity, whether by contract or +# otherwise, or (ii) ownership of fifty percent (50%) or more of the +# outstanding shares, or (iii) beneficial ownership of such entity. +# +# "You" (or "Your") shall mean an individual or Legal Entity +# exercising permissions granted by this License. +# +# "Source" form shall mean the preferred form for making modifications, +# including but not limited to software source code, documentation +# source, and configuration files. +# +# "Object" form shall mean any form resulting from mechanical +# transformation or translation of a Source form, including but +# not limited to compiled object code, generated documentation, +# and conversions to other media types. +# +# "Work" shall mean the work of authorship, whether in Source or +# Object form, made available under the License, as indicated by a +# copyright notice that is included in or attached to the work +# (an example is provided in the Appendix below). +# +# "Derivative Works" shall mean any work, whether in Source or Object +# form, that is based on (or derived from) the Work and for which the +# editorial revisions, annotations, elaborations, or other modifications +# represent, as a whole, an original work of authorship. For the purposes +# of this License, Derivative Works shall not include works that remain +# separable from, or merely link (or bind by name) to the interfaces of, +# the Work and Derivative Works thereof. +# +# "Contribution" shall mean any work of authorship, including +# the original version of the Work and any modifications or additions +# to that Work or Derivative Works thereof, that is intentionally +# submitted to Licensor for inclusion in the Work by the copyright owner +# or by an individual or Legal Entity authorized to submit on behalf of +# the copyright owner. For the purposes of this definition, "submitted" +# means any form of electronic, verbal, or written communication sent +# to the Licensor or its representatives, including but not limited to +# communication on electronic mailing lists, source code control systems, +# and issue tracking systems that are managed by, or on behalf of, the +# Licensor for the purpose of discussing and improving the Work, but +# excluding communication that is conspicuously marked or otherwise +# designated in writing by the copyright owner as "Not a Contribution." +# +# "Contributor" shall mean Licensor and any individual or Legal Entity +# on behalf of whom a Contribution has been received by Licensor and +# subsequently incorporated within the Work. +# +# 2. Grant of Copyright License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# copyright license to reproduce, prepare Derivative Works of, +# publicly display, publicly perform, sublicense, and distribute the +# Work and such Derivative Works in Source or Object form. +# +# 3. Grant of Patent License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# (except as stated in this section) patent license to make, have made, +# use, offer to sell, sell, import, and otherwise transfer the Work, +# where such license applies only to those patent claims licensable +# by such Contributor that are necessarily infringed by their +# Contribution(s) alone or by combination of their Contribution(s) +# with the Work to which such Contribution(s) was submitted. If You +# institute patent litigation against any entity (including a +# cross-claim or counterclaim in a lawsuit) alleging that the Work +# or a Contribution incorporated within the Work constitutes direct +# or contributory patent infringement, then any patent licenses +# granted to You under this License for that Work shall terminate +# as of the date such litigation is filed. +# +# 4. Redistribution. You may reproduce and distribute copies of the +# Work or Derivative Works thereof in any medium, with or without +# modifications, and in Source or Object form, provided that You +# meet the following conditions: +# +# (a) You must give any other recipients of the Work or +# Derivative Works a copy of this License; and +# +# (b) You must cause any modified files to carry prominent notices +# stating that You changed the files; and +# +# (c) You must retain, in the Source form of any Derivative Works +# that You distribute, all copyright, patent, trademark, and +# attribution notices from the Source form of the Work, +# excluding those notices that do not pertain to any part of +# the Derivative Works; and +# +# (d) If the Work includes a "NOTICE" text file as part of its +# distribution, then any Derivative Works that You distribute must +# include a readable copy of the attribution notices contained +# within such NOTICE file, excluding those notices that do not +# pertain to any part of the Derivative Works, in at least one +# of the following places: within a NOTICE text file distributed +# as part of the Derivative Works; within the Source form or +# documentation, if provided along with the Derivative Works; or, +# within a display generated by the Derivative Works, if and +# wherever such third-party notices normally appear. The contents +# of the NOTICE file are for informational purposes only and +# do not modify the License. You may add Your own attribution +# notices within Derivative Works that You distribute, alongside +# or as an addendum to the NOTICE text from the Work, provided +# that such additional attribution notices cannot be construed +# as modifying the License. +# +# You may add Your own copyright statement to Your modifications and +# may provide additional or different license terms and conditions +# for use, reproduction, or distribution of Your modifications, or +# for any such Derivative Works as a whole, provided Your use, +# reproduction, and distribution of the Work otherwise complies with +# the conditions stated in this License. +# +# 5. Submission of Contributions. Unless You explicitly state otherwise, +# any Contribution intentionally submitted for inclusion in the Work +# by You to the Licensor shall be under the terms and conditions of +# this License, without any additional terms or conditions. +# Notwithstanding the above, nothing herein shall supersede or modify +# the terms of any separate license agreement you may have executed +# with Licensor regarding such Contributions. +# +# 6. Trademarks. This License does not grant permission to use the trade +# names, trademarks, service marks, or product names of the Licensor, +# except as required for reasonable and customary use in describing the +# origin of the Work and reproducing the content of the NOTICE file. +# +# 7. Disclaimer of Warranty. Unless required by applicable law or +# agreed to in writing, Licensor provides the Work (and each +# Contributor provides its Contributions) on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied, including, without limitation, any warranties or conditions +# of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +# PARTICULAR PURPOSE. You are solely responsible for determining the +# appropriateness of using or redistributing the Work and assume any +# risks associated with Your exercise of permissions under this License. +# +# 8. Limitation of Liability. In no event and under no legal theory, +# whether in tort (including negligence), contract, or otherwise, +# unless required by applicable law (such as deliberate and grossly +# negligent acts) or agreed to in writing, shall any Contributor be +# liable to You for damages, including any direct, indirect, special, +# incidental, or consequential damages of any character arising as a +# result of this License or out of the use or inability to use the +# Work (including but not limited to damages for loss of goodwill, +# work stoppage, computer failure or malfunction, or any and all +# other commercial damages or losses), even if such Contributor +# has been advised of the possibility of such damages. +# +# 9. Accepting Warranty or Additional Liability. While redistributing +# the Work or Derivative Works thereof, You may choose to offer, +# and charge a fee for, acceptance of support, warranty, indemnity, +# or other liability obligations and/or rights consistent with this +# License. However, in accepting such obligations, You may act only +# on Your own behalf and on Your sole responsibility, not on behalf +# of any other Contributor, and only if You agree to indemnify, +# defend, and hold each Contributor harmless for any liability +# incurred by, or claims asserted against, such Contributor by reason +# of your accepting any such warranty or additional liability. +# +# END OF TERMS AND CONDITIONS +# +# APPENDIX: How to apply the Apache License to your work. +# +# To apply the Apache License to your work, attach the following +# boilerplate notice, with the fields enclosed by brackets "[]" +# replaced with your own identifying information. (Don't include +# the brackets!) The text should be enclosed in the appropriate +# comment syntax for the file format. We also recommend that a +# file or class name and description of purpose be included on the +# same "printed page" as the copyright notice for easier +# identification within third-party archives. +# +# Copyright 2024 Fraunhofer AISEC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#!/usr/bin/env sh +REKOR_URL=$1 +echo "Using rekor url: $REKOR_URL" +tree_size="$(curl "$REKOR_URL"/api/v1/log/ | jq '.treeSize')" +echo "Current tree size: $tree_size" +if [ "$tree_size" -eq "0" ]; then + echo "Tree is empty, populating ..." + echo "Hello Rekor!" > hello-rekor.txt + # create key pair, sign and publish to rekor + printf 'sigstore\nsigstore\n' | cosign generate-key-pair | exit 1 + printf 'sigstore\nsigstore\n' | COSIGN_EXPERIMENTAL=1 cosign sign-blob --rekor-url="$REKOR_URL" --key=cosign.key --yes hello-rekor.txt | exit 1 + echo "Tree is now populated!" +else + echo "Tree is already populated!" +fi + diff --git a/process-benchmark-data.py b/process-benchmark-data.py new file mode 100644 index 0000000..b5a38e4 --- /dev/null +++ b/process-benchmark-data.py @@ -0,0 +1,86 @@ +import matplotlib.pyplot as plt +import json + +crypto_libs = [ + "p256", + "sha2", + "pem_rfc7468", + "spki", + "pkcs8", + "der", + "der?", + "x509_cert", + "serde_json", + "const_oid", + "ecdsa", + "base64ct", + "sec1", + "crypto_bigint", + "heapless", + "smoltcp", + "embassy_net", + "fixed", + "hash32", +] + +def process_size_benchmarks(data_path:str): + plt.style.use("Solarize_Light2") + print("processing size benchmarks") + with open(data_path) as f: + raw_data = json.load(f) + + fig, ax = plt.subplots() + + file_size_data = [(name, data["raw_size"]/(1024**1)) for (name,data) in raw_data.items()] + file_text_section = [(name, data["cargo_bloat_crates"]["text-section-size"]/(1024**1)) for (name,data) in raw_data.items()] + tuf_no_std_size = [] + bt2x_size = [] + libs_size = [] + for (name, data) in raw_data.items(): + crates = data["cargo_bloat_crates"]["crates"] + size_tuf_no_std = sum(c["size"] for c in crates if c["name"].startswith("tuf_no_std")) / (1024**1) + size_bt2x = sum(c["size"] for c in crates if c["name"].startswith("bt2x")) / (1024**1) + size_libs = sum(c["size"] for c in crates if any(c["name"].startswith(l) for l in crypto_libs)) / (1024**1) + libs_size.append((name, size_libs, size_libs)) + bt2x_size.append((name, size_bt2x + size_libs, size_bt2x)) + tuf_no_std_size.append((name, size_tuf_no_std + size_bt2x + size_libs, size_tuf_no_std)) + + tuf_no_std_size = list(zip(*tuf_no_std_size)) + bt2x_size = list(zip(*bt2x_size)) + libs_size = list(zip(*libs_size)) + + ax.set_ylabel("size in KiB (1024B)") + ax.bar(*zip(*file_size_data),align="edge", label="Entire Binary", width=0.8) + ax.bar(*zip(*file_text_section),align="edge", label=".text section", width=0.75, hatch="o") + ax.bar(tuf_no_std_size[0], tuf_no_std_size[1], align="edge", label="TUF", width=0.7, hatch="+") + ax.bar(bt2x_size[0], bt2x_size[1],align="edge", label="BT²X", width=0.7, hatch="//") + ax.bar(libs_size[0], libs_size[1],align="edge", label="Libs", width=0.7, hatch="\\\\") + ax.legend(loc="upper right") + + table_data = { + "Entire Binary": [f"{v:.2f} KiB" for (_, v) in file_size_data], + ".text section": [f"{v:.2f} KiB" for (_, v) in file_text_section], + "TUF": [f"{v:.2f} KiB" for v in tuf_no_std_size[2]], + "BT²X": [f"{v:.2f} KiB" for v in bt2x_size[2]], + "Libs": [f"{v:.2f} KiB" for v in libs_size[2]], + } + + table = plt.table( + colWidths=[0.25, 0.25, 0.25, 0.25], + cellText=list(table_data.values()), + rowLabels=list(table_data.keys()), + colLabels=list(raw_data.keys()), + ) + table.auto_set_font_size(False) + table.set_fontsize(8) + plt.subplots_adjust(left=0.2, bottom=0.2) + plt.xticks([]) + plt.show() + + +def process_benchmarks(): + process_size_benchmarks("benchmark-output/benchmarks-size.json") + +if __name__ == "__main__": + print("processing benchmarks") + process_benchmarks() \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..78eb172 --- /dev/null +++ b/readme.md @@ -0,0 +1,145 @@ +# BT²X + +Multi-Leveled Binary Transparency to Protect the Software Supply Chain of Operational Technology. + +**The code in this repository is experimental and not to be used in production.** + +**This project is not maintained. It has been published as part of the scientific paper specified in the next section.** + +## BibTeX Citation + +If you use BT²X in a scientific publication, we would appreciate using the following citation: + +``` +@inproceedings{10.1145/3690134.3694816, +author = {Heinl, Michael P. and Embacher, Victor}, +title = {BT²X: Multi-Leveled Binary Transparency to Protect the Software Supply Chain of Operational Technology}, +year = {2024}, +publisher = {Association for Computing Machinery}, +address = {New York, NY, USA}, +url = {https://doi.org/10.1145/3690134.3694816}, +doi = {10.1145/3690134.3694816}, +booktitle = {Proceedings of the Sixth Workshop on CPS&IoT Security and Privacy (CPSIoTSec’24)}, +keywords = {digital certificates, X.509, ASN.1, parsing, TLS libraries, conformity testing}, +location = {Salt Lake City, UT, USA}, +series = {CPSIoTSec’24} +} + +``` + +## License + +This project is distributed under the Apache-2.0 License, see [LICENSE.txt](LICENSE.txt) for details. + +## Project Structure + +This repository contains a lot of code, however, it is separated into modules at a best-effort basis to improve understandability. **This readme aims to provide a high-level entry point to the project, the subdirectories and libraries have their own documentation as well.** + +We have the following major components: +- The `bt2x` directory contains most of the modules related to the binary transparency functionality. +- The `tuf-no-std` directory contains a `no-std` Rust implementation of [TUF](https://theupdateframework.io/) based on the [DER format](https://en.wikipedia.org/wiki/X.690#DER_encoding). +- The `bt2x-pi-pico-w` directory contains the code for a dummy application with an OTA updater as well as the binaries that were used for benchmarking. +- The `bt2x-embassy-std` directory contains code that can be used to run the embedded code (which mostly depends on [embassy](https://embassy.dev/) and other embedded libraries) on a regular host. +- The `benchmarking` directory contains the code to analyze the benchmark data as well as the code to gather/process the data. +- The `configs` directory contains configuration files that are used for the docker setup and also serve as an example on how to configure the applications. + +## Documentation + +This README is not the only place of documentation. +Some of the subdirectories have their own READMEs. +Additionally, there is additional documentation added to the Rust code via `rustdoc`, +which you can build and browse by running the following shell script. + +```sh +./build-docs.sh +``` + +## General Operation + +The following figure shows how the architecture roughly works. + +![General Operation](images/general-operation.svg) + +## Docker Setup + +The docker setup includes the Sigstore components as well as the BT²X components. +There is some redundancy in the components, as both Rekor and the CT log are implemented as Trillian *personalities*. Trillian itself is run as two containers and an SQL server. + +Additionally, in our example, the OIDC provider `dex-idp` is reliant on an external ID provider (e.g., the GitHub OAuth 2.0 provider). + +The following figure shows which containers belong to what system. + +![Docker Setup](images/docker-setup.svg) + + +## Getting Started + +### Development Setup + +This following figure shows how different hardware components interact with each other/how they are "wired", and how binaries flow through the system. + +![Development Setup](images/development-setup.svg) + +### Dependencies + +- Install the Rust toolchain via [rustup](https://rustup.rs/). +- Make sure you have OpenSSL installed. +- [This guide](https://reltech.substack.com/p/getting-started-with-rust-on-a-raspberry) is helpful to set up the dependencies for the Pico W development setup. + +### Initial Setup + +1. Run the `setup.sh` script to generate the keys and TUF repo. This might take a while in cases where everything needs to be compiled. +2. [Create a GitHub OAuth app](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) with the URL `http://dex-idp/` and the authorization callback URL `http://dex-idp:8888/callback` +3. Create a `.env` file in the root directory with the following variables: +```env +MYSQL_ROOT_PASSWORD=zaphod +MYSQL_USER=test +MYSQL_PASSWORD=zaphod +KEYCLOAK_ADMIN_PASSWORD=admin +GITHUB_CLIENT_ID= +GITHUB_CLIENT_SECRET= +PRIV_KEY_PASSWORD=sigstore +``` +4. You need to modify `configs/bt2x-server/config.yaml` and add the correct e-Mail address + +### Starting the Infrastructure + +Start the infrastructure with the following command. **Note:** this starts a relatively large number of docker contains and requires some resources. Also building the containers can take a while. + +```sh +docker compose -f=docker-compose.sigstore.yml -f=docker-compose.bt2x.yml up -d +``` + +You can remove the containers with the following command: + +```sh +docker compose -f=docker-compose.sigstore.yml -f=docker-compose.bt2x.yml down +``` + +### Uploading a Signed Binary to the Infrastructure + +1. In the `bt2x` directory, run the command to build the CLI binary: +```sh +cargo build --release --bin=bt2x-cli +``` +2. In the `bt2x-pi-pico-w` directory, run the following command: + ```sh +../bt2x/target/release/bt2x-cli --tag=localhost:1338/bt2x/pi-pico:bin --http --rekor-url=http://localhost:3000 --rekor-public-key=../sigstore/rekor/rekor_key.pem --fulcio-url=http://localhost:5555 --fulcio-public-key=../sigstore/configs/fulcio/config/fulcio.pem --bin=blinky --target=thumbv6m-none-eabi --log-level=debug --ct-log-public-key=../configs/sigstore/fulcio/ctfe-init/config/pubkey.pem --oidc-issuer=http://dex-idp:8888/ +``` + +### Building/Flashing the Pico W Binaries + + +## Troubleshooting + +### Something is complaining about Rekor have a log index of 0 + +Cause: this can happen if the log is empty or you are trying to run operations on an item with the log index of 0. + +Fix it by running: +- `docker compose -f=docker-compose.sigstore.yml -f=docker-compose.bt4ot.yml up populate-rekor -d` +- or by running the publishing CLI tool again. + +## "Error entering certificate in CTL" + +You might get this error when using the CLI tool. You can fix it by removing the `ctfe-config` docker volume and restarting the setup. diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..ffcd0ab --- /dev/null +++ b/setup.sh @@ -0,0 +1,222 @@ +#"" +# Apache License +# Version 2.0, January 2004 +# http://www.apache.org/licenses/ +# +# TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +# +# 1. Definitions. +# +# "License" shall mean the terms and conditions for use, reproduction, +# and distribution as defined by Sections 1 through 9 of this document. +# +# "Licensor" shall mean the copyright owner or entity authorized by +# the copyright owner that is granting the License. +# +# "Legal Entity" shall mean the union of the acting entity and all +# other entities that control, are controlled by, or are under common +# control with that entity. For the purposes of this definition, +# "control" means (i) the power, direct or indirect, to cause the +# direction or management of such entity, whether by contract or +# otherwise, or (ii) ownership of fifty percent (50%) or more of the +# outstanding shares, or (iii) beneficial ownership of such entity. +# +# "You" (or "Your") shall mean an individual or Legal Entity +# exercising permissions granted by this License. +# +# "Source" form shall mean the preferred form for making modifications, +# including but not limited to software source code, documentation +# source, and configuration files. +# +# "Object" form shall mean any form resulting from mechanical +# transformation or translation of a Source form, including but +# not limited to compiled object code, generated documentation, +# and conversions to other media types. +# +# "Work" shall mean the work of authorship, whether in Source or +# Object form, made available under the License, as indicated by a +# copyright notice that is included in or attached to the work +# (an example is provided in the Appendix below). +# +# "Derivative Works" shall mean any work, whether in Source or Object +# form, that is based on (or derived from) the Work and for which the +# editorial revisions, annotations, elaborations, or other modifications +# represent, as a whole, an original work of authorship. For the purposes +# of this License, Derivative Works shall not include works that remain +# separable from, or merely link (or bind by name) to the interfaces of, +# the Work and Derivative Works thereof. +# +# "Contribution" shall mean any work of authorship, including +# the original version of the Work and any modifications or additions +# to that Work or Derivative Works thereof, that is intentionally +# submitted to Licensor for inclusion in the Work by the copyright owner +# or by an individual or Legal Entity authorized to submit on behalf of +# the copyright owner. For the purposes of this definition, "submitted" +# means any form of electronic, verbal, or written communication sent +# to the Licensor or its representatives, including but not limited to +# communication on electronic mailing lists, source code control systems, +# and issue tracking systems that are managed by, or on behalf of, the +# Licensor for the purpose of discussing and improving the Work, but +# excluding communication that is conspicuously marked or otherwise +# designated in writing by the copyright owner as "Not a Contribution." +# +# "Contributor" shall mean Licensor and any individual or Legal Entity +# on behalf of whom a Contribution has been received by Licensor and +# subsequently incorporated within the Work. +# +# 2. Grant of Copyright License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# copyright license to reproduce, prepare Derivative Works of, +# publicly display, publicly perform, sublicense, and distribute the +# Work and such Derivative Works in Source or Object form. +# +# 3. Grant of Patent License. Subject to the terms and conditions of +# this License, each Contributor hereby grants to You a perpetual, +# worldwide, non-exclusive, no-charge, royalty-free, irrevocable +# (except as stated in this section) patent license to make, have made, +# use, offer to sell, sell, import, and otherwise transfer the Work, +# where such license applies only to those patent claims licensable +# by such Contributor that are necessarily infringed by their +# Contribution(s) alone or by combination of their Contribution(s) +# with the Work to which such Contribution(s) was submitted. If You +# institute patent litigation against any entity (including a +# cross-claim or counterclaim in a lawsuit) alleging that the Work +# or a Contribution incorporated within the Work constitutes direct +# or contributory patent infringement, then any patent licenses +# granted to You under this License for that Work shall terminate +# as of the date such litigation is filed. +# +# 4. Redistribution. You may reproduce and distribute copies of the +# Work or Derivative Works thereof in any medium, with or without +# modifications, and in Source or Object form, provided that You +# meet the following conditions: +# +# (a) You must give any other recipients of the Work or +# Derivative Works a copy of this License; and +# +# (b) You must cause any modified files to carry prominent notices +# stating that You changed the files; and +# +# (c) You must retain, in the Source form of any Derivative Works +# that You distribute, all copyright, patent, trademark, and +# attribution notices from the Source form of the Work, +# excluding those notices that do not pertain to any part of +# the Derivative Works; and +# +# (d) If the Work includes a "NOTICE" text file as part of its +# distribution, then any Derivative Works that You distribute must +# include a readable copy of the attribution notices contained +# within such NOTICE file, excluding those notices that do not +# pertain to any part of the Derivative Works, in at least one +# of the following places: within a NOTICE text file distributed +# as part of the Derivative Works; within the Source form or +# documentation, if provided along with the Derivative Works; or, +# within a display generated by the Derivative Works, if and +# wherever such third-party notices normally appear. The contents +# of the NOTICE file are for informational purposes only and +# do not modify the License. You may add Your own attribution +# notices within Derivative Works that You distribute, alongside +# or as an addendum to the NOTICE text from the Work, provided +# that such additional attribution notices cannot be construed +# as modifying the License. +# +# You may add Your own copyright statement to Your modifications and +# may provide additional or different license terms and conditions +# for use, reproduction, or distribution of Your modifications, or +# for any such Derivative Works as a whole, provided Your use, +# reproduction, and distribution of the Work otherwise complies with +# the conditions stated in this License. +# +# 5. Submission of Contributions. Unless You explicitly state otherwise, +# any Contribution intentionally submitted for inclusion in the Work +# by You to the Licensor shall be under the terms and conditions of +# this License, without any additional terms or conditions. +# Notwithstanding the above, nothing herein shall supersede or modify +# the terms of any separate license agreement you may have executed +# with Licensor regarding such Contributions. +# +# 6. Trademarks. This License does not grant permission to use the trade +# names, trademarks, service marks, or product names of the Licensor, +# except as required for reasonable and customary use in describing the +# origin of the Work and reproducing the content of the NOTICE file. +# +# 7. Disclaimer of Warranty. Unless required by applicable law or +# agreed to in writing, Licensor provides the Work (and each +# Contributor provides its Contributions) on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied, including, without limitation, any warranties or conditions +# of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +# PARTICULAR PURPOSE. You are solely responsible for determining the +# appropriateness of using or redistributing the Work and assume any +# risks associated with Your exercise of permissions under this License. +# +# 8. Limitation of Liability. In no event and under no legal theory, +# whether in tort (including negligence), contract, or otherwise, +# unless required by applicable law (such as deliberate and grossly +# negligent acts) or agreed to in writing, shall any Contributor be +# liable to You for damages, including any direct, indirect, special, +# incidental, or consequential damages of any character arising as a +# result of this License or out of the use or inability to use the +# Work (including but not limited to damages for loss of goodwill, +# work stoppage, computer failure or malfunction, or any and all +# other commercial damages or losses), even if such Contributor +# has been advised of the possibility of such damages. +# +# 9. Accepting Warranty or Additional Liability. While redistributing +# the Work or Derivative Works thereof, You may choose to offer, +# and charge a fee for, acceptance of support, warranty, indemnity, +# or other liability obligations and/or rights consistent with this +# License. However, in accepting such obligations, You may act only +# on Your own behalf and on Your sole responsibility, not on behalf +# of any other Contributor, and only if You agree to indemnify, +# defend, and hold each Contributor harmless for any liability +# incurred by, or claims asserted against, such Contributor by reason +# of your accepting any such warranty or additional liability. +# +# END OF TERMS AND CONDITIONS +# +# APPENDIX: How to apply the Apache License to your work. +# +# To apply the Apache License to your work, attach the following +# boilerplate notice, with the fields enclosed by brackets "[]" +# replaced with your own identifying information. (Don't include +# the brackets!) The text should be enclosed in the appropriate +# comment syntax for the file format. We also recommend that a +# file or class name and description of purpose be included on the +# same "printed page" as the copyright notice for easier +# identification within third-party archives. +# +# Copyright 2024 Fraunhofer AISEC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +echo "creating rekor key ..." +cd configs/sigstore/rekor || exit +./key-gen.sh +echo "complete" +cd - || exit + +echo "creating fulcio cert ..." +cd configs/sigstore/fulcio/config || exit +./cert-gen.sh +echo "complete" +cd - || exit + +echo "compiling tuf-no-std" +cd tuf-no-std || exit +cargo build --release +echo "creating creating TUF keys and metadata in './build' ..." +cd - || exit +tuf-no-std/target/release/tuf-no-std-cli configs/tuf/tuf-cli-config.yaml +echo "complete" \ No newline at end of file diff --git a/tuf-no-std/.dockerignore b/tuf-no-std/.dockerignore new file mode 100644 index 0000000..66a6354 --- /dev/null +++ b/tuf-no-std/.dockerignore @@ -0,0 +1,16 @@ +### Rust template +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + diff --git a/tuf-no-std/.gitignore b/tuf-no-std/.gitignore new file mode 100755 index 0000000..bf17ce4 --- /dev/null +++ b/tuf-no-std/.gitignore @@ -0,0 +1,8 @@ +/target +/Cargo.lock +/out/targets/ctlog.pub +/out/targets/rekor.pub +/out/1.root.der +/out/1.snapshot.der +/out/1.targets.der +/out/1.timestamp.der diff --git a/tuf-no-std/Cargo.toml b/tuf-no-std/Cargo.toml new file mode 100644 index 0000000..4d7f57b --- /dev/null +++ b/tuf-no-std/Cargo.toml @@ -0,0 +1,42 @@ +[workspace] +members = [ + "tuf-no-std-common", + "tuf-no-std-der", + "tuf-no-std", + "tuf-no-std-cli", +] +resolver = "2" + +[workspace.dependencies] +anyhow = { version = "1.0.75", default-features = false } +async-trait = "0.1" +clap = "4.5" +const-oid = { version = "0.9.5", default-features = false } +der = { version = "0.7.8", default-features = false } +ed25519 = { version = "2.2", default-features = false } +ed25519-dalek = { version = "2.0", default-features = false } +either = { version = "1.8", default-features = false } +hash32 = "0.3.1" +heapless = "0.8.0" +hex = { version = "0.4.3", default-features = false } +hex-literal = "0.4" +olpc-cjson = "0.1" +# oqs = { version = "0.9.0", default-features = false } +p256 = { version = "0.13", default-features = false } +pem = "3.0.4" +pem-rfc7468 = { version = "0.7", default-features = false } +postcard = "1.0" +rand = "0.8.5" +rand_core = { version = "0.6.4", default-features = false } +ring = "0.17.8" +rsa = { version = "0.9", default-features = false } +serde = { version = "1.0", default-features = false } +serde-json-core = "0.5" +serde_json = { version = "1.0", default-features = false } +sha2 = { version = "0.10.7", default-features = false } +signature = { version = "2", default-features = false } +spki = { version = "0.7.2", default-features = false } +tokio = "1" +tough = "0.15.0" +untrusted = "0.9.0" +zeroize = { version = "1.6", default-features = false } diff --git a/tuf-no-std/LICENSE.txt b/tuf-no-std/LICENSE.txt new file mode 100644 index 0000000..4052ad4 --- /dev/null +++ b/tuf-no-std/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2024 Fraunhofer AISEC + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/tuf-no-std/README.md b/tuf-no-std/README.md new file mode 100644 index 0000000..fa3d6f8 --- /dev/null +++ b/tuf-no-std/README.md @@ -0,0 +1,21 @@ +# tuf-no-std + +- proof-of-concept `no-std` Rust implementation for TUF based on the DER format +- attempts to adhere to the TUF specification as far as possible +- possible that some aspects of the code fail to do so + +## Project Structure + +The project is divided into the following modules. +- `tuf-no-std`: most of the logic resides here, some of the code could be split into the other crates. +- `tuf-no-cli`: tool to create a TUF repo, not very flexible; also serves as an example on how to use the builders from the `tuf-no-std` crate. +- `tuf-no-common`: crate common functionalities such as error types, traits, constants, etc. that need to be available to other non-top level modules. +- `tuf-no-der`: TUF data structures for the DER format. + +## Building the Docs + +To view the documentation within the code (RustDocs) run the following command: + +```sh +cargo doc --open +``` diff --git a/tuf-no-std/deny.toml b/tuf-no-std/deny.toml new file mode 100644 index 0000000..46c1523 --- /dev/null +++ b/tuf-no-std/deny.toml @@ -0,0 +1,237 @@ +# This template contains all of the possible sections and their default values + +# Note that all fields that take a lint level have these possible values: +# * deny - An error will be produced and the check will fail +# * warn - A warning will be produced, but the check will not fail +# * allow - No warning or error will be produced, though in some cases a note +# will be + +# The values provided in this template are the default values that will be used +# when any section or field is not specified in your own configuration + +# Root options + +# The graph table configures how the dependency graph is constructed and thus +# which crates the checks are performed against +[graph] +# If 1 or more target triples (and optionally, target_features) are specified, +# only the specified targets will be checked when running `cargo deny check`. +# This means, if a particular package is only ever used as a target specific +# dependency, such as, for example, the `nix` crate only being used via the +# `target_family = "unix"` configuration, that only having windows targets in +# this list would mean the nix crate, as well as any of its exclusive +# dependencies not shared by any other crates, would be ignored, as the target +# list here is effectively saying which targets you are building for. +targets = [ + # The triple can be any string, but only the target triples built in to + # rustc (as of 1.40) can be checked against actual config expressions + #"x86_64-unknown-linux-musl", + # You can also specify which target_features you promise are enabled for a + # particular target. target_features are currently not validated against + # the actual valid features supported by the target architecture. + #{ triple = "wasm32-unknown-unknown", features = ["atomics"] }, +] +# When creating the dependency graph used as the source of truth when checks are +# executed, this field can be used to prune crates from the graph, removing them +# from the view of cargo-deny. This is an extremely heavy hammer, as if a crate +# is pruned from the graph, all of its dependencies will also be pruned unless +# they are connected to another crate in the graph that hasn't been pruned, +# so it should be used with care. The identifiers are [Package ID Specifications] +# (https://doc.rust-lang.org/cargo/reference/pkgid-spec.html) +#exclude = [] +# If true, metadata will be collected with `--all-features`. Note that this can't +# be toggled off if true, if you want to conditionally enable `--all-features` it +# is recommended to pass `--all-features` on the cmd line instead +all-features = false +# If true, metadata will be collected with `--no-default-features`. The same +# caveat with `all-features` applies +no-default-features = false +# If set, these feature will be enabled when collecting metadata. If `--features` +# is specified on the cmd line they will take precedence over this option. +#features = [] + +# The output table provides options for how/if diagnostics are outputted +[output] +# When outputting inclusion graphs in diagnostics that include features, this +# option can be used to specify the depth at which feature edges will be added. +# This option is included since the graphs can be quite large and the addition +# of features from the crate(s) to all of the graph roots can be far too verbose. +# This option can be overridden via `--feature-depth` on the cmd line +feature-depth = 1 + +# This section is considered when running `cargo deny check advisories` +# More documentation for the advisories section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html +[advisories] +# The path where the advisory databases are cloned/fetched into +#db-path = "$CARGO_HOME/advisory-dbs" +# The url(s) of the advisory databases to use +#db-urls = ["https://github.com/rustsec/advisory-db"] +# A list of advisory IDs to ignore. Note that ignored advisories will still +# output a note when they are encountered. +ignore = [ + #"RUSTSEC-0000-0000", + #{ id = "RUSTSEC-0000-0000", reason = "you can specify a reason the advisory is ignored" }, + #"a-crate-that-is-yanked@0.1.1", # you can also ignore yanked crate versions if you wish + #{ crate = "a-crate-that-is-yanked@0.1.1", reason = "you can specify why you are ignoring the yanked crate" }, +] +# If this is true, then cargo deny will use the git executable to fetch advisory database. +# If this is false, then it uses a built-in git library. +# Setting this to true can be helpful if you have special authentication requirements that cargo-deny does not support. +# See Git Authentication for more information about setting up git authentication. +#git-fetch-with-cli = true + +# This section is considered when running `cargo deny check licenses` +# More documentation for the licenses section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html +[licenses] +# List of explicitly allowed licenses +# See https://spdx.org/licenses/ for list of possible licenses +# [possible values: any SPDX 3.11 short identifier (+ optional exception)]. +allow = [ + "MIT", + "Apache-2.0", + "Apache-2.0 WITH LLVM-exception", + "Unicode-DFS-2016", + "BSD-3-Clause", +] +# The confidence threshold for detecting a license from license text. +# The higher the value, the more closely the license text must be to the +# canonical license text of a valid SPDX license file. +# [possible values: any between 0.0 and 1.0]. +confidence-threshold = 0.8 +# Allow 1 or more licenses on a per-crate basis, so that particular licenses +# aren't accepted for every possible crate as with the normal allow list +exceptions = [ + # Each entry is the crate and version constraint, and its specific allow + # list + #{ allow = ["Zlib"], crate = "adler32" }, +] + +# Some crates don't have (easily) machine readable licensing information, +# adding a clarification entry for it allows you to manually specify the +# licensing information +#[[licenses.clarify]] +# The package spec the clarification applies to +#crate = "ring" +# The SPDX expression for the license requirements of the crate +#expression = "MIT AND ISC AND OpenSSL" +# One or more files in the crate's source used as the "source of truth" for +# the license expression. If the contents match, the clarification will be used +# when running the license check, otherwise the clarification will be ignored +# and the crate will be checked normally, which may produce warnings or errors +# depending on the rest of your configuration +#license-files = [ +# Each entry is a crate relative path, and the (opaque) hash of its contents +#{ path = "LICENSE", hash = 0xbd0eed23 } +#] + +[licenses.private] +# If true, ignores workspace crates that aren't published, or are only +# published to private registries. +# To see how to mark a crate as unpublished (to the official registry), +# visit https://doc.rust-lang.org/cargo/reference/manifest.html#the-publish-field. +ignore = false +# One or more private registries that you might publish crates to, if a crate +# is only published to private registries, and ignore is true, the crate will +# not have its license(s) checked +registries = [ + #"https://sekretz.com/registry +] + +# This section is considered when running `cargo deny check bans`. +# More documentation about the 'bans' section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html +[bans] +# Lint level for when multiple versions of the same crate are detected +multiple-versions = "warn" +# Lint level for when a crate version requirement is `*` +wildcards = "allow" +# The graph highlighting used when creating dotgraphs for crates +# with multiple versions +# * lowest-version - The path to the lowest versioned duplicate is highlighted +# * simplest-path - The path to the version with the fewest edges is highlighted +# * all - Both lowest-version and simplest-path are used +highlight = "all" +# The default lint level for `default` features for crates that are members of +# the workspace that is being checked. This can be overridden by allowing/denying +# `default` on a crate-by-crate basis if desired. +workspace-default-features = "allow" +# The default lint level for `default` features for external crates that are not +# members of the workspace. This can be overridden by allowing/denying `default` +# on a crate-by-crate basis if desired. +external-default-features = "allow" +# List of crates that are allowed. Use with care! +allow = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason it is allowed" }, +] +# List of crates to deny +deny = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason it is banned" }, + # Wrapper crates can optionally be specified to allow the crate when it + # is a direct dependency of the otherwise banned crate + #{ crate = "ansi_term@0.11.0", wrappers = ["this-crate-directly-depends-on-ansi_term"] }, +] + +# List of features to allow/deny +# Each entry the name of a crate and a version range. If version is +# not specified, all versions will be matched. +#[[bans.features]] +#crate = "reqwest" +# Features to not allow +#deny = ["json"] +# Features to allow +#allow = [ +# "rustls", +# "__rustls", +# "__tls", +# "hyper-rustls", +# "rustls", +# "rustls-pemfile", +# "rustls-tls-webpki-roots", +# "tokio-rustls", +# "webpki-roots", +#] +# If true, the allowed features must exactly match the enabled feature set. If +# this is set there is no point setting `deny` +#exact = true + +# Certain crates/versions that will be skipped when doing duplicate detection. +skip = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason why it can't be updated/removed" }, +] +# Similarly to `skip` allows you to skip certain crates during duplicate +# detection. Unlike skip, it also includes the entire tree of transitive +# dependencies starting at the specified crate, up to a certain depth, which is +# by default infinite. +skip-tree = [ + #"ansi_term@0.11.0", # will be skipped along with _all_ of its direct and transitive dependencies + #{ crate = "ansi_term@0.11.0", depth = 20 }, +] + +# This section is considered when running `cargo deny check sources`. +# More documentation about the 'sources' section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html +[sources] +# Lint level for what to happen when a crate from a crate registry that is not +# in the allow list is encountered +unknown-registry = "warn" +# Lint level for what to happen when a crate from a git repository that is not +# in the allow list is encountered +unknown-git = "warn" +# List of URLs for allowed crate registries. Defaults to the crates.io index +# if not specified. If it is specified but empty, no registries are allowed. +allow-registry = ["https://github.com/rust-lang/crates.io-index"] +# List of URLs for allowed Git repositories +allow-git = [] + +[sources.allow-org] +# github.com organizations to allow git sources for +github = [] +# gitlab.com organizations to allow git sources for +gitlab = [] +# bitbucket.org organizations to allow git sources for +bitbucket = [] diff --git a/tuf-no-std/test-scenarios.md b/tuf-no-std/test-scenarios.md new file mode 100644 index 0000000..40296d3 --- /dev/null +++ b/tuf-no-std/test-scenarios.md @@ -0,0 +1,77 @@ +## Test Scenarios for Client Updates + +### Update Root Role + +- Refer to [the corresponding TUF specification section](https://theupdateframework.github.io/specification/v1.0.33/index.html#update-root). +- [ ] *"[T]he client MUST download intermediate root metadata files, until the latest available one is reached"* +- [x] *"Check for arbitrary Software Attack"* + - [x] *"Version N+1 of the root metadata file MUST have been signed by:*" + - [x] *"a THRESHOLD of keys specified in the trusted root metadata file (version N)"* + - [x] *"a THRESHOLD of keys specified in the new root metadata file being validated (version N+1)."* + - [x] *"When computing the THRESHOLD each KEY MUST only contribute one SIGNATURE."* + - [x] *"each SIGNATURE which is counted towards the THRESHOLD MUST have a unique KEYID"* + - [x] *"Even if a KEYID is listed more than once in the "signatures" list a client MUST NOT count more than one verified SIGNATURE from that KEYID towards the THRESHOLD."* +- [x] *"Check for a rollback attack. The version number of the new root metadata (version N+1) MUST be exactly the version in the trusted root metadata (version N) incremented by one, that is precisely N+1."* +- [x] *"Check for a freeze attack. The expiration timestamp in the trusted root metadata file MUST be higher than the fixed update start time. If the trusted root metadata file has expired, abort the update cycle, report the potential freeze attack."* +- [x] *"If the timestamp and / or snapshot keys have been rotated, then delete the trusted timestamp and snapshot metadata files."* +- [ ] *"Set whether consistent snapshots are used as per the trusted root metadata file"* + +### Update Timestamp Role + +- Refer to [the corresponding TUF specification section](https://theupdateframework.github.io/specification/v1.0.33/index.html#update-timestamp). +- [x] *"Check for arbitrary Software Attack"* + - [x] *"The new timestamp metadata file MUST have been signed by:*" + - [x] *"a THRESHOLD of keys specified in the trusted root metadata file (version N)"* + - [x] *"When computing the THRESHOLD each KEY MUST only contribute one SIGNATURE."* + - [x] *"each SIGNATURE which is counted towards the THRESHOLD MUST have a unique KEYID"* + - [x] *"Even if a KEYID is listed more than once in the "signatures" list a client MUST NOT count more than one verified SIGNATURE from that KEYID towards the THRESHOLD."* +- [x] *"Check for a rollback attack."* + - [x] *"The version number of the trusted timestamp metadata file, if any, MUST be less than the version number of the new timestamp metadata file."* + - [x] *"In case they are equal, discard the new timestamp metadata and abort the update cycle. This is normal and it shouldn’t raise any error."* + - [x] *"The version number of the snapshot metadata file in the trusted timestamp metadata file, if any, MUST be less than or equal to its version number in the new timestamp metadata file. If not, discard the new timestamp metadata file, abort the update cycle, and report the failure."* +- [x] *"Check for a freeze attack. The expiration timestamp in the new timestamp metadata file MUST be higher than the fixed update start time. If so, the new timestamp metadata file becomes the trusted timestamp metadata file. If the new timestamp metadata file has expired, discard it, abort the update cycle, and report the potential freeze attack."* + + +### Update Snapshot Role + + +- Refer to [the corresponding TUF specification section](https://theupdateframework.github.io/specification/v1.0.33/index.html#update-snapshot). +- [x] *"Check against timestamp role’s snapshot hash. The hashes of the new snapshot metadata file MUST match the hashes, if any, listed in the trusted timestamp metadata."* +- [x] *"Check for arbitrary Software Attack"* + - [x] *"The new snapshot metadata file MUST have been signed by:*" + - [x] *"a THRESHOLD of keys specified in the trusted root metadata file (version N)"* + - [x] *"When computing the THRESHOLD each KEY MUST only contribute one SIGNATURE."* + - [x] *"each SIGNATURE which is counted towards the THRESHOLD MUST have a unique KEYID"* + - [x] *"Even if a KEYID is listed more than once in the "signatures" list a client MUST NOT count more than one verified SIGNATURE from that KEYID towards the THRESHOLD."* +- [x] *"The version number of the new snapshot metadata file MUST match the version number listed in the trusted timestamp metadata."* +- [x] *"Check for a rollback attack."* + - [x] *"The version number of the targets metadata file, and all delegated targets metadata files, if any, in the trusted snapshot metadata file, if any, MUST be less than or equal to its version number in the new snapshot metadata file."* + - [x] *"[A]ny targets metadata filename that was listed in the trusted snapshot metadata file, if any, MUST continue to be listed in the new snapshot metadata file."* +- [x] *"Check for a freeze attack. The expiration timestamp in the new snapshot metadata file MUST be higher than the fixed update start time. If so, the new snapshot metadata file becomes the trusted snapshot metadata file."* + +### Update Targets Role + +- Refer to [the corresponding TUF specification section](https://theupdateframework.github.io/specification/v1.0.33/index.html#update-targets). + +- [x] *"Check against snapshot role’s targets hash. The hashes of the new targets metadata file MUST match the hashes, if any, listed in the trusted snapshot metadata."* +- [x] *"Check for arbitrary Software Attack"* + - [x] *"The new targets metadata file MUST have been signed by[:]*" + - [x] *"a THRESHOLD of keys specified in the trusted root metadata file (version N)"* + - [x] *"When computing the THRESHOLD each KEY MUST only contribute one SIGNATURE."* + - [x] *"each SIGNATURE which is counted towards the THRESHOLD MUST have a unique KEYID"* + - [x] *"Even if a KEYID is listed more than once in the "signatures" list a client MUST NOT count more than one verified SIGNATURE from that KEYID towards the THRESHOLD."* +- [x] *"Check against snapshot role’s targets version. The version number of the new targets metadata file MUST match the version number listed in the trusted snapshot metadata."* +- [x] *"Check for a freeze attack. The expiration timestamp in the new targets metadata file MUST be higher than the fixed update start time."* +- [ ] *"Perform a pre-order depth-first search for metadata about the desired target, beginning with the top-level targets role."* + - [ ] *"If this role has been visited before, then skip this role (so that cycles in the delegation graph are avoided). Otherwise, if an application-specific maximum number of roles have been visited, then go to step § 5.7 Fetch target (so that attackers cannot cause the client to waste excessive bandwidth or time). Otherwise, if this role contains metadata about the desired target, then go to step § 5.7 Fetch target."* + - [ ] *"Otherwise, recursively search the list of delegations in order of appearance."* + - [x] *"If the current delegation is a terminating delegation, then jump to step § 5.7 Fetch target."* + - [] *"Otherwise, if the current delegation is a non-terminating delegation, continue processing the next delegation, if any. Stop the search, and jump to step § 5.7 Fetch target as soon as a delegation returns a result."* + +### Fetch Target + +- Refer to [the corresponding TUF specification section](https://theupdateframework.github.io/specification/v1.0.33/index.html#fetch-target). +- [x] *"Verify the desired target against its targets metadata."* +- [x] *"download the target (up to the number of bytes specified in the targets metadata)"* +- [x] *"verify that its hashes match the targets metadata"* + diff --git a/tuf-no-std/tests/1.registry.npmjs.org.json b/tuf-no-std/tests/1.registry.npmjs.org.json new file mode 100644 index 0000000..49d5d5f --- /dev/null +++ b/tuf-no-std/tests/1.registry.npmjs.org.json @@ -0,0 +1,23 @@ +{ + "signed": { + "_type": "targets", + "spec_version": "1.0", + "version": 1, + "expires": "2023-10-04T13:26:23Z", + "targets": { + "registry.npmjs.org/keys.json": { + "length": 1017, + "hashes": { + "sha256": "7a8ec9678ad824cdccaa7a6dc0961caf8f8df61bc7274189122c123446248426", + "sha512": "881a853ee92d8cf513b07c164fea36b22a7305c256125bdfffdc5c65a4205c4c3fc2b5bcc98964349167ea68d40b8cd02551fcaa870a30d4601ba1caf6f63699" + } + } + } + }, + "signatures": [ + { + "keyid": "a89d235ee2f298d757438c7473b11b0b7b42ff1a45f1dfaac4c014183d6f8c45", + "sig": "304402201acf213d8e3dea0a5f0c1757e4409a02661bcfab3278419307994ead07c36cb4022029986ed2241c630c4e45bf97e043c23220df7612e3718f921fe8a99c7515ad30" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/1.root.json b/tuf-no-std/tests/1.root.json new file mode 100644 index 0000000..a0fea1b --- /dev/null +++ b/tuf-no-std/tests/1.root.json @@ -0,0 +1,130 @@ +{ + "signed": { + "_type": "root", + "consistent_snapshot": false, + "expires": "2021-12-18T13:28:12.99008-06:00", + "keys": { + "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04cbc5cab2684160323c25cd06c3307178a6b1d1c9b949328453ae473c5ba7527e35b13f298b41633382241f3fd8526c262d43b45adee5c618fa0642c82b8a9803" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "bdde902f5ec668179ff5ca0dabf7657109287d690bf97e230c21d65f99155c62": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04a71aacd835dc170ba6db3fa33a1a33dee751d4f8b0217b805b9bd3242921ee93672fdcfd840576c5bb0dc0ed815edf394c1ee48c2b5e02485e59bfc512f3adc7" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04117b33dd265715bf23315e368faa499728db8d1f0a377070a1c7b1aba2cc21be6ab1628e42f2cdd7a35479f2dce07b303a8ba646c55569a8d2a504ba7e86e447" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "f40f32044071a9365505da3d1e3be6561f6f22d0e60cf51df783999f6c3429cb": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04cc1cd53a61c23e88cc54b488dfae168a257c34fac3e88811c55962b24cffbfecb724447999c54670e365883716302e49da57c79a33cd3e16f81fbc66f0bcdf48" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "048a78a44ac01099890d787e5e62afc29c8ccb69a70ec6549a6b04033b0a8acbfb42ab1ab9c713d225cdb52b858886cf46c8e90a7f3b9e6371882f370c259e1c5b" + }, + "scheme": "ecdsa-sha2-nistp256" + } + }, + "roles": { + "root": { + "keyids": [ + "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97", + "bdde902f5ec668179ff5ca0dabf7657109287d690bf97e230c21d65f99155c62", + "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b", + "f40f32044071a9365505da3d1e3be6561f6f22d0e60cf51df783999f6c3429cb", + "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209" + ], + "threshold": 3 + }, + "snapshot": { + "keyids": [ + "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97", + "bdde902f5ec668179ff5ca0dabf7657109287d690bf97e230c21d65f99155c62", + "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b", + "f40f32044071a9365505da3d1e3be6561f6f22d0e60cf51df783999f6c3429cb", + "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209" + ], + "threshold": 3 + }, + "targets": { + "keyids": [ + "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97", + "bdde902f5ec668179ff5ca0dabf7657109287d690bf97e230c21d65f99155c62", + "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b", + "f40f32044071a9365505da3d1e3be6561f6f22d0e60cf51df783999f6c3429cb", + "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209" + ], + "threshold": 3 + }, + "timestamp": { + "keyids": [ + "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97", + "bdde902f5ec668179ff5ca0dabf7657109287d690bf97e230c21d65f99155c62", + "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b", + "f40f32044071a9365505da3d1e3be6561f6f22d0e60cf51df783999f6c3429cb", + "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209" + ], + "threshold": 3 + } + }, + "spec_version": "1.0", + "version": 1 + }, + "signatures": [ + { + "keyid": "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97", + "sig": "30450221008a35d51da0f845301a5eac98ad0df00a934f59b709c1eaf81c86be734d9356f80220742942325599749800f52675f6efe124345980a2a636c0dc76f9caf9fc3123b0" + }, + { + "keyid": "bdde902f5ec668179ff5ca0dabf7657109287d690bf97e230c21d65f99155c62", + "sig": "3045022100ef9157ece2a09baec1eab80adfc00b04da20b1f9a0d1b47c5dabc4506719ef2c022074f72acd57398e4ddc8c2a5040df902961e9615dca48f3fbe38cbb506e500066" + }, + { + "keyid": "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b", + "sig": "30450220420fdc9a09cd069b8b15fd8db9cedf7d0dee75871bd1cfee77c926d4120a770002210097553b5ad0d6b4a13902ed37509638bb63a9009f78230cd56c802909ffbfead7" + }, + { + "keyid": "f40f32044071a9365505da3d1e3be6561f6f22d0e60cf51df783999f6c3429cb", + "sig": "304502202aaf32e66f90752f658672b085ecfe45cc1ad31ee6cf5c9ad05f3267685f8d88022100b5df02acdaa371123db9d7a42219553fe079b230b168833e951be7ee56ded347" + }, + { + "keyid": "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209", + "sig": "304402205d420c7d05c58980c1c9f7d221f53b5334aae27a447d2a91c2ceddd685269749022039ec83e51f8e1779d7f0142dfa4a5bbecfe327fc0b91b7416090fea2416fd53a" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/100.snapshot.json b/tuf-no-std/tests/100.snapshot.json new file mode 100644 index 0000000..a52e172 --- /dev/null +++ b/tuf-no-std/tests/100.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 100, + "expires": "2023-09-05T16:07:19Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3045022060ccd13742e29ab97ea2691ad9eb7b1cb7262b81ec499784113258b63d26f9330221009c7e1a24715c3aab61544f3fc323e300476a121a52e5a6ce04d26cb0ff2ea49f" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/101.snapshot.json b/tuf-no-std/tests/101.snapshot.json new file mode 100644 index 0000000..8d9d5e4 --- /dev/null +++ b/tuf-no-std/tests/101.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 101, + "expires": "2023-09-12T16:06:45Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "304402206fe91c682f17ed6282996b3655d52fe3507293e6789ece8fb621b6147356292b0220442c5d1624978f08a966ef3c4acffe2c62ff20c77a1ec22ac2f5087150189f25" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/102.snapshot.json b/tuf-no-std/tests/102.snapshot.json new file mode 100644 index 0000000..9064022 --- /dev/null +++ b/tuf-no-std/tests/102.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 102, + "expires": "2023-09-19T16:06:58Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "30450220695fb3ff8b2d92be534f894a0a4b48e52307af21c59670ea8c9829348999fe6b022100bada602e1dfdb43a08f0477e5bdfa4ed6ba5a8602a3e62857308a83dffadde26" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/103.snapshot.json b/tuf-no-std/tests/103.snapshot.json new file mode 100644 index 0000000..a99ccf3 --- /dev/null +++ b/tuf-no-std/tests/103.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 103, + "expires": "2023-09-26T16:07:01Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "30460221009336ebe2d9a98152912113c46788756710c925a6eb7d1866ff3c9f9fd736a4a5022100d0b07ea6f072e8ea2f687e46695b3b7c9fa29a6a6440c90a53c0616a58bc24ac" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/104.snapshot.json b/tuf-no-std/tests/104.snapshot.json new file mode 100644 index 0000000..ca5af6c --- /dev/null +++ b/tuf-no-std/tests/104.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 104, + "expires": "2023-10-03T16:08:51Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "304502200e0aaea2e86a8a0127283c479eb9ceee6c76b805f6f572f522b5824a3991358302210082696cfcab2e121d78727115f04f3e0ff36da8e12d96b24604ec0c555f2c8640" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/105.snapshot.json b/tuf-no-std/tests/105.snapshot.json new file mode 100644 index 0000000..2c172c9 --- /dev/null +++ b/tuf-no-std/tests/105.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 105, + "expires": "2023-10-10T16:08:34Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3046022100f8a2f2f82bd6fd1d96378574ad65a59f742adf1361753e172786326f5b68f1b2022100eac1a0943901a2fafbff8383e0ef2dcf96a9f0a687bebf7436437f039a63ecd3" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/2.root.json b/tuf-no-std/tests/2.root.json new file mode 100644 index 0000000..386ebe6 --- /dev/null +++ b/tuf-no-std/tests/2.root.json @@ -0,0 +1,144 @@ +{ + "signatures": [ + { + "keyid": "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97", + "sig": "3046022100d3ea59490b253beae0926c6fa63f54336dea1ed700555be9f27ff55cd347639c0221009157d1ba012cead81948a4ab777d355451d57f5c4a2d333fc68d2e3f358093c2" + }, + { + "keyid": "bdde902f5ec668179ff5ca0dabf7657109287d690bf97e230c21d65f99155c62", + "sig": "304502206eaef40564403ce572c6d062e0c9b0aab5e0223576133e081e1b495e8deb9efd02210080fd6f3464d759601b4afec596bbd5952f3a224cd06ed1cdfc3c399118752ba2" + }, + { + "keyid": "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b", + "sig": "304502207baace02f56d8e6069f10b6ff098a26e7f53a7f9324ad62cffa0557bdeb9036c022100fb3032baaa090d0040c3f2fd872571c84479309b773208601d65948df87a9720" + }, + { + "keyid": "f40f32044071a9365505da3d1e3be6561f6f22d0e60cf51df783999f6c3429cb", + "sig": "304402205180c01905505dd88acd7a2dad979dd75c979b3722513a7bdedac88c6ae8dbeb022056d1ddf7a192f0b1c2c90ff487de2fb3ec9f0c03f66ea937c78d3b6a493504ca" + }, + { + "keyid": "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209", + "sig": "3046022100c8806d4647c514d80fd8f707d3369444c4fd1d0812a2d25f828e564c99790e3f022100bb51f12e862ef17a7d3da2ac103bebc5c7e792237006c4cafacd76267b249c2f" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": false, + "expires": "2022-05-11T19:09:02.663975009Z", + "keys": { + "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04cbc5cab2684160323c25cd06c3307178a6b1d1c9b949328453ae473c5ba7527e35b13f298b41633382241f3fd8526c262d43b45adee5c618fa0642c82b8a9803" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "b6710623a30c010738e64c5209d367df1c0a18cf90e6ab5292fb01680f83453d": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04fa1a3e42f2300cd3c5487a61509348feb1e936920fef2f83b7cd5dbe7ba045f538725ab8f18a666e6233edb7e0db8766c8dc336633449c5e1bbe0c182b02df0b" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "bdde902f5ec668179ff5ca0dabf7657109287d690bf97e230c21d65f99155c62": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04a71aacd835dc170ba6db3fa33a1a33dee751d4f8b0217b805b9bd3242921ee93672fdcfd840576c5bb0dc0ed815edf394c1ee48c2b5e02485e59bfc512f3adc7" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04117b33dd265715bf23315e368faa499728db8d1f0a377070a1c7b1aba2cc21be6ab1628e42f2cdd7a35479f2dce07b303a8ba646c55569a8d2a504ba7e86e447" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "f40f32044071a9365505da3d1e3be6561f6f22d0e60cf51df783999f6c3429cb": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04cc1cd53a61c23e88cc54b488dfae168a257c34fac3e88811c55962b24cffbfecb724447999c54670e365883716302e49da57c79a33cd3e16f81fbc66f0bcdf48" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "048a78a44ac01099890d787e5e62afc29c8ccb69a70ec6549a6b04033b0a8acbfb42ab1ab9c713d225cdb52b858886cf46c8e90a7f3b9e6371882f370c259e1c5b" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "fc61191ba8a516fe386c7d6c97d918e1d241e1589729add09b122725b8c32451": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "044c7793ab74b9ddd713054e587b8d9c75c5f6025633d0fef7ca855ed5b8d5a474b23598fe33eb4a63630d526f74d4bdaec8adcb51993ed65652d651d7c49203eb" + }, + "scheme": "ecdsa-sha2-nistp256" + } + }, + "roles": { + "root": { + "keyids": [ + "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97", + "bdde902f5ec668179ff5ca0dabf7657109287d690bf97e230c21d65f99155c62", + "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b", + "f40f32044071a9365505da3d1e3be6561f6f22d0e60cf51df783999f6c3429cb", + "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209" + ], + "threshold": 3 + }, + "snapshot": { + "keyids": [ + "fc61191ba8a516fe386c7d6c97d918e1d241e1589729add09b122725b8c32451" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97", + "bdde902f5ec668179ff5ca0dabf7657109287d690bf97e230c21d65f99155c62", + "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b", + "f40f32044071a9365505da3d1e3be6561f6f22d0e60cf51df783999f6c3429cb", + "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209" + ], + "threshold": 3 + }, + "timestamp": { + "keyids": [ + "b6710623a30c010738e64c5209d367df1c0a18cf90e6ab5292fb01680f83453d" + ], + "threshold": 1 + } + }, + "spec_version": "1.0", + "version": 2 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/3.root.json b/tuf-no-std/tests/3.root.json new file mode 100644 index 0000000..8d69c51 --- /dev/null +++ b/tuf-no-std/tests/3.root.json @@ -0,0 +1,136 @@ +{ + "signatures": [ + { + "keyid": "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97", + "sig": "3046022100e7a80e4b03eb8768999d20f104925fd9149faf3f6f73ee80f8c2e8d5f998f48c022100d3f01eb8effee202a244e710dca09530b9c57c5e510ab35172bd5eddd373ccc8" + }, + { + "keyid": "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b", + "sig": "304502200e45fde5cf750f8c533c4f259eb1469510600993b98ae2c3cb8f1922cda96e27022100f5151760d0ef0882a96c2531ccd9f5e4a7ff2b259d8eb34ead8bfdf60cb52fee" + }, + { + "keyid": "f40f32044071a9365505da3d1e3be6561f6f22d0e60cf51df783999f6c3429cb", + "sig": "304502205a7ebeac3617bfb1aca957a6f74d37a02f2854afa54e5103fb3c891bb25836db022100f06614ca8d21f968e45edc29f826d8dbeed07c51d4cb473a734a2036171900de" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": false, + "expires": "2022-11-10T21:58:09.733402317Z", + "keys": { + "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04cbc5cab2684160323c25cd06c3307178a6b1d1c9b949328453ae473c5ba7527e35b13f298b41633382241f3fd8526c262d43b45adee5c618fa0642c82b8a9803" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "b6710623a30c010738e64c5209d367df1c0a18cf90e6ab5292fb01680f83453d": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04fa1a3e42f2300cd3c5487a61509348feb1e936920fef2f83b7cd5dbe7ba045f538725ab8f18a666e6233edb7e0db8766c8dc336633449c5e1bbe0c182b02df0b" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "bdde902f5ec668179ff5ca0dabf7657109287d690bf97e230c21d65f99155c62": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04a71aacd835dc170ba6db3fa33a1a33dee751d4f8b0217b805b9bd3242921ee93672fdcfd840576c5bb0dc0ed815edf394c1ee48c2b5e02485e59bfc512f3adc7" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04117b33dd265715bf23315e368faa499728db8d1f0a377070a1c7b1aba2cc21be6ab1628e42f2cdd7a35479f2dce07b303a8ba646c55569a8d2a504ba7e86e447" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "f40f32044071a9365505da3d1e3be6561f6f22d0e60cf51df783999f6c3429cb": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04cc1cd53a61c23e88cc54b488dfae168a257c34fac3e88811c55962b24cffbfecb724447999c54670e365883716302e49da57c79a33cd3e16f81fbc66f0bcdf48" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "048a78a44ac01099890d787e5e62afc29c8ccb69a70ec6549a6b04033b0a8acbfb42ab1ab9c713d225cdb52b858886cf46c8e90a7f3b9e6371882f370c259e1c5b" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "fc61191ba8a516fe386c7d6c97d918e1d241e1589729add09b122725b8c32451": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "044c7793ab74b9ddd713054e587b8d9c75c5f6025633d0fef7ca855ed5b8d5a474b23598fe33eb4a63630d526f74d4bdaec8adcb51993ed65652d651d7c49203eb" + }, + "scheme": "ecdsa-sha2-nistp256" + } + }, + "roles": { + "root": { + "keyids": [ + "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97", + "bdde902f5ec668179ff5ca0dabf7657109287d690bf97e230c21d65f99155c62", + "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b", + "f40f32044071a9365505da3d1e3be6561f6f22d0e60cf51df783999f6c3429cb", + "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209" + ], + "threshold": 3 + }, + "snapshot": { + "keyids": [ + "fc61191ba8a516fe386c7d6c97d918e1d241e1589729add09b122725b8c32451" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97", + "bdde902f5ec668179ff5ca0dabf7657109287d690bf97e230c21d65f99155c62", + "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b", + "f40f32044071a9365505da3d1e3be6561f6f22d0e60cf51df783999f6c3429cb", + "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209" + ], + "threshold": 3 + }, + "timestamp": { + "keyids": [ + "b6710623a30c010738e64c5209d367df1c0a18cf90e6ab5292fb01680f83453d" + ], + "threshold": 1 + } + }, + "spec_version": "1.0", + "version": 3 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/4.root.json b/tuf-no-std/tests/4.root.json new file mode 100644 index 0000000..0a055fc --- /dev/null +++ b/tuf-no-std/tests/4.root.json @@ -0,0 +1,144 @@ +{ + "signed": { + "_type": "root", + "consistent_snapshot": false, + "expires": "2023-01-12T18:22:02Z", + "keys": { + "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04cbc5cab2684160323c25cd06c3307178a6b1d1c9b949328453ae473c5ba7527e35b13f298b41633382241f3fd8526c262d43b45adee5c618fa0642c82b8a9803" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "75e867ab10e121fdef32094af634707f43ddd79c6bab8ad6c5ab9f03f4ea8c90": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04d2086b87dd8bc3562bde27465795aa0ad30307c0b1f83f21742e30d992cd2299554685462ec9186b782178cc8e8e227c90f8b5e5a436fffecffa88fb52f24f1b" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "b6710623a30c010738e64c5209d367df1c0a18cf90e6ab5292fb01680f83453d": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04fa1a3e42f2300cd3c5487a61509348feb1e936920fef2f83b7cd5dbe7ba045f538725ab8f18a666e6233edb7e0db8766c8dc336633449c5e1bbe0c182b02df0b" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04117b33dd265715bf23315e368faa499728db8d1f0a377070a1c7b1aba2cc21be6ab1628e42f2cdd7a35479f2dce07b303a8ba646c55569a8d2a504ba7e86e447" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "f40f32044071a9365505da3d1e3be6561f6f22d0e60cf51df783999f6c3429cb": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "04cc1cd53a61c23e88cc54b488dfae168a257c34fac3e88811c55962b24cffbfecb724447999c54670e365883716302e49da57c79a33cd3e16f81fbc66f0bcdf48" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "048a78a44ac01099890d787e5e62afc29c8ccb69a70ec6549a6b04033b0a8acbfb42ab1ab9c713d225cdb52b858886cf46c8e90a7f3b9e6371882f370c259e1c5b" + }, + "scheme": "ecdsa-sha2-nistp256" + }, + "fc61191ba8a516fe386c7d6c97d918e1d241e1589729add09b122725b8c32451": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ecdsa-sha2-nistp256", + "keyval": { + "public": "044c7793ab74b9ddd713054e587b8d9c75c5f6025633d0fef7ca855ed5b8d5a474b23598fe33eb4a63630d526f74d4bdaec8adcb51993ed65652d651d7c49203eb" + }, + "scheme": "ecdsa-sha2-nistp256" + } + }, + "roles": { + "root": { + "keyids": [ + "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97", + "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b", + "f40f32044071a9365505da3d1e3be6561f6f22d0e60cf51df783999f6c3429cb", + "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209", + "75e867ab10e121fdef32094af634707f43ddd79c6bab8ad6c5ab9f03f4ea8c90" + ], + "threshold": 3 + }, + "snapshot": { + "keyids": [ + "fc61191ba8a516fe386c7d6c97d918e1d241e1589729add09b122725b8c32451" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97", + "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b", + "f40f32044071a9365505da3d1e3be6561f6f22d0e60cf51df783999f6c3429cb", + "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209", + "75e867ab10e121fdef32094af634707f43ddd79c6bab8ad6c5ab9f03f4ea8c90" + ], + "threshold": 3 + }, + "timestamp": { + "keyids": [ + "b6710623a30c010738e64c5209d367df1c0a18cf90e6ab5292fb01680f83453d" + ], + "threshold": 1 + } + }, + "spec_version": "1.0", + "version": 4 + }, + "signatures": [ + { + "keyid": "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97", + "sig": "3046022100f7d4abde3d694fba01af172466629249a6743efd04c3999f958494842a7aee1f022100d19a295f9225247f17650fdb4ad50b99c2326700aadd0afaec4ae418941c7c59" + }, + { + "keyid": "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b", + "sig": "3045022075ec28360b3e310db9d3de281a5286e37884aefd9f0b7193ad67c68ab6ee95a2022100aa08a93c58d74d9cb128cea765cae378efe86092f253b75fd427aede48ac7e22" + }, + { + "keyid": "f40f32044071a9365505da3d1e3be6561f6f22d0e60cf51df783999f6c3429cb", + "sig": "304502201de38b2a56a58ae046f26e3be8673063cdde8f8b6a8733bc025ebaf0e09569c50221008f8620c960fa6f9cb52b7c39ce84a5ac18224be4a876a35e1bc8f5d76aa24e86" + }, + { + "keyid": "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209", + "sig": "3044022070d86c3fbc3fb69783d54a451187e43776d97effe500c51f2558939c80ab2bb902201fb14ce51c6c4f40e8f2db792c3d56da18fe0c39499fa3fca9e841fc8bee17f1" + }, + { + "keyid": "75e867ab10e121fdef32094af634707f43ddd79c6bab8ad6c5ab9f03f4ea8c90", + "sig": "3046022100aa1ff582569287b5160864e20bb343eff92dec316940cebe5742e47a56e8cabd0221009dc18bad12920a39b7427914ecb46e2ead58f17136935afbba488b7d6f3160ff" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/5.root.json b/tuf-no-std/tests/5.root.json new file mode 100644 index 0000000..7abd5fd --- /dev/null +++ b/tuf-no-std/tests/5.root.json @@ -0,0 +1,156 @@ +{ + "signed": { + "_type": "root", + "spec_version": "1.0", + "version": 5, + "expires": "2023-04-18T18:13:43Z", + "keys": { + "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEEXsz3SZXFb8jMV42j6pJlyjbjR8K\nN3Bwocexq6LMIb5qsWKOQvLN16NUefLc4HswOoumRsVVaajSpQS6fobkRw==\n-----END PUBLIC KEY-----\n" + } + }, + "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0ghrh92Lw1Yr3idGV5WqCtMDB8Cx\n+D8hdC4w2ZLNIplVRoVGLskYa3gheMyOjiJ8kPi15aQ2//7P+oj7UvJPGw==\n-----END PUBLIC KEY-----\n" + } + }, + "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAELrWvNt94v4R085ELeeCMxHp7PldF\n0/T1GxukUh2ODuggLGJE0pc1e8CSBf6CS91Fwo9FUOuRsjBUld+VqSyCdQ==\n-----END PUBLIC KEY-----\n" + } + }, + "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEinikSsAQmYkNeH5eYq/CnIzLaacO\nxlSaawQDOwqKy/tCqxq5xxPSJc21K4WIhs9GyOkKfzueY3GILzcMJZ4cWw==\n-----END PUBLIC KEY-----\n" + } + }, + "e1863ba02070322ebc626dcecf9d881a3a38c35c3b41a83765b6ad6c37eaec2a": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWRiGr5+j+3J5SsH+Ztr5nE2H2wO7\nBV+nO3s93gLca18qTOzHY1oWyAGDykMSsGTUBSt9D+An0KfKsD2mfSM42Q==\n-----END PUBLIC KEY-----\n" + } + }, + "f5312f542c21273d9485a49394386c4575804770667f2ddb59b3bf0669fddd2f": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzBzVOmHCPojMVLSI364WiiV8NPrD\n6IgRxVliskz/v+y3JER5mcVGcONliDcWMC5J2lfHmjPNPhb4H7xm8LzfSA==\n-----END PUBLIC KEY-----\n" + } + }, + "ff51e17fcf253119b7033f6f57512631da4a0969442afcf9fc8b141c7f2be99c": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEy8XKsmhBYDI8Jc0GwzBxeKax0cm5\nSTKEU65HPFunUn41sT8pi0FjM4IkHz/YUmwmLUO0Wt7lxhj6BkLIK4qYAw==\n-----END PUBLIC KEY-----\n" + } + } + }, + "roles": { + "root": { + "keyids": [ + "ff51e17fcf253119b7033f6f57512631da4a0969442afcf9fc8b141c7f2be99c", + "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99", + "f5312f542c21273d9485a49394386c4575804770667f2ddb59b3bf0669fddd2f", + "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b", + "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de" + ], + "threshold": 3 + }, + "snapshot": { + "keyids": [ + "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "ff51e17fcf253119b7033f6f57512631da4a0969442afcf9fc8b141c7f2be99c", + "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99", + "f5312f542c21273d9485a49394386c4575804770667f2ddb59b3bf0669fddd2f", + "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b", + "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de" + ], + "threshold": 3 + }, + "timestamp": { + "keyids": [ + "e1863ba02070322ebc626dcecf9d881a3a38c35c3b41a83765b6ad6c37eaec2a" + ], + "threshold": 1 + } + }, + "consistent_snapshot": true + }, + "signatures": [ + { + "keyid": "ff51e17fcf253119b7033f6f57512631da4a0969442afcf9fc8b141c7f2be99c", + "sig": "3045022100fc1c2be509ce50ea917bbad1d9efe9d96c8c2ebea04af2717aa3d9c6fe617a75022012eef282a19f2d8bd4818aa333ef48a06489f49d4d34a20b8fe8fc867bb25a7a" + }, + { + "keyid": "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99", + "sig": "30450221008a4392ae5057fc00778b651e61fea244766a4ae58db84d9f1d3810720ab0f3b702207c49e59e8031318caf02252ecea1281cecc1e5986c309a9cef61f455ecf7165d" + }, + { + "keyid": "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b", + "sig": "3046022100da1b8dc5d53aaffbbfac98de3e23ee2d2ad3446a7bed09fac0f88bae19be2587022100b681c046afc3919097dfe794e0d819be891e2e850aade315bec06b0c4dea221b" + }, + { + "keyid": "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de", + "sig": "3046022100b534e0030e1b271133ecfbdf3ba9fbf3becb3689abea079a2150afbb63cdb7c70221008c39a718fd9495f249b4ab8788d5b9dc269f0868dbe38b272f48207359d3ded9" + }, + { + "keyid": "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97", + "sig": "3045022100fc1c2be509ce50ea917bbad1d9efe9d96c8c2ebea04af2717aa3d9c6fe617a75022012eef282a19f2d8bd4818aa333ef48a06489f49d4d34a20b8fe8fc867bb25a7a" + }, + { + "keyid": "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b", + "sig": "30450221008a4392ae5057fc00778b651e61fea244766a4ae58db84d9f1d3810720ab0f3b702207c49e59e8031318caf02252ecea1281cecc1e5986c309a9cef61f455ecf7165d" + }, + { + "keyid": "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209", + "sig": "3046022100da1b8dc5d53aaffbbfac98de3e23ee2d2ad3446a7bed09fac0f88bae19be2587022100b681c046afc3919097dfe794e0d819be891e2e850aade315bec06b0c4dea221b" + }, + { + "keyid": "75e867ab10e121fdef32094af634707f43ddd79c6bab8ad6c5ab9f03f4ea8c90", + "sig": "3046022100b534e0030e1b271133ecfbdf3ba9fbf3becb3689abea079a2150afbb63cdb7c70221008c39a718fd9495f249b4ab8788d5b9dc269f0868dbe38b272f48207359d3ded9" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/5.targets.json b/tuf-no-std/tests/5.targets.json new file mode 100644 index 0000000..3598578 --- /dev/null +++ b/tuf-no-std/tests/5.targets.json @@ -0,0 +1,125 @@ +{ + "signed": { + "_type": "targets", + "spec_version": "1.0", + "version": 5, + "expires": "2023-04-18T18:13:43Z", + "targets": { + "artifact.pub": { + "length": 177, + "hashes": { + "sha256": "59ebf97a9850aecec4bc39c1f5c1dc46e6490a6b5fd2a6cacdcac0c3a6fc4cbf", + "sha512": "308fd1d1d95d7f80aa33b837795251cc3e886792982275e062409e13e4e236ffc34d676682aa96fdc751414de99c864bf132dde71581fa651c6343905e3bf988" + }, + "custom": { + "sigstore": { + "status": "Active", + "usage": "Unknown" + } + } + }, + "ctfe.pub": { + "length": 177, + "hashes": { + "sha256": "7fcb94a5d0ed541260473b990b99a6c39864c1fb16f3f3e594a5a3cebbfe138a", + "sha512": "4b20747d1afe2544238ad38cc0cc3010921b177d60ac743767e0ef675b915489bd01a36606c0ff83c06448622d7160f0d866c83d20f0c0f44653dcc3f9aa0bd4" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://ctfe.sigstore.dev/test", + "usage": "CTFE" + } + } + }, + "ctfe_2022.pub": { + "length": 178, + "hashes": { + "sha256": "270488a309d22e804eeb245493e87c667658d749006b9fee9cc614572d4fbbdc", + "sha512": "e83fa4f427b24ee7728637fad1b4aa45ebde2ba02751fa860694b1bb16059a490328f9985e51cc70e4d237545315a1bc866dc4fdeef2f6248d99cc7a6077bf85" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://ctfe.sigstore.dev/2022", + "usage": "CTFE" + } + } + }, + "fulcio.crt.pem": { + "length": 744, + "hashes": { + "sha256": "f360c53b2e13495a628b9b8096455badcb6d375b185c4816d95a5d746ff29908", + "sha512": "0713252a7fd17f7f3ab12f88a64accf2eb14b8ad40ca711d7fe8b4ecba3b24db9e9dffadb997b196d3867b8f9ff217faf930d80e4dab4e235c7fc3f07be69224" + }, + "custom": { + "sigstore": { + "status": "Expired", + "uri": "https://fulcio.sigstore.dev", + "usage": "Fulcio" + } + } + }, + "fulcio_intermediate_v1.crt.pem": { + "length": 789, + "hashes": { + "sha256": "f8cbecf186db7714624a5f4e99da31a917cbef70a94dd6921f5c3ca969dfe30a", + "sha512": "0f99f47dbc26c5f1e3cba0bfd9af4245a26e5cb735d6ef005792ec7e603f66fdb897de985973a6e50940ca7eff5e1849719e967b5ad2dac74a29115a41cf6f21" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://fulcio.sigstore.dev", + "usage": "Fulcio" + } + } + }, + "fulcio_v1.crt.pem": { + "length": 740, + "hashes": { + "sha256": "f989aa23def87c549404eadba767768d2a3c8d6d30a8b793f9f518a8eafd2cf5", + "sha512": "f2e33a6dc208cee1f51d33bbea675ab0f0ced269617497985f9a0680689ee7073e4b6f8fef64c91bda590d30c129b3070dddce824c05bc165ac9802f0705cab6" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://fulcio.sigstore.dev", + "usage": "Fulcio" + } + } + }, + "rekor.pub": { + "length": 178, + "hashes": { + "sha256": "dce5ef715502ec9f3cdfd11f8cc384b31a6141023d3e7595e9908a81cb6241bd", + "sha512": "0ae7705e02db33e814329746a4a0e5603c5bdcd91c96d072158d71011a2695788866565a2fec0fe363eb72cbcaeda39e54c5fe8d416daf9f3101fdba4217ef35" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://rekor.sigstore.dev", + "usage": "Rekor" + } + } + } + } + }, + "signatures": [ + { + "keyid": "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b", + "sig": "3045022100bf03c32b59f65285b91118172503c9f7e5f65fea0d4647f31adfb6cf18ed09db022069778e655e4198a3346ea9239dacb111571c7e7ed4c96d166ddce06306486a9c" + }, + { + "keyid": "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de", + "sig": "30440220562f52b2243e66d8dff72dbf67a29faf82ad60ecbe0638acd4ab00338244f0b102206051db1fbe5a7815b4076096d5f8002c0dc1ecce8d9ef9d696cdacff50c7463a" + }, + { + "keyid": "ff51e17fcf253119b7033f6f57512631da4a0969442afcf9fc8b141c7f2be99c", + "sig": "3045022100df19bbbabed7672c8e797152d6b97aa1f14fdcd6e10ce0e41703d5e7ad37c2e502200583577549f561079273460afe2b827b16d5e76a63616390bf956ee5f24d60eb" + }, + { + "keyid": "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99", + "sig": "304502207d79f0ee8965f82c24fc5b96d6fbfa760b1f7192fd829a64a32ec03c579220310221008498a536dcc7aefd267875267f08cb27f8ae455dc6d8c53fe628e2fda2772dd4" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/53.snapshot.json b/tuf-no-std/tests/53.snapshot.json new file mode 100644 index 0000000..4b53ecc --- /dev/null +++ b/tuf-no-std/tests/53.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 53, + "expires": "2022-11-10T21:10:22Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "30440220767eb9e8911edc8e2d4822d7f13d3adc03f32ab6388c3531935777fa33f7089e02202732bb45bc09801a9a547d834d1706f5fc89ccc8506d119a4303ab6af264a7f4" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/54.snapshot.json b/tuf-no-std/tests/54.snapshot.json new file mode 100644 index 0000000..3fd67fa --- /dev/null +++ b/tuf-no-std/tests/54.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 54, + "expires": "2022-11-21T15:59:09Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3046022100975026a9594db91b921d6f1190306f38f06f55ca3393194eec896b64acfe7761022100fe9f9133ba25915262beba54074cd45a70d0e4b6da699e59d479af04aa34eddf" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/55.snapshot.json b/tuf-no-std/tests/55.snapshot.json new file mode 100644 index 0000000..e4efef8 --- /dev/null +++ b/tuf-no-std/tests/55.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 55, + "expires": "2022-11-29T17:02:57Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "30450220148c56d2ccd33c80b529d02a2c11aa9effc793034829b1fe028b03482aeacf0d022100b3f729dd106451df9b8d6c3bc32bd4729fc5cd00c69af0ae37c38a027c13a703" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/56.snapshot.json b/tuf-no-std/tests/56.snapshot.json new file mode 100644 index 0000000..92d0bc9 --- /dev/null +++ b/tuf-no-std/tests/56.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 56, + "expires": "2022-12-07T23:40:52Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "304402200712a5ebf1b62689573594dac0c145051bc75e5e2e1b3e19eae2df0034ed6a2c022044d3eda32870f54333604a2d6298c271645a6eec91f1964dd583e7bc5231d3b0" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/57.snapshot.json b/tuf-no-std/tests/57.snapshot.json new file mode 100644 index 0000000..b14c432 --- /dev/null +++ b/tuf-no-std/tests/57.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 57, + "expires": "2022-12-19T14:36:29Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3045022100be618734bbebbc4d42fc94c067efd46aeaea417514cb294186812a6bd6f568560220191080395e4c99c4169f41981086df959f2f2ae46b52c009a4633b4e45d1d2a8" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/58.snapshot.json b/tuf-no-std/tests/58.snapshot.json new file mode 100644 index 0000000..d7b4fe9 --- /dev/null +++ b/tuf-no-std/tests/58.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 58, + "expires": "2022-12-22T00:10:10Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3045022100f54aca630ec8f6ae230e000a852a62ea6a11b1147fd2e592c11f06265ea5af22022055ef211955f24b3086a7eaf7025398bb6f2a8026b436b0c60c6e7bda3285e4ed" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/59.snapshot.json b/tuf-no-std/tests/59.snapshot.json new file mode 100644 index 0000000..a2b7878 --- /dev/null +++ b/tuf-no-std/tests/59.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 59, + "expires": "2022-12-29T00:08:14Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3045022038dc30edbab3494a9a1325cbb162d0c6ed83f31439dc8d9d0a0d9621a11cfdc602210083f5a12fa4f63d669c098fe6de1f6a2c46e7bed2dfb6b757d58667a001ec277c" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/6.root.json b/tuf-no-std/tests/6.root.json new file mode 100644 index 0000000..0b2c06b --- /dev/null +++ b/tuf-no-std/tests/6.root.json @@ -0,0 +1,144 @@ +{ + "signed": { + "_type": "root", + "spec_version": "1.0", + "version": 6, + "expires": "2023-08-28T07:54:10Z", + "keys": { + "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEEXsz3SZXFb8jMV42j6pJlyjbjR8K\nN3Bwocexq6LMIb5qsWKOQvLN16NUefLc4HswOoumRsVVaajSpQS6fobkRw==\n-----END PUBLIC KEY-----\n" + } + }, + "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0ghrh92Lw1Yr3idGV5WqCtMDB8Cx\n+D8hdC4w2ZLNIplVRoVGLskYa3gheMyOjiJ8kPi15aQ2//7P+oj7UvJPGw==\n-----END PUBLIC KEY-----\n" + } + }, + "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAELrWvNt94v4R085ELeeCMxHp7PldF\n0/T1GxukUh2ODuggLGJE0pc1e8CSBf6CS91Fwo9FUOuRsjBUld+VqSyCdQ==\n-----END PUBLIC KEY-----\n" + } + }, + "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEinikSsAQmYkNeH5eYq/CnIzLaacO\nxlSaawQDOwqKy/tCqxq5xxPSJc21K4WIhs9GyOkKfzueY3GILzcMJZ4cWw==\n-----END PUBLIC KEY-----\n" + } + }, + "e1863ba02070322ebc626dcecf9d881a3a38c35c3b41a83765b6ad6c37eaec2a": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWRiGr5+j+3J5SsH+Ztr5nE2H2wO7\nBV+nO3s93gLca18qTOzHY1oWyAGDykMSsGTUBSt9D+An0KfKsD2mfSM42Q==\n-----END PUBLIC KEY-----\n" + } + }, + "f5312f542c21273d9485a49394386c4575804770667f2ddb59b3bf0669fddd2f": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzBzVOmHCPojMVLSI364WiiV8NPrD\n6IgRxVliskz/v+y3JER5mcVGcONliDcWMC5J2lfHmjPNPhb4H7xm8LzfSA==\n-----END PUBLIC KEY-----\n" + } + }, + "ff51e17fcf253119b7033f6f57512631da4a0969442afcf9fc8b141c7f2be99c": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEy8XKsmhBYDI8Jc0GwzBxeKax0cm5\nSTKEU65HPFunUn41sT8pi0FjM4IkHz/YUmwmLUO0Wt7lxhj6BkLIK4qYAw==\n-----END PUBLIC KEY-----\n" + } + } + }, + "roles": { + "root": { + "keyids": [ + "ff51e17fcf253119b7033f6f57512631da4a0969442afcf9fc8b141c7f2be99c", + "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99", + "f5312f542c21273d9485a49394386c4575804770667f2ddb59b3bf0669fddd2f", + "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b", + "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de" + ], + "threshold": 3 + }, + "snapshot": { + "keyids": [ + "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "ff51e17fcf253119b7033f6f57512631da4a0969442afcf9fc8b141c7f2be99c", + "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99", + "f5312f542c21273d9485a49394386c4575804770667f2ddb59b3bf0669fddd2f", + "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b", + "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de" + ], + "threshold": 3 + }, + "timestamp": { + "keyids": [ + "e1863ba02070322ebc626dcecf9d881a3a38c35c3b41a83765b6ad6c37eaec2a" + ], + "threshold": 1 + } + }, + "consistent_snapshot": true + }, + "signatures": [ + { + "keyid": "ff51e17fcf253119b7033f6f57512631da4a0969442afcf9fc8b141c7f2be99c", + "sig": "3044022079941eab7035ffd603354ee9a072ad87ad24e084f2aa52a718f76b21545d90190220368a65bb4ac83a9938885f5bba6a0b9a25c9979c85d85840497a95e47466eafb" + }, + { + "keyid": "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99", + "sig": "3045022100ca33d35657c55b93c827ecad61be61e6d91da886d413f5083894a70d6e9af1cd022049d2b8b50d34a4e48cb3832a17a82c1ec1ae6b61af2a6db6e7d1c63d81a0dae7" + }, + { + "keyid": "f5312f542c21273d9485a49394386c4575804770667f2ddb59b3bf0669fddd2f", + "sig": "304402207875857b20d8258e0c888e55516cb50593746543cd3c34c9743efb2921cb2a660220127107a67b585e67d3df0538a6be1f5d4834857d1d88da9f8a6b8b8ac8998904" + }, + { + "keyid": "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b", + "sig": "304502205c7b76ad222ffe16fed152f5bbf1c18b3df4814bf93703fea4605ae335914953022100a9d187ee02a4babe12b1646b572171bac60b23b0846ff3f067ded075194b549c" + }, + { + "keyid": "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de", + "sig": "30440220724e672fd7a2dbd338dfea683712a77bc1579ae5061dbc501d498ade02ea3aeb022012758bd3f1d4d245d92a692d26f743ad7a1f9af0982d1983a8619186c1fbcdd4" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/6.targets.json b/tuf-no-std/tests/6.targets.json new file mode 100644 index 0000000..d096a05 --- /dev/null +++ b/tuf-no-std/tests/6.targets.json @@ -0,0 +1,136 @@ +{ + "signed": { + "_type": "targets", + "spec_version": "1.0", + "version": 6, + "expires": "2023-08-28T07:54:10Z", + "targets": { + "artifact.pub": { + "length": 177, + "hashes": { + "sha256": "59ebf97a9850aecec4bc39c1f5c1dc46e6490a6b5fd2a6cacdcac0c3a6fc4cbf", + "sha512": "308fd1d1d95d7f80aa33b837795251cc3e886792982275e062409e13e4e236ffc34d676682aa96fdc751414de99c864bf132dde71581fa651c6343905e3bf988" + }, + "custom": { + "sigstore": { + "status": "Active", + "usage": "Unknown" + } + } + }, + "ctfe.pub": { + "length": 177, + "hashes": { + "sha256": "7fcb94a5d0ed541260473b990b99a6c39864c1fb16f3f3e594a5a3cebbfe138a", + "sha512": "4b20747d1afe2544238ad38cc0cc3010921b177d60ac743767e0ef675b915489bd01a36606c0ff83c06448622d7160f0d866c83d20f0c0f44653dcc3f9aa0bd4" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://ctfe.sigstore.dev/test", + "usage": "CTFE" + } + } + }, + "ctfe_2022.pub": { + "length": 178, + "hashes": { + "sha256": "270488a309d22e804eeb245493e87c667658d749006b9fee9cc614572d4fbbdc", + "sha512": "e83fa4f427b24ee7728637fad1b4aa45ebde2ba02751fa860694b1bb16059a490328f9985e51cc70e4d237545315a1bc866dc4fdeef2f6248d99cc7a6077bf85" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://ctfe.sigstore.dev/2022", + "usage": "CTFE" + } + } + }, + "fulcio.crt.pem": { + "length": 744, + "hashes": { + "sha256": "f360c53b2e13495a628b9b8096455badcb6d375b185c4816d95a5d746ff29908", + "sha512": "0713252a7fd17f7f3ab12f88a64accf2eb14b8ad40ca711d7fe8b4ecba3b24db9e9dffadb997b196d3867b8f9ff217faf930d80e4dab4e235c7fc3f07be69224" + }, + "custom": { + "sigstore": { + "status": "Expired", + "uri": "https://fulcio.sigstore.dev", + "usage": "Fulcio" + } + } + }, + "fulcio_intermediate_v1.crt.pem": { + "length": 789, + "hashes": { + "sha256": "f8cbecf186db7714624a5f4e99da31a917cbef70a94dd6921f5c3ca969dfe30a", + "sha512": "0f99f47dbc26c5f1e3cba0bfd9af4245a26e5cb735d6ef005792ec7e603f66fdb897de985973a6e50940ca7eff5e1849719e967b5ad2dac74a29115a41cf6f21" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://fulcio.sigstore.dev", + "usage": "Fulcio" + } + } + }, + "fulcio_v1.crt.pem": { + "length": 740, + "hashes": { + "sha256": "f989aa23def87c549404eadba767768d2a3c8d6d30a8b793f9f518a8eafd2cf5", + "sha512": "f2e33a6dc208cee1f51d33bbea675ab0f0ced269617497985f9a0680689ee7073e4b6f8fef64c91bda590d30c129b3070dddce824c05bc165ac9802f0705cab6" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://fulcio.sigstore.dev", + "usage": "Fulcio" + } + } + }, + "rekor.pub": { + "length": 178, + "hashes": { + "sha256": "dce5ef715502ec9f3cdfd11f8cc384b31a6141023d3e7595e9908a81cb6241bd", + "sha512": "0ae7705e02db33e814329746a4a0e5603c5bdcd91c96d072158d71011a2695788866565a2fec0fe363eb72cbcaeda39e54c5fe8d416daf9f3101fdba4217ef35" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://rekor.sigstore.dev", + "usage": "Rekor" + } + } + }, + "trusted_root.json": { + "length": 4567, + "hashes": { + "sha256": "cec894ad77f79b1cb324150f6363012bcef7492954f3ab9134f932e6aa2e2e20", + "sha512": "08be2fd75c19e654caad30852847c566f97e6245f2bbcc54d347d6bdec7e879135e3395b5633b9e3b85d739fdb9b4eb8c09ddc70495792bc2ea65c8caf770d27" + } + } + } + }, + "signatures": [ + { + "keyid": "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de", + "sig": "3044022061696eb6f8b51dd576b283f1326721fc1287ed87301f96b2b694e711efd0308702205a8f8b30c093032400d0e8a2d16388cebc3ad36fddd78baed7e8f6199a95aec8" + }, + { + "keyid": "ff51e17fcf253119b7033f6f57512631da4a0969442afcf9fc8b141c7f2be99c", + "sig": "3046022100b1c637be9b9ca306538a686f24943fa1bceb0e6efaeb8d8c66182502a6e1a651022100a9c002f701ecf37f7fbf493bd2a97751f1280d9786fb34fafa13b78182f59822" + }, + { + "keyid": "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99", + "sig": "30450221009b51e35eb5f6fbe664d8d9f2131a0293d6bf4e9128debba563892d17e51c4132022056cf3a48a482dc09d56b78ffacf13a5045054b7861b154239fc6b78c44b282e7" + }, + { + "keyid": "f5312f542c21273d9485a49394386c4575804770667f2ddb59b3bf0669fddd2f", + "sig": "3045022100c508e1c2ac28ff5beb50aa2868f55fcba73fe17ea02d73d76b334778a65aba8102203ffd85878fd0f8ec78f8124a5229720c2d91536608d5487022fe502d6e4d7649" + }, + { + "keyid": "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b", + "sig": "3045022100968006fba63357bfbe81a6bd43228f46586fd5a15cd2519fc00d629636687ef1022002b2766ee0d845d48db09a8787d375d535d10573f4fc227b06a8b4ec46b883f4" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/60.snapshot.json b/tuf-no-std/tests/60.snapshot.json new file mode 100644 index 0000000..7a81803 --- /dev/null +++ b/tuf-no-std/tests/60.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 60, + "expires": "2023-01-05T00:08:27Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3045022064943e143665125a93e0646bd24516f7d8b950caf644a13a129d415d5a557f8d022100d6409dbaafb5d8698974dfe987dc84d6c49a364b1bd20641bfeebb002285e18d" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/61.snapshot.json b/tuf-no-std/tests/61.snapshot.json new file mode 100644 index 0000000..1589f1c --- /dev/null +++ b/tuf-no-std/tests/61.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 61, + "expires": "2023-01-12T00:07:59Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "30440220437f105a861bf1c828c9fd016557688e095e630b61e3f1707961300e63f0894c022012f7f4f292e2f01ca32351571c0cf3e2ef20e7f3ea69b00dba539d45d6f1ea0b" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/62.snapshot.json b/tuf-no-std/tests/62.snapshot.json new file mode 100644 index 0000000..059b5a9 --- /dev/null +++ b/tuf-no-std/tests/62.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 62, + "expires": "2023-01-19T01:12:57Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3046022100ec02beec8d301be4f160045deac81122a6c3a84fd7df825293118db93ebb80c6022100cbfe25f7034c834d0d06a734e7c33810a8797fa9b0f3448674bf6289b88d7250" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/63.snapshot.json b/tuf-no-std/tests/63.snapshot.json new file mode 100644 index 0000000..06a5a1c --- /dev/null +++ b/tuf-no-std/tests/63.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 63, + "expires": "2023-01-22T00:08:42Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3045022100c829b6534ee82724a771ab77791d794ea210cf33549ccdab103795adc0875bdf0220577bbd2b892481d5da8fa0fd32238ad07b25995c31e1222108b021c400ff4813" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/64.snapshot.json b/tuf-no-std/tests/64.snapshot.json new file mode 100644 index 0000000..39726ce --- /dev/null +++ b/tuf-no-std/tests/64.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 64, + "expires": "2023-01-29T00:08:48Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "30450221008cd2c0e3aa7cf586237d0ad60651db27e0fd7369f6939a6b11ebe5006283f44a02200be12170e98f1e0e7b4796c514bf7fda2a174aaeb32dae8c6e44a87d2bc3d5aa" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/65.snapshot.json b/tuf-no-std/tests/65.snapshot.json new file mode 100644 index 0000000..099fef6 --- /dev/null +++ b/tuf-no-std/tests/65.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 65, + "expires": "2023-02-05T00:08:38Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "30440220190e4f5c1fa91fcb4da0598dae9606d1145ee26dde02038383b19f93c7db2aa602205c566db8f3c786ab572db379fa15a49ae8e3626d666e76cd95ab07eb9d05e4b6" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/66.snapshot.json b/tuf-no-std/tests/66.snapshot.json new file mode 100644 index 0000000..5009336 --- /dev/null +++ b/tuf-no-std/tests/66.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 66, + "expires": "2023-02-12T00:08:53Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3044022069a7ea2db1987ee76884ed5350840d95909b9c655c8f62deccb6e3ac23dde58a02207344d3fa328df12d9a33acf62076a33776965569e2d1f685273343dfb7efa0a2" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/67.snapshot.json b/tuf-no-std/tests/67.snapshot.json new file mode 100644 index 0000000..5800e64 --- /dev/null +++ b/tuf-no-std/tests/67.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 67, + "expires": "2023-02-19T00:08:44Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3045022100b39e717d8629d1c291ab2d77e1c16facbda14e7fc9132910b240f0e4f4efab79022003becd79ee922bb2f76c38c84fd9ad1688578737333799307e2013fe3631860c" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/68.snapshot.json b/tuf-no-std/tests/68.snapshot.json new file mode 100644 index 0000000..7b32788 --- /dev/null +++ b/tuf-no-std/tests/68.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 68, + "expires": "2023-02-22T00:09:16Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3046022100c1304df9ba6f3d1c28b7f5fd31e2f874b29f7b163bffe3f096847594924f1aeb022100e33ee32d9334668ee2af6b609ca58e1b158b5472b7e04be5c8207b783138a838" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/69.snapshot.json b/tuf-no-std/tests/69.snapshot.json new file mode 100644 index 0000000..4a23bf3 --- /dev/null +++ b/tuf-no-std/tests/69.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 69, + "expires": "2023-03-01T00:07:52Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3044022056f506140374dda69b810c22673b3facb5ed298a5168cc935abb76854ac70aa30220530e72f5b2bb824e772a1d14ebc8137ff4677792f1ae861b115b5cc06426d251" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/7.root.json b/tuf-no-std/tests/7.root.json new file mode 100644 index 0000000..c3ea9cb --- /dev/null +++ b/tuf-no-std/tests/7.root.json @@ -0,0 +1,140 @@ +{ + "signed": { + "_type": "root", + "spec_version": "1.0", + "version": 7, + "expires": "2023-10-04T13:08:11Z", + "keys": { + "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEEXsz3SZXFb8jMV42j6pJlyjbjR8K\nN3Bwocexq6LMIb5qsWKOQvLN16NUefLc4HswOoumRsVVaajSpQS6fobkRw==\n-----END PUBLIC KEY-----\n" + } + }, + "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0ghrh92Lw1Yr3idGV5WqCtMDB8Cx\n+D8hdC4w2ZLNIplVRoVGLskYa3gheMyOjiJ8kPi15aQ2//7P+oj7UvJPGw==\n-----END PUBLIC KEY-----\n" + } + }, + "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAELrWvNt94v4R085ELeeCMxHp7PldF\n0/T1GxukUh2ODuggLGJE0pc1e8CSBf6CS91Fwo9FUOuRsjBUld+VqSyCdQ==\n-----END PUBLIC KEY-----\n" + } + }, + "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEinikSsAQmYkNeH5eYq/CnIzLaacO\nxlSaawQDOwqKy/tCqxq5xxPSJc21K4WIhs9GyOkKfzueY3GILzcMJZ4cWw==\n-----END PUBLIC KEY-----\n" + } + }, + "e1863ba02070322ebc626dcecf9d881a3a38c35c3b41a83765b6ad6c37eaec2a": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWRiGr5+j+3J5SsH+Ztr5nE2H2wO7\nBV+nO3s93gLca18qTOzHY1oWyAGDykMSsGTUBSt9D+An0KfKsD2mfSM42Q==\n-----END PUBLIC KEY-----\n" + } + }, + "f5312f542c21273d9485a49394386c4575804770667f2ddb59b3bf0669fddd2f": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzBzVOmHCPojMVLSI364WiiV8NPrD\n6IgRxVliskz/v+y3JER5mcVGcONliDcWMC5J2lfHmjPNPhb4H7xm8LzfSA==\n-----END PUBLIC KEY-----\n" + } + }, + "ff51e17fcf253119b7033f6f57512631da4a0969442afcf9fc8b141c7f2be99c": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEy8XKsmhBYDI8Jc0GwzBxeKax0cm5\nSTKEU65HPFunUn41sT8pi0FjM4IkHz/YUmwmLUO0Wt7lxhj6BkLIK4qYAw==\n-----END PUBLIC KEY-----\n" + } + } + }, + "roles": { + "root": { + "keyids": [ + "ff51e17fcf253119b7033f6f57512631da4a0969442afcf9fc8b141c7f2be99c", + "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99", + "f5312f542c21273d9485a49394386c4575804770667f2ddb59b3bf0669fddd2f", + "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b", + "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de" + ], + "threshold": 3 + }, + "snapshot": { + "keyids": [ + "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "ff51e17fcf253119b7033f6f57512631da4a0969442afcf9fc8b141c7f2be99c", + "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99", + "f5312f542c21273d9485a49394386c4575804770667f2ddb59b3bf0669fddd2f", + "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b", + "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de" + ], + "threshold": 3 + }, + "timestamp": { + "keyids": [ + "e1863ba02070322ebc626dcecf9d881a3a38c35c3b41a83765b6ad6c37eaec2a" + ], + "threshold": 1 + } + }, + "consistent_snapshot": true + }, + "signatures": [ + { + "keyid": "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99", + "sig": "3046022100c0610c0055ce5c4a52d054d7322e7b514d55baf44423d63aa4daa077cc60fd1f022100a097f2803f090fb66c42ead915a2c46ebe7db53a32bf18f2188275cc936f8bdd" + }, + { + "keyid": "f5312f542c21273d9485a49394386c4575804770667f2ddb59b3bf0669fddd2f", + "sig": "304502203134f0468810299d5493a867c40630b341296b92e59c29821311d353343bb3a4022100e667ae3d304e7e3da0894c7425f6b9ecd917106841280e5cf6f3496ad5f8f68e" + }, + { + "keyid": "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b", + "sig": "3045022037fe5f45426f21eaaf4730d2136f2b1611d6379688f79b9d1e3f61719997135c022100b63b022d7b79d4694b96f416d88aa4d7b1a3bff8a01f4fb51e0f42137c7d2d06" + }, + { + "keyid": "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de", + "sig": "3044022007cc8fcc4940809f2751ad5b535f4c5f53f5b4952f5b5696b09668e743306ac1022006dfcdf94e94c92163eeb1b47796db62cedaa730aa13aa61b573fe23714730f2" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/7.targets.json b/tuf-no-std/tests/7.targets.json new file mode 100644 index 0000000..c63cce9 --- /dev/null +++ b/tuf-no-std/tests/7.targets.json @@ -0,0 +1,160 @@ +{ + "signed": { + "_type": "targets", + "spec_version": "1.0", + "version": 7, + "expires": "2023-10-04T13:26:23Z", + "targets": { + "artifact.pub": { + "length": 177, + "hashes": { + "sha256": "59ebf97a9850aecec4bc39c1f5c1dc46e6490a6b5fd2a6cacdcac0c3a6fc4cbf", + "sha512": "308fd1d1d95d7f80aa33b837795251cc3e886792982275e062409e13e4e236ffc34d676682aa96fdc751414de99c864bf132dde71581fa651c6343905e3bf988" + }, + "custom": { + "sigstore": { + "status": "Active", + "usage": "Unknown" + } + } + }, + "ctfe.pub": { + "length": 177, + "hashes": { + "sha256": "7fcb94a5d0ed541260473b990b99a6c39864c1fb16f3f3e594a5a3cebbfe138a", + "sha512": "4b20747d1afe2544238ad38cc0cc3010921b177d60ac743767e0ef675b915489bd01a36606c0ff83c06448622d7160f0d866c83d20f0c0f44653dcc3f9aa0bd4" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://ctfe.sigstore.dev/test", + "usage": "CTFE" + } + } + }, + "ctfe_2022.pub": { + "length": 178, + "hashes": { + "sha256": "270488a309d22e804eeb245493e87c667658d749006b9fee9cc614572d4fbbdc", + "sha512": "e83fa4f427b24ee7728637fad1b4aa45ebde2ba02751fa860694b1bb16059a490328f9985e51cc70e4d237545315a1bc866dc4fdeef2f6248d99cc7a6077bf85" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://ctfe.sigstore.dev/2022", + "usage": "CTFE" + } + } + }, + "fulcio.crt.pem": { + "length": 744, + "hashes": { + "sha256": "f360c53b2e13495a628b9b8096455badcb6d375b185c4816d95a5d746ff29908", + "sha512": "0713252a7fd17f7f3ab12f88a64accf2eb14b8ad40ca711d7fe8b4ecba3b24db9e9dffadb997b196d3867b8f9ff217faf930d80e4dab4e235c7fc3f07be69224" + }, + "custom": { + "sigstore": { + "status": "Expired", + "uri": "https://fulcio.sigstore.dev", + "usage": "Fulcio" + } + } + }, + "fulcio_intermediate_v1.crt.pem": { + "length": 789, + "hashes": { + "sha256": "f8cbecf186db7714624a5f4e99da31a917cbef70a94dd6921f5c3ca969dfe30a", + "sha512": "0f99f47dbc26c5f1e3cba0bfd9af4245a26e5cb735d6ef005792ec7e603f66fdb897de985973a6e50940ca7eff5e1849719e967b5ad2dac74a29115a41cf6f21" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://fulcio.sigstore.dev", + "usage": "Fulcio" + } + } + }, + "fulcio_v1.crt.pem": { + "length": 740, + "hashes": { + "sha256": "f989aa23def87c549404eadba767768d2a3c8d6d30a8b793f9f518a8eafd2cf5", + "sha512": "f2e33a6dc208cee1f51d33bbea675ab0f0ced269617497985f9a0680689ee7073e4b6f8fef64c91bda590d30c129b3070dddce824c05bc165ac9802f0705cab6" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://fulcio.sigstore.dev", + "usage": "Fulcio" + } + } + }, + "rekor.pub": { + "length": 178, + "hashes": { + "sha256": "dce5ef715502ec9f3cdfd11f8cc384b31a6141023d3e7595e9908a81cb6241bd", + "sha512": "0ae7705e02db33e814329746a4a0e5603c5bdcd91c96d072158d71011a2695788866565a2fec0fe363eb72cbcaeda39e54c5fe8d416daf9f3101fdba4217ef35" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://rekor.sigstore.dev", + "usage": "Rekor" + } + } + }, + "trusted_root.json": { + "length": 7014, + "hashes": { + "sha256": "4364d7724c04cc912ce2a6c45ed2610e8d8d1c4dc857fb500292738d4d9c8d2c", + "sha512": "fdebade075c4840d40f1806a14d0660ae1d22f47c0516abc4141e09f4ddf6ee6f4dbfbf08a7025bea10a4b8794658a4cd8ebb1024b963f239a9bfe02c2057fc6" + } + } + }, + "delegations": { + "keys": { + "a89d235ee2f298d757438c7473b11b0b7b42ff1a45f1dfaac4c014183d6f8c45": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEoLrh0jmOfHWLwsyo/4oGbldF91WV\nfXvxVlDhW8fZwP/3vTnliBkDp5sH8/Dpm1SBOHkqENVt1+4Un/sFtl2zAQ==\n-----END PUBLIC KEY-----\n" + } + } + }, + "roles": [ + { + "name": "registry.npmjs.org", + "keyids": [ + "a89d235ee2f298d757438c7473b11b0b7b42ff1a45f1dfaac4c014183d6f8c45" + ], + "threshold": 1, + "terminating": true, + "paths": [ + "registry.npmjs.org/*" + ] + } + ] + } + }, + "signatures": [ + { + "keyid": "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de", + "sig": "3045022100eeb820ad0b0aabb0f6bf68159d7a9cbd24d1c4633f14317f9944fcb3bb2e1ff802207f92fb20b84df6bcf0c3c2f39fa089238bbee9ff12490c555b694421a45e8d5d" + }, + { + "keyid": "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99", + "sig": "304502202984e536e9442c9f5a14700195b481fb0b3255e4572734700c5ff527b1135f88022100be2f4947b34a02e391417c96ffab8643476164fc44fa258bfe0133ab49858f29" + }, + { + "keyid": "f5312f542c21273d9485a49394386c4575804770667f2ddb59b3bf0669fddd2f", + "sig": "3045022100d757e9268801bb1eb4f883abd570dae52a3201c622b4e7e5a30a8b42f3e2f54b02206663b846a8d13d95497d651334dbb754587a14c274fadd91ca796733bc467b95" + }, + { + "keyid": "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b", + "sig": "3045022054d7fb7d70a80f8f4021f090307ada7a196a32f4794954baf405475b38e68d45022100d85fde60eecb2003e4eb329e1b68f22d33dbe11a2293155dad88209250b25b2c" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/70.snapshot.json b/tuf-no-std/tests/70.snapshot.json new file mode 100644 index 0000000..a25aa29 --- /dev/null +++ b/tuf-no-std/tests/70.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 70, + "expires": "2023-03-08T00:08:32Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3045022100cc2678b0de41677ccd7653054f39630c923c4555653e28e67a34fecb632d51c6022021590f345a3e6e542f3099b594eccb1de02b635fbaee154269fa10e8ac553112" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/71.snapshot.json b/tuf-no-std/tests/71.snapshot.json new file mode 100644 index 0000000..3d24343 --- /dev/null +++ b/tuf-no-std/tests/71.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 71, + "expires": "2023-03-15T00:09:04Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3044022058c63d131e187d2f810af0933ecad0275be9723ab639f76a307a8b4587101c5502207c80d639b8b1ec83a737d6abfb495016690d20ec01e4003f6442d90c3c6eede1" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/72.snapshot.json b/tuf-no-std/tests/72.snapshot.json new file mode 100644 index 0000000..e6c5003 --- /dev/null +++ b/tuf-no-std/tests/72.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 72, + "expires": "2023-03-22T00:09:39Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4188, + "hashes": { + "sha256": "5dbc142fcda89c914175b4e8570a2745d41f8ff799625b8890e6e56e009038ca", + "sha512": "e9397f3c1b84c7c7e52f91e4e62409c66af42bde74f93e12005054ee5fc00a1811685306276bea115dc1e4679cd8e6d9aeb49115e9493872b0c1c9308f93714a" + }, + "version": 5 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "304502205a3364cefd870314d1bd7f4a9a97c3198e985964a7ed81cd08543a8feef33279022100f3a57fa9531d15d4cdda1aae416d41a12259817803b501fbab691c42d2fce0ca" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/73.snapshot.json b/tuf-no-std/tests/73.snapshot.json new file mode 100644 index 0000000..3eb55f7 --- /dev/null +++ b/tuf-no-std/tests/73.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 73, + "expires": "2023-03-23T12:12:10Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4737, + "hashes": { + "sha256": "79698024b773e7c669b8c5def0031fdc7cd2ab7785d80f7f72a7495472f63218", + "sha512": "e19872e801ccefee869177d72a6f929197fd02faaa823fbd0f0bb6a0833ef7246040f90c313a271fbb2d29ac7ca5cab7aa09d422a9ec85950f2ad297fc455915" + }, + "version": 6 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "30440220138586309855cb19cce0036a72c2119605eee68577eea2bd08c1d8c141e582d502207bc523dce58809c089af8b713b4f577965ba59c759761e899c4ccde5852c8c36" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/74.snapshot.json b/tuf-no-std/tests/74.snapshot.json new file mode 100644 index 0000000..bbbf4c6 --- /dev/null +++ b/tuf-no-std/tests/74.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 74, + "expires": "2023-03-29T00:08:35Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4737, + "hashes": { + "sha256": "79698024b773e7c669b8c5def0031fdc7cd2ab7785d80f7f72a7495472f63218", + "sha512": "e19872e801ccefee869177d72a6f929197fd02faaa823fbd0f0bb6a0833ef7246040f90c313a271fbb2d29ac7ca5cab7aa09d422a9ec85950f2ad297fc455915" + }, + "version": 6 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3045022100c9c6338ee2a24ecea7e2e04d2c1d5b99838c506dcef20ec6f6ec0241fe41286802200f092258a257f519871727ca43fd29f08e48cd8539638b90fb051273cf77d515" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/75.snapshot.json b/tuf-no-std/tests/75.snapshot.json new file mode 100644 index 0000000..3d74ce8 --- /dev/null +++ b/tuf-no-std/tests/75.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 75, + "expires": "2023-04-05T00:08:33Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4737, + "hashes": { + "sha256": "79698024b773e7c669b8c5def0031fdc7cd2ab7785d80f7f72a7495472f63218", + "sha512": "e19872e801ccefee869177d72a6f929197fd02faaa823fbd0f0bb6a0833ef7246040f90c313a271fbb2d29ac7ca5cab7aa09d422a9ec85950f2ad297fc455915" + }, + "version": 6 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3045022100d334e319c67af10e466d743e5ce2098a895290ac3e3d80c20dd180c98ffe8b00022043a7695ea314f53d7a0d27a102c2c28a2e4772cfb3e49c9da16756af0ddd4e09" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/76.snapshot.json b/tuf-no-std/tests/76.snapshot.json new file mode 100644 index 0000000..7bf4e35 --- /dev/null +++ b/tuf-no-std/tests/76.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 76, + "expires": "2023-04-12T00:06:27Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4737, + "hashes": { + "sha256": "79698024b773e7c669b8c5def0031fdc7cd2ab7785d80f7f72a7495472f63218", + "sha512": "e19872e801ccefee869177d72a6f929197fd02faaa823fbd0f0bb6a0833ef7246040f90c313a271fbb2d29ac7ca5cab7aa09d422a9ec85950f2ad297fc455915" + }, + "version": 6 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3046022100dde566254e256db7c69fd03eb5059a1a61c1dfa07a8de8deef613838c08bb665022100d8c9350eaa72ce42df5f7a570aa2ee6d2dc51868520c30279cbd963bcf4209d3" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/77.snapshot.json b/tuf-no-std/tests/77.snapshot.json new file mode 100644 index 0000000..2e31457 --- /dev/null +++ b/tuf-no-std/tests/77.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 77, + "expires": "2023-04-19T00:08:00Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4737, + "hashes": { + "sha256": "79698024b773e7c669b8c5def0031fdc7cd2ab7785d80f7f72a7495472f63218", + "sha512": "e19872e801ccefee869177d72a6f929197fd02faaa823fbd0f0bb6a0833ef7246040f90c313a271fbb2d29ac7ca5cab7aa09d422a9ec85950f2ad297fc455915" + }, + "version": 6 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "304502203c60c26b377a3b7e33ec28875ec19370c453d1c7305f658ba28fae33d95d932d022100edc042951938688e490e8a344390aae0fafc530f10cecb6b7864cb6c4a89b504" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/78.snapshot.json b/tuf-no-std/tests/78.snapshot.json new file mode 100644 index 0000000..ab6974e --- /dev/null +++ b/tuf-no-std/tests/78.snapshot.json @@ -0,0 +1,56 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 78, + "expires": "2023-04-22T00:07:04Z", + "meta": { + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 4737, + "hashes": { + "sha256": "79698024b773e7c669b8c5def0031fdc7cd2ab7785d80f7f72a7495472f63218", + "sha512": "e19872e801ccefee869177d72a6f929197fd02faaa823fbd0f0bb6a0833ef7246040f90c313a271fbb2d29ac7ca5cab7aa09d422a9ec85950f2ad297fc455915" + }, + "version": 6 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "304502207f924837ad510a57a6760723ca46b964d7bc3a5a823de424e377906646b113d3022100a40d3cef790705f5bdeed93f0da28133c7063593758d9a2f6e3458bd4b563db2" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/79.snapshot.json b/tuf-no-std/tests/79.snapshot.json new file mode 100644 index 0000000..006d694 --- /dev/null +++ b/tuf-no-std/tests/79.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 79, + "expires": "2023-04-26T05:54:24Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "304402204c98136370eb818742f2edca6f5eaaa9c210f5b6c09b06a32357dccdba40d33102201c970fea42ae3a46f5cf82968c44066043bd8c85b0b67d73926dbf37ea161df2" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/80.snapshot.json b/tuf-no-std/tests/80.snapshot.json new file mode 100644 index 0000000..32dd5d0 --- /dev/null +++ b/tuf-no-std/tests/80.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 80, + "expires": "2023-05-02T16:15:56Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3046022100c2ee8a19903b6eaaade0795d53ef56d944659f70cde8e698a8ea3e505fb622c1022100ee4af7afa8f1831580e767cfcf568b6378082fd790ed92ed2b6630b71e932eb7" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/81.snapshot.json b/tuf-no-std/tests/81.snapshot.json new file mode 100644 index 0000000..0233de4 --- /dev/null +++ b/tuf-no-std/tests/81.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 81, + "expires": "2023-05-06T00:06:37Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "304402202484c66f0dd45dc99a9dd7ec78e46e4eeaf255ccf7a203ccfe55967a6aed532d022079685790ce2f6ef8916d67c3ee3e140af68b9f2b12c9cfe3e10109813ba87fb5" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/82.snapshot.json b/tuf-no-std/tests/82.snapshot.json new file mode 100644 index 0000000..eaaca1a --- /dev/null +++ b/tuf-no-std/tests/82.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 82, + "expires": "2023-05-13T00:06:59Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3046022100ce1e8c5262c35b375c16a45474c62e957bdc592f3abf6b4bcb5f2f23059e4bc5022100b238ab12c46c2a6c49d00a8224e5c6726a0fcbdc63bc76a82dc17df3765286cf" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/83.snapshot.json b/tuf-no-std/tests/83.snapshot.json new file mode 100644 index 0000000..f98bc78 --- /dev/null +++ b/tuf-no-std/tests/83.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 83, + "expires": "2023-05-20T00:06:32Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3044022002aff3ecdbf751886222e1f5c562de3fc5e90726685ddb82a6a30c20014101260220790576ec4eff2cfeb640d5e81e939f5e2d836ae083a68c4ca6f215e2c094b043" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/84.snapshot.json b/tuf-no-std/tests/84.snapshot.json new file mode 100644 index 0000000..5cb83df --- /dev/null +++ b/tuf-no-std/tests/84.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 84, + "expires": "2023-05-22T00:07:24Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3045022100c907199023ea376a3eb432e0ddff75247f7906c11ab5513797eac623350cab0d02207e30c2ff78e85d3312b30370e07ea9571fe896ca5b2ef3973d51162d90868ee5" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/85.snapshot.json b/tuf-no-std/tests/85.snapshot.json new file mode 100644 index 0000000..7e3fd20 --- /dev/null +++ b/tuf-no-std/tests/85.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 85, + "expires": "2023-05-29T16:02:03Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3046022100ec501e5ad6335320705a673e8d27ead029378267ee1278f7d74f92714d54c6c3022100b5b25e58eaf5d8aa533916fd3f0d938a8169c060db3aea0fbf3e8e59c14c7da4" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/86.snapshot.json b/tuf-no-std/tests/86.snapshot.json new file mode 100644 index 0000000..6d6db68 --- /dev/null +++ b/tuf-no-std/tests/86.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 86, + "expires": "2023-06-05T16:07:24Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "30440220059a3e2653a888ec3a249d0561167d6ff301efab5777e514c2ed70f859a7d01a0220259f6bf0c8cd34444c5a0a96858ea30e2b646357ff06f3cb389f761408ce3cea" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/87.snapshot.json b/tuf-no-std/tests/87.snapshot.json new file mode 100644 index 0000000..43f2b86 --- /dev/null +++ b/tuf-no-std/tests/87.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 87, + "expires": "2023-06-12T16:02:17Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3046022100a70cceb25c5f93bfb0bf6861255bcc5abc776b1b8d51c1b764efa3d5d15d629d022100d662773a81c824c0f5d2bc1431caedf5289609836c7daf0cc962f2306920defb" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/88.snapshot.json b/tuf-no-std/tests/88.snapshot.json new file mode 100644 index 0000000..87df2ce --- /dev/null +++ b/tuf-no-std/tests/88.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 88, + "expires": "2023-06-19T16:02:51Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3045022100f5591102af8e08a6d27ad9ea821c0db14e0df2fd37200af8e2aac79219bc4dea02207a5e98247f8b3da8656ae2ac4b80910bef119b66f8bd9b980312c58c463f2219" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/89.snapshot.json b/tuf-no-std/tests/89.snapshot.json new file mode 100644 index 0000000..f2b70f7 --- /dev/null +++ b/tuf-no-std/tests/89.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 89, + "expires": "2023-06-26T16:01:55Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3044022012187d7abce242e7feac4818c770630ee6d799b54f923098147946058d69f712022037b9958c15a058f4890d3b4c54420488bb9a52562cd42916c54073fa4fa7d2eb" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/90.snapshot.json b/tuf-no-std/tests/90.snapshot.json new file mode 100644 index 0000000..8d87a62 --- /dev/null +++ b/tuf-no-std/tests/90.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 90, + "expires": "2023-07-03T16:03:08Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3046022100dd3b064b0da1653ebc8f2084473c0c4f89431e544e7e9f12492b8c1578719d2c022100ec60cedb17835da34740f6cf3408a5f0175c1a7601b50081e93f6fc95da21bbd" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/91.snapshot.json b/tuf-no-std/tests/91.snapshot.json new file mode 100644 index 0000000..4ea3a91 --- /dev/null +++ b/tuf-no-std/tests/91.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 91, + "expires": "2023-07-10T16:02:00Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "30440220773c14c5c76caf7f3b02b0bfd19451d629625132821aced5ad9b5f88bd83c82b02201ebae49d90aa95cf05e60eb211316062abbb9d1d929717410414be6575fb658e" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/92.snapshot.json b/tuf-no-std/tests/92.snapshot.json new file mode 100644 index 0000000..5ce6f3c --- /dev/null +++ b/tuf-no-std/tests/92.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 92, + "expires": "2023-07-17T16:01:58Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "304402204e4a84fa9cf115ea8df23c523efdad10556f083c599f99bcbed8357c9e6ef10902202940758be7718dc09944ba82a1b7626abe61f135608ebee4f7b4c36a04c508d8" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/93.snapshot.json b/tuf-no-std/tests/93.snapshot.json new file mode 100644 index 0000000..ec70850 --- /dev/null +++ b/tuf-no-std/tests/93.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 93, + "expires": "2023-07-24T16:02:12Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3046022100834c88c5e4da6510e9ccae8340191ffc6ec9edaf978ecd6d5842f81dbb942412022100e5fef7dbc388fe6ee09a922346780ac34d7832655a8cdd35d5338e48c0711f07" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/94.snapshot.json b/tuf-no-std/tests/94.snapshot.json new file mode 100644 index 0000000..6722bcb --- /dev/null +++ b/tuf-no-std/tests/94.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 94, + "expires": "2023-07-31T16:01:54Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3044022061e74ee2e3ead8a1571b67cef13f03cd1b269c0009ee61c47146430cc7e53de8022001daf18d96510630c8360749e238ea62186b9ce1652011fd2898af4390e40540" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/95.snapshot.json b/tuf-no-std/tests/95.snapshot.json new file mode 100644 index 0000000..b8c0bf9 --- /dev/null +++ b/tuf-no-std/tests/95.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 95, + "expires": "2023-08-07T16:01:59Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3045022100b55e57cd19dedf2ec1e59849704b5ae839fa24aafcd6b06281926137daf178bc02201149c08507cf049dd4bc23874853889305a74f714e30b26a98f7350cfb0e61a1" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/96.snapshot.json b/tuf-no-std/tests/96.snapshot.json new file mode 100644 index 0000000..51edcce --- /dev/null +++ b/tuf-no-std/tests/96.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 96, + "expires": "2023-08-14T16:01:40Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3044022023fce9e7c4626d222afd4fe0e2ab1d8f364abcb09b7b9b04cd30e0d363288fca02203e791a4cb731d873018cba209f80a076e22e3c8d40a1c912a36382b0ea75b3b5" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/97.snapshot.json b/tuf-no-std/tests/97.snapshot.json new file mode 100644 index 0000000..6fb45d2 --- /dev/null +++ b/tuf-no-std/tests/97.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 97, + "expires": "2023-08-15T16:07:13Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "304402200de4c9766e8c95c1648fea7e76972da549f273b1827bcd87d67007ede26f4db102206b96ea81507052b08c44307b5382806d560e383b5202e95b5282669a4d6e21f3" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/98.snapshot.json b/tuf-no-std/tests/98.snapshot.json new file mode 100644 index 0000000..6296f83 --- /dev/null +++ b/tuf-no-std/tests/98.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 98, + "expires": "2023-08-22T16:06:39Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3045022100e09ed2c67f70b8050e9f1bb5e93d20568db2d2e5e06784f5d4873ef31b4db549022070d2eb5648a1416f3a5bb1f6c7e5ab37c8d80d05ac7f51922ad81eaed87fb140" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/99.snapshot.json b/tuf-no-std/tests/99.snapshot.json new file mode 100644 index 0000000..a31fefd --- /dev/null +++ b/tuf-no-std/tests/99.snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 99, + "expires": "2023-08-29T16:06:57Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "304502202b8ef04b9b4584d5d99fece32d801a01d8eb2d8a4d26c17bf2837ab4976577f2022100a01385d9e06bfe28f9859272ac4bb087a44f9d22ab7e02655766399dc5aae557" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/generated_data/ed25519_metadata/root_with_ed25519.json b/tuf-no-std/tests/generated_data/ed25519_metadata/root_with_ed25519.json new file mode 100644 index 0000000..0181de4 --- /dev/null +++ b/tuf-no-std/tests/generated_data/ed25519_metadata/root_with_ed25519.json @@ -0,0 +1,71 @@ +{ + "signatures": [ + { + "keyid": "5822582e7072996c1eef1cec24b61115d364987faa486659fe3d3dce8dae2aba", + "sig": "06fc2b26d10afae02689c96dee96ff40e702734accec6f3e69671dec0a59e0763bd7cb7d5ffa4b9e87441c4c98e798ce97cb462e7075e38ad9bc1d0d0c657309" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": true, + "expires": "2050-01-01T00:00:00Z", + "keys": { + "09d440e3725cec247dcb8703b646a87dd2a4d75343e8095c036c32795eefe3b9": { + "keytype": "ed25519", + "keyval": { + "public": "250f9ae3d1d3d5c419a73cfb4a470c01de1d5d3d61a3825416b5f5d6b88f4a30" + }, + "scheme": "ed25519" + }, + "2be5c21e3614f9f178fb49c4a34d0c18ffac30abd14ced917c60a52c8d8094b7": { + "keytype": "ed25519", + "keyval": { + "public": "0e6738fc1ac6fb4de680b4be99ecbcd99b030f3963f291277eef67bb9bd123e9" + }, + "scheme": "ed25519" + }, + "3458204ed467519c19a5316eb278b5608472a1bbf15850ebfb462d5315e4f86d": { + "keytype": "ed25519", + "keyval": { + "public": "82380623abb9666d4bf274b1a02577469445a972e5650d270101faa5107b19c8" + }, + "scheme": "ed25519" + }, + "5822582e7072996c1eef1cec24b61115d364987faa486659fe3d3dce8dae2aba": { + "keytype": "ed25519", + "keyval": { + "public": "b11d2ff132c033a657318c74c39526476c56de7556c776f11070842dbc4ac14c" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "5822582e7072996c1eef1cec24b61115d364987faa486659fe3d3dce8dae2aba" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "3458204ed467519c19a5316eb278b5608472a1bbf15850ebfb462d5315e4f86d" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "2be5c21e3614f9f178fb49c4a34d0c18ffac30abd14ced917c60a52c8d8094b7" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "09d440e3725cec247dcb8703b646a87dd2a4d75343e8095c036c32795eefe3b9" + ], + "threshold": 1 + } + }, + "spec_version": "1.0.31", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/generated_data/ed25519_metadata/snapshot_with_ed25519.json b/tuf-no-std/tests/generated_data/ed25519_metadata/snapshot_with_ed25519.json new file mode 100644 index 0000000..ec14913 --- /dev/null +++ b/tuf-no-std/tests/generated_data/ed25519_metadata/snapshot_with_ed25519.json @@ -0,0 +1,19 @@ +{ + "signatures": [ + { + "keyid": "3458204ed467519c19a5316eb278b5608472a1bbf15850ebfb462d5315e4f86d", + "sig": "bab356be0a82b85b9529aa4625cbd7b8e03b71d1a0fb5d3242f6e8377f102bcf60cc1b8c2a566fd5618c5f5ee3fc07745e84920d26e5514ad455868d7899ae03" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2050-01-01T00:00:00Z", + "meta": { + "targets.json": { + "version": 1 + } + }, + "spec_version": "1.0.31", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/generated_data/ed25519_metadata/targets_with_ed25519.json b/tuf-no-std/tests/generated_data/ed25519_metadata/targets_with_ed25519.json new file mode 100644 index 0000000..36572b5 --- /dev/null +++ b/tuf-no-std/tests/generated_data/ed25519_metadata/targets_with_ed25519.json @@ -0,0 +1,15 @@ +{ + "signatures": [ + { + "keyid": "2be5c21e3614f9f178fb49c4a34d0c18ffac30abd14ced917c60a52c8d8094b7", + "sig": "9e47f85b3edc79b7215bfee1291da46655deca0b6de99cb3968293218f3329855e57c1523120a50e3a2a8cc50aa9e886f4f74d902d28f43559f294681152f30b" + } + ], + "signed": { + "_type": "targets", + "expires": "2050-01-01T00:00:00Z", + "spec_version": "1.0.31", + "targets": {}, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/generated_data/ed25519_metadata/timestamp_with_ed25519.json b/tuf-no-std/tests/generated_data/ed25519_metadata/timestamp_with_ed25519.json new file mode 100644 index 0000000..b789090 --- /dev/null +++ b/tuf-no-std/tests/generated_data/ed25519_metadata/timestamp_with_ed25519.json @@ -0,0 +1,19 @@ +{ + "signatures": [ + { + "keyid": "09d440e3725cec247dcb8703b646a87dd2a4d75343e8095c036c32795eefe3b9", + "sig": "f1b1921a5963485eb5f1cf83f1b44548420bdcced420a367f0c42b63c91950410287f6d062824941085361c3906bb44a365352e2971787a653443ff8df484007" + } + ], + "signed": { + "_type": "timestamp", + "expires": "2050-01-01T00:00:00Z", + "meta": { + "snapshot.json": { + "version": 1 + } + }, + "spec_version": "1.0.31", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/registry.npmjs.org.json b/tuf-no-std/tests/registry.npmjs.org.json new file mode 100644 index 0000000..49d5d5f --- /dev/null +++ b/tuf-no-std/tests/registry.npmjs.org.json @@ -0,0 +1,23 @@ +{ + "signed": { + "_type": "targets", + "spec_version": "1.0", + "version": 1, + "expires": "2023-10-04T13:26:23Z", + "targets": { + "registry.npmjs.org/keys.json": { + "length": 1017, + "hashes": { + "sha256": "7a8ec9678ad824cdccaa7a6dc0961caf8f8df61bc7274189122c123446248426", + "sha512": "881a853ee92d8cf513b07c164fea36b22a7305c256125bdfffdc5c65a4205c4c3fc2b5bcc98964349167ea68d40b8cd02551fcaa870a30d4601ba1caf6f63699" + } + } + } + }, + "signatures": [ + { + "keyid": "a89d235ee2f298d757438c7473b11b0b7b42ff1a45f1dfaac4c014183d6f8c45", + "sig": "304402201acf213d8e3dea0a5f0c1757e4409a02661bcfab3278419307994ead07c36cb4022029986ed2241c630c4e45bf97e043c23220df7612e3718f921fe8a99c7515ad30" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/README.md b/tuf-no-std/tests/repository_data/README.md new file mode 100644 index 0000000..9819e1c --- /dev/null +++ b/tuf-no-std/tests/repository_data/README.md @@ -0,0 +1,48 @@ +# Unit and integration testing + +## Running the tests +The unit and integration tests can be executed by invoking `tox` from any +path under the project directory. + +``` +$ tox +``` + +Or by invoking `aggregate_tests.py` from the +[tests](https://github.com/theupdateframework/python-tuf/tree/develop/tests) +directory. + +``` +$ python3 aggregate_tests.py +``` + +Note: integration tests end in `_integration.py`. + +If you wish to run a particular unit test, navigate to the tests directory and +run that specific unit test. For example: + +``` +$ python3 test_updater.py +``` + +It it also possible to run the test cases of a unit test. For instance: + +``` +$ python3 -m unittest test_updater.TestMultiRepoUpdater.test_get_one_valid_targetinfo +``` + +## Setup +The unit and integration tests operate on static metadata available in the +[repository_data +directory](https://github.com/theupdateframework/python-tuf/tree/develop/tests/repository_data/). +Before running the tests, static metadata is first copied to temporary +directories and modified, as needed, by the tests. + +The test modules typically spawn HTTP(S) servers that serve metadata and target +files for the unit tests. The [map +file](https://github.com/theupdateframework/python-tuf/tree/develop/tests/repository_data) +specifies the location of the test repositories and other properties. For +specific targets and metadata provided by the tests repositories, please +inspect their [respective +metadata](https://github.com/theupdateframework/python-tuf/tree/develop/tests/repository_data/repository). + diff --git a/tuf-no-std/tests/repository_data/client/map.json b/tuf-no-std/tests/repository_data/client/map.json new file mode 100644 index 0000000..d683880 --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/map.json @@ -0,0 +1,33 @@ +{ + "mapping": [ + { + "paths": [ + "*1.txt" + ], + "repositories": [ + "test_repository1", + "test_repository2" + ], + "terminating": false, + "threshold": 1 + }, + { + "paths": [ + "*3.txt" + ], + "repositories": [ + "test_repository2" + ], + "terminating": true, + "threshold": 1 + } + ], + "repositories": { + "test_repository1": [ + "http://localhost:30001" + ], + "test_repository2": [ + "http://localhost:30002" + ] + } +} diff --git a/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/1.root.json b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/1.root.json new file mode 100644 index 0000000..214d8db --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/1.root.json @@ -0,0 +1,87 @@ +{ + "signatures": [ + { + "keyid": "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb", + "sig": "a337d6375fedd2eabfcd6c2ef6c8a9c3bb85dc5a857715f6a6bd41123e7670c4972d8548bcd7248154f3d864bf25f1823af59d74c459f41ea09a02db057ca1245612ebbdb97e782c501dc3e094f7fa8aa1402b03c6ed0635f565e2a26f9f543a89237e15a2faf0c267e2b34c3c38f2a43a28ddcdaf8308a12ead8c6dc47d1b762de313e9ddda8cc5bc25aea1b69d0e5b9199ca02f5dda48c3bff615fd12a7136d00634b9abc6e75c3256106c4d6f12e6c43f6195071355b2857bbe377ce028619b58837696b805040ce144b393d50a472531f430fadfb68d3081b6a8b5e49337e328c9a0a3f11e80b0bc8eb2dc6e78d1451dd857e6e6e6363c3fd14c590aa95e083c9bfc77724d78af86eb7a7ef635eeddaa353030c79f66b3ba9ea11fab456cfe896a826fdfb50a43cd444f762821aada9bcd7b022c0ee85b8768f960343d5a1d3d76374cc0ac9e12a500de0bf5d48569e5398cadadadab045931c398e3bcb6cec88af2437ba91959f956079cbed159fed3938016e6c3b5e446131f81cc5981" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": false, + "expires": "2030-01-01T00:00:00Z", + "keys": { + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "rsa", + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA0GjPoVrjS9eCqzoQ8VRe\nPkC0cI6ktiEgqPfHESFzyxyjC490Cuy19nuxPcJuZfN64MC48oOkR+W2mq4pM51i\nxmdG5xjvNOBRkJ5wUCc8fDCltMUTBlqt9y5eLsf/4/EoBU+zC4SW1iPU++mCsity\nfQQ7U6LOn3EYCyrkH51hZ/dvKC4o9TPYMVxNecJ3CL1q02Q145JlyjBTuM3Xdqsa\nndTHoXSRPmmzgB/1dL/c4QjMnCowrKW06mFLq9RAYGIaJWfM/0CbrOJpVDkATmEc\nMdpGJYDfW/sRQvRdlHNPo24ZW7vkQUCqdRxvnTWkK5U81y7RtjLt1yskbWXBIbOV\nz94GXsgyzANyCT9qRjHXDDz2mkLq+9I2iKtEqaEePcWRu3H6RLahpM/TxFzw684Y\nR47weXdDecPNxWyiWiyMGStRFP4Cg9trcwAGnEm1w8R2ggmWphznCd5dXGhPNjfA\na82yNFY8ubnOUVJOf0nXGg3Edw9iY3xyjJb2+nrsk5f3AgMBAAE=\n-----END PUBLIC KEY-----" + }, + "scheme": "rsassa-pss-sha256" + }, + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "edcd0a32a07dce33f7c7873aaffbff36d20ea30787574ead335eefd337e4dacd" + }, + "scheme": "ed25519" + }, + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "89f28bd4ede5ec3786ab923fd154f39588d20881903e69c7b08fb504c6750815" + }, + "scheme": "ed25519" + }, + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "82ccf6ac47298ff43bfa0cd639868894e305a99c723ff0515ae2e9856eb5bbf4" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758" + ], + "threshold": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/role1.json b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/role1.json new file mode 100644 index 0000000..0ac4687 --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/role1.json @@ -0,0 +1,49 @@ +{ + "signatures": [ + { + "keyid": "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a", + "sig": "9408b46569e622a46f1d35d9fa3c10e17a9285631ced4f2c9c2bba2c2842413fcb796db4e81d6f988fc056c21c407fdc3c10441592cf1e837e088f2e2dfd5403" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": { + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "fcf224e55fa226056adf113ef1eb3d55e308b75b321c8c8316999d8c4fd9e0d9" + }, + "scheme": "ed25519" + } + }, + "roles": [ + { + "keyids": [ + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a" + ], + "name": "role2", + "paths": [], + "terminating": false, + "threshold": 1 + } + ] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": { + "file3.txt": { + "hashes": { + "sha256": "141f740f53781d1ca54b8a50af22cbf74e44c21a998fa2a8a05aaac2c002886b", + "sha512": "ef5beafa16041bcdd2937140afebd485296cd54f7348ecd5a4d035c09759608de467a7ac0eb58753d0242df873c305e8bffad2454aa48f44480f15efae1cacd0" + }, + "length": 28 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/role2.json b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/role2.json new file mode 100644 index 0000000..93f378a --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/role2.json @@ -0,0 +1,19 @@ +{ + "signatures": [ + { + "keyid": "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a", + "sig": "6c32f8cc2c642803a7b3b022ede0cf727e82964c1aa934571ef366bd5050ed02cfe3fdfe5477c08d0cbcc2dd17bb786d37ab1ce2b27e01ad79faf087594e0300" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": {}, + "roles": [] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": {}, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/root.json b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/root.json new file mode 100644 index 0000000..214d8db --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/root.json @@ -0,0 +1,87 @@ +{ + "signatures": [ + { + "keyid": "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb", + "sig": "a337d6375fedd2eabfcd6c2ef6c8a9c3bb85dc5a857715f6a6bd41123e7670c4972d8548bcd7248154f3d864bf25f1823af59d74c459f41ea09a02db057ca1245612ebbdb97e782c501dc3e094f7fa8aa1402b03c6ed0635f565e2a26f9f543a89237e15a2faf0c267e2b34c3c38f2a43a28ddcdaf8308a12ead8c6dc47d1b762de313e9ddda8cc5bc25aea1b69d0e5b9199ca02f5dda48c3bff615fd12a7136d00634b9abc6e75c3256106c4d6f12e6c43f6195071355b2857bbe377ce028619b58837696b805040ce144b393d50a472531f430fadfb68d3081b6a8b5e49337e328c9a0a3f11e80b0bc8eb2dc6e78d1451dd857e6e6e6363c3fd14c590aa95e083c9bfc77724d78af86eb7a7ef635eeddaa353030c79f66b3ba9ea11fab456cfe896a826fdfb50a43cd444f762821aada9bcd7b022c0ee85b8768f960343d5a1d3d76374cc0ac9e12a500de0bf5d48569e5398cadadadab045931c398e3bcb6cec88af2437ba91959f956079cbed159fed3938016e6c3b5e446131f81cc5981" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": false, + "expires": "2030-01-01T00:00:00Z", + "keys": { + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "rsa", + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA0GjPoVrjS9eCqzoQ8VRe\nPkC0cI6ktiEgqPfHESFzyxyjC490Cuy19nuxPcJuZfN64MC48oOkR+W2mq4pM51i\nxmdG5xjvNOBRkJ5wUCc8fDCltMUTBlqt9y5eLsf/4/EoBU+zC4SW1iPU++mCsity\nfQQ7U6LOn3EYCyrkH51hZ/dvKC4o9TPYMVxNecJ3CL1q02Q145JlyjBTuM3Xdqsa\nndTHoXSRPmmzgB/1dL/c4QjMnCowrKW06mFLq9RAYGIaJWfM/0CbrOJpVDkATmEc\nMdpGJYDfW/sRQvRdlHNPo24ZW7vkQUCqdRxvnTWkK5U81y7RtjLt1yskbWXBIbOV\nz94GXsgyzANyCT9qRjHXDDz2mkLq+9I2iKtEqaEePcWRu3H6RLahpM/TxFzw684Y\nR47weXdDecPNxWyiWiyMGStRFP4Cg9trcwAGnEm1w8R2ggmWphznCd5dXGhPNjfA\na82yNFY8ubnOUVJOf0nXGg3Edw9iY3xyjJb2+nrsk5f3AgMBAAE=\n-----END PUBLIC KEY-----" + }, + "scheme": "rsassa-pss-sha256" + }, + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "edcd0a32a07dce33f7c7873aaffbff36d20ea30787574ead335eefd337e4dacd" + }, + "scheme": "ed25519" + }, + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "89f28bd4ede5ec3786ab923fd154f39588d20881903e69c7b08fb504c6750815" + }, + "scheme": "ed25519" + }, + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "82ccf6ac47298ff43bfa0cd639868894e305a99c723ff0515ae2e9856eb5bbf4" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758" + ], + "threshold": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/snapshot.json b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/snapshot.json new file mode 100644 index 0000000..7c8c091 --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/snapshot.json @@ -0,0 +1,25 @@ +{ + "signatures": [ + { + "keyid": "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d", + "sig": "085672c70dffe26610e58542ee552843633cfed973abdad94c56138dbf0cd991644f2d3f27e4dda3098e08ab676e7f52627b587947ae69db1012d59a6da18e0c" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2030-01-01T00:00:00Z", + "meta": { + "role1.json": { + "version": 1 + }, + "role2.json": { + "version": 1 + }, + "targets.json": { + "version": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/targets.json b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/targets.json new file mode 100644 index 0000000..8e21c26 --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/targets.json @@ -0,0 +1,61 @@ +{ + "signatures": [ + { + "keyid": "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093", + "sig": "d65f8db0c1a8f0976552b9742bbb393f24a5fa5eaf145c37aee047236c79dd0b83cfbb8b49fa7803689dfe0031dcf22c4d006b593acac07d69093b9b81722c08" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": { + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "fcf224e55fa226056adf113ef1eb3d55e308b75b321c8c8316999d8c4fd9e0d9" + }, + "scheme": "ed25519" + } + }, + "roles": [ + { + "keyids": [ + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a" + ], + "name": "role1", + "paths": [ + "file3.txt" + ], + "terminating": false, + "threshold": 1 + } + ] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": { + "file1.txt": { + "custom": { + "file_permissions": "0644" + }, + "hashes": { + "sha256": "65b8c67f51c993d898250f40aa57a317d854900b3a04895464313e48785440da", + "sha512": "467430a68afae8e9f9c0771ea5d78bf0b3a0d79a2d3d3b40c69fde4dd42c461448aef76fcef4f5284931a1ffd0ac096d138ba3a0d6ca83fa8d7285a47a296f77" + }, + "length": 31 + }, + "file2.txt": { + "hashes": { + "sha256": "452ce8308500d83ef44248d8e6062359211992fd837ea9e370e561efb1a4ca99", + "sha512": "052b49a21e03606b28942db69aa597530fe52d47ee3d748ba65afcd14b857738e36bc1714c4f4adde46c3e683548552fe5c96722e0e0da3acd9050c2524902d8" + }, + "length": 39 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/timestamp.json b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/timestamp.json new file mode 100644 index 0000000..9a0daf0 --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/current/timestamp.json @@ -0,0 +1,23 @@ +{ + "signatures": [ + { + "keyid": "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758", + "sig": "de0e16920f87bf5500cc65736488ac17e09788cce808f6a4e85eb9e4e478a312b4c1a2d7723af56f7bfb1df533c67d8c93b6f49d39eabe7fae391a08e1f72f01" + } + ], + "signed": { + "_type": "timestamp", + "expires": "2030-01-01T00:00:00Z", + "meta": { + "snapshot.json": { + "hashes": { + "sha256": "8f88e2ba48b412c3843e9bb26e1b6f8fc9e98aceb0fbaa97ba37b4c98717d7ab" + }, + "length": 515, + "version": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/1.root.json b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/1.root.json new file mode 100644 index 0000000..214d8db --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/1.root.json @@ -0,0 +1,87 @@ +{ + "signatures": [ + { + "keyid": "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb", + "sig": "a337d6375fedd2eabfcd6c2ef6c8a9c3bb85dc5a857715f6a6bd41123e7670c4972d8548bcd7248154f3d864bf25f1823af59d74c459f41ea09a02db057ca1245612ebbdb97e782c501dc3e094f7fa8aa1402b03c6ed0635f565e2a26f9f543a89237e15a2faf0c267e2b34c3c38f2a43a28ddcdaf8308a12ead8c6dc47d1b762de313e9ddda8cc5bc25aea1b69d0e5b9199ca02f5dda48c3bff615fd12a7136d00634b9abc6e75c3256106c4d6f12e6c43f6195071355b2857bbe377ce028619b58837696b805040ce144b393d50a472531f430fadfb68d3081b6a8b5e49337e328c9a0a3f11e80b0bc8eb2dc6e78d1451dd857e6e6e6363c3fd14c590aa95e083c9bfc77724d78af86eb7a7ef635eeddaa353030c79f66b3ba9ea11fab456cfe896a826fdfb50a43cd444f762821aada9bcd7b022c0ee85b8768f960343d5a1d3d76374cc0ac9e12a500de0bf5d48569e5398cadadadab045931c398e3bcb6cec88af2437ba91959f956079cbed159fed3938016e6c3b5e446131f81cc5981" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": false, + "expires": "2030-01-01T00:00:00Z", + "keys": { + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "rsa", + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA0GjPoVrjS9eCqzoQ8VRe\nPkC0cI6ktiEgqPfHESFzyxyjC490Cuy19nuxPcJuZfN64MC48oOkR+W2mq4pM51i\nxmdG5xjvNOBRkJ5wUCc8fDCltMUTBlqt9y5eLsf/4/EoBU+zC4SW1iPU++mCsity\nfQQ7U6LOn3EYCyrkH51hZ/dvKC4o9TPYMVxNecJ3CL1q02Q145JlyjBTuM3Xdqsa\nndTHoXSRPmmzgB/1dL/c4QjMnCowrKW06mFLq9RAYGIaJWfM/0CbrOJpVDkATmEc\nMdpGJYDfW/sRQvRdlHNPo24ZW7vkQUCqdRxvnTWkK5U81y7RtjLt1yskbWXBIbOV\nz94GXsgyzANyCT9qRjHXDDz2mkLq+9I2iKtEqaEePcWRu3H6RLahpM/TxFzw684Y\nR47weXdDecPNxWyiWiyMGStRFP4Cg9trcwAGnEm1w8R2ggmWphznCd5dXGhPNjfA\na82yNFY8ubnOUVJOf0nXGg3Edw9iY3xyjJb2+nrsk5f3AgMBAAE=\n-----END PUBLIC KEY-----" + }, + "scheme": "rsassa-pss-sha256" + }, + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "edcd0a32a07dce33f7c7873aaffbff36d20ea30787574ead335eefd337e4dacd" + }, + "scheme": "ed25519" + }, + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "89f28bd4ede5ec3786ab923fd154f39588d20881903e69c7b08fb504c6750815" + }, + "scheme": "ed25519" + }, + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "82ccf6ac47298ff43bfa0cd639868894e305a99c723ff0515ae2e9856eb5bbf4" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758" + ], + "threshold": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/role1.json b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/role1.json new file mode 100644 index 0000000..0ac4687 --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/role1.json @@ -0,0 +1,49 @@ +{ + "signatures": [ + { + "keyid": "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a", + "sig": "9408b46569e622a46f1d35d9fa3c10e17a9285631ced4f2c9c2bba2c2842413fcb796db4e81d6f988fc056c21c407fdc3c10441592cf1e837e088f2e2dfd5403" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": { + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "fcf224e55fa226056adf113ef1eb3d55e308b75b321c8c8316999d8c4fd9e0d9" + }, + "scheme": "ed25519" + } + }, + "roles": [ + { + "keyids": [ + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a" + ], + "name": "role2", + "paths": [], + "terminating": false, + "threshold": 1 + } + ] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": { + "file3.txt": { + "hashes": { + "sha256": "141f740f53781d1ca54b8a50af22cbf74e44c21a998fa2a8a05aaac2c002886b", + "sha512": "ef5beafa16041bcdd2937140afebd485296cd54f7348ecd5a4d035c09759608de467a7ac0eb58753d0242df873c305e8bffad2454aa48f44480f15efae1cacd0" + }, + "length": 28 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/role2.json b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/role2.json new file mode 100644 index 0000000..93f378a --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/role2.json @@ -0,0 +1,19 @@ +{ + "signatures": [ + { + "keyid": "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a", + "sig": "6c32f8cc2c642803a7b3b022ede0cf727e82964c1aa934571ef366bd5050ed02cfe3fdfe5477c08d0cbcc2dd17bb786d37ab1ce2b27e01ad79faf087594e0300" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": {}, + "roles": [] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": {}, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/root.json b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/root.json new file mode 100644 index 0000000..214d8db --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/root.json @@ -0,0 +1,87 @@ +{ + "signatures": [ + { + "keyid": "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb", + "sig": "a337d6375fedd2eabfcd6c2ef6c8a9c3bb85dc5a857715f6a6bd41123e7670c4972d8548bcd7248154f3d864bf25f1823af59d74c459f41ea09a02db057ca1245612ebbdb97e782c501dc3e094f7fa8aa1402b03c6ed0635f565e2a26f9f543a89237e15a2faf0c267e2b34c3c38f2a43a28ddcdaf8308a12ead8c6dc47d1b762de313e9ddda8cc5bc25aea1b69d0e5b9199ca02f5dda48c3bff615fd12a7136d00634b9abc6e75c3256106c4d6f12e6c43f6195071355b2857bbe377ce028619b58837696b805040ce144b393d50a472531f430fadfb68d3081b6a8b5e49337e328c9a0a3f11e80b0bc8eb2dc6e78d1451dd857e6e6e6363c3fd14c590aa95e083c9bfc77724d78af86eb7a7ef635eeddaa353030c79f66b3ba9ea11fab456cfe896a826fdfb50a43cd444f762821aada9bcd7b022c0ee85b8768f960343d5a1d3d76374cc0ac9e12a500de0bf5d48569e5398cadadadab045931c398e3bcb6cec88af2437ba91959f956079cbed159fed3938016e6c3b5e446131f81cc5981" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": false, + "expires": "2030-01-01T00:00:00Z", + "keys": { + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "rsa", + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA0GjPoVrjS9eCqzoQ8VRe\nPkC0cI6ktiEgqPfHESFzyxyjC490Cuy19nuxPcJuZfN64MC48oOkR+W2mq4pM51i\nxmdG5xjvNOBRkJ5wUCc8fDCltMUTBlqt9y5eLsf/4/EoBU+zC4SW1iPU++mCsity\nfQQ7U6LOn3EYCyrkH51hZ/dvKC4o9TPYMVxNecJ3CL1q02Q145JlyjBTuM3Xdqsa\nndTHoXSRPmmzgB/1dL/c4QjMnCowrKW06mFLq9RAYGIaJWfM/0CbrOJpVDkATmEc\nMdpGJYDfW/sRQvRdlHNPo24ZW7vkQUCqdRxvnTWkK5U81y7RtjLt1yskbWXBIbOV\nz94GXsgyzANyCT9qRjHXDDz2mkLq+9I2iKtEqaEePcWRu3H6RLahpM/TxFzw684Y\nR47weXdDecPNxWyiWiyMGStRFP4Cg9trcwAGnEm1w8R2ggmWphznCd5dXGhPNjfA\na82yNFY8ubnOUVJOf0nXGg3Edw9iY3xyjJb2+nrsk5f3AgMBAAE=\n-----END PUBLIC KEY-----" + }, + "scheme": "rsassa-pss-sha256" + }, + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "edcd0a32a07dce33f7c7873aaffbff36d20ea30787574ead335eefd337e4dacd" + }, + "scheme": "ed25519" + }, + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "89f28bd4ede5ec3786ab923fd154f39588d20881903e69c7b08fb504c6750815" + }, + "scheme": "ed25519" + }, + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "82ccf6ac47298ff43bfa0cd639868894e305a99c723ff0515ae2e9856eb5bbf4" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758" + ], + "threshold": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/snapshot.json b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/snapshot.json new file mode 100644 index 0000000..7c8c091 --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/snapshot.json @@ -0,0 +1,25 @@ +{ + "signatures": [ + { + "keyid": "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d", + "sig": "085672c70dffe26610e58542ee552843633cfed973abdad94c56138dbf0cd991644f2d3f27e4dda3098e08ab676e7f52627b587947ae69db1012d59a6da18e0c" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2030-01-01T00:00:00Z", + "meta": { + "role1.json": { + "version": 1 + }, + "role2.json": { + "version": 1 + }, + "targets.json": { + "version": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/targets.json b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/targets.json new file mode 100644 index 0000000..8e21c26 --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/targets.json @@ -0,0 +1,61 @@ +{ + "signatures": [ + { + "keyid": "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093", + "sig": "d65f8db0c1a8f0976552b9742bbb393f24a5fa5eaf145c37aee047236c79dd0b83cfbb8b49fa7803689dfe0031dcf22c4d006b593acac07d69093b9b81722c08" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": { + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "fcf224e55fa226056adf113ef1eb3d55e308b75b321c8c8316999d8c4fd9e0d9" + }, + "scheme": "ed25519" + } + }, + "roles": [ + { + "keyids": [ + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a" + ], + "name": "role1", + "paths": [ + "file3.txt" + ], + "terminating": false, + "threshold": 1 + } + ] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": { + "file1.txt": { + "custom": { + "file_permissions": "0644" + }, + "hashes": { + "sha256": "65b8c67f51c993d898250f40aa57a317d854900b3a04895464313e48785440da", + "sha512": "467430a68afae8e9f9c0771ea5d78bf0b3a0d79a2d3d3b40c69fde4dd42c461448aef76fcef4f5284931a1ffd0ac096d138ba3a0d6ca83fa8d7285a47a296f77" + }, + "length": 31 + }, + "file2.txt": { + "hashes": { + "sha256": "452ce8308500d83ef44248d8e6062359211992fd837ea9e370e561efb1a4ca99", + "sha512": "052b49a21e03606b28942db69aa597530fe52d47ee3d748ba65afcd14b857738e36bc1714c4f4adde46c3e683548552fe5c96722e0e0da3acd9050c2524902d8" + }, + "length": 39 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/timestamp.json b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/timestamp.json new file mode 100644 index 0000000..9a0daf0 --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository1/metadata/previous/timestamp.json @@ -0,0 +1,23 @@ +{ + "signatures": [ + { + "keyid": "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758", + "sig": "de0e16920f87bf5500cc65736488ac17e09788cce808f6a4e85eb9e4e478a312b4c1a2d7723af56f7bfb1df533c67d8c93b6f49d39eabe7fae391a08e1f72f01" + } + ], + "signed": { + "_type": "timestamp", + "expires": "2030-01-01T00:00:00Z", + "meta": { + "snapshot.json": { + "hashes": { + "sha256": "8f88e2ba48b412c3843e9bb26e1b6f8fc9e98aceb0fbaa97ba37b4c98717d7ab" + }, + "length": 515, + "version": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/1.root.json b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/1.root.json new file mode 100644 index 0000000..214d8db --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/1.root.json @@ -0,0 +1,87 @@ +{ + "signatures": [ + { + "keyid": "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb", + "sig": "a337d6375fedd2eabfcd6c2ef6c8a9c3bb85dc5a857715f6a6bd41123e7670c4972d8548bcd7248154f3d864bf25f1823af59d74c459f41ea09a02db057ca1245612ebbdb97e782c501dc3e094f7fa8aa1402b03c6ed0635f565e2a26f9f543a89237e15a2faf0c267e2b34c3c38f2a43a28ddcdaf8308a12ead8c6dc47d1b762de313e9ddda8cc5bc25aea1b69d0e5b9199ca02f5dda48c3bff615fd12a7136d00634b9abc6e75c3256106c4d6f12e6c43f6195071355b2857bbe377ce028619b58837696b805040ce144b393d50a472531f430fadfb68d3081b6a8b5e49337e328c9a0a3f11e80b0bc8eb2dc6e78d1451dd857e6e6e6363c3fd14c590aa95e083c9bfc77724d78af86eb7a7ef635eeddaa353030c79f66b3ba9ea11fab456cfe896a826fdfb50a43cd444f762821aada9bcd7b022c0ee85b8768f960343d5a1d3d76374cc0ac9e12a500de0bf5d48569e5398cadadadab045931c398e3bcb6cec88af2437ba91959f956079cbed159fed3938016e6c3b5e446131f81cc5981" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": false, + "expires": "2030-01-01T00:00:00Z", + "keys": { + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "rsa", + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA0GjPoVrjS9eCqzoQ8VRe\nPkC0cI6ktiEgqPfHESFzyxyjC490Cuy19nuxPcJuZfN64MC48oOkR+W2mq4pM51i\nxmdG5xjvNOBRkJ5wUCc8fDCltMUTBlqt9y5eLsf/4/EoBU+zC4SW1iPU++mCsity\nfQQ7U6LOn3EYCyrkH51hZ/dvKC4o9TPYMVxNecJ3CL1q02Q145JlyjBTuM3Xdqsa\nndTHoXSRPmmzgB/1dL/c4QjMnCowrKW06mFLq9RAYGIaJWfM/0CbrOJpVDkATmEc\nMdpGJYDfW/sRQvRdlHNPo24ZW7vkQUCqdRxvnTWkK5U81y7RtjLt1yskbWXBIbOV\nz94GXsgyzANyCT9qRjHXDDz2mkLq+9I2iKtEqaEePcWRu3H6RLahpM/TxFzw684Y\nR47weXdDecPNxWyiWiyMGStRFP4Cg9trcwAGnEm1w8R2ggmWphznCd5dXGhPNjfA\na82yNFY8ubnOUVJOf0nXGg3Edw9iY3xyjJb2+nrsk5f3AgMBAAE=\n-----END PUBLIC KEY-----" + }, + "scheme": "rsassa-pss-sha256" + }, + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "edcd0a32a07dce33f7c7873aaffbff36d20ea30787574ead335eefd337e4dacd" + }, + "scheme": "ed25519" + }, + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "89f28bd4ede5ec3786ab923fd154f39588d20881903e69c7b08fb504c6750815" + }, + "scheme": "ed25519" + }, + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "82ccf6ac47298ff43bfa0cd639868894e305a99c723ff0515ae2e9856eb5bbf4" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758" + ], + "threshold": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/role1.json b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/role1.json new file mode 100644 index 0000000..0ac4687 --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/role1.json @@ -0,0 +1,49 @@ +{ + "signatures": [ + { + "keyid": "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a", + "sig": "9408b46569e622a46f1d35d9fa3c10e17a9285631ced4f2c9c2bba2c2842413fcb796db4e81d6f988fc056c21c407fdc3c10441592cf1e837e088f2e2dfd5403" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": { + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "fcf224e55fa226056adf113ef1eb3d55e308b75b321c8c8316999d8c4fd9e0d9" + }, + "scheme": "ed25519" + } + }, + "roles": [ + { + "keyids": [ + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a" + ], + "name": "role2", + "paths": [], + "terminating": false, + "threshold": 1 + } + ] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": { + "file3.txt": { + "hashes": { + "sha256": "141f740f53781d1ca54b8a50af22cbf74e44c21a998fa2a8a05aaac2c002886b", + "sha512": "ef5beafa16041bcdd2937140afebd485296cd54f7348ecd5a4d035c09759608de467a7ac0eb58753d0242df873c305e8bffad2454aa48f44480f15efae1cacd0" + }, + "length": 28 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/role2.json b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/role2.json new file mode 100644 index 0000000..93f378a --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/role2.json @@ -0,0 +1,19 @@ +{ + "signatures": [ + { + "keyid": "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a", + "sig": "6c32f8cc2c642803a7b3b022ede0cf727e82964c1aa934571ef366bd5050ed02cfe3fdfe5477c08d0cbcc2dd17bb786d37ab1ce2b27e01ad79faf087594e0300" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": {}, + "roles": [] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": {}, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/root.json b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/root.json new file mode 100644 index 0000000..214d8db --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/root.json @@ -0,0 +1,87 @@ +{ + "signatures": [ + { + "keyid": "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb", + "sig": "a337d6375fedd2eabfcd6c2ef6c8a9c3bb85dc5a857715f6a6bd41123e7670c4972d8548bcd7248154f3d864bf25f1823af59d74c459f41ea09a02db057ca1245612ebbdb97e782c501dc3e094f7fa8aa1402b03c6ed0635f565e2a26f9f543a89237e15a2faf0c267e2b34c3c38f2a43a28ddcdaf8308a12ead8c6dc47d1b762de313e9ddda8cc5bc25aea1b69d0e5b9199ca02f5dda48c3bff615fd12a7136d00634b9abc6e75c3256106c4d6f12e6c43f6195071355b2857bbe377ce028619b58837696b805040ce144b393d50a472531f430fadfb68d3081b6a8b5e49337e328c9a0a3f11e80b0bc8eb2dc6e78d1451dd857e6e6e6363c3fd14c590aa95e083c9bfc77724d78af86eb7a7ef635eeddaa353030c79f66b3ba9ea11fab456cfe896a826fdfb50a43cd444f762821aada9bcd7b022c0ee85b8768f960343d5a1d3d76374cc0ac9e12a500de0bf5d48569e5398cadadadab045931c398e3bcb6cec88af2437ba91959f956079cbed159fed3938016e6c3b5e446131f81cc5981" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": false, + "expires": "2030-01-01T00:00:00Z", + "keys": { + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "rsa", + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA0GjPoVrjS9eCqzoQ8VRe\nPkC0cI6ktiEgqPfHESFzyxyjC490Cuy19nuxPcJuZfN64MC48oOkR+W2mq4pM51i\nxmdG5xjvNOBRkJ5wUCc8fDCltMUTBlqt9y5eLsf/4/EoBU+zC4SW1iPU++mCsity\nfQQ7U6LOn3EYCyrkH51hZ/dvKC4o9TPYMVxNecJ3CL1q02Q145JlyjBTuM3Xdqsa\nndTHoXSRPmmzgB/1dL/c4QjMnCowrKW06mFLq9RAYGIaJWfM/0CbrOJpVDkATmEc\nMdpGJYDfW/sRQvRdlHNPo24ZW7vkQUCqdRxvnTWkK5U81y7RtjLt1yskbWXBIbOV\nz94GXsgyzANyCT9qRjHXDDz2mkLq+9I2iKtEqaEePcWRu3H6RLahpM/TxFzw684Y\nR47weXdDecPNxWyiWiyMGStRFP4Cg9trcwAGnEm1w8R2ggmWphznCd5dXGhPNjfA\na82yNFY8ubnOUVJOf0nXGg3Edw9iY3xyjJb2+nrsk5f3AgMBAAE=\n-----END PUBLIC KEY-----" + }, + "scheme": "rsassa-pss-sha256" + }, + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "edcd0a32a07dce33f7c7873aaffbff36d20ea30787574ead335eefd337e4dacd" + }, + "scheme": "ed25519" + }, + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "89f28bd4ede5ec3786ab923fd154f39588d20881903e69c7b08fb504c6750815" + }, + "scheme": "ed25519" + }, + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "82ccf6ac47298ff43bfa0cd639868894e305a99c723ff0515ae2e9856eb5bbf4" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758" + ], + "threshold": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/snapshot.json b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/snapshot.json new file mode 100644 index 0000000..7c8c091 --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/snapshot.json @@ -0,0 +1,25 @@ +{ + "signatures": [ + { + "keyid": "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d", + "sig": "085672c70dffe26610e58542ee552843633cfed973abdad94c56138dbf0cd991644f2d3f27e4dda3098e08ab676e7f52627b587947ae69db1012d59a6da18e0c" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2030-01-01T00:00:00Z", + "meta": { + "role1.json": { + "version": 1 + }, + "role2.json": { + "version": 1 + }, + "targets.json": { + "version": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/targets.json b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/targets.json new file mode 100644 index 0000000..8e21c26 --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/targets.json @@ -0,0 +1,61 @@ +{ + "signatures": [ + { + "keyid": "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093", + "sig": "d65f8db0c1a8f0976552b9742bbb393f24a5fa5eaf145c37aee047236c79dd0b83cfbb8b49fa7803689dfe0031dcf22c4d006b593acac07d69093b9b81722c08" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": { + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "fcf224e55fa226056adf113ef1eb3d55e308b75b321c8c8316999d8c4fd9e0d9" + }, + "scheme": "ed25519" + } + }, + "roles": [ + { + "keyids": [ + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a" + ], + "name": "role1", + "paths": [ + "file3.txt" + ], + "terminating": false, + "threshold": 1 + } + ] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": { + "file1.txt": { + "custom": { + "file_permissions": "0644" + }, + "hashes": { + "sha256": "65b8c67f51c993d898250f40aa57a317d854900b3a04895464313e48785440da", + "sha512": "467430a68afae8e9f9c0771ea5d78bf0b3a0d79a2d3d3b40c69fde4dd42c461448aef76fcef4f5284931a1ffd0ac096d138ba3a0d6ca83fa8d7285a47a296f77" + }, + "length": 31 + }, + "file2.txt": { + "hashes": { + "sha256": "452ce8308500d83ef44248d8e6062359211992fd837ea9e370e561efb1a4ca99", + "sha512": "052b49a21e03606b28942db69aa597530fe52d47ee3d748ba65afcd14b857738e36bc1714c4f4adde46c3e683548552fe5c96722e0e0da3acd9050c2524902d8" + }, + "length": 39 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/timestamp.json b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/timestamp.json new file mode 100644 index 0000000..9a0daf0 --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/current/timestamp.json @@ -0,0 +1,23 @@ +{ + "signatures": [ + { + "keyid": "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758", + "sig": "de0e16920f87bf5500cc65736488ac17e09788cce808f6a4e85eb9e4e478a312b4c1a2d7723af56f7bfb1df533c67d8c93b6f49d39eabe7fae391a08e1f72f01" + } + ], + "signed": { + "_type": "timestamp", + "expires": "2030-01-01T00:00:00Z", + "meta": { + "snapshot.json": { + "hashes": { + "sha256": "8f88e2ba48b412c3843e9bb26e1b6f8fc9e98aceb0fbaa97ba37b4c98717d7ab" + }, + "length": 515, + "version": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/1.root.json b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/1.root.json new file mode 100644 index 0000000..214d8db --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/1.root.json @@ -0,0 +1,87 @@ +{ + "signatures": [ + { + "keyid": "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb", + "sig": "a337d6375fedd2eabfcd6c2ef6c8a9c3bb85dc5a857715f6a6bd41123e7670c4972d8548bcd7248154f3d864bf25f1823af59d74c459f41ea09a02db057ca1245612ebbdb97e782c501dc3e094f7fa8aa1402b03c6ed0635f565e2a26f9f543a89237e15a2faf0c267e2b34c3c38f2a43a28ddcdaf8308a12ead8c6dc47d1b762de313e9ddda8cc5bc25aea1b69d0e5b9199ca02f5dda48c3bff615fd12a7136d00634b9abc6e75c3256106c4d6f12e6c43f6195071355b2857bbe377ce028619b58837696b805040ce144b393d50a472531f430fadfb68d3081b6a8b5e49337e328c9a0a3f11e80b0bc8eb2dc6e78d1451dd857e6e6e6363c3fd14c590aa95e083c9bfc77724d78af86eb7a7ef635eeddaa353030c79f66b3ba9ea11fab456cfe896a826fdfb50a43cd444f762821aada9bcd7b022c0ee85b8768f960343d5a1d3d76374cc0ac9e12a500de0bf5d48569e5398cadadadab045931c398e3bcb6cec88af2437ba91959f956079cbed159fed3938016e6c3b5e446131f81cc5981" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": false, + "expires": "2030-01-01T00:00:00Z", + "keys": { + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "rsa", + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA0GjPoVrjS9eCqzoQ8VRe\nPkC0cI6ktiEgqPfHESFzyxyjC490Cuy19nuxPcJuZfN64MC48oOkR+W2mq4pM51i\nxmdG5xjvNOBRkJ5wUCc8fDCltMUTBlqt9y5eLsf/4/EoBU+zC4SW1iPU++mCsity\nfQQ7U6LOn3EYCyrkH51hZ/dvKC4o9TPYMVxNecJ3CL1q02Q145JlyjBTuM3Xdqsa\nndTHoXSRPmmzgB/1dL/c4QjMnCowrKW06mFLq9RAYGIaJWfM/0CbrOJpVDkATmEc\nMdpGJYDfW/sRQvRdlHNPo24ZW7vkQUCqdRxvnTWkK5U81y7RtjLt1yskbWXBIbOV\nz94GXsgyzANyCT9qRjHXDDz2mkLq+9I2iKtEqaEePcWRu3H6RLahpM/TxFzw684Y\nR47weXdDecPNxWyiWiyMGStRFP4Cg9trcwAGnEm1w8R2ggmWphznCd5dXGhPNjfA\na82yNFY8ubnOUVJOf0nXGg3Edw9iY3xyjJb2+nrsk5f3AgMBAAE=\n-----END PUBLIC KEY-----" + }, + "scheme": "rsassa-pss-sha256" + }, + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "edcd0a32a07dce33f7c7873aaffbff36d20ea30787574ead335eefd337e4dacd" + }, + "scheme": "ed25519" + }, + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "89f28bd4ede5ec3786ab923fd154f39588d20881903e69c7b08fb504c6750815" + }, + "scheme": "ed25519" + }, + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "82ccf6ac47298ff43bfa0cd639868894e305a99c723ff0515ae2e9856eb5bbf4" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758" + ], + "threshold": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/role1.json b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/role1.json new file mode 100644 index 0000000..0ac4687 --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/role1.json @@ -0,0 +1,49 @@ +{ + "signatures": [ + { + "keyid": "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a", + "sig": "9408b46569e622a46f1d35d9fa3c10e17a9285631ced4f2c9c2bba2c2842413fcb796db4e81d6f988fc056c21c407fdc3c10441592cf1e837e088f2e2dfd5403" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": { + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "fcf224e55fa226056adf113ef1eb3d55e308b75b321c8c8316999d8c4fd9e0d9" + }, + "scheme": "ed25519" + } + }, + "roles": [ + { + "keyids": [ + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a" + ], + "name": "role2", + "paths": [], + "terminating": false, + "threshold": 1 + } + ] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": { + "file3.txt": { + "hashes": { + "sha256": "141f740f53781d1ca54b8a50af22cbf74e44c21a998fa2a8a05aaac2c002886b", + "sha512": "ef5beafa16041bcdd2937140afebd485296cd54f7348ecd5a4d035c09759608de467a7ac0eb58753d0242df873c305e8bffad2454aa48f44480f15efae1cacd0" + }, + "length": 28 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/role2.json b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/role2.json new file mode 100644 index 0000000..93f378a --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/role2.json @@ -0,0 +1,19 @@ +{ + "signatures": [ + { + "keyid": "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a", + "sig": "6c32f8cc2c642803a7b3b022ede0cf727e82964c1aa934571ef366bd5050ed02cfe3fdfe5477c08d0cbcc2dd17bb786d37ab1ce2b27e01ad79faf087594e0300" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": {}, + "roles": [] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": {}, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/root.json b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/root.json new file mode 100644 index 0000000..214d8db --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/root.json @@ -0,0 +1,87 @@ +{ + "signatures": [ + { + "keyid": "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb", + "sig": "a337d6375fedd2eabfcd6c2ef6c8a9c3bb85dc5a857715f6a6bd41123e7670c4972d8548bcd7248154f3d864bf25f1823af59d74c459f41ea09a02db057ca1245612ebbdb97e782c501dc3e094f7fa8aa1402b03c6ed0635f565e2a26f9f543a89237e15a2faf0c267e2b34c3c38f2a43a28ddcdaf8308a12ead8c6dc47d1b762de313e9ddda8cc5bc25aea1b69d0e5b9199ca02f5dda48c3bff615fd12a7136d00634b9abc6e75c3256106c4d6f12e6c43f6195071355b2857bbe377ce028619b58837696b805040ce144b393d50a472531f430fadfb68d3081b6a8b5e49337e328c9a0a3f11e80b0bc8eb2dc6e78d1451dd857e6e6e6363c3fd14c590aa95e083c9bfc77724d78af86eb7a7ef635eeddaa353030c79f66b3ba9ea11fab456cfe896a826fdfb50a43cd444f762821aada9bcd7b022c0ee85b8768f960343d5a1d3d76374cc0ac9e12a500de0bf5d48569e5398cadadadab045931c398e3bcb6cec88af2437ba91959f956079cbed159fed3938016e6c3b5e446131f81cc5981" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": false, + "expires": "2030-01-01T00:00:00Z", + "keys": { + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "rsa", + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA0GjPoVrjS9eCqzoQ8VRe\nPkC0cI6ktiEgqPfHESFzyxyjC490Cuy19nuxPcJuZfN64MC48oOkR+W2mq4pM51i\nxmdG5xjvNOBRkJ5wUCc8fDCltMUTBlqt9y5eLsf/4/EoBU+zC4SW1iPU++mCsity\nfQQ7U6LOn3EYCyrkH51hZ/dvKC4o9TPYMVxNecJ3CL1q02Q145JlyjBTuM3Xdqsa\nndTHoXSRPmmzgB/1dL/c4QjMnCowrKW06mFLq9RAYGIaJWfM/0CbrOJpVDkATmEc\nMdpGJYDfW/sRQvRdlHNPo24ZW7vkQUCqdRxvnTWkK5U81y7RtjLt1yskbWXBIbOV\nz94GXsgyzANyCT9qRjHXDDz2mkLq+9I2iKtEqaEePcWRu3H6RLahpM/TxFzw684Y\nR47weXdDecPNxWyiWiyMGStRFP4Cg9trcwAGnEm1w8R2ggmWphznCd5dXGhPNjfA\na82yNFY8ubnOUVJOf0nXGg3Edw9iY3xyjJb2+nrsk5f3AgMBAAE=\n-----END PUBLIC KEY-----" + }, + "scheme": "rsassa-pss-sha256" + }, + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "edcd0a32a07dce33f7c7873aaffbff36d20ea30787574ead335eefd337e4dacd" + }, + "scheme": "ed25519" + }, + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "89f28bd4ede5ec3786ab923fd154f39588d20881903e69c7b08fb504c6750815" + }, + "scheme": "ed25519" + }, + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "82ccf6ac47298ff43bfa0cd639868894e305a99c723ff0515ae2e9856eb5bbf4" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758" + ], + "threshold": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/snapshot.json b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/snapshot.json new file mode 100644 index 0000000..7c8c091 --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/snapshot.json @@ -0,0 +1,25 @@ +{ + "signatures": [ + { + "keyid": "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d", + "sig": "085672c70dffe26610e58542ee552843633cfed973abdad94c56138dbf0cd991644f2d3f27e4dda3098e08ab676e7f52627b587947ae69db1012d59a6da18e0c" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2030-01-01T00:00:00Z", + "meta": { + "role1.json": { + "version": 1 + }, + "role2.json": { + "version": 1 + }, + "targets.json": { + "version": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/targets.json b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/targets.json new file mode 100644 index 0000000..8e21c26 --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/targets.json @@ -0,0 +1,61 @@ +{ + "signatures": [ + { + "keyid": "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093", + "sig": "d65f8db0c1a8f0976552b9742bbb393f24a5fa5eaf145c37aee047236c79dd0b83cfbb8b49fa7803689dfe0031dcf22c4d006b593acac07d69093b9b81722c08" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": { + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "fcf224e55fa226056adf113ef1eb3d55e308b75b321c8c8316999d8c4fd9e0d9" + }, + "scheme": "ed25519" + } + }, + "roles": [ + { + "keyids": [ + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a" + ], + "name": "role1", + "paths": [ + "file3.txt" + ], + "terminating": false, + "threshold": 1 + } + ] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": { + "file1.txt": { + "custom": { + "file_permissions": "0644" + }, + "hashes": { + "sha256": "65b8c67f51c993d898250f40aa57a317d854900b3a04895464313e48785440da", + "sha512": "467430a68afae8e9f9c0771ea5d78bf0b3a0d79a2d3d3b40c69fde4dd42c461448aef76fcef4f5284931a1ffd0ac096d138ba3a0d6ca83fa8d7285a47a296f77" + }, + "length": 31 + }, + "file2.txt": { + "hashes": { + "sha256": "452ce8308500d83ef44248d8e6062359211992fd837ea9e370e561efb1a4ca99", + "sha512": "052b49a21e03606b28942db69aa597530fe52d47ee3d748ba65afcd14b857738e36bc1714c4f4adde46c3e683548552fe5c96722e0e0da3acd9050c2524902d8" + }, + "length": 39 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/timestamp.json b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/timestamp.json new file mode 100644 index 0000000..9a0daf0 --- /dev/null +++ b/tuf-no-std/tests/repository_data/client/test_repository2/metadata/previous/timestamp.json @@ -0,0 +1,23 @@ +{ + "signatures": [ + { + "keyid": "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758", + "sig": "de0e16920f87bf5500cc65736488ac17e09788cce808f6a4e85eb9e4e478a312b4c1a2d7723af56f7bfb1df533c67d8c93b6f49d39eabe7fae391a08e1f72f01" + } + ], + "signed": { + "_type": "timestamp", + "expires": "2030-01-01T00:00:00Z", + "meta": { + "snapshot.json": { + "hashes": { + "sha256": "8f88e2ba48b412c3843e9bb26e1b6f8fc9e98aceb0fbaa97ba37b4c98717d7ab" + }, + "length": 515, + "version": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/fishy_rolenames/1.a.json b/tuf-no-std/tests/repository_data/fishy_rolenames/1.a.json new file mode 100644 index 0000000..a55173a --- /dev/null +++ b/tuf-no-std/tests/repository_data/fishy_rolenames/1.a.json @@ -0,0 +1,15 @@ +{ + "signatures": [ + { + "keyid": "f9b50dd62b5540788b5c5cde0842124b64fa467261bc349dd77de49568eed0ef", + "sig": "a36aa69e0c35d8b5b9578bc656ce5d8a76ea05a2c814f59cc710a11f5e3fe6c7bcbef2bfba4812e3b2936f99e89f10862f6320c901e213f1343e79525474920a" + } + ], + "signed": { + "_type": "targets", + "expires": "2050-10-22T11:21:56Z", + "spec_version": "1.0.19", + "targets": {}, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/fishy_rolenames/metadata/1...json b/tuf-no-std/tests/repository_data/fishy_rolenames/metadata/1...json new file mode 100644 index 0000000..e5ae82e --- /dev/null +++ b/tuf-no-std/tests/repository_data/fishy_rolenames/metadata/1...json @@ -0,0 +1,15 @@ +{ + "signatures": [ + { + "keyid": "80a5bda93ec130c2fda8ce0c619d7b122b24cc2e0743afedf98a8e368d32019c", + "sig": "8fff438c2347dd7c4fb94c43ec347bcd6b0e79521bd11d95121cb8cc25723efa38565a959a6123da0a2375a2093e53f13a5412df9e51397e06b313837d0d590c" + } + ], + "signed": { + "_type": "targets", + "expires": "2050-10-22T11:21:56Z", + "spec_version": "1.0.19", + "targets": {}, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/fishy_rolenames/metadata/1.root.json b/tuf-no-std/tests/repository_data/fishy_rolenames/metadata/1.root.json new file mode 100644 index 0000000..69cc04c --- /dev/null +++ b/tuf-no-std/tests/repository_data/fishy_rolenames/metadata/1.root.json @@ -0,0 +1,71 @@ +{ + "signatures": [ + { + "keyid": "72b70899257dc30b596af3a9fe141a924af821aff28ed58d1aea0db9f70a70f7", + "sig": "53ae844137dd04abf9d3ed10380ba46fa2726f328963ffe006aa955804afa3b0d100bc59610c1584234a9598ab4b9af762b533174b8b8d8aaf2be8e413c1b304" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": true, + "expires": "2050-10-22T11:21:56Z", + "keys": { + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d": { + "keytype": "ed25519", + "keyval": { + "public": "edcd0a32a07dce33f7c7873aaffbff36d20ea30787574ead335eefd337e4dacd" + }, + "scheme": "ed25519" + }, + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093": { + "keytype": "ed25519", + "keyval": { + "public": "89f28bd4ede5ec3786ab923fd154f39588d20881903e69c7b08fb504c6750815" + }, + "scheme": "ed25519" + }, + "72b70899257dc30b596af3a9fe141a924af821aff28ed58d1aea0db9f70a70f7": { + "keytype": "ed25519", + "keyval": { + "public": "3ba219e69666298bce5d1d653a166346aef807c02e32a846aaefcb5190fddeb4" + }, + "scheme": "ed25519" + }, + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758": { + "keytype": "ed25519", + "keyval": { + "public": "82ccf6ac47298ff43bfa0cd639868894e305a99c723ff0515ae2e9856eb5bbf4" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "72b70899257dc30b596af3a9fe141a924af821aff28ed58d1aea0db9f70a70f7" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758" + ], + "threshold": 1 + } + }, + "spec_version": "1.0.19", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/fishy_rolenames/metadata/1.targets.json b/tuf-no-std/tests/repository_data/fishy_rolenames/metadata/1.targets.json new file mode 100644 index 0000000..285b3f4 --- /dev/null +++ b/tuf-no-std/tests/repository_data/fishy_rolenames/metadata/1.targets.json @@ -0,0 +1,75 @@ +{ + "signatures": [ + { + "keyid": "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093", + "sig": "b390c5d9d5355b963e94dfa30ce04520c462fd869fad968d01f0a3b185db5895807b14435e725ff376adc793fd21ef8f01890ac722c94e9c05ab3797c4887101" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": { + "426edf0d9fa383688c5b40b7b7d15a7cd11a991f12cc20da87f1b48dd6c036a1": { + "keytype": "ed25519", + "keyval": { + "public": "d38eef769f6dee77b6d898dce548c0ea0f90add0072dc28a20769b6421552ec3" + }, + "scheme": "ed25519" + }, + "80a5bda93ec130c2fda8ce0c619d7b122b24cc2e0743afedf98a8e368d32019c": { + "keytype": "ed25519", + "keyval": { + "public": "bb256c0b6d5226a5a9ae8377c0bf68e958fb668d063971f48638b9bae5251f3b" + }, + "scheme": "ed25519" + }, + "f9b50dd62b5540788b5c5cde0842124b64fa467261bc349dd77de49568eed0ef": { + "keytype": "ed25519", + "keyval": { + "public": "da1b8586dc0cdd5fe0d8d428bde62dc63e06138f58cfc39770c424a4636f59f4" + }, + "scheme": "ed25519" + } + }, + "roles": [ + { + "keyids": [ + "f9b50dd62b5540788b5c5cde0842124b64fa467261bc349dd77de49568eed0ef" + ], + "name": "../a", + "paths": [ + "*" + ], + "terminating": false, + "threshold": 1 + }, + { + "keyids": [ + "80a5bda93ec130c2fda8ce0c619d7b122b24cc2e0743afedf98a8e368d32019c" + ], + "name": ".", + "paths": [ + "*" + ], + "terminating": false, + "threshold": 1 + }, + { + "keyids": [ + "426edf0d9fa383688c5b40b7b7d15a7cd11a991f12cc20da87f1b48dd6c036a1" + ], + "name": "\u00f6", + "paths": [ + "*" + ], + "terminating": false, + "threshold": 1 + } + ] + }, + "expires": "2050-10-22T11:21:56Z", + "spec_version": "1.0.19", + "targets": {}, + "version": 1 + } +} \ No newline at end of file diff --git "a/tuf-no-std/tests/repository_data/fishy_rolenames/metadata/1.\303\266.json" "b/tuf-no-std/tests/repository_data/fishy_rolenames/metadata/1.\303\266.json" new file mode 100644 index 0000000..e6aa802 --- /dev/null +++ "b/tuf-no-std/tests/repository_data/fishy_rolenames/metadata/1.\303\266.json" @@ -0,0 +1,15 @@ +{ + "signatures": [ + { + "keyid": "426edf0d9fa383688c5b40b7b7d15a7cd11a991f12cc20da87f1b48dd6c036a1", + "sig": "faada7f8c9a238955d5b27dbd88032a6c9068742cb114a66f97c730235a8033dd1ff0647f4bbc2b49210c33655a3d7755e754e245799683b3f4e00a59f3da006" + } + ], + "signed": { + "_type": "targets", + "expires": "2050-10-22T11:21:56Z", + "spec_version": "1.0.19", + "targets": {}, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/fishy_rolenames/metadata/2.snapshot.json b/tuf-no-std/tests/repository_data/fishy_rolenames/metadata/2.snapshot.json new file mode 100644 index 0000000..bf91cab --- /dev/null +++ b/tuf-no-std/tests/repository_data/fishy_rolenames/metadata/2.snapshot.json @@ -0,0 +1,28 @@ +{ + "signatures": [ + { + "keyid": "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d", + "sig": "5b00100e9cf1c083f8347371ab840cf60124780305124ed7a53fe31bf43473c90b1d2c802ed2f11f5057ba21e6b7a05118b1907f737d2e29c9692aa3345f9801" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2050-10-22T11:21:56Z", + "meta": { + "../a.json": { + "version": 1 + }, + "..json": { + "version": 1 + }, + "targets.json": { + "version": 1 + }, + "\u00f6.json": { + "version": 1 + } + }, + "spec_version": "1.0.19", + "version": 2 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/fishy_rolenames/metadata/timestamp.json b/tuf-no-std/tests/repository_data/fishy_rolenames/metadata/timestamp.json new file mode 100644 index 0000000..6bde92c --- /dev/null +++ b/tuf-no-std/tests/repository_data/fishy_rolenames/metadata/timestamp.json @@ -0,0 +1,19 @@ +{ + "signatures": [ + { + "keyid": "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758", + "sig": "f7003e848366c7e55f474df2c0c68471c44c68a87c0d3c1aa56f64778c91e9c8f22c3adc4dd9ec0535b6b4dc04783f7fa4ca992bed2445c7395a58acff152f0d" + } + ], + "signed": { + "_type": "timestamp", + "expires": "2050-10-22T11:21:56Z", + "meta": { + "snapshot.json": { + "version": 2 + } + }, + "spec_version": "1.0.19", + "version": 2 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/keystore/delegation_key b/tuf-no-std/tests/repository_data/keystore/delegation_key new file mode 100644 index 0000000..461169d --- /dev/null +++ b/tuf-no-std/tests/repository_data/keystore/delegation_key @@ -0,0 +1 @@ +68593a508472ad3007915379e6b1f3c0@@@@100000@@@@615986af4d1ba89aeadc2f489f89b0e8d46da133a6f75c7b162b8f99f63f86ed@@@@8319255f9856c4f40f9d71bc10e79e5d@@@@1dc7b20f1c668a1f544dc39c7a9fcb3c4a4dd34d1cc8c9d8f779bab026cf0b8e0f46e53bc5ed20bf0e5048b94a5d2ea176e79c12bcc7daa65cd55bf810deebeec5bc903ce9e5316d7dbba88f1a2b51d3f9bc782f8fa9b21dff91609ad0260e21a2039223f816d0fe97ace2e204d0025d327b38d27aa6cd87e85aa8883bfcb6d12f93155d72ffd3c7717a0570cf9811eb6d6a340baa0f27433315d83322c685fec02053ff8c173c4ebf91a258e83402f39546821e3352baa7b246e33b2a573a8ff7b289682407abbcb9184249d4304db68d3bf8e124e94377fd62dde5c4f3b7617d483776345154d047d139b1e559351577da315f54e16153c510159e1908231574bcf49c4f96cafe6530e86a09e9eee47bcff78f2fed2984754c895733938999ff085f9e3532d7174fd76dc09921506dd2137e16ec4926998f5d9df8a8ffb3e6649c71bc32571b2e24357739fa1a56be \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/keystore/delegation_key.pub b/tuf-no-std/tests/repository_data/keystore/delegation_key.pub new file mode 100644 index 0000000..d600bff --- /dev/null +++ b/tuf-no-std/tests/repository_data/keystore/delegation_key.pub @@ -0,0 +1 @@ +{"keyval": {"public": "fcf224e55fa226056adf113ef1eb3d55e308b75b321c8c8316999d8c4fd9e0d9"}, "keytype": "ed25519", "scheme": "ed25519", "keyid_hash_algorithms": ["sha256", "sha512"]} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/keystore/root_key b/tuf-no-std/tests/repository_data/keystore/root_key new file mode 100644 index 0000000..1b8fb14 --- /dev/null +++ b/tuf-no-std/tests/repository_data/keystore/root_key @@ -0,0 +1,42 @@ +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIHbTBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQIsnvMDGLfuE8CAggA +MAwGCCqGSIb3DQIJBQAwHQYJYIZIAWUDBAEqBBBN6jE1eBpMFrFfAs0FkzHQBIIH +EAacUao28rDMs/r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QkPuR977lkWodLOU9mwOnvZqplmhprh4w+znoPcuTNM5XQ7Rxulfx +ZOJZ7NjLr3t2gY2Ni4Su961GcG9/1qgb/gbh+epzpIWaMSfJhXwBv/TmDppg1IB/ +q1Y2ICtZX0V6/szszPsPpBcqRpMAa6T12pL/J6OVYcnSrX6lzY8uVzM4Va1M/Fwn +C45VwvBK0StZY2T+CWdAoG20wA9IJhSr8xajCxR1UNsNgrQ84dJN6KduURbNmMTM +m5fryjMFAoykt+cz1TOq7G3sFLslYkWH8DP1mdknC1uC +-----END ENCRYPTED PRIVATE KEY----- diff --git a/tuf-no-std/tests/repository_data/keystore/root_key.pub b/tuf-no-std/tests/repository_data/keystore/root_key.pub new file mode 100644 index 0000000..11cc245 --- /dev/null +++ b/tuf-no-std/tests/repository_data/keystore/root_key.pub @@ -0,0 +1,11 @@ +-----BEGIN PUBLIC KEY----- +MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA0GjPoVrjS9eCqzoQ8VRe +PkC0cI6ktiEgqPfHESFzyxyjC490Cuy19nuxPcJuZfN64MC48oOkR+W2mq4pM51i +xmdG5xjvNOBRkJ5wUCc8fDCltMUTBlqt9y5eLsf/4/EoBU+zC4SW1iPU++mCsity +fQQ7U6LOn3EYCyrkH51hZ/dvKC4o9TPYMVxNecJ3CL1q02Q145JlyjBTuM3Xdqsa +ndTHoXSRPmmzgB/1dL/c4QjMnCowrKW06mFLq9RAYGIaJWfM/0CbrOJpVDkATmEc +MdpGJYDfW/sRQvRdlHNPo24ZW7vkQUCqdRxvnTWkK5U81y7RtjLt1yskbWXBIbOV +z94GXsgyzANyCT9qRjHXDDz2mkLq+9I2iKtEqaEePcWRu3H6RLahpM/TxFzw684Y +R47weXdDecPNxWyiWiyMGStRFP4Cg9trcwAGnEm1w8R2ggmWphznCd5dXGhPNjfA +a82yNFY8ubnOUVJOf0nXGg3Edw9iY3xyjJb2+nrsk5f3AgMBAAE= +-----END PUBLIC KEY----- diff --git a/tuf-no-std/tests/repository_data/keystore/root_key2 b/tuf-no-std/tests/repository_data/keystore/root_key2 new file mode 100644 index 0000000..8222946 --- /dev/null +++ b/tuf-no-std/tests/repository_data/keystore/root_key2 @@ -0,0 +1 @@ +77c02ab5647ee765d5f6c5fc202a5b32@@@@100000@@@@7c73c1100fab52dc8695c1b955d31770ed6e53f1820d9020aeb6541c948573d9@@@@98280307ffa9c5f6ff1fea1a4b79d0ea@@@@f3342882b1cf842e3377ab4205c0ca8fab564cc55fa742f55b364a1ac597e93d8c56a9a6e6bbb6a812556077be44a1066ac6781a6ed34b86beaf3985f846f007dab31c46af562e921f03c1ea8d299f15324ab137aa426ee61d396a7e20191aa71a70b670775b2ad48f25de367fb48881c55e93f468c6e59402907e82985c27c94c715161c85c5c1904353ba33c3d129988029f03a2d7d00720118697baaf73a3c4e72f8e538b4323866fe525ddccfcfc6dd45598545f65cd7ab581f5172bc253416283a66621eb03dbabaf33923bb1963f9f8cbae6fd6a1c86736a8f80c8d1ba3cbc3f53b0123ba9b0bdd44f25b65033b19a50ee978d2687d6a2ee724515a20026d0213ced59cda9bfdf37c82c59e1356795fd603d85996f448a3c9357b32de2042997a1d27353ee3866c0ed5218d633e0b28991119d77d147354c7fa2de8a168d17efdfd5fa9a8e528bd47ede4ff697 \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/keystore/root_key2.pub b/tuf-no-std/tests/repository_data/keystore/root_key2.pub new file mode 100644 index 0000000..dd5c43b --- /dev/null +++ b/tuf-no-std/tests/repository_data/keystore/root_key2.pub @@ -0,0 +1 @@ +{"keytype": "ed25519", "scheme": "ed25519", "keyid_hash_algorithms": ["sha256", "sha512"], "keyval": {"public": "3ba219e69666298bce5d1d653a166346aef807c02e32a846aaefcb5190fddeb4"}} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/keystore/root_key3 b/tuf-no-std/tests/repository_data/keystore/root_key3 new file mode 100644 index 0000000..89c0b2c --- /dev/null +++ b/tuf-no-std/tests/repository_data/keystore/root_key3 @@ -0,0 +1 @@ +a3d266f446cb23c0248feed240a8a85a@@@@100000@@@@61ea41c73d4b1d8bd7566a9884a2fdb88c1d4e48550341e532768f98c8f4bd3c@@@@46b15764c50c934fcfc041a5fa207337@@@@d84b8c473d5f42d2bbceca28b0087c2c5908673b2a92eb8f1ca91dacc27c1cfac24c98d06191f6f54633dd428e9ca0987f183e8f34322a104dc38a0f4fefcc168f21e203e3abc5842f132df2dcb61d6b31dc19d0ecb50e898655f81e9b8a9730f2bff4c5ca4b6fc0b572a7e3672b6dc814ed127c964d960a57155c29eccf44824442d3c6761662ed2d8a1c48a3222d0f0cb1a58f543ccd852c247522595d987d95d1bf49dfdffaf33f18085460dac791d81347cc576a83c6ebca2625d26ddd294e74fa67f676a02d533b52fc9702237b2c898469a30753d98b091cd6aa713aa7b0c4c741684674084b27862e64adf4b1e88fa22cfcf6eeae8608dd818a4cba020058fa7271028ea9d9a7302c9e50e82972a82ac2080201c0fb9f2fb1cadfe97d62470414428227add1c40594f5135a8169d0d7d0889cb4a1949b015e65f5dc656204c58c463acc5b7872f4a078d0bc5a09a7795187e360e7b225892601aa9065086b24397f653d20e59a656ec86ef94e64d5baf16080f12a7f2461b92f99dfb5bf2e4dadec91cc72d8eede952449fd586c863734d84f31e036ecc96c55ab7baa9b049c20b8281a7c28f5ca42d9cfad6498f51ee907bfd9dc17e2a1bc9b69145ee82a86a90817394c01770581727889d3ba1791592c7ac2e74753485f1811cc4477078732873185240fc1572927d2fef210066bdf015471bd9d1683e8074b3fb6957246589dc62dea4843a17a7c734ae45ae20d31f0083a32d3310fae459fe3fbf7c763e5e4ead4acd9b0233e45237f4465576e85ff707fe316488f329d5bc73596b104cc28b926d6b1f5a3d26a0a6ec534a3cbc54cab97f5cea51f17b8d7f1cc6c9977275c34ee4942dd3e22a19ae1e4252199226cc4fd60 \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/keystore/root_key3.pub b/tuf-no-std/tests/repository_data/keystore/root_key3.pub new file mode 100644 index 0000000..ee5d487 --- /dev/null +++ b/tuf-no-std/tests/repository_data/keystore/root_key3.pub @@ -0,0 +1 @@ +{"keytype": "ecdsa", "scheme": "ecdsa-sha2-nistp256", "keyid_hash_algorithms": ["sha256", "sha512"], "keyval": {"public": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE4huWFUZelzzZk2xLwnLqyc2q7cfI\nIqgg3qOWSddQ3Q/GBXCzgg7zqNqS+xSt+D3gy3mMBbkeo+6OVm8/W9BrqQ=="}} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/keystore/snapshot_key b/tuf-no-std/tests/repository_data/keystore/snapshot_key new file mode 100644 index 0000000..08c954f --- /dev/null +++ b/tuf-no-std/tests/repository_data/keystore/snapshot_key @@ -0,0 +1 @@ +a87b80b8a0d39b919b9638181e7b274e@@@@100000@@@@132edd670981aaf1980673966266174d944d735eb5b0b7ec83ed97da5c212249@@@@bd08ae9898ac5f81fc14e418e9790f9b@@@@399250c9aad40035e0acff48db59697bc3cf33d55b52aa272246addeaaf318d931d3a72964f0c84eccf5b89279b8233685330ad884f7b39bf369553133b985f9396bd5e24cb8e343643923022565a645e188a1165e427aedc389cca821d6a93cb2d8d16cea8ffeb56469bcb9f2f66e03d581a2ea37da271980dd02b84717fe475e13a305b4ae714c11c94f6711c744bb291a146d7419474584bad4be152d0299273c1fad6cd95232a4bf07f39c16da7f4d13201a88fad822cb328008e8a2762baf974b5d5080451751fb8ef53a01ca734157be78b3eb13c6270e4e98b138c78388360e7f558389871b7a32b4d5572626b3112264a0b56dbbb1138c9765872a71dd4e7d31006c2e690f5ede608ce633ad94ebb7d1ddec1a7eac2168fc5d36efe590c4c2059c6f3bcf75ab63474eede3ce4fdc93c6564058b14a0fa9bf3cb6d58c53315b406409ee4aeb18abe072734df0 \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/keystore/snapshot_key.pub b/tuf-no-std/tests/repository_data/keystore/snapshot_key.pub new file mode 100644 index 0000000..d08bb84 --- /dev/null +++ b/tuf-no-std/tests/repository_data/keystore/snapshot_key.pub @@ -0,0 +1 @@ +{"keyval": {"public": "edcd0a32a07dce33f7c7873aaffbff36d20ea30787574ead335eefd337e4dacd"}, "keytype": "ed25519", "scheme": "ed25519", "keyid_hash_algorithms": ["sha256", "sha512"]} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/keystore/targets_key b/tuf-no-std/tests/repository_data/keystore/targets_key new file mode 100644 index 0000000..c3883ec --- /dev/null +++ b/tuf-no-std/tests/repository_data/keystore/targets_key @@ -0,0 +1 @@ +a5a903322888df0bf8275b215f2044fe@@@@100000@@@@5f6b803652cb6d5bce4e07b1482597adb96d06c2efa3393abdcc0425f70be692@@@@0664811967e2f413927ce51a7f43a80e@@@@cf1dccd034400195c667c064198ef25555f3f94bf9cf77fbe300246618e557ad0efa775ef90bd46c842696c45d14033199860b2214c3641e87889a41171f8a2c763d004681b66b462ff34599e8d9da87f5642d2a015b75d3f601d198e0467fa4bc28f65c76260585e0cce71281f67a8053116f0f06883155f602811071b56bf75bf54daae5968b0a31cf829510f3c52c0eeb8f1c6bb8b8cb0c3edb4c6c2dd9d13bee00c5d63c3f98e0904eebb609864f4ab4fcc2c17bba8fd36aa06bc96bc1922eb10557051a674acf2cb01ff3efb7d55411df6915bbc49a095ff4472dc441e2765244f801d0df07b754c952d039f39b4530930a14be42cb2041f22eeb306b12f12158fcd2beb033db1be21f5a6ab72335cf16dfbd19cbf39c00b0a571d2b0e25df032be53a49a7a70ecebebb441d327c638cf31804381afaf809cd1c75f9070e83240fbaaa87bea0799404ece788862 \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/keystore/targets_key.pub b/tuf-no-std/tests/repository_data/keystore/targets_key.pub new file mode 100644 index 0000000..e859eb2 --- /dev/null +++ b/tuf-no-std/tests/repository_data/keystore/targets_key.pub @@ -0,0 +1 @@ +{"keyval": {"public": "89f28bd4ede5ec3786ab923fd154f39588d20881903e69c7b08fb504c6750815"}, "keytype": "ed25519", "scheme": "ed25519", "keyid_hash_algorithms": ["sha256", "sha512"]} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/keystore/timestamp_key b/tuf-no-std/tests/repository_data/keystore/timestamp_key new file mode 100644 index 0000000..ca82579 --- /dev/null +++ b/tuf-no-std/tests/repository_data/keystore/timestamp_key @@ -0,0 +1 @@ +677a42cd6c1df08d0c6156ae356c2875@@@@100000@@@@3850dbcf2973b80044912d630f05039df64775b63d1cf43e750d3cd8a457c64f@@@@bf01961c386d9fefb4b29db7f6ef0c7f@@@@96d37abafb902f821134d2034855d23b78c82e5b768b092fcf0d3b6b28a74734877a5014b26e5fed289d24f7cf6b393445c3231554c5b6d9711192cf9bd2fb7490497d7d76c619a0cfc70abae026b5068fb66db0138b04f890917daad66ca1f7baabdcbb5282e46a2f1c6ff2e8c241ff16ef31e918ca1387a15bc2ceadb2f75ce68fcff08186b5b901a499efe1f674319b503ff8b6fc004b71d0ecb94253f38c58349ab749e72f492e541e7504d25a0bfe791f53eb95c4524431b0f952fc3d7c7204a2a4aab44d33fe09cb36b337339e2a004bf15dfd925b63930905972749441a0c6e50ec9b1748a4cfbacf10b402ebd9c0074fcb38d236fd3146f60232862b0501e8e6caa9f81c223de03ba7b25a1d4bc2d031901dc445f25ce302d2189b8b8de443bc6f562f941b55595655193ab6b84c1ec2302ca056c70e8efb1cad909c50e82e0b7da9ad64202d149e4e837409 \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/keystore/timestamp_key.pub b/tuf-no-std/tests/repository_data/keystore/timestamp_key.pub new file mode 100644 index 0000000..69ba7de --- /dev/null +++ b/tuf-no-std/tests/repository_data/keystore/timestamp_key.pub @@ -0,0 +1 @@ +{"keyval": {"public": "82ccf6ac47298ff43bfa0cd639868894e305a99c723ff0515ae2e9856eb5bbf4"}, "keytype": "ed25519", "scheme": "ed25519", "keyid_hash_algorithms": ["sha256", "sha512"]} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/map.json b/tuf-no-std/tests/repository_data/map.json new file mode 100644 index 0000000..c2e0fb8 --- /dev/null +++ b/tuf-no-std/tests/repository_data/map.json @@ -0,0 +1,29 @@ +{ + "mapping": [ + { + "paths": [ + "*1.txt" + ], + "repositories": [ + "test_repository1", + "test_repository2" + ], + "terminating": false, + "threshold": 1 + }, + { + "paths": [ + "*3.txt" + ], + "repositories": [ + "test_repository2" + ], + "terminating": true, + "threshold": 1 + } + ], + "repositories": { + "test_repository1": [], + "test_repository2": [] + } +} diff --git a/tuf-no-std/tests/repository_data/project/targets/file1.txt b/tuf-no-std/tests/repository_data/project/targets/file1.txt new file mode 100644 index 0000000..7bf3499 --- /dev/null +++ b/tuf-no-std/tests/repository_data/project/targets/file1.txt @@ -0,0 +1 @@ +This is an example target file. \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/project/targets/file2.txt b/tuf-no-std/tests/repository_data/project/targets/file2.txt new file mode 100644 index 0000000..606f18e --- /dev/null +++ b/tuf-no-std/tests/repository_data/project/targets/file2.txt @@ -0,0 +1 @@ +This is an another example target file. \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/project/targets/file3.txt b/tuf-no-std/tests/repository_data/project/targets/file3.txt new file mode 100644 index 0000000..6046460 --- /dev/null +++ b/tuf-no-std/tests/repository_data/project/targets/file3.txt @@ -0,0 +1 @@ +This is role1's target file. \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/project/test-flat/project.cfg b/tuf-no-std/tests/repository_data/project/test-flat/project.cfg new file mode 100644 index 0000000..1564431 --- /dev/null +++ b/tuf-no-std/tests/repository_data/project/test-flat/project.cfg @@ -0,0 +1 @@ +{"project_name": "test-flat", "targets_location": "/Users/vlad/projects/vladforks/tuf/tests/repository_data/project/targets", "prefix": "prefix", "metadata_location": "test-flat", "threshold": 1, "public_keys": {"4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb": {"keyval": {"public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA0GjPoVrjS9eCqzoQ8VRe\nPkC0cI6ktiEgqPfHESFzyxyjC490Cuy19nuxPcJuZfN64MC48oOkR+W2mq4pM51i\nxmdG5xjvNOBRkJ5wUCc8fDCltMUTBlqt9y5eLsf/4/EoBU+zC4SW1iPU++mCsity\nfQQ7U6LOn3EYCyrkH51hZ/dvKC4o9TPYMVxNecJ3CL1q02Q145JlyjBTuM3Xdqsa\nndTHoXSRPmmzgB/1dL/c4QjMnCowrKW06mFLq9RAYGIaJWfM/0CbrOJpVDkATmEc\nMdpGJYDfW/sRQvRdlHNPo24ZW7vkQUCqdRxvnTWkK5U81y7RtjLt1yskbWXBIbOV\nz94GXsgyzANyCT9qRjHXDDz2mkLq+9I2iKtEqaEePcWRu3H6RLahpM/TxFzw684Y\nR47weXdDecPNxWyiWiyMGStRFP4Cg9trcwAGnEm1w8R2ggmWphznCd5dXGhPNjfA\na82yNFY8ubnOUVJOf0nXGg3Edw9iY3xyjJb2+nrsk5f3AgMBAAE=\n-----END PUBLIC KEY-----"}, "keytype": "rsa", "scheme": "rsassa-pss-sha256", "keyid_hash_algorithms": ["sha256", "sha512"]}}, "layout_type": "flat"} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/project/test-flat/role1.json b/tuf-no-std/tests/repository_data/project/test-flat/role1.json new file mode 100644 index 0000000..93f378a --- /dev/null +++ b/tuf-no-std/tests/repository_data/project/test-flat/role1.json @@ -0,0 +1,19 @@ +{ + "signatures": [ + { + "keyid": "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a", + "sig": "6c32f8cc2c642803a7b3b022ede0cf727e82964c1aa934571ef366bd5050ed02cfe3fdfe5477c08d0cbcc2dd17bb786d37ab1ce2b27e01ad79faf087594e0300" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": {}, + "roles": [] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": {}, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/project/test-flat/test-flat.json b/tuf-no-std/tests/repository_data/project/test-flat/test-flat.json new file mode 100644 index 0000000..15f3a49 --- /dev/null +++ b/tuf-no-std/tests/repository_data/project/test-flat/test-flat.json @@ -0,0 +1,58 @@ +{ + "signatures": [ + { + "keyid": "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb", + "sig": "89d042b364a853d3a9f7caf16005d88102a21a63b4841bf67c81c8cda4de7aff6fe2c877e94c0693961f423230da47055fa88f73ecc5b6f47515af61e4e85cbdb19af87a681dc202c8bdcdfdb0d43920198dde97f0b27b404c93308083225f311d196a7e8bbcf921a68580e760fb4616828438dd1236ae0639eda4c1f98e4074e6b5eb79043de9d3dc30e29f993dddf808e533947055d1a7b4b4d2344ed5c327568ac9065fdb7649c753aa4a37751284da57b236a9d171f00d0e7f93fc56bacd966d025bec3c21f769f94fc21c70e2b9c8d4b2cddb2bcae30b9626edd9a4c954a1c5a9e49b6b079bd15b44413987b98a69f92cf950a18049ba13d2dd1c338e1d2cd0625b659ac71df8bfbd49d7be31cdabddef7a4ecf83b674016028f519ca0d421150c9fe71abf7130644b494bf88861c365787e345b95a019e0cb6d403ad8d628fbc3b9f397824104bcf00e20fb7135895a7265b516f9b1ccd18c9b82a327b211297143d2ab16e8ac3ce98ab24c0b84d91c6e3b3d451858da1cdfbbafc4dd7" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": { + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "fcf224e55fa226056adf113ef1eb3d55e308b75b321c8c8316999d8c4fd9e0d9" + }, + "scheme": "ed25519" + } + }, + "roles": [ + { + "keyids": [ + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a" + ], + "name": "role1", + "paths": [ + "project/targets/file3.txt" + ], + "terminating": false, + "threshold": 1 + } + ] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": { + "prefix/file1.txt": { + "hashes": { + "sha256": "65b8c67f51c993d898250f40aa57a317d854900b3a04895464313e48785440da", + "sha512": "467430a68afae8e9f9c0771ea5d78bf0b3a0d79a2d3d3b40c69fde4dd42c461448aef76fcef4f5284931a1ffd0ac096d138ba3a0d6ca83fa8d7285a47a296f77" + }, + "length": 31 + }, + "prefix/file2.txt": { + "hashes": { + "sha256": "452ce8308500d83ef44248d8e6062359211992fd837ea9e370e561efb1a4ca99", + "sha512": "052b49a21e03606b28942db69aa597530fe52d47ee3d748ba65afcd14b857738e36bc1714c4f4adde46c3e683548552fe5c96722e0e0da3acd9050c2524902d8" + }, + "length": 39 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/repository/metadata.staged/1.root.json b/tuf-no-std/tests/repository_data/repository/metadata.staged/1.root.json new file mode 100644 index 0000000..214d8db --- /dev/null +++ b/tuf-no-std/tests/repository_data/repository/metadata.staged/1.root.json @@ -0,0 +1,87 @@ +{ + "signatures": [ + { + "keyid": "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb", + "sig": "a337d6375fedd2eabfcd6c2ef6c8a9c3bb85dc5a857715f6a6bd41123e7670c4972d8548bcd7248154f3d864bf25f1823af59d74c459f41ea09a02db057ca1245612ebbdb97e782c501dc3e094f7fa8aa1402b03c6ed0635f565e2a26f9f543a89237e15a2faf0c267e2b34c3c38f2a43a28ddcdaf8308a12ead8c6dc47d1b762de313e9ddda8cc5bc25aea1b69d0e5b9199ca02f5dda48c3bff615fd12a7136d00634b9abc6e75c3256106c4d6f12e6c43f6195071355b2857bbe377ce028619b58837696b805040ce144b393d50a472531f430fadfb68d3081b6a8b5e49337e328c9a0a3f11e80b0bc8eb2dc6e78d1451dd857e6e6e6363c3fd14c590aa95e083c9bfc77724d78af86eb7a7ef635eeddaa353030c79f66b3ba9ea11fab456cfe896a826fdfb50a43cd444f762821aada9bcd7b022c0ee85b8768f960343d5a1d3d76374cc0ac9e12a500de0bf5d48569e5398cadadadab045931c398e3bcb6cec88af2437ba91959f956079cbed159fed3938016e6c3b5e446131f81cc5981" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": false, + "expires": "2030-01-01T00:00:00Z", + "keys": { + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "rsa", + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA0GjPoVrjS9eCqzoQ8VRe\nPkC0cI6ktiEgqPfHESFzyxyjC490Cuy19nuxPcJuZfN64MC48oOkR+W2mq4pM51i\nxmdG5xjvNOBRkJ5wUCc8fDCltMUTBlqt9y5eLsf/4/EoBU+zC4SW1iPU++mCsity\nfQQ7U6LOn3EYCyrkH51hZ/dvKC4o9TPYMVxNecJ3CL1q02Q145JlyjBTuM3Xdqsa\nndTHoXSRPmmzgB/1dL/c4QjMnCowrKW06mFLq9RAYGIaJWfM/0CbrOJpVDkATmEc\nMdpGJYDfW/sRQvRdlHNPo24ZW7vkQUCqdRxvnTWkK5U81y7RtjLt1yskbWXBIbOV\nz94GXsgyzANyCT9qRjHXDDz2mkLq+9I2iKtEqaEePcWRu3H6RLahpM/TxFzw684Y\nR47weXdDecPNxWyiWiyMGStRFP4Cg9trcwAGnEm1w8R2ggmWphznCd5dXGhPNjfA\na82yNFY8ubnOUVJOf0nXGg3Edw9iY3xyjJb2+nrsk5f3AgMBAAE=\n-----END PUBLIC KEY-----" + }, + "scheme": "rsassa-pss-sha256" + }, + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "edcd0a32a07dce33f7c7873aaffbff36d20ea30787574ead335eefd337e4dacd" + }, + "scheme": "ed25519" + }, + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "89f28bd4ede5ec3786ab923fd154f39588d20881903e69c7b08fb504c6750815" + }, + "scheme": "ed25519" + }, + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "82ccf6ac47298ff43bfa0cd639868894e305a99c723ff0515ae2e9856eb5bbf4" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758" + ], + "threshold": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/repository/metadata.staged/role1.json b/tuf-no-std/tests/repository_data/repository/metadata.staged/role1.json new file mode 100644 index 0000000..0ac4687 --- /dev/null +++ b/tuf-no-std/tests/repository_data/repository/metadata.staged/role1.json @@ -0,0 +1,49 @@ +{ + "signatures": [ + { + "keyid": "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a", + "sig": "9408b46569e622a46f1d35d9fa3c10e17a9285631ced4f2c9c2bba2c2842413fcb796db4e81d6f988fc056c21c407fdc3c10441592cf1e837e088f2e2dfd5403" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": { + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "fcf224e55fa226056adf113ef1eb3d55e308b75b321c8c8316999d8c4fd9e0d9" + }, + "scheme": "ed25519" + } + }, + "roles": [ + { + "keyids": [ + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a" + ], + "name": "role2", + "paths": [], + "terminating": false, + "threshold": 1 + } + ] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": { + "file3.txt": { + "hashes": { + "sha256": "141f740f53781d1ca54b8a50af22cbf74e44c21a998fa2a8a05aaac2c002886b", + "sha512": "ef5beafa16041bcdd2937140afebd485296cd54f7348ecd5a4d035c09759608de467a7ac0eb58753d0242df873c305e8bffad2454aa48f44480f15efae1cacd0" + }, + "length": 28 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/repository/metadata.staged/role2.json b/tuf-no-std/tests/repository_data/repository/metadata.staged/role2.json new file mode 100644 index 0000000..93f378a --- /dev/null +++ b/tuf-no-std/tests/repository_data/repository/metadata.staged/role2.json @@ -0,0 +1,19 @@ +{ + "signatures": [ + { + "keyid": "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a", + "sig": "6c32f8cc2c642803a7b3b022ede0cf727e82964c1aa934571ef366bd5050ed02cfe3fdfe5477c08d0cbcc2dd17bb786d37ab1ce2b27e01ad79faf087594e0300" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": {}, + "roles": [] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": {}, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/repository/metadata.staged/root.json b/tuf-no-std/tests/repository_data/repository/metadata.staged/root.json new file mode 100644 index 0000000..214d8db --- /dev/null +++ b/tuf-no-std/tests/repository_data/repository/metadata.staged/root.json @@ -0,0 +1,87 @@ +{ + "signatures": [ + { + "keyid": "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb", + "sig": "a337d6375fedd2eabfcd6c2ef6c8a9c3bb85dc5a857715f6a6bd41123e7670c4972d8548bcd7248154f3d864bf25f1823af59d74c459f41ea09a02db057ca1245612ebbdb97e782c501dc3e094f7fa8aa1402b03c6ed0635f565e2a26f9f543a89237e15a2faf0c267e2b34c3c38f2a43a28ddcdaf8308a12ead8c6dc47d1b762de313e9ddda8cc5bc25aea1b69d0e5b9199ca02f5dda48c3bff615fd12a7136d00634b9abc6e75c3256106c4d6f12e6c43f6195071355b2857bbe377ce028619b58837696b805040ce144b393d50a472531f430fadfb68d3081b6a8b5e49337e328c9a0a3f11e80b0bc8eb2dc6e78d1451dd857e6e6e6363c3fd14c590aa95e083c9bfc77724d78af86eb7a7ef635eeddaa353030c79f66b3ba9ea11fab456cfe896a826fdfb50a43cd444f762821aada9bcd7b022c0ee85b8768f960343d5a1d3d76374cc0ac9e12a500de0bf5d48569e5398cadadadab045931c398e3bcb6cec88af2437ba91959f956079cbed159fed3938016e6c3b5e446131f81cc5981" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": false, + "expires": "2030-01-01T00:00:00Z", + "keys": { + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "rsa", + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA0GjPoVrjS9eCqzoQ8VRe\nPkC0cI6ktiEgqPfHESFzyxyjC490Cuy19nuxPcJuZfN64MC48oOkR+W2mq4pM51i\nxmdG5xjvNOBRkJ5wUCc8fDCltMUTBlqt9y5eLsf/4/EoBU+zC4SW1iPU++mCsity\nfQQ7U6LOn3EYCyrkH51hZ/dvKC4o9TPYMVxNecJ3CL1q02Q145JlyjBTuM3Xdqsa\nndTHoXSRPmmzgB/1dL/c4QjMnCowrKW06mFLq9RAYGIaJWfM/0CbrOJpVDkATmEc\nMdpGJYDfW/sRQvRdlHNPo24ZW7vkQUCqdRxvnTWkK5U81y7RtjLt1yskbWXBIbOV\nz94GXsgyzANyCT9qRjHXDDz2mkLq+9I2iKtEqaEePcWRu3H6RLahpM/TxFzw684Y\nR47weXdDecPNxWyiWiyMGStRFP4Cg9trcwAGnEm1w8R2ggmWphznCd5dXGhPNjfA\na82yNFY8ubnOUVJOf0nXGg3Edw9iY3xyjJb2+nrsk5f3AgMBAAE=\n-----END PUBLIC KEY-----" + }, + "scheme": "rsassa-pss-sha256" + }, + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "edcd0a32a07dce33f7c7873aaffbff36d20ea30787574ead335eefd337e4dacd" + }, + "scheme": "ed25519" + }, + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "89f28bd4ede5ec3786ab923fd154f39588d20881903e69c7b08fb504c6750815" + }, + "scheme": "ed25519" + }, + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "82ccf6ac47298ff43bfa0cd639868894e305a99c723ff0515ae2e9856eb5bbf4" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758" + ], + "threshold": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/repository/metadata.staged/snapshot.json b/tuf-no-std/tests/repository_data/repository/metadata.staged/snapshot.json new file mode 100644 index 0000000..7c8c091 --- /dev/null +++ b/tuf-no-std/tests/repository_data/repository/metadata.staged/snapshot.json @@ -0,0 +1,25 @@ +{ + "signatures": [ + { + "keyid": "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d", + "sig": "085672c70dffe26610e58542ee552843633cfed973abdad94c56138dbf0cd991644f2d3f27e4dda3098e08ab676e7f52627b587947ae69db1012d59a6da18e0c" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2030-01-01T00:00:00Z", + "meta": { + "role1.json": { + "version": 1 + }, + "role2.json": { + "version": 1 + }, + "targets.json": { + "version": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/repository/metadata.staged/targets.json b/tuf-no-std/tests/repository_data/repository/metadata.staged/targets.json new file mode 100644 index 0000000..8e21c26 --- /dev/null +++ b/tuf-no-std/tests/repository_data/repository/metadata.staged/targets.json @@ -0,0 +1,61 @@ +{ + "signatures": [ + { + "keyid": "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093", + "sig": "d65f8db0c1a8f0976552b9742bbb393f24a5fa5eaf145c37aee047236c79dd0b83cfbb8b49fa7803689dfe0031dcf22c4d006b593acac07d69093b9b81722c08" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": { + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "fcf224e55fa226056adf113ef1eb3d55e308b75b321c8c8316999d8c4fd9e0d9" + }, + "scheme": "ed25519" + } + }, + "roles": [ + { + "keyids": [ + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a" + ], + "name": "role1", + "paths": [ + "file3.txt" + ], + "terminating": false, + "threshold": 1 + } + ] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": { + "file1.txt": { + "custom": { + "file_permissions": "0644" + }, + "hashes": { + "sha256": "65b8c67f51c993d898250f40aa57a317d854900b3a04895464313e48785440da", + "sha512": "467430a68afae8e9f9c0771ea5d78bf0b3a0d79a2d3d3b40c69fde4dd42c461448aef76fcef4f5284931a1ffd0ac096d138ba3a0d6ca83fa8d7285a47a296f77" + }, + "length": 31 + }, + "file2.txt": { + "hashes": { + "sha256": "452ce8308500d83ef44248d8e6062359211992fd837ea9e370e561efb1a4ca99", + "sha512": "052b49a21e03606b28942db69aa597530fe52d47ee3d748ba65afcd14b857738e36bc1714c4f4adde46c3e683548552fe5c96722e0e0da3acd9050c2524902d8" + }, + "length": 39 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/repository/metadata.staged/timestamp.json b/tuf-no-std/tests/repository_data/repository/metadata.staged/timestamp.json new file mode 100644 index 0000000..9a0daf0 --- /dev/null +++ b/tuf-no-std/tests/repository_data/repository/metadata.staged/timestamp.json @@ -0,0 +1,23 @@ +{ + "signatures": [ + { + "keyid": "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758", + "sig": "de0e16920f87bf5500cc65736488ac17e09788cce808f6a4e85eb9e4e478a312b4c1a2d7723af56f7bfb1df533c67d8c93b6f49d39eabe7fae391a08e1f72f01" + } + ], + "signed": { + "_type": "timestamp", + "expires": "2030-01-01T00:00:00Z", + "meta": { + "snapshot.json": { + "hashes": { + "sha256": "8f88e2ba48b412c3843e9bb26e1b6f8fc9e98aceb0fbaa97ba37b4c98717d7ab" + }, + "length": 515, + "version": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/repository/metadata/1.root.json b/tuf-no-std/tests/repository_data/repository/metadata/1.root.json new file mode 100644 index 0000000..214d8db --- /dev/null +++ b/tuf-no-std/tests/repository_data/repository/metadata/1.root.json @@ -0,0 +1,87 @@ +{ + "signatures": [ + { + "keyid": "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb", + "sig": "a337d6375fedd2eabfcd6c2ef6c8a9c3bb85dc5a857715f6a6bd41123e7670c4972d8548bcd7248154f3d864bf25f1823af59d74c459f41ea09a02db057ca1245612ebbdb97e782c501dc3e094f7fa8aa1402b03c6ed0635f565e2a26f9f543a89237e15a2faf0c267e2b34c3c38f2a43a28ddcdaf8308a12ead8c6dc47d1b762de313e9ddda8cc5bc25aea1b69d0e5b9199ca02f5dda48c3bff615fd12a7136d00634b9abc6e75c3256106c4d6f12e6c43f6195071355b2857bbe377ce028619b58837696b805040ce144b393d50a472531f430fadfb68d3081b6a8b5e49337e328c9a0a3f11e80b0bc8eb2dc6e78d1451dd857e6e6e6363c3fd14c590aa95e083c9bfc77724d78af86eb7a7ef635eeddaa353030c79f66b3ba9ea11fab456cfe896a826fdfb50a43cd444f762821aada9bcd7b022c0ee85b8768f960343d5a1d3d76374cc0ac9e12a500de0bf5d48569e5398cadadadab045931c398e3bcb6cec88af2437ba91959f956079cbed159fed3938016e6c3b5e446131f81cc5981" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": false, + "expires": "2030-01-01T00:00:00Z", + "keys": { + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "rsa", + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA0GjPoVrjS9eCqzoQ8VRe\nPkC0cI6ktiEgqPfHESFzyxyjC490Cuy19nuxPcJuZfN64MC48oOkR+W2mq4pM51i\nxmdG5xjvNOBRkJ5wUCc8fDCltMUTBlqt9y5eLsf/4/EoBU+zC4SW1iPU++mCsity\nfQQ7U6LOn3EYCyrkH51hZ/dvKC4o9TPYMVxNecJ3CL1q02Q145JlyjBTuM3Xdqsa\nndTHoXSRPmmzgB/1dL/c4QjMnCowrKW06mFLq9RAYGIaJWfM/0CbrOJpVDkATmEc\nMdpGJYDfW/sRQvRdlHNPo24ZW7vkQUCqdRxvnTWkK5U81y7RtjLt1yskbWXBIbOV\nz94GXsgyzANyCT9qRjHXDDz2mkLq+9I2iKtEqaEePcWRu3H6RLahpM/TxFzw684Y\nR47weXdDecPNxWyiWiyMGStRFP4Cg9trcwAGnEm1w8R2ggmWphznCd5dXGhPNjfA\na82yNFY8ubnOUVJOf0nXGg3Edw9iY3xyjJb2+nrsk5f3AgMBAAE=\n-----END PUBLIC KEY-----" + }, + "scheme": "rsassa-pss-sha256" + }, + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "edcd0a32a07dce33f7c7873aaffbff36d20ea30787574ead335eefd337e4dacd" + }, + "scheme": "ed25519" + }, + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "89f28bd4ede5ec3786ab923fd154f39588d20881903e69c7b08fb504c6750815" + }, + "scheme": "ed25519" + }, + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "82ccf6ac47298ff43bfa0cd639868894e305a99c723ff0515ae2e9856eb5bbf4" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758" + ], + "threshold": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/repository/metadata/role1.json b/tuf-no-std/tests/repository_data/repository/metadata/role1.json new file mode 100644 index 0000000..0ac4687 --- /dev/null +++ b/tuf-no-std/tests/repository_data/repository/metadata/role1.json @@ -0,0 +1,49 @@ +{ + "signatures": [ + { + "keyid": "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a", + "sig": "9408b46569e622a46f1d35d9fa3c10e17a9285631ced4f2c9c2bba2c2842413fcb796db4e81d6f988fc056c21c407fdc3c10441592cf1e837e088f2e2dfd5403" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": { + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "fcf224e55fa226056adf113ef1eb3d55e308b75b321c8c8316999d8c4fd9e0d9" + }, + "scheme": "ed25519" + } + }, + "roles": [ + { + "keyids": [ + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a" + ], + "name": "role2", + "paths": [], + "terminating": false, + "threshold": 1 + } + ] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": { + "file3.txt": { + "hashes": { + "sha256": "141f740f53781d1ca54b8a50af22cbf74e44c21a998fa2a8a05aaac2c002886b", + "sha512": "ef5beafa16041bcdd2937140afebd485296cd54f7348ecd5a4d035c09759608de467a7ac0eb58753d0242df873c305e8bffad2454aa48f44480f15efae1cacd0" + }, + "length": 28 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/repository/metadata/role2.json b/tuf-no-std/tests/repository_data/repository/metadata/role2.json new file mode 100644 index 0000000..9c49e16 --- /dev/null +++ b/tuf-no-std/tests/repository_data/repository/metadata/role2.json @@ -0,0 +1,15 @@ +{ + "signatures": [ + { + "keyid": "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a", + "sig": "75b196a224fd200e46e738b1216b3316c5384f61083872f8d14b8b0a378b2344e64b1a6f1a89a711206a66a0b199d65ac0e30fe15ddbc4de89fa8ff645f99403" + } + ], + "signed": { + "_type": "targets", + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": {}, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/repository/metadata/root.json b/tuf-no-std/tests/repository_data/repository/metadata/root.json new file mode 100644 index 0000000..214d8db --- /dev/null +++ b/tuf-no-std/tests/repository_data/repository/metadata/root.json @@ -0,0 +1,87 @@ +{ + "signatures": [ + { + "keyid": "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb", + "sig": "a337d6375fedd2eabfcd6c2ef6c8a9c3bb85dc5a857715f6a6bd41123e7670c4972d8548bcd7248154f3d864bf25f1823af59d74c459f41ea09a02db057ca1245612ebbdb97e782c501dc3e094f7fa8aa1402b03c6ed0635f565e2a26f9f543a89237e15a2faf0c267e2b34c3c38f2a43a28ddcdaf8308a12ead8c6dc47d1b762de313e9ddda8cc5bc25aea1b69d0e5b9199ca02f5dda48c3bff615fd12a7136d00634b9abc6e75c3256106c4d6f12e6c43f6195071355b2857bbe377ce028619b58837696b805040ce144b393d50a472531f430fadfb68d3081b6a8b5e49337e328c9a0a3f11e80b0bc8eb2dc6e78d1451dd857e6e6e6363c3fd14c590aa95e083c9bfc77724d78af86eb7a7ef635eeddaa353030c79f66b3ba9ea11fab456cfe896a826fdfb50a43cd444f762821aada9bcd7b022c0ee85b8768f960343d5a1d3d76374cc0ac9e12a500de0bf5d48569e5398cadadadab045931c398e3bcb6cec88af2437ba91959f956079cbed159fed3938016e6c3b5e446131f81cc5981" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": false, + "expires": "2030-01-01T00:00:00Z", + "keys": { + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "rsa", + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA0GjPoVrjS9eCqzoQ8VRe\nPkC0cI6ktiEgqPfHESFzyxyjC490Cuy19nuxPcJuZfN64MC48oOkR+W2mq4pM51i\nxmdG5xjvNOBRkJ5wUCc8fDCltMUTBlqt9y5eLsf/4/EoBU+zC4SW1iPU++mCsity\nfQQ7U6LOn3EYCyrkH51hZ/dvKC4o9TPYMVxNecJ3CL1q02Q145JlyjBTuM3Xdqsa\nndTHoXSRPmmzgB/1dL/c4QjMnCowrKW06mFLq9RAYGIaJWfM/0CbrOJpVDkATmEc\nMdpGJYDfW/sRQvRdlHNPo24ZW7vkQUCqdRxvnTWkK5U81y7RtjLt1yskbWXBIbOV\nz94GXsgyzANyCT9qRjHXDDz2mkLq+9I2iKtEqaEePcWRu3H6RLahpM/TxFzw684Y\nR47weXdDecPNxWyiWiyMGStRFP4Cg9trcwAGnEm1w8R2ggmWphznCd5dXGhPNjfA\na82yNFY8ubnOUVJOf0nXGg3Edw9iY3xyjJb2+nrsk5f3AgMBAAE=\n-----END PUBLIC KEY-----" + }, + "scheme": "rsassa-pss-sha256" + }, + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "edcd0a32a07dce33f7c7873aaffbff36d20ea30787574ead335eefd337e4dacd" + }, + "scheme": "ed25519" + }, + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "89f28bd4ede5ec3786ab923fd154f39588d20881903e69c7b08fb504c6750815" + }, + "scheme": "ed25519" + }, + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "82ccf6ac47298ff43bfa0cd639868894e305a99c723ff0515ae2e9856eb5bbf4" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "4e777de0d275f9d28588dd9a1606cc748e548f9e22b6795b7cb3f63f98035fcb" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758" + ], + "threshold": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/repository/metadata/snapshot.json b/tuf-no-std/tests/repository_data/repository/metadata/snapshot.json new file mode 100644 index 0000000..7c8c091 --- /dev/null +++ b/tuf-no-std/tests/repository_data/repository/metadata/snapshot.json @@ -0,0 +1,25 @@ +{ + "signatures": [ + { + "keyid": "59a4df8af818e9ed7abe0764c0b47b4240952aa0d179b5b78346c470ac30278d", + "sig": "085672c70dffe26610e58542ee552843633cfed973abdad94c56138dbf0cd991644f2d3f27e4dda3098e08ab676e7f52627b587947ae69db1012d59a6da18e0c" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2030-01-01T00:00:00Z", + "meta": { + "role1.json": { + "version": 1 + }, + "role2.json": { + "version": 1 + }, + "targets.json": { + "version": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/repository/metadata/targets.json b/tuf-no-std/tests/repository_data/repository/metadata/targets.json new file mode 100644 index 0000000..8e21c26 --- /dev/null +++ b/tuf-no-std/tests/repository_data/repository/metadata/targets.json @@ -0,0 +1,61 @@ +{ + "signatures": [ + { + "keyid": "65171251a9aff5a8b3143a813481cb07f6e0de4eb197c767837fe4491b739093", + "sig": "d65f8db0c1a8f0976552b9742bbb393f24a5fa5eaf145c37aee047236c79dd0b83cfbb8b49fa7803689dfe0031dcf22c4d006b593acac07d69093b9b81722c08" + } + ], + "signed": { + "_type": "targets", + "delegations": { + "keys": { + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a": { + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keytype": "ed25519", + "keyval": { + "public": "fcf224e55fa226056adf113ef1eb3d55e308b75b321c8c8316999d8c4fd9e0d9" + }, + "scheme": "ed25519" + } + }, + "roles": [ + { + "keyids": [ + "c8022fa1e9b9cb239a6b362bbdffa9649e61ad2cb699d2e4bc4fdf7930a0e64a" + ], + "name": "role1", + "paths": [ + "file3.txt" + ], + "terminating": false, + "threshold": 1 + } + ] + }, + "expires": "2030-01-01T00:00:00Z", + "spec_version": "1.0.0", + "targets": { + "file1.txt": { + "custom": { + "file_permissions": "0644" + }, + "hashes": { + "sha256": "65b8c67f51c993d898250f40aa57a317d854900b3a04895464313e48785440da", + "sha512": "467430a68afae8e9f9c0771ea5d78bf0b3a0d79a2d3d3b40c69fde4dd42c461448aef76fcef4f5284931a1ffd0ac096d138ba3a0d6ca83fa8d7285a47a296f77" + }, + "length": 31 + }, + "file2.txt": { + "hashes": { + "sha256": "452ce8308500d83ef44248d8e6062359211992fd837ea9e370e561efb1a4ca99", + "sha512": "052b49a21e03606b28942db69aa597530fe52d47ee3d748ba65afcd14b857738e36bc1714c4f4adde46c3e683548552fe5c96722e0e0da3acd9050c2524902d8" + }, + "length": 39 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/repository/metadata/timestamp.json b/tuf-no-std/tests/repository_data/repository/metadata/timestamp.json new file mode 100644 index 0000000..9a0daf0 --- /dev/null +++ b/tuf-no-std/tests/repository_data/repository/metadata/timestamp.json @@ -0,0 +1,23 @@ +{ + "signatures": [ + { + "keyid": "8a1c4a3ac2d515dec982ba9910c5fd79b91ae57f625b9cff25d06bf0a61c1758", + "sig": "de0e16920f87bf5500cc65736488ac17e09788cce808f6a4e85eb9e4e478a312b4c1a2d7723af56f7bfb1df533c67d8c93b6f49d39eabe7fae391a08e1f72f01" + } + ], + "signed": { + "_type": "timestamp", + "expires": "2030-01-01T00:00:00Z", + "meta": { + "snapshot.json": { + "hashes": { + "sha256": "8f88e2ba48b412c3843e9bb26e1b6f8fc9e98aceb0fbaa97ba37b4c98717d7ab" + }, + "length": 515, + "version": 1 + } + }, + "spec_version": "1.0.0", + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/repository/targets/file1.txt b/tuf-no-std/tests/repository_data/repository/targets/file1.txt new file mode 100644 index 0000000..7bf3499 --- /dev/null +++ b/tuf-no-std/tests/repository_data/repository/targets/file1.txt @@ -0,0 +1 @@ +This is an example target file. \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/repository/targets/file2.txt b/tuf-no-std/tests/repository_data/repository/targets/file2.txt new file mode 100644 index 0000000..606f18e --- /dev/null +++ b/tuf-no-std/tests/repository_data/repository/targets/file2.txt @@ -0,0 +1 @@ +This is an another example target file. \ No newline at end of file diff --git a/tuf-no-std/tests/repository_data/repository/targets/file3.txt b/tuf-no-std/tests/repository_data/repository/targets/file3.txt new file mode 100644 index 0000000..6046460 --- /dev/null +++ b/tuf-no-std/tests/repository_data/repository/targets/file3.txt @@ -0,0 +1 @@ +This is role1's target file. \ No newline at end of file diff --git a/tuf-no-std/tests/root.json b/tuf-no-std/tests/root.json new file mode 100755 index 0000000..aaefda3 --- /dev/null +++ b/tuf-no-std/tests/root.json @@ -0,0 +1,71 @@ +{ + "signatures": [ + { + "keyid": "cb3fbd83df4ba2471a736b065650878280964a98843ec13b457a99b2a21cc3b4", + "sig": "a312b9c3cb4a1b693e8ebac5ee1ca9cc01f2661c14391917dcb111517f72370809f32c890c6b801e30158ac4efe0d4d87317223077784c7a378834249d048306" + } + ], + "signed": { + "_type": "root", + "spec_version": "1.0.0", + "consistent_snapshot": false, + "expires": "2030-01-01T00:00:00Z", + "keys": { + "135c2f50e57ff11e744d234a62cebad8c38daf399604a7655661cc9199c69164": { + "keytype": "ed25519", + "scheme": "ed25519", + "keyval": { + "public": "68ead6e54a43f8f36f9717b10669d1ef0ebb38cee6b05317669341309f1069cb" + } + }, + "1bf1c6e3cdd3d3a8420b19199e27511999850f4b376c4547b2f32fba7e80fca3": { + "keytype": "ed25519", + "scheme": "ed25519", + "keyval": { + "public": "72378e5bc588793e58f81c8533da64a2e8f1565c1fcc7f253496394ffc52542c" + } + }, + "66676daa73bdfb4804b56070c8927ae491e2a6c2314f05b854dea94de8ff6bfc": { + "keytype": "ed25519", + "scheme": "ed25519", + "keyval": { + "public": "01c61f8dc7d77fcef973f4267927541e355e8ceda757e2c402818dad850f856e" + } + }, + "cb3fbd83df4ba2471a736b065650878280964a98843ec13b457a99b2a21cc3b4": { + "keytype": "ed25519", + "scheme": "ed25519", + "keyval": { + "public": "66dd78c5c2a78abc6fc6b267ff1a8017ba0e8bfc853dd97af351949bba021275" + } + } + }, + "roles": { + "root": { + "keyids": [ + "cb3fbd83df4ba2471a736b065650878280964a98843ec13b457a99b2a21cc3b4" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "66676daa73bdfb4804b56070c8927ae491e2a6c2314f05b854dea94de8ff6bfc" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "135c2f50e57ff11e744d234a62cebad8c38daf399604a7655661cc9199c69164" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "1bf1c6e3cdd3d3a8420b19199e27511999850f4b376c4547b2f32fba7e80fca3" + ], + "threshold": 1 + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/rsa-root.json b/tuf-no-std/tests/rsa-root.json new file mode 100644 index 0000000..24ea2d7 --- /dev/null +++ b/tuf-no-std/tests/rsa-root.json @@ -0,0 +1,40 @@ +{ + "signed": { + "_type": "root", + "spec_version": "1.0", + "consistent_snapshot": true, + "version": 1, + "expires": "3000-03-30T03:30:30Z", + "keys": { + "8ec3a843a0f9328c863cac4046ab1cacbbc67888476ac7acf73d9bcd9a223ada": { + "keytype": "rsa", + "scheme": "rsassa-pss-sha256", + "keyval": {"public": "-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAnL6u6Q9Q6pg1G5020a83\nGlH/aFUO0PQ5leIpwWL8kWgpaWuUG7oRlOUG2/4cwN5FCvJJGXqU5AtSKq2fZ42J\n5XR9QMip4Pg0Q6mE8XCvAXAoMnkWSchdzgT2GoEntaOeRRTCUGb/DsVoxsVXjV6m\nFaRMx7nh8ggshMWgTYgTUDK+CSIBCcBWapCFq1BrM60XZmGTqeAuHSHaUUuF9G3b\ngOflH5L9IpQkaHWbJtGvyKLr53mhWO2r8BPR3+CtNZojAnkwmu4lA94k8C7TLMdc\nutzU4OzODe9UPERc33lRv8DBgsH3F077ZQwv/ikZXWSlACTDWZwenncCEwqdeDd4\n+q2AHyqxRN7bUAh57mUN+kFd3SS/4T44sfBrJw6N4JV/mE+/YfRLWtpIKIsXnBCb\nrC+dt96Vqz6g6eVVvqPwhOCSKcYsmp/iS6qwVn0Dq2SCrGG1FTmBjeA9ZkcjZhUG\nQEMyMNhoS+U2Nx5oIEIq2kREpuu+KsBSTUaOgR07WNUxAgMBAAE=\n-----END PUBLIC KEY-----\n"} + } + }, + "roles": { + "root": { + "keyids": ["8ec3a843a0f9328c863cac4046ab1cacbbc67888476ac7acf73d9bcd9a223ada"], + "threshold": 1 + }, + "snapshot": { + "keyids": ["8ec3a843a0f9328c863cac4046ab1cacbbc67888476ac7acf73d9bcd9a223ada"], + "threshold": 1 + }, + "targets": { + "keyids": ["8ec3a843a0f9328c863cac4046ab1cacbbc67888476ac7acf73d9bcd9a223ada"], + "threshold": 1 + }, + "timestamp": { + "keyids": ["8ec3a843a0f9328c863cac4046ab1cacbbc67888476ac7acf73d9bcd9a223ada"], + "threshold": 1 + } + } + }, + "signatures": [ + { + "keyid": "8ec3a843a0f9328c863cac4046ab1cacbbc67888476ac7acf73d9bcd9a223ada", + "sig": "00988a64c9513713ca39197738f5fc8d5babb3a070e065bb08fa09bd3ab6e0f8f4e822a3de2fd54ecd799c22eb380d3e47ba34052112509ed1e717e91303d47d8b211c09424b5eacf675cff98c53d1aa24370a7218d526119156ec391fe6097649b3b6b5753431a3f9f9d46ee5a3b9f053ab0aa1fabecf78d305ce86f8634bd921e3ba728c00572307a278cc526ecf5c17a1b804149fef6de6e3a2d58d7fbfab9dfc59abe8b9cf02be34325401296e9e0c4eb4375aab102fe208984e5fdddd1f878eb1e1623eb6463cd9f96d114967ff311d2bbf87b6de49594c1e66faf7e07844d2e0dfab33e4f946d3b862218c6404a385731803f5d5dcde1d9a8489f81e7637edf2cb6c9c98676a8424acbf88946d73e4676b378b058840130764210663ef531b26db19b952f5f0177444c2b2a0198684fe5d911f4813eb40f78a7e234e663ebfa9f75fee6d32bec7f9fb97911d1f0919c3837207b73af97fde19fcc62c34ad3062e1ffe3b52b857bceb4e78f79ca5bc780fa17f41c66730d4c138593a581" + } + ] +} diff --git a/tuf-no-std/tests/sigstore-root.json b/tuf-no-std/tests/sigstore-root.json new file mode 100755 index 0000000..7abd5fd --- /dev/null +++ b/tuf-no-std/tests/sigstore-root.json @@ -0,0 +1,156 @@ +{ + "signed": { + "_type": "root", + "spec_version": "1.0", + "version": 5, + "expires": "2023-04-18T18:13:43Z", + "keys": { + "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEEXsz3SZXFb8jMV42j6pJlyjbjR8K\nN3Bwocexq6LMIb5qsWKOQvLN16NUefLc4HswOoumRsVVaajSpQS6fobkRw==\n-----END PUBLIC KEY-----\n" + } + }, + "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0ghrh92Lw1Yr3idGV5WqCtMDB8Cx\n+D8hdC4w2ZLNIplVRoVGLskYa3gheMyOjiJ8kPi15aQ2//7P+oj7UvJPGw==\n-----END PUBLIC KEY-----\n" + } + }, + "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAELrWvNt94v4R085ELeeCMxHp7PldF\n0/T1GxukUh2ODuggLGJE0pc1e8CSBf6CS91Fwo9FUOuRsjBUld+VqSyCdQ==\n-----END PUBLIC KEY-----\n" + } + }, + "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEinikSsAQmYkNeH5eYq/CnIzLaacO\nxlSaawQDOwqKy/tCqxq5xxPSJc21K4WIhs9GyOkKfzueY3GILzcMJZ4cWw==\n-----END PUBLIC KEY-----\n" + } + }, + "e1863ba02070322ebc626dcecf9d881a3a38c35c3b41a83765b6ad6c37eaec2a": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWRiGr5+j+3J5SsH+Ztr5nE2H2wO7\nBV+nO3s93gLca18qTOzHY1oWyAGDykMSsGTUBSt9D+An0KfKsD2mfSM42Q==\n-----END PUBLIC KEY-----\n" + } + }, + "f5312f542c21273d9485a49394386c4575804770667f2ddb59b3bf0669fddd2f": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzBzVOmHCPojMVLSI364WiiV8NPrD\n6IgRxVliskz/v+y3JER5mcVGcONliDcWMC5J2lfHmjPNPhb4H7xm8LzfSA==\n-----END PUBLIC KEY-----\n" + } + }, + "ff51e17fcf253119b7033f6f57512631da4a0969442afcf9fc8b141c7f2be99c": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEy8XKsmhBYDI8Jc0GwzBxeKax0cm5\nSTKEU65HPFunUn41sT8pi0FjM4IkHz/YUmwmLUO0Wt7lxhj6BkLIK4qYAw==\n-----END PUBLIC KEY-----\n" + } + } + }, + "roles": { + "root": { + "keyids": [ + "ff51e17fcf253119b7033f6f57512631da4a0969442afcf9fc8b141c7f2be99c", + "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99", + "f5312f542c21273d9485a49394386c4575804770667f2ddb59b3bf0669fddd2f", + "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b", + "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de" + ], + "threshold": 3 + }, + "snapshot": { + "keyids": [ + "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "ff51e17fcf253119b7033f6f57512631da4a0969442afcf9fc8b141c7f2be99c", + "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99", + "f5312f542c21273d9485a49394386c4575804770667f2ddb59b3bf0669fddd2f", + "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b", + "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de" + ], + "threshold": 3 + }, + "timestamp": { + "keyids": [ + "e1863ba02070322ebc626dcecf9d881a3a38c35c3b41a83765b6ad6c37eaec2a" + ], + "threshold": 1 + } + }, + "consistent_snapshot": true + }, + "signatures": [ + { + "keyid": "ff51e17fcf253119b7033f6f57512631da4a0969442afcf9fc8b141c7f2be99c", + "sig": "3045022100fc1c2be509ce50ea917bbad1d9efe9d96c8c2ebea04af2717aa3d9c6fe617a75022012eef282a19f2d8bd4818aa333ef48a06489f49d4d34a20b8fe8fc867bb25a7a" + }, + { + "keyid": "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99", + "sig": "30450221008a4392ae5057fc00778b651e61fea244766a4ae58db84d9f1d3810720ab0f3b702207c49e59e8031318caf02252ecea1281cecc1e5986c309a9cef61f455ecf7165d" + }, + { + "keyid": "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b", + "sig": "3046022100da1b8dc5d53aaffbbfac98de3e23ee2d2ad3446a7bed09fac0f88bae19be2587022100b681c046afc3919097dfe794e0d819be891e2e850aade315bec06b0c4dea221b" + }, + { + "keyid": "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de", + "sig": "3046022100b534e0030e1b271133ecfbdf3ba9fbf3becb3689abea079a2150afbb63cdb7c70221008c39a718fd9495f249b4ab8788d5b9dc269f0868dbe38b272f48207359d3ded9" + }, + { + "keyid": "2f64fb5eac0cf94dd39bb45308b98920055e9a0d8e012a7220787834c60aef97", + "sig": "3045022100fc1c2be509ce50ea917bbad1d9efe9d96c8c2ebea04af2717aa3d9c6fe617a75022012eef282a19f2d8bd4818aa333ef48a06489f49d4d34a20b8fe8fc867bb25a7a" + }, + { + "keyid": "eaf22372f417dd618a46f6c627dbc276e9fd30a004fc94f9be946e73f8bd090b", + "sig": "30450221008a4392ae5057fc00778b651e61fea244766a4ae58db84d9f1d3810720ab0f3b702207c49e59e8031318caf02252ecea1281cecc1e5986c309a9cef61f455ecf7165d" + }, + { + "keyid": "f505595165a177a41750a8e864ed1719b1edfccd5a426fd2c0ffda33ce7ff209", + "sig": "3046022100da1b8dc5d53aaffbbfac98de3e23ee2d2ad3446a7bed09fac0f88bae19be2587022100b681c046afc3919097dfe794e0d819be891e2e850aade315bec06b0c4dea221b" + }, + { + "keyid": "75e867ab10e121fdef32094af634707f43ddd79c6bab8ad6c5ab9f03f4ea8c90", + "sig": "3046022100b534e0030e1b271133ecfbdf3ba9fbf3becb3689abea079a2150afbb63cdb7c70221008c39a718fd9495f249b4ab8788d5b9dc269f0868dbe38b272f48207359d3ded9" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/snapshot.json b/tuf-no-std/tests/snapshot.json new file mode 100644 index 0000000..2c172c9 --- /dev/null +++ b/tuf-no-std/tests/snapshot.json @@ -0,0 +1,64 @@ +{ + "signed": { + "_type": "snapshot", + "spec_version": "1.0", + "version": 105, + "expires": "2023-10-10T16:08:34Z", + "meta": { + "registry.npmjs.org.json": { + "length": 713, + "hashes": { + "sha256": "235bb462df505d1dd1c2fbb12ffa1ac65adffdba13d2c9cf01924372f0d182cd", + "sha512": "9e7fa5cd8d0ef677f77e2ec9379739bf83125a8aa97761d431d2305935769ba7aae2663e81a84ddbad9328ed0412f684f5e6fb27b9c9634331b82ab21deab805" + }, + "version": 1 + }, + "rekor.json": { + "length": 797, + "hashes": { + "sha256": "9d2e1a5842937d8e0d3e3759170b0ad15c56c5df36afc5cf73583ddd283a463b", + "sha512": "176e9e710ddddd1b357a7d7970831bae59763395a0c18976110cbd35b25e5412dc50f356ec421a7a30265670cf7aec9ed84ee944ba700ec2394b9c876645b960" + }, + "version": 3 + }, + "revocation.json": { + "length": 800, + "hashes": { + "sha256": "6f60848ba8fb0955a02abfd1232fb3845dc9ee9f418bf03521a7ddb48217e040", + "sha512": "a965dddd0d0edef6c59e84cf02ecf5a53299f633fd339b2b61814a4219ab4df672a6390f265b8b29e1c8cea9368ea3440df013790759d50231a30df1c1f02551" + }, + "version": 2 + }, + "root.json": { + "length": 5297, + "hashes": { + "sha256": "f5ad897c9414cca99629f400ac3585e41bd8ebb44c5af07fb08dd636a9eced9c", + "sha512": "7445ddfdd338ef786c324fc3d68f75be28cb95b7fb581d2a383e3e5dde18aa17029a5636ec0a22e9631931bbcb34057788311718ea41e21e7cdd3c0de13ede42" + }, + "version": 2 + }, + "staging.json": { + "length": 401, + "hashes": { + "sha256": "cda57759abac5375397eea3531d7ca51e3a67da9a2dc93f2cdab749e2ae73149", + "sha512": "e9e59587bde453144c7079884a880c706f1d43f26e8bb23fac2b96a99569a2a30ae6cf51ec51c2454f760ce83d4c20915e062aede7f319b3da6a6ed1d26ca281" + }, + "version": 2 + }, + "targets.json": { + "length": 5252, + "hashes": { + "sha256": "62e5983ffb9fd792b70a349ec9f7f59d16009914236a0036acef8ebdf8cff445", + "sha512": "b7ef79bb5b0b6619cc0c9696069f2332c702b36d7f86dcf52ccae53c4d7b5d6217b4287137ca38e9bc10dbc2d57a7e3a393c9a8fbf0e4fb30b766f0dd953db27" + }, + "version": 7 + } + } + }, + "signatures": [ + { + "keyid": "45b283825eb184cabd582eb17b74fc8ed404f68cf452acabdad2ed6f90ce216b", + "sig": "3046022100f8a2f2f82bd6fd1d96378574ad65a59f742adf1361753e172786326f5b68f1b2022100eac1a0943901a2fafbff8383e0ef2dcf96a9f0a687bebf7436437f039a63ecd3" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tests/snapshots.json b/tuf-no-std/tests/snapshots.json new file mode 100755 index 0000000..8f6d1e8 --- /dev/null +++ b/tuf-no-std/tests/snapshots.json @@ -0,0 +1,32 @@ +{ + "signatures": [ + { + "keyid": "66676daa73bdfb4804b56070c8927ae491e2a6c2314f05b854dea94de8ff6bfc", + "sig": "f7f03b13e3f4a78a23561419fc0dd741a637e49ee671251be9f8f3fceedfc112e44ee3aaff2278fad9164ab039118d4dc53f22f94900dae9a147aa4d35dcfc0f" + } + ], + "signed": { + "_type": "snapshot", + "spec_version": "1.0.0", + "expires": "2030-01-01T00:00:00Z", + "meta": { + "targets.json": { + "version": 1 + }, + "project1.json": { + "version": 1, + "hashes": { + "sha256": "f592d072e1193688a686267e8e10d7257b4ebfcf28133350dae88362d82a0c8a" + } + }, + "project2.json": { + "version": 1, + "length": 604, + "hashes": { + "sha256": "1f812e378264c3085bb69ec5f6663ed21e5882bbece3c3f8a0e8479f205ffb91" + } + } + }, + "version": 1 + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/targets.json b/tuf-no-std/tests/targets.json new file mode 100755 index 0000000..c54adb7 --- /dev/null +++ b/tuf-no-std/tests/targets.json @@ -0,0 +1,160 @@ +{ + "signatures": [ + { + "keyid": "2e61cd0cbf4a8f45809bda9f7f78c0d33ad11842ff94ae340873e2664dc843de", + "sig": "3045022100eeb820ad0b0aabb0f6bf68159d7a9cbd24d1c4633f14317f9944fcb3bb2e1ff802207f92fb20b84df6bcf0c3c2f39fa089238bbee9ff12490c555b694421a45e8d5d" + }, + { + "keyid": "25a0eb450fd3ee2bd79218c963dce3f1cc6118badf251bf149f0bd07d5cabe99", + "sig": "304502202984e536e9442c9f5a14700195b481fb0b3255e4572734700c5ff527b1135f88022100be2f4947b34a02e391417c96ffab8643476164fc44fa258bfe0133ab49858f29" + }, + { + "keyid": "f5312f542c21273d9485a49394386c4575804770667f2ddb59b3bf0669fddd2f", + "sig": "3045022100d757e9268801bb1eb4f883abd570dae52a3201c622b4e7e5a30a8b42f3e2f54b02206663b846a8d13d95497d651334dbb754587a14c274fadd91ca796733bc467b95" + }, + { + "keyid": "7f7513b25429a64473e10ce3ad2f3da372bbdd14b65d07bbaf547e7c8bbbe62b", + "sig": "3045022054d7fb7d70a80f8f4021f090307ada7a196a32f4794954baf405475b38e68d45022100d85fde60eecb2003e4eb329e1b68f22d33dbe11a2293155dad88209250b25b2c" + } + ], + "signed": { + "_type": "targets", + "spec_version": "1.0", + "version": 7, + "expires": "2023-10-04T13:26:23Z", + "targets": { + "artifact.pub": { + "length": 177, + "hashes": { + "sha256": "59ebf97a9850aecec4bc39c1f5c1dc46e6490a6b5fd2a6cacdcac0c3a6fc4cbf", + "sha512": "308fd1d1d95d7f80aa33b837795251cc3e886792982275e062409e13e4e236ffc34d676682aa96fdc751414de99c864bf132dde71581fa651c6343905e3bf988" + }, + "custom": { + "sigstore": { + "status": "Active", + "usage": "Unknown" + } + } + }, + "ctfe.pub": { + "length": 177, + "hashes": { + "sha256": "7fcb94a5d0ed541260473b990b99a6c39864c1fb16f3f3e594a5a3cebbfe138a", + "sha512": "4b20747d1afe2544238ad38cc0cc3010921b177d60ac743767e0ef675b915489bd01a36606c0ff83c06448622d7160f0d866c83d20f0c0f44653dcc3f9aa0bd4" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://ctfe.sigstore.dev/test", + "usage": "CTFE" + } + } + }, + "ctfe_2022.pub": { + "length": 178, + "hashes": { + "sha256": "270488a309d22e804eeb245493e87c667658d749006b9fee9cc614572d4fbbdc", + "sha512": "e83fa4f427b24ee7728637fad1b4aa45ebde2ba02751fa860694b1bb16059a490328f9985e51cc70e4d237545315a1bc866dc4fdeef2f6248d99cc7a6077bf85" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://ctfe.sigstore.dev/2022", + "usage": "CTFE" + } + } + }, + "fulcio.crt.pem": { + "length": 744, + "hashes": { + "sha256": "f360c53b2e13495a628b9b8096455badcb6d375b185c4816d95a5d746ff29908", + "sha512": "0713252a7fd17f7f3ab12f88a64accf2eb14b8ad40ca711d7fe8b4ecba3b24db9e9dffadb997b196d3867b8f9ff217faf930d80e4dab4e235c7fc3f07be69224" + }, + "custom": { + "sigstore": { + "status": "Expired", + "uri": "https://fulcio.sigstore.dev", + "usage": "Fulcio" + } + } + }, + "fulcio_intermediate_v1.crt.pem": { + "length": 789, + "hashes": { + "sha256": "f8cbecf186db7714624a5f4e99da31a917cbef70a94dd6921f5c3ca969dfe30a", + "sha512": "0f99f47dbc26c5f1e3cba0bfd9af4245a26e5cb735d6ef005792ec7e603f66fdb897de985973a6e50940ca7eff5e1849719e967b5ad2dac74a29115a41cf6f21" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://fulcio.sigstore.dev", + "usage": "Fulcio" + } + } + }, + "fulcio_v1.crt.pem": { + "length": 740, + "hashes": { + "sha256": "f989aa23def87c549404eadba767768d2a3c8d6d30a8b793f9f518a8eafd2cf5", + "sha512": "f2e33a6dc208cee1f51d33bbea675ab0f0ced269617497985f9a0680689ee7073e4b6f8fef64c91bda590d30c129b3070dddce824c05bc165ac9802f0705cab6" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://fulcio.sigstore.dev", + "usage": "Fulcio" + } + } + }, + "rekor.pub": { + "length": 178, + "hashes": { + "sha256": "dce5ef715502ec9f3cdfd11f8cc384b31a6141023d3e7595e9908a81cb6241bd", + "sha512": "0ae7705e02db33e814329746a4a0e5603c5bdcd91c96d072158d71011a2695788866565a2fec0fe363eb72cbcaeda39e54c5fe8d416daf9f3101fdba4217ef35" + }, + "custom": { + "sigstore": { + "status": "Active", + "uri": "https://rekor.sigstore.dev", + "usage": "Rekor" + } + } + }, + "trusted_root.json": { + "length": 7014, + "hashes": { + "sha256": "4364d7724c04cc912ce2a6c45ed2610e8d8d1c4dc857fb500292738d4d9c8d2c", + "sha512": "fdebade075c4840d40f1806a14d0660ae1d22f47c0516abc4141e09f4ddf6ee6f4dbfbf08a7025bea10a4b8794658a4cd8ebb1024b963f239a9bfe02c2057fc6" + } + } + }, + "delegations": { + "keys": { + "a89d235ee2f298d757438c7473b11b0b7b42ff1a45f1dfaac4c014183d6f8c45": { + "keytype": "ecdsa-sha2-nistp256", + "scheme": "ecdsa-sha2-nistp256", + "keyid_hash_algorithms": [ + "sha256", + "sha512" + ], + "keyval": { + "public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEoLrh0jmOfHWLwsyo/4oGbldF91WV\nfXvxVlDhW8fZwP/3vTnliBkDp5sH8/Dpm1SBOHkqENVt1+4Un/sFtl2zAQ==\n-----END PUBLIC KEY-----\n" + } + } + }, + "roles": [ + { + "name": "registry.npmjs.org", + "keyids": [ + "a89d235ee2f298d757438c7473b11b0b7b42ff1a45f1dfaac4c014183d6f8c45" + ], + "threshold": 1, + "terminating": true, + "paths": [ + "registry.npmjs.org/*" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/tuf-no-std/tests/timestamp.json b/tuf-no-std/tests/timestamp.json new file mode 100755 index 0000000..4ffd568 --- /dev/null +++ b/tuf-no-std/tests/timestamp.json @@ -0,0 +1,24 @@ +{ + "signed": { + "_type": "timestamp", + "spec_version": "1.0", + "version": 116, + "expires": "2023-09-26T16:08:35Z", + "meta": { + "snapshot.json": { + "length": 2304, + "hashes": { + "sha256": "6fac89d8e110d261e5194966578f665e60890183ef3be985b4062104eff13a7b", + "sha512": "7518beaa1a0920a3c17187d9ba93e0296187c5c2d0c393814620b0bb9ed6922189f4c7d0bcda9568861728e33a412ba39eaca172a814478d87c109e35877daa2" + }, + "version": 105 + } + } + }, + "signatures": [ + { + "keyid": "e1863ba02070322ebc626dcecf9d881a3a38c35c3b41a83765b6ad6c37eaec2a", + "sig": "3045022100b53cdca27e8135b4aca3bb3907089c4b95a38f35292b0cc9c7df18667eec870d02205dd5a7686f0222437f24cf48a8e11439fc55b88e548af6cd6cd8c10789e289ca" + } + ] +} \ No newline at end of file diff --git a/tuf-no-std/tuf-no-std-cli/Cargo.toml b/tuf-no-std/tuf-no-std-cli/Cargo.toml new file mode 100644 index 0000000..25e062a --- /dev/null +++ b/tuf-no-std/tuf-no-std-cli/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "tuf-no-std-cli" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +tuf-no-std = { path = "../tuf-no-std", default-features = false, features = [ + "der", + "verify", + "ecdsa", + "rand", + "async", +] } +clap = { workspace = true, features = ["derive"] } +tuf-no-std-der = { path = "../tuf-no-std-der" } +pem = { workspace = true } +der = { workspace = true } +anyhow = { workspace = true, default-features = true } +serde = { version = "1.0.171", features = ["derive"] } +serde_yaml = { version = "0.9.33" } diff --git a/tuf-no-std/tuf-no-std-cli/src/args.rs b/tuf-no-std/tuf-no-std-cli/src/args.rs new file mode 100644 index 0000000..822ef39 --- /dev/null +++ b/tuf-no-std/tuf-no-std-cli/src/args.rs @@ -0,0 +1,8 @@ +use clap::Parser; +use std::path::PathBuf; + +#[derive(Debug, Parser)] +pub struct Args { + /// Path to the config file. + pub config: PathBuf, +} diff --git a/tuf-no-std/tuf-no-std-cli/src/config.rs b/tuf-no-std/tuf-no-std-cli/src/config.rs new file mode 100644 index 0000000..43746d8 --- /dev/null +++ b/tuf-no-std/tuf-no-std-cli/src/config.rs @@ -0,0 +1,38 @@ +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; +use std::path::PathBuf; + +/// Data structure to parse/store configurations +#[derive(Debug, Deserialize, Serialize)] +pub struct Config { + /// key: role name, value: role configuration + pub roles: HashMap, + /// key: target name, value: target configuration + pub targets: HashMap, + /// directory to store the output + pub out: PathBuf, +} + +#[derive(Debug, Deserialize, Serialize)] +pub struct TargetConfig { + pub name: String, + pub filepath: PathBuf, +} + +#[derive(Debug, Deserialize, Serialize)] +pub struct RoleConfig { + pub threshold: u8, + pub version: u32, + pub keys: Vec, +} + +#[derive(Debug, Deserialize, Serialize)] +pub struct KeyConfig { + pub kind: KeyKind, +} + +#[derive(Debug, Deserialize, Serialize)] +#[serde(rename_all = "lowercase")] +pub enum KeyKind { + Ecdsa, +} diff --git a/tuf-no-std/tuf-no-std-cli/src/main.rs b/tuf-no-std/tuf-no-std-cli/src/main.rs new file mode 100644 index 0000000..30cee4a --- /dev/null +++ b/tuf-no-std/tuf-no-std-cli/src/main.rs @@ -0,0 +1,141 @@ +mod args; +mod config; + +use crate::args::Args; +use crate::config::{Config, KeyConfig, KeyKind}; +use anyhow::{Context, Result}; +use clap::Parser; +use der::Encode; +use std::fs::read; +use std::{ + fs, + fs::{read_to_string, OpenOptions}, + io::Write, +}; +use tuf_no_std::{ + builder::*, + common::crypto::sign::{Cipher, SigningKey}, +}; +use tuf_no_std_der::{ + root::Root, snapshot::Snapshot, targets::Targets, timestamp::Timestamp, Signed, +}; + +fn main() -> Result<()> { + let args = Args::parse(); + let config: Config = read_to_string(args.config) + .context("failed to config file") + .and_then(|s| serde_yaml::from_str(&s).context("failed to parse config file"))?; + + let root_config = &config.roles["root"]; + let timestamp_config = &config.roles["timestamp"]; + let snapshot_config = &config.roles["snapshot"]; + let targets_config = &config.roles["targets"]; + + let func = |k_conf: &KeyConfig| match k_conf.kind { + KeyKind::Ecdsa => SigningKey::new(Cipher::Ecdsa), + }; + let root_keys = root_config.keys.iter().map(func).collect::>(); + let timestamp_keys = timestamp_config.keys.iter().map(func).collect::>(); + let snapshot_keys = snapshot_config.keys.iter().map(func).collect::>(); + let targets_keys = targets_config.keys.iter().map(func).collect::>(); + + let root_keys_spki = root_keys + .iter() + .map(|k| k.as_spki().unwrap()) + .collect::>(); + let targets_keys_spki = targets_keys + .iter() + .map(|k| k.as_spki().unwrap()) + .collect::>(); + let snapshot_keys_spki = snapshot_keys + .iter() + .map(|k| k.as_spki().unwrap()) + .collect::>(); + let timestamp_keys_spki = timestamp_keys + .iter() + .map(|k| k.as_spki().unwrap()) + .collect::>(); + + let root = RootBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_role_and_key("root", &root_keys_spki, root_config.threshold) + .with_role_and_key("targets", &targets_keys_spki, targets_config.threshold) + .with_role_and_key("snapshot", &snapshot_keys_spki, snapshot_config.threshold) + .with_role_and_key( + "timestamp", + ×tamp_keys_spki, + timestamp_config.threshold, + ) + .with_version(root_config.version) + .build(); + let signed_root = Signed::::from_signed(root, &root_keys).unwrap(); + + let root_der = signed_root.to_der().unwrap(); + let rekor_pub_pem = config + .targets + .get("rekor") + .context("missing rekor target") + .and_then(|c| read(&c.filepath).context("failed to read rekor key"))?; + let ct_log_pub_pem = config + .targets + .get("ctlog") + .context("missing rekor target") + .and_then(|c| read(&c.filepath).context("failed to read rekor key"))?; + let fulcio_crt_pem = config + .targets + .get("fulcio") + .context("missing rekor target") + .and_then(|c| read(&c.filepath).context("failed to read rekor key"))?; + + let targets = TargetsBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(targets_config.version) + .with_target(config.targets["rekor"].name.as_bytes(), &rekor_pub_pem) + .with_target(config.targets["fulcio"].name.as_bytes(), &fulcio_crt_pem) + .with_target(config.targets["ctlog"].name.as_bytes(), &ct_log_pub_pem) + .build(); + let signed_targets = Signed::::from_signed(targets, &targets_keys).unwrap(); + let targets_der = signed_targets.to_der().unwrap(); + + let snapshot = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_meta(b"targets.der", targets_der.as_slice(), 1) + .with_version(snapshot_config.version) + .build(); + let signed_snapshot = Signed::::from_signed(snapshot, &snapshot_keys).unwrap(); + let snapshot_der = signed_snapshot.to_der().unwrap(); + + let timestamp = TimestampBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_snapshot("snapshot.der", &signed_snapshot) + .with_version(snapshot_config.version) + .build(); + let signed_timestamp = Signed::::from_signed(timestamp, ×tamp_keys).unwrap(); + let timestamp_der = signed_timestamp.to_der().unwrap(); + let out_dir = config.out; + fs::create_dir_all(out_dir.join("targets")).expect("failed to create dir 'out/targets' dir"); + [ + (out_dir.join("1.root.der"), root_der.as_slice()), + (out_dir.join("1.targets.der"), targets_der.as_slice()), + (out_dir.join("1.timestamp.der"), timestamp_der.as_slice()), + (out_dir.join("1.snapshot.der"), snapshot_der.as_slice()), + (out_dir.join("targets/rekor.pub"), rekor_pub_pem.as_slice()), + ( + out_dir.join("targets/fulcio.crt.pem"), + fulcio_crt_pem.as_slice(), + ), + (out_dir.join("targets/ctlog.pub"), ct_log_pub_pem.as_slice()), + ] + .into_iter() + .for_each(|(p, f)| { + OpenOptions::new() + .write(true) + .truncate(true) + .create(true) + .open(&p) + .unwrap_or_else(|_| panic!("failed to open file at path: {p:?}")) + .write_all(f) + .expect("failed to write to file"); + }); + Ok(()) +} diff --git a/tuf-no-std/tuf-no-std-common/Cargo.toml b/tuf-no-std/tuf-no-std-common/Cargo.toml new file mode 100755 index 0000000..6dc054b --- /dev/null +++ b/tuf-no-std/tuf-no-std-common/Cargo.toml @@ -0,0 +1,63 @@ +[package] +name = "tuf-no-std-common" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[features] +default = ["sign", "verify"] +sign = ["p256/pem"] +verify = [] +rsa = ["dep:rsa"] +rand = ["dep:rand_core", "ed25519-dalek/rand_core"] +ecdsa = ["dep:p256"] +p256 = ["dep:p256"] +ed25519 = ["dep:ed25519", "dep:ed25519-dalek"] +dilithium3 = [ +# "dep:oqs" +] +composite = [] +async = ["dep:async-trait"] + +[dependencies] +serde = { workspace = true, features = ["derive"] } +#time = { version = "0.3", default-features = false, features = [ +# "serde", +# "parsing", +#] } +# semver = { version = "1.0", default-features = false, features = ["serde"] } +anyhow = { workspace = true, features = [] } +either = { workspace = true } +signature = { workspace = true, features = [] } +p256 = { workspace = true, features = ["ecdsa", "arithmetic", "pkcs8"], optional = true } +ed25519 = { workspace = true, optional = true } +ed25519-dalek = { workspace = true, features = ["pkcs8", "alloc"], optional = true } +rsa = { workspace = true, features = ["sha2"], optional = true } +pem-rfc7468 = { workspace = true, features = [] } +hex = { workspace = true, features = [] } +sha2 = { workspace = true, features = [] } +# oqs = { workspace = true, features = ["sigs", "non_portable"], optional = true } +spki = { workspace = true, features = ["fingerprint"] } +const-oid = { workspace = true, features = ["db"] } +der = { workspace = true, features = ["oid", "derive"] } +zeroize = { workspace = true, features = [] } +hash32 = { workspace = true } +rand_core = { workspace = true, features = ["getrandom"], optional = true } +async-trait = { workspace = true, optional = true } + + +[dev-dependencies] +serde_json = { workspace = true } +postcard = { workspace = true } +olpc-cjson = { workspace = true } +rand_core = { workspace = true, features = ["getrandom"] } +p256 = { workspace = true, features = ["ecdsa", "arithmetic", "pem"] } +hex-literal = { workspace = true } +anyhow = { workspace = true } +ring = { workspace = true } +untrusted = { workspace = true } +tough = { workspace = true } +rand = { workspace = true } +ed25519-dalek = { workspace = true, features = ["rand_core", "alloc", "pkcs8"] } diff --git a/tuf-no-std/tuf-no-std-common/src/common.rs b/tuf-no-std/tuf-no-std-common/src/common.rs new file mode 100644 index 0000000..2c764d5 --- /dev/null +++ b/tuf-no-std/tuf-no-std-common/src/common.rs @@ -0,0 +1 @@ +pub type Threshold = u8; diff --git a/tuf-no-std/tuf-no-std-common/src/constants.rs b/tuf-no-std/tuf-no-std-common/src/constants.rs new file mode 100644 index 0000000..103b11d --- /dev/null +++ b/tuf-no-std/tuf-no-std-common/src/constants.rs @@ -0,0 +1,15 @@ +use const_oid::ObjectIdentifier; + +pub const PEM_KEY_MAX_SIZE: usize = 1024; +pub const PEM_ECDSA_KEY_MAX_SIZE: usize = 130; + +pub const DER_DILITHIUM3_ECDSA_P256_SHA256_KEY_MAX_SIZE: usize = 2090; +pub const PEM_DILITHIUM3_ECDSA_P256_SHA256_KEY_MAX_SIZE: usize = 2884; +// https://github.com/IETF-Hackathon/pqc-certificates/blob/master/docs/oid_mapping.md +pub const ID_DILITHIUM3_ECDSA_P256_SHA256: ObjectIdentifier = + ObjectIdentifier::new_unwrap("2.16.840.1.114027.80.5.1.2"); +pub const ID_DILITHIUM3: ObjectIdentifier = + ObjectIdentifier::new_unwrap("1.3.6.1.4.1.2.267.12.6.5"); + +pub const ID_COMPOSITE_KEY_OID: ObjectIdentifier = + ObjectIdentifier::new_unwrap("2.16.840.1.114027.80.4.1"); diff --git a/tuf-no-std/tuf-no-std-common/src/crypto/composite_spki.rs b/tuf-no-std/tuf-no-std-common/src/crypto/composite_spki.rs new file mode 100644 index 0000000..6730b13 --- /dev/null +++ b/tuf-no-std/tuf-no-std-common/src/crypto/composite_spki.rs @@ -0,0 +1,116 @@ +use der::{AnyRef, Decode, Encode, FixedTag, Length, Reader, Tag, Writer}; + +pub(crate) struct PkComposite {} + +use crate::constants::*; +use crate::crypto::Dilithium3VerificationKey; +use der::asn1::{BitStringRef, SequenceOf}; +#[cfg(feature = "dilithium3")] +use oqs::sig::Algorithm::Dilithium3; +use signature::digest::Digest; +use signature::{DigestVerifier, Error, Verifier}; +use spki::{SubjectPublicKeyInfo, SubjectPublicKeyInfoRef}; + +pub type CompositeSubjectPublicKeyInfoRef<'a, const N: usize> = + SubjectPublicKeyInfo, CompositePublicKeyRef<'a, N>>; +pub type CompositePublicKeyRef<'a, const N: usize> = SequenceOf, N>; + +#[cfg(feature = "composite")] +pub enum CompositeVerificationKey { + #[cfg(all(feature = "dilithium3", feature = "ecdsa"))] + Dilithium3EcdsaP256Sha256 { + k1: p256::ecdsa::VerifyingKey, + k2: Dilithium3VerificationKey, + }, +} +#[cfg(feature = "composite")] +pub type CompositeSignatureRef<'a, const N: usize> = SequenceOf, N>; +#[cfg(feature = "composite")] +impl<'a> TryFrom> for CompositeVerificationKey { + type Error = (); + + fn try_from(value: CompositeSubjectPublicKeyInfoRef<'a, 2>) -> Result { + match value.algorithm.oid { + id if id == ID_DILITHIUM3_ECDSA_P256_SHA256 => { + let ecdsa_key = value + .subject_public_key + .iter() + .find(|k| k.algorithm.oid == const_oid::db::rfc5912::ID_EC_PUBLIC_KEY) + .ok_or(()) + .and_then(|k| p256::ecdsa::VerifyingKey::try_from(k.clone()).or(Err(())))?; + let dilithium3_key = value + .subject_public_key + .iter() + .find(|k| k.algorithm.oid == ID_DILITHIUM3) + .ok_or(()) + .and_then(|k| { + k.subject_public_key.as_bytes().ok_or(()).and_then(|b| { + oqs::sig::Sig::new(Dilithium3) + .unwrap() + .public_key_from_bytes(b) + .ok_or(()) + .map(|k| k.to_owned()) + }) + })?; + Ok(Self::Dilithium3EcdsaP256Sha256 { + k1: ecdsa_key, + k2: Dilithium3VerificationKey(dilithium3_key), + }) + } + _ => return Err(()), + } + } +} + +#[cfg(test)] +mod test { + use der::asn1::{BitStringRef, SequenceOf}; + use der::{AnyRef, Decode, DecodePem, Encode, EncodePem}; + use rand_core::OsRng; + use spki::{ + AlgorithmIdentifier, EncodePublicKey, SubjectPublicKeyInfo, SubjectPublicKeyInfoRef, + }; + + use crate::constants::*; + use crate::crypto::composite_spki::{ + CompositeSubjectPublicKeyInfoRef, CompositeVerificationKey, + }; + use oqs::*; + + #[test] + fn test() { + let signing_key = p256::ecdsa::SigningKey::random(&mut OsRng); // Serialize with `::to_bytes()` + let pubkey = p256::ecdsa::VerifyingKey::from(signing_key); + + let der = pubkey.to_public_key_der().unwrap(); + let spki = spki::SubjectPublicKeyInfoRef::from_der(der.as_ref()).unwrap(); + let mut keys = SequenceOf::new(); + keys.add(spki.clone()).unwrap(); + + oqs::init(); // Important: initialize liboqs + let sigalg = sig::Sig::new(sig::Algorithm::Dilithium3).unwrap(); + // A's long-term secrets + let (a_sig_pk, a_sig_sk) = sigalg.keypair().unwrap(); + let pk_bytes = a_sig_pk.as_ref(); + + keys.add(SubjectPublicKeyInfo { + algorithm: AlgorithmIdentifier { + oid: ID_DILITHIUM3, + parameters: None, + }, + subject_public_key: BitStringRef::from_bytes(pk_bytes).unwrap(), + }) + .unwrap(); + + let spki_new = CompositeSubjectPublicKeyInfoRef::<2> { + algorithm: AlgorithmIdentifier { + oid: ID_DILITHIUM3_ECDSA_P256_SHA256, + parameters: None, + }, + subject_public_key: keys, + }; + let composite_der = spki_new.to_pem(Default::default()).unwrap(); + eprintln!("{:#?}", composite_der.len()); + let key = CompositeVerificationKey::try_from(spki_new).expect("failed to get key"); + } +} diff --git a/tuf-no-std/tuf-no-std-common/src/crypto/mod.rs b/tuf-no-std/tuf-no-std-common/src/crypto/mod.rs new file mode 100644 index 0000000..37c52dc --- /dev/null +++ b/tuf-no-std/tuf-no-std-common/src/crypto/mod.rs @@ -0,0 +1,55 @@ +#[cfg(feature = "dilithium3")] +pub mod composite_spki; +pub mod sign; + +#[cfg(feature = "dilithium3")] +use oqs::sig::PublicKeyRef; +use sha2::digest::Output; +use sha2::{Digest, Sha256}; + +// Disable this lint because there is not point in an Err type. +#[allow(clippy::result_unit_err)] +pub fn verify_sha256(hash: impl AsRef<[u8]>, data: impl AsRef<[u8]>) -> Result<(), ()> { + let decoded = hash.as_ref().into(); + verify_sha256_impl(decoded, data.as_ref()) +} + +fn verify_sha256_impl(hash: &Output, data: impl AsRef<[u8]>) -> Result<(), ()> { + let output = ::new().chain_update(data).finalize(); + if hash == &output { + Ok(()) + } else { + Err(()) + } +} + +#[cfg(feature = "dilithium3")] +fn from_pem_oqs<'o>( + pem: &[u8], + out: &'o mut [u8], + algo: oqs::sig::Algorithm, +) -> Result, ()> { + let scheme = oqs::sig::Sig::new(algo).or(Err(()))?; + let Ok((_label, data)) = pem_rfc7468::decode(pem, out) else { + return Err(()); // PEM decoding error + }; + let Ok((s, k)) = scheme.keypair() else { + panic!() + }; + scheme.public_key_from_bytes(data).ok_or(()) +} + +#[cfg(feature = "dilithium3")] +pub struct Dilithium3VerificationKey(pub(crate) oqs::sig::PublicKey); + +#[cfg(feature = "dilithium3")] +impl<'a> Verifier> for Dilithium3VerificationKey { + fn verify(&self, msg: &[u8], signature: &oqs::sig::SignatureRef) -> Result<(), Error> { + oqs::sig::Sig::new(oqs::sig::Algorithm::Dilithium3) + .or(Err(Default::default())) + .and_then(|alg| { + alg.verify(msg, signature, &self.0) + .or(Err(Default::default())) + }) + } +} diff --git a/tuf-no-std/tuf-no-std-common/src/crypto/sign.rs b/tuf-no-std/tuf-no-std-common/src/crypto/sign.rs new file mode 100644 index 0000000..8355e67 --- /dev/null +++ b/tuf-no-std/tuf-no-std-common/src/crypto/sign.rs @@ -0,0 +1,100 @@ +use crate::TufError; +use crate::TufError::InternalError; +use alloc::vec::Vec; +use der::Decode; +use p256::ecdsa; +use signature::Signer; +use spki::{EncodePublicKey, SubjectPublicKeyInfoOwned, SubjectPublicKeyInfoRef}; + +#[derive(Debug, Clone)] +pub enum SigningKey { + #[cfg(feature = "ed25519")] + Ed25519Dalek(ed25519_dalek::SigningKey), + #[cfg(feature = "ecdsa")] + Ecdsa(ecdsa::SigningKey), +} +#[derive(Debug, Clone)] +pub enum Cipher { + #[cfg(feature = "ed25519")] + Ed25519Dalek, + #[cfg(feature = "ecdsa")] + Ecdsa, +} + +#[derive(Debug)] +pub enum RawSignature { + #[cfg(feature = "ed25519")] + Ed25519Dalek(ed25519_dalek::Signature), + #[cfg(feature = "ecdsa")] + Ecdsa(ecdsa::Signature), +} + +impl RawSignature { + pub fn to_vec(&self) -> Vec { + match self { + #[cfg(feature = "ed25519")] + RawSignature::Ed25519Dalek(sig) => sig.to_vec(), + #[cfg(feature = "ecdsa")] + RawSignature::Ecdsa(sig) => sig.to_bytes().to_vec(), + } + } +} + +#[cfg(feature = "sign")] +impl SigningKey { + #[cfg(feature = "rand")] + pub fn new(cipher: Cipher) -> Self { + match cipher { + #[cfg(feature = "ed25519")] + Cipher::Ed25519Dalek => { + Self::Ed25519Dalek(ed25519_dalek::SigningKey::generate(&mut rand_core::OsRng)) + } + #[cfg(feature = "ecdsa")] + Cipher::Ecdsa => Self::Ecdsa(p256::ecdsa::SigningKey::random(&mut rand_core::OsRng)), + } + } + + pub fn sign(&self, msg: &[u8]) -> Result { + match self { + #[cfg(feature = "ed25519")] + SigningKey::Ed25519Dalek(key) => Ok(RawSignature::Ed25519Dalek(key.sign(msg))), + #[cfg(feature = "ecdsa")] + SigningKey::Ecdsa(key) => Ok(RawSignature::Ecdsa(key.sign(msg))), + } + } + pub fn key_id(&self) -> Result<[u8; 32], TufError> { + match self { + #[cfg(feature = "ed25519")] + SigningKey::Ed25519Dalek(key) => key + .verifying_key() + .to_public_key_der() + .map_err(|_| TufError::EncodingError) + .and_then(|d| { + SubjectPublicKeyInfoRef::from_der(d.as_bytes()) + .map_err(|_| InternalError) + .and_then(|spki| spki.fingerprint_bytes().map_err(|_| InternalError)) + }), + #[cfg(feature = "ecdsa")] + SigningKey::Ecdsa(key) => key + .verifying_key() + .to_public_key_der() + .map_err(|_| TufError::EncodingError) + .and_then(|d| { + SubjectPublicKeyInfoRef::from_der(d.as_bytes()) + .map_err(|_| InternalError) + .and_then(|spki| spki.fingerprint_bytes().map_err(|_| InternalError)) + }), + } + } + pub fn as_spki(&self) -> Result { + let pubkey_der = match self { + #[cfg(feature = "ed25519")] + SigningKey::Ed25519Dalek(key) => { + key.verifying_key().to_public_key_der().unwrap().into_vec() + } + #[cfg(feature = "ecdsa")] + SigningKey::Ecdsa(key) => key.verifying_key().to_public_key_der().unwrap().into_vec(), + }; + TryFrom::try_from(pubkey_der.as_slice()).map_err(|_| TufError::DecodingError) + } +} diff --git a/tuf-no-std/tuf-no-std-common/src/error.rs b/tuf-no-std/tuf-no-std-common/src/error.rs new file mode 100644 index 0000000..028b24f --- /dev/null +++ b/tuf-no-std/tuf-no-std-common/src/error.rs @@ -0,0 +1,42 @@ +#[derive(Debug, PartialEq, Copy, Clone)] +pub enum TufError { + // fewer signatures than threshold of old root -> arbitrary software attack possible + OldRootThresholdNotReached, + // fewer signatures than threshold of new root -> arbitrary software attack possible + ThresholdNotReached, + // new version number has to be exactly N+1 for old root with version number N -> roll back attack + InvalidNewVersionNumber, + // the client was not able to persistently store a new root file + CouldNotPersistRootMetadata, + // The expiration timestamp in the trusted root metadata file MUST be higher than the fixed update start time + // -> freeze attack + ExpiredRootFile, + ExpiredTimestampFile, + ExpiredSnapshotFile, + ExpiredTargetsFile, + // A fast-forward attack happens when attackers arbitrarily increase the version numbers of: (1) the timestamp metadata, (2) the snapshot metadata, and / or (3) the targets, or a delegated targets, metadata file in the snapshot metadata. + PotentialFastForwardAttack, + // could not fetch new data + FetchError, + InvalidSignature, + DecodingSignatureFailed, + DecodingPublicKeyFailed, + InternalError, + DecodingError, + EncodingError, + // could not find keys for a role + MissingSnapshotKeys, + MissingTargetsKeys, + MissingTimestampKeys, + MissingSnapshotFile, + MissingTargetsFile, + MissingTimestampFile, + MissingRootKeys, + NoSupportedHash, + MissingTargetMetadata, + InvalidHash, + InvalidTargetsInSnapshot, + InvalidLength, + NotEnoughSpace, + InvalidUtcTimestamp, +} diff --git a/tuf-no-std/tuf-no-std-common/src/lib.rs b/tuf-no-std/tuf-no-std-common/src/lib.rs new file mode 100755 index 0000000..179b72b --- /dev/null +++ b/tuf-no-std/tuf-no-std-common/src/lib.rs @@ -0,0 +1,62 @@ +#![cfg_attr(not(test), no_std)] +extern crate alloc; + +pub mod common; +pub mod constants; +pub mod crypto; +pub mod error; +pub mod remote; +pub mod storage; + +use der::asn1::BitStringRef; +pub use error::TufError; + +pub type Version = u32; + +#[derive(Debug, Clone)] +pub enum RoleType { + Root, + Snapshot, + Targets, + Timestamp, +} + +impl<'a> PartialEq> for RoleType { + fn eq(&self, other: &BitStringRef<'a>) -> bool { + let name = match self { + RoleType::Root => "root", + RoleType::Snapshot => "snapshot", + RoleType::Targets => "targets", + RoleType::Timestamp => "timestamp", + }; + &BitStringRef::from_bytes(name.as_bytes()).unwrap() == other + } +} + +#[cfg(test)] +mod test { + use der::asn1::BitStringRef; + + use crate::RoleType; + + #[test] + fn test_eq() { + assert_eq!(RoleType::Root, BitStringRef::from_bytes(b"root").unwrap()); + assert_eq!( + RoleType::Snapshot, + BitStringRef::from_bytes(b"snapshot").unwrap() + ); + assert_eq!( + RoleType::Targets, + BitStringRef::from_bytes(b"targets").unwrap() + ); + assert_eq!( + RoleType::Timestamp, + BitStringRef::from_bytes(b"timestamp").unwrap() + ); + assert_ne!(RoleType::Root, BitStringRef::from_bytes(b"a").unwrap()); + assert_ne!(RoleType::Timestamp, BitStringRef::from_bytes(b"a").unwrap()); + assert_ne!(RoleType::Targets, BitStringRef::from_bytes(b"a").unwrap()); + assert_ne!(RoleType::Snapshot, BitStringRef::from_bytes(b"a").unwrap()); + } +} diff --git a/tuf-no-std/tuf-no-std-common/src/remote.rs b/tuf-no-std/tuf-no-std-common/src/remote.rs new file mode 100644 index 0000000..6abfb82 --- /dev/null +++ b/tuf-no-std/tuf-no-std-common/src/remote.rs @@ -0,0 +1,54 @@ +use core::num::NonZeroU64; + +#[derive(Debug, Clone)] +pub enum TransportError { + /// Failed to fetch the specific file. For instance, if it was not present there. + FetchError, + /// Failed to connect to the remote host. + ConnectError, +} + +/// Trait that is used represent the communication with a remote TUF repository. +pub trait TufTransport { + fn fetch_root<'o>( + &self, + version: NonZeroU64, + out: &'o mut [u8], + ) -> Result<&'o [u8], TransportError>; + /// Fetches the most recent timestamp provided by the remote. + fn fetch_timestamp<'o>(&self, out: &'o mut [u8]) -> Result<&'o [u8], TransportError>; + /// Fetches the most recent snapshot provided by the remote. + fn fetch_snapshot<'o>(&self, out: &'o mut [u8]) -> Result<&'o [u8], TransportError>; + /// Fetches the most recent targets provided by the remote. + fn fetch_targets<'o>(&self, out: &'o mut [u8]) -> Result<&'o [u8], TransportError>; + /// Fetches the target file with the name provided in `metapath`. + fn fetch_target_file<'o>( + &self, + metapath: &[u8], + out: &'o mut [u8], + ) -> Result<&'o [u8], TransportError>; +} + +/// Async version of the trait `TufTransport` trait that is used represent the communication with a remote TUF repository. +#[allow(async_fn_in_trait)] +#[cfg(feature = "async")] +pub trait TufTransportAsync { + /// Fetches the root file with the given version number. + async fn fetch_root<'o>( + &self, + version: NonZeroU64, + out: &'o mut [u8], + ) -> Result<&'o [u8], TransportError>; + /// Fetches the most recent timestamp provided by the remote. + async fn fetch_timestamp<'o>(&self, out: &'o mut [u8]) -> Result<&'o [u8], TransportError>; + /// Fetches the most recent snapshot provided by the remote. + async fn fetch_snapshot<'o>(&self, out: &'o mut [u8]) -> Result<&'o [u8], TransportError>; + /// Fetches the most recent targets provided by the remote. + async fn fetch_targets<'o>(&self, out: &'o mut [u8]) -> Result<&'o [u8], TransportError>; + /// Fetches the target file with the name provided in `metapath`. + async fn fetch_target_file<'o>( + &self, + metapath: &[u8], + out: &'o mut [u8], + ) -> Result<&'o [u8], TransportError>; +} diff --git a/tuf-no-std/tuf-no-std-common/src/storage.rs b/tuf-no-std/tuf-no-std-common/src/storage.rs new file mode 100644 index 0000000..a7e05e5 --- /dev/null +++ b/tuf-no-std/tuf-no-std-common/src/storage.rs @@ -0,0 +1,193 @@ +use crate::TufError; + +/// A trait to abstract file storage for TUF. +pub trait TufStorage { + /// Delete currently stored timestamp metadata. + fn delete_timestamp_metadata(&mut self); + /// Delete currently stored snapshot metadata. + fn delete_snapshot_metadata(&mut self); + /// Persistently store the provided root file. This does overwrite the previous root file, this happens when it is committed. + fn persist_root(&mut self, data: &[u8]) -> Result<(), TufError>; + /// Persistently store the provided timestamp file. + fn persist_timestamp(&mut self, data: &[u8]) -> Result<(), TufError>; + /// Persistently store the provided snapshot file. + fn persist_snapshot(&mut self, data: &[u8]) -> Result<(), TufError>; + /// Persistently store the provided targets file. + fn persist_targets(&mut self, data: &[u8]) -> Result<(), TufError>; + /// Update the root file to the last root file that was persisted. + fn commit_root(&mut self) -> Result<(), TufError>; + fn current_root(&self) -> &[u8]; + fn current_root_copy<'o>(&self, out: &'o mut [u8]) -> &'o [u8]; + fn current_uncommitted_root_copy<'o>(&self, out: &'o mut [u8]) -> Option<&'o [u8]>; + fn current_uncommitted_root(&self) -> Option<&[u8]>; + fn current_timestamp(&self) -> Option<&[u8]>; + fn current_timestamp_copy<'o>(&self, out: &'o mut [u8]) -> Option<&'o [u8]>; + fn current_snapshot(&self) -> Option<&[u8]>; + fn current_snapshot_copy<'o>(&self, out: &'o mut [u8]) -> Option<&'o [u8]>; + fn current_targets(&self) -> Option<&[u8]>; +} + +pub enum StorageState { + Empty, + NonEmpty(usize), +} +/* +pub struct StackStorage<'a, const N: usize> { + buf: [[u8; N]; 5], + ref_storage: RefStorage<'a>, +} + +impl<'a, const N: usize> StackStorage<'a, N> { + pub fn new(buf: &'a mut [u8; N]) -> Self { + let (root, rest) = buf.split_at_mut(N / 5); + let (uncommitted_root, rest) = rest.split_at_mut(N / 5); + let (timestamp, rest) = rest.split_at_mut(N / 5); + let (snapshot, rest) = rest.split_at_mut(N / 5); + let (targets, _) = rest.split_at_mut(N / 5); + StackStorage { + buf: [[0u8; N]; 5], + ref_storage: RefStorage { + root: (0, root), + uncommitted_root: (StorageState::Empty, uncommitted_root), + timestamp: (StorageState::Empty, timestamp), + snapshot: (StorageState::Empty, snapshot), + targets: (StorageState::Empty, targets), + }, + } + } +} + +impl<'a, const N: usize> Storage<'a> for StackStorage<'a, N> { + fn delete_timestamp_metadata(&mut self) { + self.ref_storage.delete_timestamp_metadata() + } + fn delete_snapshot_metadata(&mut self) { + self.ref_storage.delete_snapshot_metadata() + } + fn persist_root(&mut self, data: &[u8]) -> Result<(), RootVerificationError> { + self.ref_storage.persist_root(data) + } + fn persist_timestamp(&mut self, data: &[u8]) -> Result<(), RootVerificationError> { + self.ref_storage.persist_timestamp(data) + } + fn persist_snapshot(&mut self, data: &[u8]) -> Result<(), RootVerificationError> { + self.ref_storage.persist_snapshot(data) + } + fn persist_targets(&mut self, data: &[u8]) -> Result<(), RootVerificationError> { + self.ref_storage.persist_targets(data) + } + fn commit_root(&mut self) -> Result<(), RootVerificationError> { + self.ref_storage.commit_root() + } + fn current_root<'o>(&self, out: &'o mut [u8]) -> &'o [u8] { + self.ref_storage.current_root(out) + } + fn current_uncommitted_root<'o>(&self, out: &'o mut [u8]) -> Option<&'o [u8]> { + self.ref_storage.current_uncommitted_root(out) + } + fn current_timestamp<'o>(&self, out: &'o mut [u8]) -> Option<&'o [u8]> { + self.ref_storage.current_timestamp(out) + } + fn current_snapshot<'o>(&self, out: &'o mut [u8]) -> Option<&'o [u8]> { + self.ref_storage.current_snapshot(out) + } +} + +pub struct RefStorage<'a> { + root: (usize, &'a mut [u8]), + uncommitted_root: (StorageState, &'a mut [u8]), + timestamp: (StorageState, &'a mut [u8]), + snapshot: (StorageState, &'a mut [u8]), + targets: (StorageState, &'a mut [u8]), +} + +impl<'a> RefStorage<'a> { + fn persist(dst: &mut (StorageState, &'a mut [u8]), src: &[u8]) -> Result<(), ()> { + if src.len() > dst.1.len() { + return Err(()); + } + dst.1[..src.len()].copy_from_slice(src); + dst.0 = StorageState::NonEmpty(src.len()); + Ok(()) + } +} + +impl<'a> Storage for RefStorage<'a> { + fn delete_timestamp_metadata(&mut self) { + self.timestamp.1.zeroize(); + self.timestamp.0 = StorageState::Empty; + } + + fn delete_snapshot_metadata(&mut self) { + self.snapshot.1.zeroize(); + self.snapshot.0 = StorageState::Empty; + } + + fn persist_root(&mut self, data: &[u8]) -> Result<(), RootVerificationError> { + RefStorage::persist(&mut self.uncommitted_root, data) + .map_err(|_| CouldNotPersistRootMetadata) + } + + fn persist_timestamp(&mut self, data: &[u8]) -> Result<(), RootVerificationError> { + RefStorage::persist(&mut self.timestamp, data).map_err(|_| CouldNotPersistRootMetadata) + } + + fn persist_snapshot(&mut self, data: &[u8]) -> Result<(), RootVerificationError> { + RefStorage::persist(&mut self.snapshot, data).map_err(|_| CouldNotPersistRootMetadata) + } + + fn persist_targets(&mut self, data: &[u8]) -> Result<(), RootVerificationError> { + RefStorage::persist(&mut self.targets, data).map_err(|_| CouldNotPersistRootMetadata) + } + + fn commit_root(&mut self) -> Result<(), RootVerificationError> { + let (StorageState::NonEmpty(size), data) = &self.uncommitted_root else { + return Ok(()); + }; + if self.root.1.len() < *size { + return Err(NotEnoughSpace); + } + self.root.1.zeroize(); + self.root.0 = *size; + self.root.1[0..*size].copy_from_slice(data); + Ok(()) + } + + fn current_root<'o>(&self, out: &'o mut [u8]) -> &'o [u8] { + let out = &mut out[..self.root.0]; + let src = &self.root.1[..self.root.0]; + out.copy_from_slice(src); + out + } + + fn current_uncommitted_root<'o>(&self, out: &'o mut [u8]) -> Option<&'o [u8]> { + let (StorageState::NonEmpty(size), data) = &self.uncommitted_root else { + return None; + }; + let out = &mut out[..*size]; + let src = &data[..*size]; + out.copy_from_slice(src); + Some(out) + } + + fn current_timestamp<'o>(&self, out: &'o mut [u8]) -> Option<&'o [u8]> { + let (StorageState::NonEmpty(size), data) = &self.timestamp else { + return None; + }; + let out = &mut out[..*size]; + let src = &data[..*size]; + out.copy_from_slice(src); + Some(out) + } + + fn current_snapshot<'o>(&self, out: &'o mut [u8]) -> Option<&'o [u8]> { + let (StorageState::NonEmpty(size), data) = &self.timestamp else { + return None; + }; + let out = &mut out[..*size]; + let src = &data[..*size]; + out.copy_from_slice(src); + Some(out) + } +} +*/ diff --git a/tuf-no-std/tuf-no-std-der/Cargo.toml b/tuf-no-std/tuf-no-std-der/Cargo.toml new file mode 100644 index 0000000..18ded58 --- /dev/null +++ b/tuf-no-std/tuf-no-std-der/Cargo.toml @@ -0,0 +1,61 @@ +[package] +name = "tuf-no-std-der" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" + + +[features] +default = [] +sign = [] +verify = [] +rsa = ["dep:rsa"] +ecdsa = ["dep:p256"] +ed25519 = ["dep:ed25519", "dep:ed25519-dalek"] +dilithium3 = [ +# "dep:oqs" +] +composite = [] + +[dependencies] +tuf-no-std-common = { path = "../tuf-no-std-common" } +serde = { workspace = true, features = ["derive"] } +# time = { version = "0.3", default-features = false, features = [ +# "serde", +# "parsing", +# ] } +# semver = { version = "1.0", default-features = false, features = ["serde"] } +serde-json-core = { workspace = true } +anyhow = { workspace = true, features = [] } + +either = { workspace = true } +signature = { workspace = true, features = [] } +p256 = { workspace = true, features = ["ecdsa", "arithmetic"], optional = true } +ed25519 = { workspace = true, optional = true } +ed25519-dalek = { workspace = true, features = ["pkcs8"], optional = true } +rsa = { workspace = true, features = ["sha2"], optional = true } +# oqs = { workspace = true, features = ["sigs", "non_portable"], optional = true } +pem-rfc7468 = { workspace = true, features = [] } +hex = { workspace = true, features = [] } +sha2 = { workspace = true, features = [] } + +spki = { workspace = true, features = ["fingerprint"] } +const-oid = { workspace = true, features = ["db"] } +der = { workspace = true, features = ["oid", "derive"] } +zeroize = { workspace = true, features = [] } +hash32 = { workspace = true } + + +[dev-dependencies] +serde_json = { workspace = true } +postcard = { workspace = true } +olpc-cjson = { workspace = true } +rand_core = { workspace = true, features = ["getrandom"] } +p256 = { workspace = true, features = ["ecdsa", "arithmetic", "pem"] } +hex-literal = { workspace = true } +anyhow = { workspace = true } +ring = { workspace = true } +untrusted = { workspace = true } +tough = { workspace = true } +rand = { workspace = true } +ed25519-dalek = { workspace = true, features = ["rand_core", "alloc", "pkcs8"] } diff --git a/tuf-no-std/tuf-no-std-der/src/lib.rs b/tuf-no-std/tuf-no-std-der/src/lib.rs new file mode 100644 index 0000000..8f79455 --- /dev/null +++ b/tuf-no-std/tuf-no-std-der/src/lib.rs @@ -0,0 +1,452 @@ +#![cfg_attr(not(test), no_std)] +extern crate alloc; + +use ::signature::DigestVerifier; +use alloc::vec::Vec; +use const_oid::db::rfc5912::ID_SHA_256; +use const_oid::ObjectIdentifier; +use core::fmt::Debug; +use core::marker::PhantomData; +use der::asn1::{BitString, BitStringRef, SequenceOf, UtcTime}; +use der::{Decode, Encode, Sequence}; +use spki::{ + AlgorithmIdentifier, AlgorithmIdentifierOwned, AlgorithmIdentifierRef, + SubjectPublicKeyInfoOwned, SubjectPublicKeyInfoRef, +}; +use tuf_no_std_common::{TufError, Version}; + +pub mod role; +pub mod root; +pub mod signature; +pub mod snapshot; +pub mod targets; +pub mod timestamp; + +use crate::root::{Root, RootRef}; +use der::referenced::OwnedToRef; +#[cfg(feature = "dilithium3")] +use oqs::sig::Algorithm::Dilithium3; + +use sha2::digest::Digest; +use tuf_no_std_common::common::Threshold; +#[cfg(feature = "dilithium3")] +use tuf_no_std_common::crypto::composite_spki::{CompositePublicKeyRef, CompositeSignatureRef}; +use tuf_no_std_common::crypto::sign::SigningKey; + +pub type KeyId = BitString; + +pub type RawSignature = BitString; +pub type SpecVersion = BitString; +pub type KeyIdRef<'a> = BitStringRef<'a>; +pub type RawSignatureRef<'a> = BitStringRef<'a>; +pub type SpecVersionRef<'a> = BitStringRef<'a>; +pub type Scheme = AlgorithmIdentifierOwned; +pub type SchemeRef<'a> = AlgorithmIdentifierRef<'a>; +pub type KeyVal = SubjectPublicKeyInfoOwned; +pub type KeyValRef<'a> = SubjectPublicKeyInfoRef<'a>; +pub type DateTime = UtcTime; +pub type ConsistentSnapshot = bool; +/// Not using usize because the traits are not implemented for it +pub type Length = u64; + +/// DER encoded signature. +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct Signature { + /// SHA256 digest of the canonical form of the key. + pub keyid: KeyId, + /// Canonical encoding of the signature. + pub sig: RawSignature, +} + +/// Borrowed version of [Signature]. +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct SignatureRef<'a> { + /// SHA256 digest of the canonical form of the key. + pub keyid: KeyIdRef<'a>, + /// Canonical encoding of the signature. + pub sig: RawSignatureRef<'a>, +} + +impl OwnedToRef for Signature { + type Borrowed<'a> = SignatureRef<'a> where Self: 'a; + + fn owned_to_ref(&self) -> Self::Borrowed<'_> { + SignatureRef { + sig: self.sig.owned_to_ref(), + keyid: self.keyid.owned_to_ref(), + } + } +} + +/// Encoding of a TUF role key. +#[derive(Debug, Eq, PartialEq, Sequence)] +pub struct Key { + /// The OID of the key type. + keytype: ObjectIdentifier, + /// SPKI encoding of the public key. + keyval: KeyVal, + /// Algorithm identifier of the signature scheme. + scheme: Scheme, +} + +/// Borrowed version of [Key]. +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct KeyRef<'a> { + /// The OID of the key type. + keytype: ObjectIdentifier, + /// SPKI encoding of the public key. + keyval: KeyValRef<'a>, + /// Algorithm identifier of the signature scheme. + scheme: SchemeRef<'a>, +} + +impl<'a> KeyRef<'a> { + /// Key hashes are calculated from the DER encoded SPKI. + pub fn key_hash(&self) -> [u8; 32] { + self.keyval.fingerprint_bytes().unwrap() + } +} + +pub fn verify(spki: &SubjectPublicKeyInfoRef<'_>, msg: &[u8], sig: &[u8]) -> Result<(), TufError> { + match spki.algorithm.oid { + #[cfg(feature = "ed25519")] + const_oid::db::rfc8410::ID_ED_25519 => { + use ::signature::Verifier; + let key = ed25519_dalek::VerifyingKey::try_from(spki.clone()) + .map_err(|_| TufError::DecodingPublicKeyFailed)?; + let sig = sig + .try_into() + .map_err(|_| TufError::DecodingSignatureFailed) + .map(ed25519::Signature::from_bytes)?; + key.verify(msg, &sig) + .map_err(|_| TufError::InvalidSignature) + } + #[cfg(feature = "rsa")] + const_oid::db::rfc5912::ID_RSASSA_PSS => { + use ::signature::Verifier; + let sig = + rsa::pss::Signature::try_from(sig).or(Err(TufError::DecodingSignatureFailed))?; + rsa::RsaPublicKey::try_from(spki.clone()) + .map(Into::>::into) + .map_err(|_| TufError::DecodingPublicKeyFailed) + .and_then(|k| k.verify(msg, &sig).map_err(|_| TufError::InvalidSignature)) + } + #[cfg(feature = "ecdsa")] + const_oid::db::rfc5912::ID_EC_PUBLIC_KEY => { + let key = p256::ecdsa::VerifyingKey::try_from(spki.clone()) + .map_err(|_| TufError::DecodingPublicKeyFailed)?; + let mut hasher = ::new(); + Digest::update(&mut hasher, msg); + let sig = p256::ecdsa::Signature::from_bytes(sig.into()) + .map_err(|_| TufError::DecodingSignatureFailed)?; + key.verify_digest(hasher, &sig) + .or(Err(TufError::InvalidSignature))?; + Ok(()) + } + #[cfg(all(feature = "ecdsa", feature = "dilithium3"))] + tuf_no_std_common::constants::ID_DILITHIUM3_ECDSA_P256_SHA256 => { + let sigs = CompositeSignatureRef::<2>::from_der(sig).map_err(|_| ())?; + let d3 = oqs::sig::Sig::new(Dilithium3).unwrap(); + let ecdsa_sig = sigs + .iter() + .find_map(|s| p256::ecdsa::Signature::from_der(s.raw_bytes()).ok()) + .ok_or(())?; + let dilithium3_sig = sigs + .iter() + .find_map(|s| d3.signature_from_bytes(s.raw_bytes())) + .ok_or(())?; + + let spkis = spki + .subject_public_key + .as_bytes() + .ok_or(()) + .and_then(|bytes| CompositePublicKeyRef::<2>::from_der(bytes).map_err(|_| ()))?; + + spkis + .iter() + .find(|spki| spki.algorithm.oid == const_oid::db::rfc5912::ECDSA_WITH_SHA_256) + .ok_or(()) + .and_then(|spki| p256::ecdsa::VerifyingKey::try_from(spki.clone()).map_err(|_| ())) + .and_then(|key| { + let mut hasher = ::new(); + Digest::update(&mut hasher, msg); + key.verify_digest(hasher, &ecdsa_sig).or(Err(()))?; + Ok(()) + })?; + + spkis + .iter() + .find(|spki| spki.algorithm.oid == tuf_no_std_common::constants::ID_DILITHIUM3) + .and_then(|spki| d3.public_key_from_bytes(spki.subject_public_key.raw_bytes())) + .ok_or(()) + .and_then(|key| d3.verify(msg, dilithium3_sig, key).map_err(|_| ()))?; + Ok(()) + } + _ => { + unimplemented!( + "algorithm with OID {:?} is not implemented or activated", + spki.algorithm.oid + ) + } + } +} + +impl OwnedToRef for Key { + type Borrowed<'a> = KeyRef<'a> where Self: 'a; + + fn owned_to_ref(&self) -> Self::Borrowed<'_> { + KeyRef { + keytype: self.keytype, + keyval: self.keyval.owned_to_ref(), + scheme: self.scheme.owned_to_ref(), + } + } +} + +/// DER encoding of a TUF role. +#[derive(Debug, Eq, PartialEq, Sequence, Clone)] +pub struct Role { + /// The name of the role, e.g. "root". + pub name: BitString, + /// A collection of [KeyId]s that specify which keys are associated with this role. + pub keyids: Vec, + /// The signature threshold that needs to be reached for validity. + pub threshold: Threshold, +} + +impl OwnedToRef for Role { + type Borrowed<'a> = RoleRef<'a> where Self: 'a; + + fn owned_to_ref(&self) -> Self::Borrowed<'_> { + let keyids = self.keyids.iter().fold(SequenceOf::new(), |mut acc, a| { + acc.add(OwnedToRef::owned_to_ref(a)).expect("failed to add"); + acc + }); + RoleRef { + name: self.name.owned_to_ref(), + keyids, + threshold: self.threshold, + } + } +} + +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct RoleRef<'a> { + pub name: BitStringRef<'a>, + pub keyids: SequenceOf, 5>, + pub threshold: Threshold, +} + +/// DER encoding of a Hash +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct Hash { + pub algorithm: AlgorithmIdentifierOwned, + pub value: BitString, +} + +impl Hash { + pub fn from_sha256_bytes(bytes: &[u8; 32]) -> Self { + Hash { + algorithm: AlgorithmIdentifier { + oid: const_oid::db::rfc5912::ID_SHA_256, + parameters: None, + }, + value: BitString::from_bytes(bytes).expect("failed to encode"), + } + } + /// Returns `Some` if this is a SHA-256 hash. + pub fn sha256(&self) -> Option<&[u8; 32]> { + if self.algorithm.oid != ID_SHA_256 { + return None; + } + self.value + .as_bytes() + .and_then(|b| TryFrom::try_from(b).ok()) + } +} + +impl<'a> HashRef<'a> { + /// Returns `Some` if this is a SHA-256 hash. + pub fn sha256(&self) -> Option<&[u8; 32]> { + if self.algorithm.oid != ID_SHA_256 { + return None; + } + self.value + .as_bytes() + .and_then(|b| TryFrom::try_from(b).ok()) + } +} + +/// Borrowed version of [Hash]. +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct HashRef<'a> { + pub algorithm: AlgorithmIdentifierRef<'a>, + pub value: BitStringRef<'a>, +} + +/// A signed TUF file. +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct Signed<'a, T: Debug + Eq + PartialEq + Decode<'a> + Encode> { + pub signatures: Vec, + pub signed: T, + pub _phantom: PhantomData<&'a ()>, +} + +impl<'a, T> Signed<'a, T> +where + T: Debug + Eq + PartialEq + Decode<'a> + Encode, +{ + /// Creates a signed object using the given signing keys from the data in `signed`. + pub fn from_signed(signed: T, signing_keys: &[SigningKey]) -> Result, TufError> { + let mut buf = [0u8; 2048]; + let encoded = signed + .encode_to_slice(&mut buf) + .map_err(|_| TufError::EncodingError)?; + let signatures = signing_keys + .iter() + .map(|key| { + key.sign(encoded).map(|sig| Signature { + keyid: key + .key_id() + .map(|key_id| BitString::from_bytes(&key_id).unwrap()) + .unwrap(), + sig: BitString::from_bytes(&sig.to_vec()).unwrap(), + }) + }) + .collect::, TufError>>()?; + Ok(Signed { + signatures, + _phantom: Default::default(), + signed, + }) + } + + pub fn encode_as_file<'o>(&self, out: &'o mut [u8]) -> Result<&'o [u8], TufError> { + self.encode_to_slice(out) + .map_err(|_| TufError::EncodingError) + } +} + +/// Borrowed version of [SignedRef]. +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct SignedRef<'a, T: Debug + Eq + PartialEq + Decode<'a> + Encode> { + pub signatures: SequenceOf, 5>, + pub signed: T, +} + +impl<'a, T> SignedRef<'a, T> +where + T: Debug + Eq + PartialEq + Decode<'a> + Encode, +{ + pub fn encode_as_file<'o>(&self, out: &'o mut [u8]) -> Result<&'o [u8], TufError> { + self.encode_to_slice(out) + .map_err(|_| TufError::EncodingError) + } +} + +/// Enum for signature schemes. +#[derive(Clone, Debug)] +pub enum SigningScheme { + Ed25519, + RsassaPss, + EcdsaSha256, + Dilithium3EcdsaP256Sha256, +} + +/// Enum for key types. +#[derive(Clone, Debug)] +pub enum KeyType { + Ed25519, + Ecdsa, + Dilithium3EcdsaP256Sha256, + Rsa, +} + +/// Get signing schemes from algorithm identifiers. +impl From for AlgorithmIdentifierOwned { + fn from(value: SigningScheme) -> Self { + match value { + SigningScheme::Ed25519 => AlgorithmIdentifier { + oid: const_oid::db::rfc8410::ID_ED_25519, + parameters: None, + }, + // This might need parameters. + SigningScheme::RsassaPss => AlgorithmIdentifier { + oid: const_oid::db::rfc5912::ID_RSASSA_PSS, + parameters: None, + }, + SigningScheme::EcdsaSha256 => AlgorithmIdentifier { + oid: const_oid::db::rfc5912::ECDSA_WITH_SHA_256, + parameters: None, + }, + SigningScheme::Dilithium3EcdsaP256Sha256 => AlgorithmIdentifier { + oid: tuf_no_std_common::constants::ID_DILITHIUM3_ECDSA_P256_SHA256, + parameters: None, + }, + } + } +} + +/// Get a key type from an OID that specifies the key type. +/// The relationship is usually specified in the standardization of the key type. +impl From for ObjectIdentifier { + fn from(value: KeyType) -> Self { + match value { + KeyType::Ed25519 => const_oid::db::rfc8410::ID_ED_25519, + KeyType::Ecdsa => const_oid::db::rfc5912::SECP_256_R_1, + KeyType::Dilithium3EcdsaP256Sha256 => { + tuf_no_std_common::constants::ID_DILITHIUM3_ECDSA_P256_SHA256 + } + KeyType::Rsa => const_oid::db::rfc5912::RSA_ENCRYPTION, + } + } +} + +impl<'b> OwnedToRef for Signed<'b, Root> { + type Borrowed<'a> = SignedRef<'a, RootRef<'a>> where Self: 'a; + + fn owned_to_ref(&self) -> Self::Borrowed<'_> { + let mut sigs = SequenceOf::new(); + for sig in self.signatures.iter() { + sigs.add(sig.owned_to_ref()).unwrap() + } + SignedRef { + signatures: sigs, + signed: self.signed.owned_to_ref(), + } + } +} +pub struct TufDer(); + +#[cfg(test)] +mod test { + use crate::{Key, KeyType, SigningScheme}; + use der::referenced::OwnedToRef; + use der::Decode; + use ed25519_dalek::SigningKey; + use rand::rngs::OsRng; + use spki::{EncodePublicKey, SubjectPublicKeyInfoOwned}; + + #[test] + fn test_key_hash() { + let mut csprng = OsRng; + + let root_key: SigningKey = SigningKey::generate(&mut csprng); + let root_pub_spki = SubjectPublicKeyInfoOwned::from_der( + root_key + .verifying_key() + .to_public_key_der() + .unwrap() + .as_bytes(), + ) + .unwrap(); + let root_key_id = root_pub_spki.fingerprint_bytes().unwrap(); + let key = Key { + keytype: KeyType::Ed25519.into(), + keyval: root_pub_spki, + scheme: SigningScheme::Ed25519.into(), + }; + + assert_eq!(root_key_id, key.owned_to_ref().key_hash(),) + } +} diff --git a/tuf-no-std/tuf-no-std-der/src/role.rs b/tuf-no-std/tuf-no-std-der/src/role.rs new file mode 100644 index 0000000..e44e694 --- /dev/null +++ b/tuf-no-std/tuf-no-std-der/src/role.rs @@ -0,0 +1,17 @@ +use der::Enumerated; + +/// +/// ```der +/// Root ::= ENUMERATED {root (0), +// timestamp (1), +// snapshot (2), +// target (3)} +/// ``` +#[derive(Enumerated, Copy, Clone, Debug, Eq, PartialEq)] +#[repr(u8)] +pub enum Role { + Root = 0, + Timestamp = 1, + Snapshot = 2, + Target = 3, +} diff --git a/tuf-no-std/tuf-no-std-der/src/root.rs b/tuf-no-std/tuf-no-std-der/src/root.rs new file mode 100644 index 0000000..fe388f2 --- /dev/null +++ b/tuf-no-std/tuf-no-std-der/src/root.rs @@ -0,0 +1,63 @@ +use crate::{Role, RoleRef, SpecVersion, SpecVersionRef}; +use alloc::vec::Vec; +use core::fmt::Debug; +use der::asn1::{SequenceOf, UtcTime}; +use der::referenced::OwnedToRef; +use der::Sequence; +use spki::{SubjectPublicKeyInfoOwned, SubjectPublicKeyInfoRef}; +use tuf_no_std_common::Version; + +/// DER encoding of a TUF root file. +#[derive(Debug, Eq, PartialEq, Sequence, Clone)] +pub struct Root { + /// Not implemented, refer to the [TUF specification section on consistent snapshots](https://theupdateframework.github.io/specification/latest/#consistent-snapshots). + pub consistent_snapshot: bool, + pub expires: UtcTime, + // Keys sorted by key ID. + pub keys: Vec, + /// Roles sorted by name. + pub roles: Vec, + /// Version of the TUF spec. + pub spec_version: SpecVersion, + /// Version of the root file. + pub version: Version, +} + +/// Borrowed version of [Root]. +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct RootRef<'a> { + /// Not implemented, refer to the [TUF specification section on consistent snapshots](https://theupdateframework.github.io/specification/latest/#consistent-snapshots). + pub consistent_snapshot: bool, + pub expires: UtcTime, + // Keys sorted by key ID. + pub keys: SequenceOf, 7>, + // sorted by name + pub roles: SequenceOf, 4>, + /// Version of the TUF spec. + pub spec_version: SpecVersionRef<'a>, + /// Version of the root file. + pub version: Version, +} + +impl OwnedToRef for Root { + type Borrowed<'a> = RootRef<'a> where Self: 'a; + + fn owned_to_ref(&self) -> Self::Borrowed<'_> { + let mut keys: SequenceOf = Default::default(); + let mut roles: SequenceOf = Default::default(); + self.keys + .iter() + .for_each(|k| keys.add(k.owned_to_ref()).unwrap()); + self.roles + .iter() + .for_each(|r| roles.add(r.owned_to_ref()).unwrap()); + RootRef { + consistent_snapshot: self.consistent_snapshot, + expires: self.expires, + keys, + roles, + spec_version: self.spec_version.owned_to_ref(), + version: self.version, + } + } +} diff --git a/tuf-no-std/tuf-no-std-der/src/signature.rs b/tuf-no-std/tuf-no-std-der/src/signature.rs new file mode 100644 index 0000000..b12fa37 --- /dev/null +++ b/tuf-no-std/tuf-no-std-der/src/signature.rs @@ -0,0 +1,3 @@ +use der::asn1::BitStringRef; + +pub type SignatureRef<'a> = BitStringRef<'a>; diff --git a/tuf-no-std/tuf-no-std-der/src/snapshot.rs b/tuf-no-std/tuf-no-std-der/src/snapshot.rs new file mode 100644 index 0000000..79de09f --- /dev/null +++ b/tuf-no-std/tuf-no-std-der/src/snapshot.rs @@ -0,0 +1,49 @@ +use crate::{Hash, HashRef, SpecVersion, SpecVersionRef, Version}; +use alloc::vec::Vec; +use core::fmt::Debug; +use der::asn1::{BitString, BitStringRef, SequenceOf, UtcTime}; +use der::Sequence; + +/// DER encoding of a TUF snapshot file. +/// [Refer to the TUF specification.](https://theupdateframework.github.io/specification/latest/#file-formats-snapshot) +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct Snapshot { + pub expires: UtcTime, + pub meta: Vec, + pub spec_version: SpecVersion, + pub version: Version, +} + +/// [Refer to the TUF specification](https://theupdateframework.github.io/specification/latest/#metafiles). +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct SnapshotMeta { + /// Identifier/metapath of the file. + pub metapath: BitString, + pub length: u64, + /// Version of the file specified in this struct. + pub version: Version, + /// Hashes of the file. + pub hashes: Vec, +} + +/// Borrowed version of [Snapshot]. +/// [Refer to the TUF specification.](https://theupdateframework.github.io/specification/latest/#file-formats-snapshot) +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct SnapshotRef<'a> { + pub expires: UtcTime, + pub meta: SequenceOf, 1>, + pub spec_version: SpecVersionRef<'a>, + pub version: Version, +} + +/// Borrowed version of [SnapshotMeta]. +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct SnapshotMetaRef<'a> { + /// Identifier/metapath of the file. + pub metapath: BitStringRef<'a>, + pub length: u64, + /// Version of the file specified in this struct. + pub version: Version, + /// Hashes of the file. Hard coded to size 1 to reduce stack usage. + pub hashes: SequenceOf, 1>, +} diff --git a/tuf-no-std/tuf-no-std-der/src/targets.rs b/tuf-no-std/tuf-no-std-der/src/targets.rs new file mode 100644 index 0000000..4a9197d --- /dev/null +++ b/tuf-no-std/tuf-no-std-der/src/targets.rs @@ -0,0 +1,88 @@ +use crate::{Hash, HashRef, Length, SpecVersion, SpecVersionRef, Version}; +use alloc::vec::Vec; +use core::fmt::Debug; +use der::asn1::{BitString, BitStringRef, SequenceOf, UtcTime}; +use der::{Any, AnyRef, Sequence}; + +pub type TargetPath = BitString; +pub type TargetPathRef<'a> = BitStringRef<'a>; + +/// DER encoding of the TUF targets file format. +/// [Refer to the TUF specification.](https://theupdateframework.github.io/specification/latest/#file-formats-targets) +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct Targets { + pub expires: UtcTime, + pub spec_version: SpecVersion, + /// Version of this targets file. + pub version: Version, + /// Targets specified in this targets file. + pub targets: Vec, + /// Delegations are not implemented. + pub delegations: Vec, +} + +/// Borrowed version of [Targets]. +/// [Refer to the TUF specification.](https://theupdateframework.github.io/specification/latest/#file-formats-targets) +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct TargetsRef<'a, const N_TARGETS: usize, const N_DELEGATIONS: usize> { + pub expires: UtcTime, + pub spec_version: SpecVersionRef<'a>, + /// Version of this targets file. + pub version: Version, + /// Targets specified in this targets file. + pub targets: SequenceOf, N_TARGETS>, + /// Delegations are not implemented. + pub delegations: SequenceOf, +} + +pub type Delegation = (); +pub type DelegationRef<'a> = (); + +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct Target { + /// Used to identify the target file. + pub name: TargetPath, + /// The inner part of the data, containing the actual information. + pub value: TargetValue, +} + +/// Borrowed version of [Target]. +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct TargetRef<'a> { + /// Used to identify the target file. + pub metapath: TargetPathRef<'a>, + /// Used to identify the target file. + pub value: TargetValueRef<'a>, +} + +/// Information about a target file. +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct TargetValue { + pub hashes: Vec, + pub length: Option, + pub custom: Option, +} + +/// Borrowed version of [TargetValue]. +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct TargetValueRef<'a> { + // not using usize because the traits are not implemented for it + pub hashes: SequenceOf, 2>, + pub length: Option, + pub custom: Option>, +} + +/// [Refer to the TUF specification](https://theupdateframework.github.io/specification/latest/#custom). +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct Custom { + pub name: BitString, + pub value: Any, +} + +/// Borrowed version of [Custom]. +/// [Refer to the TUF specification](https://theupdateframework.github.io/specification/latest/#custom). +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct CustomRef<'a> { + pub name: BitStringRef<'a>, + pub value: AnyRef<'a>, +} diff --git a/tuf-no-std/tuf-no-std-der/src/timestamp.rs b/tuf-no-std/tuf-no-std-der/src/timestamp.rs new file mode 100644 index 0000000..d4ff7aa --- /dev/null +++ b/tuf-no-std/tuf-no-std-der/src/timestamp.rs @@ -0,0 +1,26 @@ +use crate::snapshot::{SnapshotMeta, SnapshotMetaRef}; +use crate::{SpecVersion, SpecVersionRef}; +use core::fmt::Debug; +use der::asn1::UtcTime; +use der::Sequence; +use tuf_no_std_common::Version; + +/// DER encoding of the TUF Timestamp format. +/// [Refer to the TUF specification.](https://theupdateframework.github.io/specification/latest/#file-formats-timestamp) +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct Timestamp { + pub expires: UtcTime, + pub meta: SnapshotMeta, + pub spec_version: SpecVersion, + pub version: Version, +} + +/// Borrowed version of [Timestamp]. +/// [Refer to the TUF specification.](https://theupdateframework.github.io/specification/latest/#file-formats-timestamp) +#[derive(Clone, Debug, Eq, PartialEq, Sequence)] +pub struct TimestampRef<'a> { + pub expires: UtcTime, + pub meta: SnapshotMetaRef<'a>, + pub spec_version: SpecVersionRef<'a>, + pub version: Version, +} diff --git a/tuf-no-std/tuf-no-std/Cargo.toml b/tuf-no-std/tuf-no-std/Cargo.toml new file mode 100644 index 0000000..3dee726 --- /dev/null +++ b/tuf-no-std/tuf-no-std/Cargo.toml @@ -0,0 +1,102 @@ +[package] +name = "tuf-no-std" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" + +[features] +default = [ + "der", + "sign", + "rsa", + "ecdsa", + "ed25519", + "composite", + "rand", + "async", +] +memory-transport = [] +rand = ["tuf-no-std-common/rand"] +async = ["tuf-no-std-common/async"] +der = ["dep:tuf-no-std-der"] +sign = [ + "tuf-no-std-common/sign", + "tuf-no-std-der/sign", +] +verify = [ + "tuf-no-std-common/verify", + "tuf-no-std-der/verify", +] +rsa = [ + "tuf-no-std-common/rsa", + "tuf-no-std-der/rsa", +] +ecdsa = [ + "dep:p256", + "tuf-no-std-common/ecdsa", + "tuf-no-std-der/ecdsa", +] +ed25519 = [ + "dep:ed25519", + "dep:ed25519-dalek", + "tuf-no-std-common/ed25519", + "tuf-no-std-der/ed25519", +] +dilithium3 = [ + "tuf-no-std-common/dilithium3", + "tuf-no-std-der/dilithium3", +] +composite = [ + "tuf-no-std-common/composite", + "tuf-no-std-der/composite", +] + + +[dependencies] +tuf-no-std-common = { path = "../tuf-no-std-common" } +tuf-no-std-der = { path = "../tuf-no-std-der", optional = true } + + +serde = { workspace = true, features = ["derive"] } +heapless = { workspace = true } + +#time = { version = "0.3", default-features = false, features = [ +# "serde", +# "parsing", +#] } +# semver = { version = "1.0", default-features = false, features = ["serde"] } + +serde-json-core = { workspace = true } +anyhow = { workspace = true, features = [] } + +either = { workspace = true } +signature = { workspace = true, features = [] } +p256 = { workspace = true, features = ["ecdsa", "arithmetic"], optional = true } +ed25519 = { workspace = true, optional = true } +ed25519-dalek = { workspace = true, features = ["pkcs8"], optional = true } + +pem-rfc7468 = { workspace = true, features = [] } +hex = { workspace = true, features = [] } +sha2 = { workspace = true, features = [] } + +spki = { workspace = true, features = ["fingerprint"] } +const-oid = { workspace = true, features = ["db"] } +der = { workspace = true, features = ["oid", "derive"] } +zeroize = { workspace = true, features = [] } +hash32 = { workspace = true } + + +[dev-dependencies] +serde_json = { workspace = true } +postcard = { workspace = true } +olpc-cjson = { workspace = true } +rand_core = { workspace = true, features = ["getrandom"] } +p256 = { workspace = true, features = ["ecdsa", "arithmetic", "pem"] } +hex-literal = { workspace = true } +anyhow = { workspace = true } +ring = { workspace = true } +untrusted = { workspace = true } +tough = { workspace = true } +rand = { workspace = true } +ed25519-dalek = { workspace = true, features = ["rand_core", "alloc", "pkcs8"] } +tokio = { workspace = true, features = ["full"] } diff --git a/tuf-no-std/tuf-no-std/src/builder.rs b/tuf-no-std/tuf-no-std/src/builder.rs new file mode 100644 index 0000000..5f73228 --- /dev/null +++ b/tuf-no-std/tuf-no-std/src/builder.rs @@ -0,0 +1,363 @@ +use der::asn1::{BitString, UtcTime}; +use der::{DateTime, Encode}; +use sha2::{Digest, Sha256}; +use spki::SubjectPublicKeyInfo; +use tuf_no_std_common::Version; +use tuf_no_std_der::targets::TargetValue; +use tuf_no_std_der::Signed; +#[cfg(feature = "der")] +use tuf_no_std_der::{ + root::Root, + snapshot::{Snapshot, SnapshotMeta}, + targets::{Delegation, Target, Targets}, + timestamp::Timestamp, + {Hash, Role}, +}; + +pub struct RootBuilder { + root: Root, +} + +impl Default for RootBuilder { + fn default() -> Self { + RootBuilder { + root: Root { + consistent_snapshot: false, + expires: UtcTime::from_date_time(DateTime::new(1970, 1, 1, 0, 0, 0).unwrap()) + .unwrap(), + keys: Default::default(), + roles: Default::default(), + spec_version: BitString::from_bytes(b"1.0").unwrap(), + version: 0, + }, + } + } +} + +impl RootBuilder { + /// Set the expiration date of the root role to this [UTC date](https://en.wikipedia.org/wiki/Coordinated_Universal_Time). + pub fn with_expiration_utc( + mut self, + year: u16, + month: u8, + day: u8, + hour: u8, + minutes: u8, + seconds: u8, + ) -> Self { + self.root.expires = UtcTime::from_date_time( + DateTime::new(year, month, day, hour, minutes, seconds).unwrap(), + ) + .unwrap(); + self + } + + /// Add add a role to the root file. + pub fn with_role(mut self, role: Role) -> Self { + self.root.roles.push(role); + self + } + + /// Add a key to the root file. + pub fn with_key(mut self, key: SubjectPublicKeyInfo) -> Self { + self.root.keys.push(key); + self + } + + /// Add a root role that has the given key. Useful to add roles with a single key. + pub fn with_role_and_key( + self, + role: &str, + keys: &[SubjectPublicKeyInfo], + threshold: u8, + ) -> Self { + let key_ids = keys + .iter() + .map(|key| key.fingerprint_bytes().unwrap()) + .map(|key_id| BitString::from_bytes(key_id.as_slice()).unwrap()) + .collect(); + + let builder = self.with_role(Role { + name: BitString::from_bytes(role.as_bytes()).unwrap(), + keyids: key_ids, + threshold, + }); + keys.iter() + .fold(builder, |builder, key| builder.with_key(key.clone())) + } + + /// Set the version of the root file. + pub fn with_version(mut self, version: u32) -> Self { + self.root.version = version; + self + } + + /// Set the flag whether [consistent snapshots](https://theupdateframework.github.io/specification/latest/#consistent-snapshots) are enabled. + pub fn consistent_snapshot(mut self, consistent_snapshots: bool) -> Self { + self.root.consistent_snapshot = consistent_snapshots; + self + } + + /// Return the constructed root file.. + pub fn build(self) -> Root { + self.root + } +} + +pub struct TimestampBuilder { + inner: Timestamp, +} + +impl Default for TimestampBuilder { + fn default() -> Self { + TimestampBuilder { + inner: Timestamp { + expires: UtcTime::from_date_time(DateTime::new(1970, 1, 1, 0, 0, 0).unwrap()) + .unwrap(), + meta: SnapshotMeta { + metapath: BitString::from_bytes(b"snapshot.der").unwrap(), + length: 0, + version: 0, + hashes: Default::default(), + }, + spec_version: BitString::from_bytes(b"1.0").unwrap(), + version: 0, + }, + } + } +} + +impl TimestampBuilder { + /// Add a snapshot file to the timestamp file. + pub fn with_snapshot(mut self, metapath: &str, snapshot: &Signed) -> Self { + let encoded_snapshot = snapshot.to_der().unwrap(); + let hash = Hash::from_sha256_bytes( + &::new() + .chain_update(encoded_snapshot) + .finalize() + .into(), + ); + let length = snapshot + .encoded_len() + .expect("failed to get encoded length"); + self.inner.meta.metapath = BitString::from_bytes(metapath.as_bytes()).unwrap(); + self.inner.meta.length = Into::::into(length).into(); + self.inner.meta.hashes = [hash].to_vec(); + self.inner.meta.version = snapshot.signed.version; + self + } + + /// Set the expiration date of the timestamp role to this [UTC date](https://en.wikipedia.org/wiki/Coordinated_Universal_Time). + pub fn with_expiration_utc( + mut self, + year: u16, + month: u8, + day: u8, + hour: u8, + minutes: u8, + seconds: u8, + ) -> Self { + self.inner.expires = UtcTime::from_date_time( + DateTime::new(year, month, day, hour, minutes, seconds).unwrap(), + ) + .unwrap(); + self + } + + /// Set the version of the timestamp file. Has to increase between iterations. + pub fn with_version(mut self, version: Version) -> Self { + self.inner.version = version; + self + } + + /// Finish the construction. + pub fn build(self) -> Timestamp { + self.inner + } +} + +pub struct SnapshotBuilder { + inner: Snapshot, +} + +impl Default for SnapshotBuilder { + fn default() -> Self { + SnapshotBuilder { + inner: Snapshot { + expires: UtcTime::from_date_time(DateTime::new(1970, 1, 1, 0, 0, 0).unwrap()) + .unwrap(), + meta: Default::default(), + spec_version: BitString::from_bytes(b"1.0").unwrap(), + version: 0, + }, + } + } +} + +impl SnapshotBuilder { + /// Set the expiration date of the snapshot role to this [UTC date](https://en.wikipedia.org/wiki/Coordinated_Universal_Time). + pub fn with_expiration_utc( + mut self, + year: u16, + month: u8, + day: u8, + hour: u8, + minutes: u8, + seconds: u8, + ) -> Self { + self.inner.expires = UtcTime::from_date_time( + DateTime::new(year, month, day, hour, minutes, seconds).unwrap(), + ) + .unwrap(); + self + } + + /// Set the version of the snapshot file. Has to increase between iterations. + pub fn with_version(mut self, version: Version) -> Self { + self.inner.version = version; + self + } + pub fn with_meta(mut self, metapath: &[u8], data: &[u8], version: Version) -> Self { + let hash = &::new() + .chain_update(data) + .finalize() + .into(); + self.inner.meta.push(SnapshotMeta { + metapath: BitString::from_bytes(metapath).unwrap(), + hashes: [Hash::from_sha256_bytes(hash)].to_vec(), + length: data.len() as u64, + version, + }); + + self + } + pub fn build(self) -> Snapshot { + self.inner + } +} + +pub struct TargetsBuilder { + inner: Targets, +} + +impl Default for TargetsBuilder { + fn default() -> Self { + TargetsBuilder { + inner: Targets { + expires: UtcTime::from_date_time(DateTime::new(1970, 1, 1, 0, 0, 0).unwrap()) + .unwrap(), + spec_version: BitString::from_bytes(b"1.0").unwrap(), + version: 0, + targets: Default::default(), + delegations: Default::default(), + }, + } + } +} + +impl TargetsBuilder { + /// Add target file to the targets role. + pub fn with_target(mut self, name: &[u8], target_file: &[u8]) -> Self { + let hash = &::new() + .chain_update(target_file) + .finalize() + .into(); + let target = Target { + name: BitString::from_bytes(name).unwrap(), + value: TargetValue { + length: Some(target_file.len() as u64), + hashes: [Hash::from_sha256_bytes(hash)].to_vec(), + custom: None, + }, + }; + self.inner.targets.push(target); + self + } + + /// Delegations are not implemented. + pub fn with_delegation(self, _delegation: Delegation) -> Self { + unimplemented!("delegations are not implemented") + } + + /// Set the expiration date of the targets role to this [UTC date](https://en.wikipedia.org/wiki/Coordinated_Universal_Time). + pub fn with_expiration_utc( + mut self, + year: u16, + month: u8, + day: u8, + hour: u8, + minutes: u8, + seconds: u8, + ) -> Self { + self.inner.expires = UtcTime::from_date_time( + DateTime::new(year, month, day, hour, minutes, seconds).unwrap(), + ) + .unwrap(); + self + } + + /// Set the version of the targets file. Has to increase between iterations. + pub fn with_version(mut self, version: Version) -> Self { + self.inner.version = version; + self + } + + /// Finish the construction. + pub fn build(self) -> Targets { + self.inner + } +} + +#[cfg(test)] +mod test { + use crate::builder::RootBuilder; + use alloc::vec; + use der::asn1::{BitString, UtcTime}; + use der::Decode; + use ed25519_dalek::SigningKey; + use rand_core::OsRng; + use spki::{EncodePublicKey, SubjectPublicKeyInfoOwned}; + use tuf_no_std_der::root::Root; + use tuf_no_std_der::Role; + + #[test] + fn test_root_builder() { + let mut csprng = OsRng; + let root_key: SigningKey = SigningKey::generate(&mut csprng); + let root_pub_spki = SubjectPublicKeyInfoOwned::from_der( + root_key + .verifying_key() + .to_public_key_der() + .unwrap() + .as_bytes(), + ) + .unwrap(); + let root_key_id = root_pub_spki.fingerprint_bytes().unwrap(); + + let output = RootBuilder::default() + .with_key(root_pub_spki.clone()) + .with_role(Role { + name: BitString::from_bytes(b"root").unwrap(), + keyids: vec![BitString::from_bytes(&root_key_id).unwrap()], + threshold: 1, + }) + .with_expiration_utc(2023, 1, 1, 1, 1, 1) + .with_version(1) + .build(); + + let expected = Root { + consistent_snapshot: false, + expires: UtcTime::from_date_time(der::DateTime::new(2023, 1, 1, 1, 1, 1).unwrap()) + .unwrap(), + keys: vec![root_pub_spki], + roles: vec![Role { + keyids: vec![BitString::from_bytes(&root_key_id).unwrap()], + threshold: 1, + name: BitString::from_bytes(b"root").unwrap(), + }], + spec_version: BitString::from_bytes(b"1.0").unwrap(), + version: 1, + }; + assert_eq!(expected, output); + } +} diff --git a/tuf-no-std/tuf-no-std/src/canonical.rs b/tuf-no-std/tuf-no-std/src/canonical.rs new file mode 100644 index 0000000..00278e1 --- /dev/null +++ b/tuf-no-std/tuf-no-std/src/canonical.rs @@ -0,0 +1,12 @@ +#[derive(Debug)] +pub enum EncodingError { + BufferTooSmall, +} + +/// Trait used to abstract files being encoded canonically. +pub trait EncodeCanonically { + /// Encodes the file canonically. + /// It is important to note that this **does never** encode the + /// `signatures` field, as it is not used as part of the canonical encoding. + fn encode_canonically<'o>(&self, out: &'o mut [u8]) -> Result<&'o [u8], EncodingError>; +} diff --git a/tuf-no-std/tuf-no-std/src/format.rs b/tuf-no-std/tuf-no-std/src/format.rs new file mode 100644 index 0000000..5708a79 --- /dev/null +++ b/tuf-no-std/tuf-no-std/src/format.rs @@ -0,0 +1,32 @@ +use crate::role::root::TufRoot; +use crate::role::targets::TufTargets; +use crate::role::{DecodeRole, RoleUpdate, SignedFile, TufSnapshot, TufTimestamp}; +#[cfg(feature = "der")] +use spki::SubjectPublicKeyInfoRef; +#[cfg(feature = "der")] +use tuf_no_std_der::{ + root::RootRef, + snapshot::SnapshotRef, + targets::TargetsRef, + timestamp::TimestampRef, + {SignedRef, TufDer}, +}; + +/// Trait used to abstract a file format that can be used to implement TUF. +/// An important constraint is that it has to support canonical encoding. +pub trait TufFormat<'a> { + type Root: TufRoot + RoleUpdate + DecodeRole<'a> + SignedFile + Clone; + type Timestamp: TufTimestamp + DecodeRole<'a> + RoleUpdate + SignedFile + Clone; + type Snapshot: TufSnapshot + DecodeRole<'a> + RoleUpdate + SignedFile + Clone; + type Targets: TufTargets + DecodeRole<'a> + RoleUpdate + SignedFile + Clone; + type Key; +} + +#[cfg(feature = "der")] +impl<'a> TufFormat<'a> for TufDer { + type Root = SignedRef<'a, RootRef<'a>>; + type Timestamp = SignedRef<'a, TimestampRef<'a>>; + type Snapshot = SignedRef<'a, SnapshotRef<'a>>; + type Targets = SignedRef<'a, TargetsRef<'a, 4, 0>>; + type Key = SubjectPublicKeyInfoRef<'a>; +} diff --git a/tuf-no-std/tuf-no-std/src/lib.rs b/tuf-no-std/tuf-no-std/src/lib.rs new file mode 100644 index 0000000..54a405c --- /dev/null +++ b/tuf-no-std/tuf-no-std/src/lib.rs @@ -0,0 +1,191 @@ +#![cfg_attr(not(test), no_std)] +//! A no `no-std` rust implementation for TUF based on the [DER format](https://en.wikipedia.org/wiki/X.690#DER_encoding). +//! This implementation aims to fulfill the [TUF specification](https://theupdateframework.github.io/specification/v1.0.33/index.html), +//! however, it is not guaranteed that it does so fully. +//! +//! ## Why DER? +//! - DER is an encoding that is deterministic, +//! which is important for TUF as it requires signatures of *canonically* encoded files. +//! - DER parsing and encoding is more readily available than for canonical JSON, which is the default format for TUF, which does not have a `no-std` implementation. +//! - Additionally, DER is also required for certificate parsing and therefore potentially adds less overhead regarding dependencies. +//! - DER allows a great degree of parsing without requiring [ownership](https://doc.rust-lang.org/book/ch04-01-what-is-ownership.html) over the encoded data or copying it. Which is desirable for parsing on embedded devices. +//! +//! ## Example +//! +//! **Note:** this example use the sync functions, the same functions also exist as async functions. +//! +//! ```ignore +//! use tuf_no_std::utils::MemoryStorage; +//! use tuf_no_std::storage::TufStorage; +//! use tuf_no_std::remote::TufTransport; +//! use tuf_no_std::{update_repo, fetch_and_verify_target_file}; +//! use heapless::Vec; +//! const TUF_ROOT = include_bytes("path/to/root.der"); +//! +//! // initialize storage and transport +//! let mut storage = MemoryStorage { +//! root: Vec::<_, _>::from(TUF_ROOT), +//! uncommitted_root: None, +//! timestamp: None, +//! snapshot: None, +//! targets: None, +//! }; +//! +//! let mut transport = { panic!("add your own transport here")}; +//! +//! +//! let update_start = { panic!("create an timestamp of this moment here") }; +//! +//! update_repo( +//! &mut storage, +//! &mut transport, +//! 10, +//! update_start, +//! ).expect("update repo failed"); +//! +//! // fetching and verifying files using the updated repo +//! // allocate buffer to store the data +//! let mut buf = [0u8; 4096]; +//! let verified_file = fetch_and_verify_target_file( +//! &mut storage, +//! &mut transport, +//! b"hello-world.txt", +//! &mut buf, +//! ).expect("could not fetch and verify target file"); +//! ``` +//! ## Storage +//! +//! If you need a implementor of the [TufStorage] trait you can use [utils::MemoryStorage] or implement your own solution using the trait. +//! +//! ## TufTransport/Remote +//! +//! This crate does not provide an implementation for the [TufTransport] and [TufTransportAsync] traits. +//! You can find one for platforms that use the [`embassy-net`](https://docs.embassy.dev/embassy-net/git/default/index.html) crate in the `bt2x-ota-common` crate. +//! + +#[cfg(feature = "async")] +use common::remote::TufTransportAsync; +pub use der::asn1::UtcTime; +pub use der::DateTime; +use role::targets::verify_target_file; +pub use tuf_no_std_common::{remote::TufTransport, storage::TufStorage, TufError}; + +use crate::role::{ + root::update_root, snapshot::update_snapshot, targets::update_targets, + timestamp::update_timestamp, +}; +#[cfg(feature = "async")] +use crate::role::{ + snapshot::update_snapshot_async, targets::update_targets_async, + timestamp::update_timestamp_async, +}; +extern crate alloc; + +/// Module for builders to create TUF repositories. +pub mod builder; +/// Canonical encoding of metadata files. +pub mod canonical; +/// Abstract the concept of a file format that implements TUF. +pub mod format; +/// Implementation of TUF roles. +pub mod role; +/// Trait to abstract signatures. +mod signature; +/// Error types and more traits. +pub use tuf_no_std_common as common; +/// Utility functions. +pub mod utils; +/// Re-export of heapless for convenience. +pub use heapless; +/// Re-export of constants. +pub use tuf_no_std_common::constants; +/// Re-export of errors. +pub use tuf_no_std_common::error; +/// Fetching TUF files from remotes. +pub use tuf_no_std_common::remote; +/// Storage of TUF files. Only has traits, there is an in-memory implementation available in [utils::MemoryStorage]. +pub use tuf_no_std_common::storage; +pub enum TufFormat { + #[cfg(feature = "der")] + Der, +} + +/// Run a full TUF repo update. For more information refer to the [TUF specification](https://theupdateframework.github.io/specification/latest/). +/// This requires an initial root file in the `storage` object. The number specified in `max_fetches` limits the number of attempts to fetch new roots. +/// The value provided by `update_start` should be right before the update was started. +#[cfg(feature = "async")] +pub fn update_repo( + storage: &mut S, + transport: &mut T, + max_fetches: u32, + update_start: impl TryInto, +) -> Result<(), TufError> { + let update_start = &update_start + .try_into() + .map_err(|_| TufError::InvalidUtcTimestamp)?; + update_root(transport, storage, max_fetches, update_start)?; + update_timestamp(transport, storage, update_start)?; + update_snapshot(transport, storage, update_start)?; + update_targets(transport, storage, update_start)?; + Ok(()) +} + +/// Run a full TUF repo update. For more information refer to the [TUF specification](https://theupdateframework.github.io/specification/latest/). +/// This requires an initial root file in the `storage` object. The number specified in `max_fetches` limits the number of attempts to fetch new roots. +/// The value provided by `update_start` should be right before the update was started. +#[cfg(feature = "async")] +pub async fn update_repo_async( + storage: &mut S, + transport: &mut T, + max_fetches: u32, + update_start: impl TryInto, +) -> Result<(), TufError> { + use role::root::update_root_async; + + let update_start = &update_start + .try_into() + .map_err(|_| TufError::InvalidUtcTimestamp)?; + update_root_async(transport, storage, max_fetches, update_start).await?; + update_timestamp_async(transport, storage, update_start).await?; + update_snapshot_async(transport, storage, update_start).await?; + update_targets_async(transport, storage, update_start).await?; + Ok(()) +} + +/// Fetches and verifies the target file at the specified `metapath`. +/// This requires an updated TUF repo. +pub fn fetch_and_verify_target_file<'o, S: TufStorage, T: TufTransport>( + storage: &mut S, + transport: &mut T, + metapath: &[u8], + out: &'o mut [u8], +) -> Result<&'o [u8], TufError> { + let target_file = transport + .fetch_target_file(metapath, out) + .map_err(|_| TufError::FetchError)?; + let targets = storage + .current_targets() + .ok_or(TufError::MissingTargetsFile)?; + verify_target_file(targets, metapath, target_file)?; + Ok(target_file) +} + +/// Fetches and verifies the target file at the specified `metapath`. +/// This requires an updated TUF repo. +#[cfg(feature = "async")] +pub async fn fetch_and_verify_target_file_async<'o, S: TufStorage, T: TufTransportAsync>( + storage: &mut S, + transport: &mut T, + metapath: &[u8], + out: &'o mut [u8], +) -> Result<&'o [u8], TufError> { + let target_file = transport + .fetch_target_file(metapath, out) + .await + .map_err(|_| TufError::FetchError)?; + let targets = storage + .current_targets() + .ok_or(TufError::MissingTargetsFile)?; + verify_target_file(targets, metapath, target_file)?; + Ok(target_file) +} diff --git a/tuf-no-std/tuf-no-std/src/role/mod.rs b/tuf-no-std/tuf-no-std/src/role/mod.rs new file mode 100644 index 0000000..50e0cb7 --- /dev/null +++ b/tuf-no-std/tuf-no-std/src/role/mod.rs @@ -0,0 +1,167 @@ +pub mod root; +pub mod snapshot; +pub mod targets; +pub mod timestamp; + +use tuf_no_std_common::{RoleType, TufError, Version}; + +use crate::canonical::{EncodeCanonically, EncodingError}; +use crate::role::targets::TufTargets; +use core::fmt::Debug; +use der::asn1::UtcTime; +use der::{Decode, Encode}; +use sha2::{Digest, Sha256}; +use tuf_no_std_der::{SignatureRef, SignedRef}; + +/// Trait for easy access to a constant that specifies the role. +pub trait TufRole { + const TYPE: RoleType; +} + +/// Trait to abstract the decoding of a TUF role. +pub trait DecodeRole<'a>: Sized { + fn decode_role(input: &'a [u8]) -> Result; +} + +/// Trait to extract information that is required to update a TUF role. +pub trait RoleUpdate: TufRole + EncodeCanonically { + fn version(&self) -> Version; + fn expires(&self) -> UtcTime; +} + +/// Trait to abstract signatures within TUF files. +pub trait TufSignature { + /// Extract the raw signature. + fn raw_sig(&self) -> &[u8]; + /// Return the ID of the key that was used to create the signature. + fn keyid(&self) -> [u8; 32]; +} + +/// Trait used to abstract signed files. +pub trait SignedFile { + type Signature: TufSignature; + type Signed: EncodeCanonically; + + /// Return the signatures of this file. + fn get_signatures(&self) -> serde_json_core::heapless::Vec<&Self::Signature, 16>; + /// Return the part of the file that is used to create signatures. + fn get_signed(&self) -> &Self::Signed; +} + +/// Trait used to abstract operations of a TUF timestamp file. +pub trait TufTimestamp { + /// Extract the version of the snapshot file specified in this timestamp file. + fn snapshot_version(&self) -> Version; + /// Extract the expiration date of the snapshot file specified in this timestamp file. + fn snapshot_expires(&self) -> UtcTime; + /// Extract the hash of the snapshot file specified in this timestamp file. + fn snapshot_hash(&self) -> [u8; 32]; +} + +/// Trait used to abstract operations of a TUF snapshot file. +pub trait TufSnapshot: EncodeCanonically { + /// Extract the hash of the targets file specified in this snapshot file. + fn targets_hash(&self) -> [u8; 32]; + /// Calculate the hash of this snapshot file. + fn snapshot_hash(&self) -> Result<[u8; 32], TufError> { + let mut buf = [0u8; 8096]; + self.encode_canonically(&mut buf) + .map(|encoded| Sha256::new().chain_update(encoded).finalize().into()) + .map_err(|_| TufError::EncodingError) + } + /// Extract the version of the targets file specified in this snapshot file. + fn targets_version(&self) -> Version; +} + +impl<'a, T> DecodeRole<'a> for T +where + T: Decode<'a> + TufRole, +{ + fn decode_role(input: &'a [u8]) -> Result { + Decode::from_der(input).map_err(|_| TufError::DecodingError) + } +} + +impl<'a, T> RoleUpdate for SignedRef<'a, T> +where + T: RoleUpdate + Debug + Eq + PartialEq + Decode<'a> + Encode, +{ + fn version(&self) -> Version { + self.signed.version() + } + fn expires(&self) -> UtcTime { + self.signed.expires() + } +} + +impl<'a, T> TufRole for SignedRef<'a, T> +where + T: TufRole + Debug + Eq + PartialEq + Decode<'a> + Encode, +{ + const TYPE: RoleType = T::TYPE; +} + +impl<'a, T> TufTimestamp for SignedRef<'a, T> +where + T: TufTimestamp + Debug + Eq + PartialEq + Decode<'a> + Encode, +{ + fn snapshot_version(&self) -> Version { + self.signed.snapshot_version() + } + + fn snapshot_expires(&self) -> UtcTime { + self.signed.snapshot_expires() + } + + fn snapshot_hash(&self) -> [u8; 32] { + self.signed.snapshot_hash() + } +} + +impl<'a, T> EncodeCanonically for SignedRef<'a, T> +where + T: Debug + Decode<'a> + Encode + Eq + PartialEq + RoleUpdate, +{ + fn encode_canonically<'o>(&self, out: &'o mut [u8]) -> Result<&'o [u8], EncodingError> { + match self.signed.encode_to_slice(out) { + Ok(data) => Ok(data), + Err(err) => { + panic!("{err:?}") + } + } + } +} + +impl<'a, T> TufSnapshot for SignedRef<'a, T> +where + T: TufSnapshot + Debug + Eq + PartialEq + Decode<'a> + Encode + RoleUpdate, +{ + fn targets_hash(&self) -> [u8; 32] { + self.signed.targets_hash() + } + + fn targets_version(&self) -> Version { + self.signed.targets_version() + } +} + +impl<'a, T> TufTargets for SignedRef<'a, T> where + T: TufTargets + Debug + Eq + PartialEq + Decode<'a> + Encode +{ +} + +impl<'a, T> SignedFile for SignedRef<'a, T> +where + T: EncodeCanonically + Debug + Eq + PartialEq + Decode<'a> + Encode, +{ + type Signature = SignatureRef<'a>; + type Signed = T; + + fn get_signatures(&self) -> serde_json_core::heapless::Vec<&Self::Signature, 16> { + self.signatures.iter().collect() + } + + fn get_signed(&self) -> &Self::Signed { + &self.signed + } +} diff --git a/tuf-no-std/tuf-no-std/src/role/root.rs b/tuf-no-std/tuf-no-std/src/role/root.rs new file mode 100644 index 0000000..a047176 --- /dev/null +++ b/tuf-no-std/tuf-no-std/src/role/root.rs @@ -0,0 +1,1050 @@ +use crate::canonical::EncodeCanonically; +use crate::role::{DecodeRole, RoleUpdate, SignedFile, TufRole, TufSignature}; +use core::cmp::max; +use core::num::NonZeroU64; +use core::ops::Add; +use der::asn1::UtcTime; +use der::{Decode, Encode}; +use serde_json_core::heapless::FnvIndexMap; +use spki::SubjectPublicKeyInfoRef; +use tuf_no_std_common::common::Threshold; +use tuf_no_std_common::remote::TufTransport; +#[cfg(feature = "async")] +use tuf_no_std_common::remote::TufTransportAsync; +use tuf_no_std_common::storage::TufStorage; +use tuf_no_std_common::TufError::*; +use tuf_no_std_common::{RoleType, TufError, Version}; +use tuf_no_std_der::root::{Root, RootRef}; +use tuf_no_std_der::{verify, SignedRef}; + +/// A trait that represents all the operations that can be done with a root file on the client side. +pub trait TufRoot: TufRole + SignedFile + EncodeCanonically { + type Key; + /// Verify that the role was signed by the root. + fn verify_role(&self, role: &T) -> Result<(), TufError> + where + T: TufRole + EncodeCanonically + SignedFile, + { + let mut buf = [0u8; 4096]; + let msg = role + .get_signed() + .encode_canonically(&mut buf) + .map_err(|_| TufError::EncodingError)?; + let threshold = self.role_threshold(T::TYPE); + + let mut role_keys = self.role_keys(T::TYPE).expect("failed to get role keys"); + let reached = role.get_signatures().iter().fold(0, |acc, sig| { + let raw_sig = sig.raw_sig(); + let key_id = sig.keyid(); + + // Using remove ensures each key is only used to create a single signature. + let Some(key) = role_keys.remove(&key_id) else { + return acc; + }; + Self::verify_signature(&key, msg, raw_sig) + .map(|_| 1) + .unwrap_or(0) + .add(acc) + }); + + if reached < threshold { + return Err(ThresholdNotReached); + } + Ok(()) + } + + /// Verify that the other root is signed by this root. + fn verify_root(&self, other: &Self) -> Result<(), TufError> { + let mut buf = [0u8; 4096]; + let msg = other + .get_signed() + .encode_canonically(&mut buf) + .map_err(|_| TufError::EncodingError)?; + let threshold = max( + self.role_threshold(RoleType::Root), + self.role_threshold(RoleType::Root), + ); + // Use the key specified in this file. + let role_keys = self + .role_keys(RoleType::Root) + .expect("failed to get role keys"); + // Signatures are specified in the other file! + let reached = other.get_signatures().iter().fold(0, |acc, sig| { + let raw_sig = sig.raw_sig(); + let key_id = sig.keyid(); + + let Some(key) = role_keys.get(&key_id) else { + return acc; + }; + Self::verify_signature(key, msg, raw_sig) + .map(|_| 1) + .unwrap_or(0) + .add(acc) + }); + + if reached < threshold { + return Err(ThresholdNotReached); + } + Ok(()) + } + + /// Extract the signing threshold for the given role. + fn role_threshold(&self, role: RoleType) -> Threshold; + + /// Return the keys for a given role. + fn role_keys(&self, role: RoleType) -> Option>; + + /// Verify the signature of the message with the role keys. + fn verify_signature(key: &Self::Key, msg: &[u8], sig: &[u8]) -> Result<(), TufError>; +} + +impl<'a> TufRole for RootRef<'a> { + const TYPE: RoleType = RoleType::Root; +} + +impl<'a> EncodeCanonically for RootRef<'a> { + fn encode_canonically<'o>( + &self, + out: &'o mut [u8], + ) -> Result<&'o [u8], crate::canonical::EncodingError> { + self.encode_to_slice(out) + .map_err(|_| crate::canonical::EncodingError::BufferTooSmall) + } +} + +impl<'a> RoleUpdate for RootRef<'a> { + fn version(&self) -> Version { + self.version + } + + fn expires(&self) -> UtcTime { + self.expires + } +} + +impl<'a> TufRoot for SignedRef<'a, RootRef<'a>> { + type Key = SubjectPublicKeyInfoRef<'a>; + + fn role_threshold(&self, role: RoleType) -> Threshold { + self.signed + .roles + .iter() + .find(|r| role == r.name) + .map(|r| r.threshold) + .expect("did not find role") + } + + fn role_keys(&self, role: RoleType) -> Option> { + // Get the role. + let role = self.signed.roles.iter().find(|&r| role == r.name)?; + // Collect the matching keys. + let mut result = FnvIndexMap::new(); + for key_id in role.keyids.iter() { + let key_id = key_id + .as_bytes() + .expect("failed to convert to bytes") + .try_into() + .expect("failed to convert to sized array"); + let key = self + .signed + .keys + .iter() + .find(|key| key.fingerprint_bytes().unwrap().as_slice() == key_id) + .expect("failed to calculate fingerprint"); + result + .insert(key_id, key.clone()) + .expect("failed to insert key"); + } + Some(result) + } + + fn verify_signature(key: &Self::Key, msg: &[u8], sig: &[u8]) -> Result<(), TufError> { + verify(key, msg, sig).map_err(|_| TufError::InvalidSignature) + } +} + +impl TufRole for Root { + const TYPE: RoleType = RoleType::Root; +} + +/// Verify that the new root is valid given the old root. Returns the new root if successful. +pub(crate) fn update_root_step<'a, 'b>( + old_root: &SignedRef<'b, RootRef<'b>>, + new_root: &'a [u8], +) -> Result>, TufError> { + let next_root = SignedRef::::from_der(new_root).expect("failed to parse next root"); + // verify signatures + // FIXME: old_root does not know the signatures from the new root and therefore cannot verify it. + old_root.verify_root(&next_root)?; + next_root.verify_role(&next_root)?; + // check for a rollback attack (5.3.5) + if next_root.version() != old_root.version().saturating_add(1) && old_root != &next_root { + return Err(InvalidNewVersionNumber); + } + Ok(next_root) +} + +/// Refer to the [TUF specification section on updating the root role](https://theupdateframework.github.io/specification/latest/#update-root) for more information +pub fn update_root( + remote: &mut T, + storage: &mut S, + max_fetches: u32, + update_start: &UtcTime, +) -> Result<(), TufError> +where + S: TufStorage, + T: TufTransport, +{ + let mut fetches_left = max_fetches; + //let mut new_root_buf = [0u8; 8096]; + + let mut buf = [0u8; 2048]; + let initial_root = storage.current_root_copy(&mut buf); + let initial_root_decoded = SignedRef::::decode_role(initial_root)?; + let next_version = NonZeroU64::new(initial_root_decoded.signed.version as u64 + 1) + .ok_or(TufError::InternalError)?; + loop { + if fetches_left == 0 { + break; + } + let mut buf = [0u8; 2048]; + let Ok(next_root) = remote.fetch_root(next_version, &mut buf) else { + break; + }; + fetches_left -= 1; + let current_root = storage + .current_uncommitted_root() + .and_then(|root| SignedRef::::decode_role(root).ok()) + .unwrap_or(initial_root_decoded.clone()); + update_root_step(¤t_root, next_root)?; + storage.persist_root(next_root)?; + } + + let Some(new_root) = storage.current_uncommitted_root() else { + // assume no new root + return Ok(()); + }; + let new_root = SignedRef::::decode_role(new_root)?; + if &new_root.expires() < update_start { + return Err(ExpiredRootFile); + } + // delete timestamp or snapshot metadata when keys are rotated (5.3.11) + let delete_timestamp = + if let Some(timestamp_keys_old) = initial_root_decoded.role_keys(RoleType::Timestamp) { + let timestamp_keys_new = new_root + .role_keys(RoleType::Timestamp) + .ok_or(MissingTimestampKeys)?; + + timestamp_keys_new + .into_iter() + .any(|(key_id, _)| !timestamp_keys_old.contains_key(&key_id)) + } else { + false + }; + let delete_snapshot = + if let Some(snapshot_keys_old) = initial_root_decoded.role_keys(RoleType::Snapshot) { + let snapshot_keys_new = new_root + .role_keys(RoleType::Snapshot) + .ok_or(MissingSnapshotKeys)?; + + snapshot_keys_new + .into_iter() + .any(|(key_id, _)| !snapshot_keys_old.contains_key(&key_id)) + } else { + false + }; + // this is handled here because of borrowing rules + if delete_timestamp { + storage.delete_timestamp_metadata(); + }; + if delete_snapshot { + storage.delete_snapshot_metadata(); + }; + + storage.commit_root() +} + +/// Refer to the [TUF specification section on updating the root role](https://theupdateframework.github.io/specification/latest/#update-root) for more information +#[cfg(feature = "async")] +pub async fn update_root_async( + remote: &mut T, + storage: &mut S, + max_fetches: u32, + update_start: &UtcTime, +) -> Result<(), TufError> +where + S: TufStorage, + T: TufTransportAsync, +{ + let mut fetches_left = max_fetches; + //let mut new_root_buf = [0u8; 8096]; + + let mut buf = [0u8; 2048]; + let initial_root = storage.current_root_copy(&mut buf); + let initial_root_decoded = SignedRef::::decode_role(initial_root)?; + let next_version = NonZeroU64::new(initial_root_decoded.signed.version as u64 + 1) + .ok_or(TufError::InternalError)?; + loop { + if fetches_left == 0 { + break; + } + let mut buf = [0u8; 2048]; + let Ok(next_root) = remote.fetch_root(next_version, &mut buf).await else { + break; + }; + fetches_left -= 1; + let current_root = storage + .current_uncommitted_root() + .and_then(|root| SignedRef::::decode_role(root).ok()) + .unwrap_or(initial_root_decoded.clone()); + update_root_step(¤t_root, next_root)?; + storage.persist_root(next_root)?; + } + + let Some(new_root) = storage.current_uncommitted_root() else { + // assume no new root + return Ok(()); + }; + let new_root = SignedRef::::decode_role(new_root)?; + if &new_root.expires() < update_start { + return Err(ExpiredRootFile); + } + // delete timestamp or snapshot metadata when keys are rotated (5.3.11) + let delete_timestamp = + if let Some(timestamp_keys_old) = initial_root_decoded.role_keys(RoleType::Timestamp) { + let timestamp_keys_new = new_root + .role_keys(RoleType::Timestamp) + .ok_or(MissingTimestampKeys)?; + + timestamp_keys_new + .into_iter() + .any(|(key_id, _)| !timestamp_keys_old.contains_key(&key_id)) + } else { + false + }; + let delete_snapshot = + if let Some(snapshot_keys_old) = initial_root_decoded.role_keys(RoleType::Snapshot) { + let snapshot_keys_new = new_root + .role_keys(RoleType::Snapshot) + .ok_or(MissingSnapshotKeys)?; + + snapshot_keys_new + .into_iter() + .any(|(key_id, _)| !snapshot_keys_old.contains_key(&key_id)) + } else { + false + }; + // this is handled here because of borrowing rules + if delete_timestamp { + storage.delete_timestamp_metadata(); + }; + if delete_snapshot { + storage.delete_snapshot_metadata(); + }; + + storage.commit_root() +} + +#[cfg(test)] +mod test { + use crate::builder::RootBuilder; + use crate::utils::spki_from_signing_key; + use alloc::vec; + use der::asn1::BitString; + use der::{Decode, Encode}; + use ed25519_dalek::SigningKey; + use rand_core::OsRng; + use tuf_no_std_common::crypto::sign::RawSignature; + use tuf_no_std_der::{Signed, SignedRef}; + + use crate::role::root::{update_root_step, TufRoot}; + use der::referenced::OwnedToRef; + use ed25519::Signature; + use tuf_no_std_common::crypto::sign::SigningKey::Ed25519Dalek; + use tuf_no_std_der::root::RootRef; + + #[test] + fn test_root_update_step_valid() { + let mut csprng = OsRng; + + let root_key_old = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = root_key_old.as_spki().unwrap(); + + let old_root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_old = Signed::from_signed(old_root, &[root_key_old.clone()]).unwrap(); + + let root_key_new = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = root_key_new.as_spki().unwrap(); + + let root_new = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(2) + .build(); + + let signed_new = Signed::from_signed(root_new, &[root_key_old, root_key_new]).unwrap(); + let signed_new = signed_new.to_der().unwrap(); + update_root_step(&signed_old.owned_to_ref(), &signed_new).expect("failed to verify"); + } + + /// Test if using the same root again is accepted. + #[test] + fn test_root_update_step_valid_self() { + let mut csprng = OsRng; + + let root_key_old = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key_old); + + let old_root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_old = Signed::from_signed(old_root, &[root_key_old.clone()]).unwrap(); + + update_root_step( + &signed_old.owned_to_ref(), + signed_old.to_der().unwrap().as_slice(), + ) + .expect("failed to verify"); + } + + #[test] + fn test_root_update_step_invalid_version_too_low() { + let mut csprng = OsRng; + + let root_key_old = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key_old); + + let old_root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_old = Signed::from_signed(old_root, &[root_key_old.clone()]).unwrap(); + + let root_key_new = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key_new); + + let root_new = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_new = Signed::from_signed(root_new, &[root_key_old, root_key_new]).unwrap(); + let signed_new = signed_new.to_der().unwrap(); + update_root_step(&signed_old.owned_to_ref(), &signed_new) + .expect_err("this should not be accepted"); + } + + #[test] + fn test_root_update_step_threshold_not_reached() { + let mut csprng = OsRng; + + let root_key_old_1 = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki_1 = spki_from_signing_key(&root_key_old_1); + + let root_key_old_2 = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki_2 = spki_from_signing_key(&root_key_old_2); + + let old_root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki_1, root_pub_spki_2], 2) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_old = + Signed::from_signed(old_root, &[root_key_old_1.clone(), root_key_old_2.clone()]) + .unwrap(); + + let root_key_new_1 = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki_1 = spki_from_signing_key(&root_key_new_1); + + let root_key_new_2 = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki_2 = spki_from_signing_key(&root_key_new_2); + + let root_new = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki_1, root_pub_spki_2], 2) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(2) + .build(); + + // Case: threshold not reached for new root + let signed_new = Signed::from_signed( + root_new.clone(), + &[ + root_key_old_1.clone(), + root_key_old_2, + root_key_new_1.clone(), + ], + ) + .unwrap(); + let signed_new = signed_new.to_der().unwrap(); + update_root_step(&signed_old.owned_to_ref(), &signed_new) + .expect_err("accepted root where new file does not meet threshold"); + + // Case: threshold not reached for old root + let signed_new = Signed::from_signed( + root_new.clone(), + &[ + root_key_old_1.clone(), + root_key_new_1.clone(), + root_key_new_2.clone(), + ], + ) + .unwrap(); + let signed_new = signed_new.to_der().unwrap(); + update_root_step(&signed_old.owned_to_ref(), &signed_new) + .expect_err("accepted root where new file does not meet threshold"); + + // Case: keys are reused + let signed_new = Signed::from_signed( + root_new, + &[ + root_key_old_1.clone(), + root_key_old_1.clone(), + root_key_new_1.clone(), + root_key_new_1.clone(), + ], + ) + .unwrap(); + let signed_new = signed_new.to_der().unwrap(); + update_root_step(&signed_old.owned_to_ref(), &signed_new) + .expect_err("accepted root where signing keys contributed multiple signatures"); + } + + #[test] + fn test_root_update_step_invald_version_too_high() { + let mut csprng = OsRng; + + let root_key_old = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key_old); + + let old_root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_old = Signed::from_signed(old_root, &[root_key_old.clone()]).unwrap(); + + let root_key_new = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key_new); + + let root_new = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_new = Signed::from_signed(root_new, &[root_key_old, root_key_new]).unwrap(); + let signed_new = signed_new.to_der().unwrap(); + update_root_step(&signed_old.owned_to_ref(), &signed_new) + .expect_err("this should not be accepted"); + } + + /// Tests for failure when the new root is signed by a random key instead of the new key. + #[test] + fn test_root_update_step_invald_sig() { + let mut csprng = OsRng; + + let root_key_old = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key_old); + + let old_root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_old = Signed::from_signed(old_root, &[root_key_old.clone()]).unwrap(); + + let root_key_new = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key_new); + + let root_new = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(2) + .build(); + + let root_key_random = Ed25519Dalek(SigningKey::generate(&mut csprng)); + + let signed_new = Signed::from_signed(root_new, &[root_key_old, root_key_random]).unwrap(); + let signed_new = signed_new.to_der().unwrap(); + update_root_step(&signed_old.owned_to_ref(), &signed_new).expect_err("expected failure"); + } + + #[test] + fn test_root_update_step_invald_duplicate_sig_old_root() { + let mut csprng = OsRng; + + let root_key_old = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key_old); + + let old_root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_old = Signed::from_signed(old_root, &[root_key_old.clone()]).unwrap(); + + let root_key_new = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key_new); + + let root_new = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(2) + .build(); + + let signed_new = + Signed::from_signed(root_new, &[root_key_old.clone(), root_key_old.clone()]).unwrap(); + let signed_new = signed_new.to_der().unwrap(); + update_root_step(&signed_old.owned_to_ref(), &signed_new).expect_err("expected failure"); + } + + /// Tests if a root is accepted despite the previous root not having signed it. + #[test] + fn test_root_update_step_invalid_no_sig_old_root() { + let mut csprng = OsRng; + + let root_key_old = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key_old); + + let old_root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_old = Signed::from_signed(old_root, &[root_key_old.clone()]).unwrap(); + + let root_key_new = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key_new); + + let root_new = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(2) + .build(); + + let signed_new = Signed::from_signed(root_new, &[root_key_new]).unwrap(); + let signed_new = signed_new.to_der().unwrap(); + update_root_step(&signed_old.owned_to_ref(), &signed_new).expect_err("expected failure"); + } + + /// Tests if a root is accepted despite the new root not having signed it. + #[test] + fn test_root_update_step_invalid_no_sig_new_root() { + let mut csprng = OsRng; + + let root_key_old = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key_old); + + let old_root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_old = Signed::from_signed(old_root, &[root_key_old.clone()]).unwrap(); + + let root_key_new = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key_new); + + let root_new = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(2) + .build(); + + let signed_new = Signed::from_signed(root_new, &[root_key_old]).unwrap(); + let signed_new = signed_new.to_der().unwrap(); + update_root_step(&signed_old.owned_to_ref(), &signed_new).expect_err("expected failure"); + } + + /// Tests if a root is accepted despite no root not having signed it. + #[test] + fn test_root_update_step_invalid_no_sig() { + let mut csprng = OsRng; + + let root_key_old = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key_old); + + let old_root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_old = Signed::from_signed(old_root, &[root_key_old.clone()]).unwrap(); + + let root_key_new = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key_new); + + let root_new = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(2) + .build(); + + let signed_new = Signed::from_signed(root_new, &[]).unwrap(); + let signed_new = signed_new.to_der().unwrap(); + update_root_step(&signed_old.owned_to_ref(), &signed_new).expect_err("expected failure"); + } + + #[test] + fn test_root() { + let mut csprng = OsRng; + + let root_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key); + let root_key_id = root_pub_spki.fingerprint_bytes().unwrap(); + + let timestamp_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let timestamp_pub_spki = spki_from_signing_key(×tamp_key); + + let snapshot_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let snapshot_pub_spki = spki_from_signing_key(&snapshot_key); + + let targets_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let targets_pub_spki = spki_from_signing_key(&targets_key); + + let root = RootBuilder::default() + .consistent_snapshot(false) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_role_and_key("root", &[root_pub_spki], 1) + .with_role_and_key("targets", &[targets_pub_spki], 1) + .with_role_and_key("timestamp", &[timestamp_pub_spki], 1) + .with_role_and_key("snapshot", &[snapshot_pub_spki], 1) + .build(); + + let encoded_root = root.to_der().unwrap(); + let RawSignature::Ed25519Dalek(signature) = root_key.sign(&encoded_root).unwrap() else { + unreachable!() + }; + let signature = tuf_no_std_der::Signature { + keyid: BitString::from_bytes(root_key_id.as_slice()).unwrap(), + sig: BitString::from_bytes(&signature.to_bytes()).unwrap(), + }; + let signed = Signed { + signed: root, + signatures: vec![signature], + _phantom: Default::default(), + }; + let decoded_root: RootRef = Decode::from_der(&encoded_root).unwrap(); + let Ed25519Dalek(root_key) = root_key else { + unreachable!() + }; + root_key + .verify( + &decoded_root.to_der().unwrap(), + &Signature::from_bytes( + signed.signatures[0] + .sig + .as_bytes() + .unwrap() + .try_into() + .unwrap(), + ), + ) + .unwrap(); + let signed = signed.owned_to_ref(); + let decoded_root = SignedRef { + signatures: signed.signatures.clone(), + signed: decoded_root, + }; + decoded_root.verify_role(&signed).unwrap(); + } + + #[cfg(test)] + mod test_update_root { + use crate::builder::RootBuilder; + use crate::utils::{MockStorage, MockTransport}; + use alloc::vec; + use core::num::NonZeroU64; + use der::asn1::UtcTime; + use der::{DateTime, Encode}; + use ed25519_dalek::SigningKey; + use rand_core::OsRng; + use tuf_no_std_common::crypto::sign::SigningKey::Ed25519Dalek; + use tuf_no_std_der::Signed; + + use crate::role::root::{update_root, update_root_async}; + + use super::spki_from_signing_key; + + #[test] + fn test_update_root() { + let mut csprng = OsRng; + + let old_root_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + + let root_pub_spki = spki_from_signing_key(&old_root_key); + + let old_root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2023, 1, 1, 1, 1, 1) + .with_version(1) + .build(); + + let signing_keys = vec![old_root_key.clone()]; + let signed_old = Signed::from_signed(old_root, &signing_keys).unwrap(); + let root_key_new = Ed25519Dalek(SigningKey::generate(&mut csprng)); + + let root_pub_spki = spki_from_signing_key(&root_key_new); + + let root_new = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2023, 1, 1, 1, 1, 1) + .with_version(2) + .build(); + + let signing_keys = vec![root_key_new, old_root_key]; + let signed_new = Signed::from_signed(root_new, &signing_keys).unwrap(); + //eprintln!("{signed_new:#?}"); + let signed_new = signed_new.to_der(); + let signed_new = signed_new.as_ref().unwrap().as_slice(); + let mut transport = MockTransport::<_, &[u8]> { + roots: heapless::FnvIndexMap::from_iter([ + (NonZeroU64::new(1).unwrap(), signed_old.to_der().unwrap()), + (NonZeroU64::new(2).unwrap(), signed_new.to_vec()), + ]), + timestamp: vec![], + snapshot: vec![], + targets: vec![], + target_files: Default::default(), + }; + let mut storage = MockStorage { + root: signed_old.to_der().unwrap(), + uncommitted_root: None, + timestamp: None, + snapshot: None, + targets: None, + }; + update_root( + &mut transport, + &mut storage, + 1, + &UtcTime::from_date_time(DateTime::new(2023, 1, 1, 1, 1, 1).unwrap()).unwrap(), + ) + .expect("rejected correct update"); + let mut storage = MockStorage { + root: signed_old.to_der().unwrap(), + uncommitted_root: None, + timestamp: None, + snapshot: None, + targets: None, + }; + tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap() + .block_on(async { + update_root_async( + &mut transport, + &mut storage, + 1, + &UtcTime::from_date_time(DateTime::new(2023, 1, 1, 1, 1, 1).unwrap()) + .unwrap(), + ) + .await + .expect("rejected correct update"); + }); + } + + #[test] + fn test_update_root_expired() { + let mut csprng = OsRng; + + let old_root_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + + let root_pub_spki = spki_from_signing_key(&old_root_key); + + let old_root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2023, 1, 1, 1, 1, 1) + .with_version(1) + .build(); + + let signing_keys = vec![old_root_key.clone()]; + let signed_old = Signed::from_signed(old_root, &signing_keys).unwrap(); + let root_key_new = Ed25519Dalek(SigningKey::generate(&mut csprng)); + + let root_pub_spki = spki_from_signing_key(&root_key_new); + + let root_new = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_expiration_utc(2000, 1, 1, 1, 1, 1) + .with_version(2) + .build(); + + let signing_keys = vec![root_key_new, old_root_key]; + let signed_new = Signed::from_signed(root_new, &signing_keys).unwrap(); + //eprintln!("{signed_new:#?}"); + let signed_new = signed_new.to_der(); + let signed_new = signed_new.as_ref().unwrap().as_slice(); + let mut transport = MockTransport::<_, &[u8]> { + roots: heapless::FnvIndexMap::from_iter([ + (NonZeroU64::new(1).unwrap(), signed_old.to_der().unwrap()), + (NonZeroU64::new(2).unwrap(), signed_new.to_vec()), + ]), + timestamp: vec![], + snapshot: vec![], + targets: vec![], + target_files: Default::default(), + }; + let mut storage = MockStorage { + root: signed_old.to_der().unwrap(), + uncommitted_root: None, + timestamp: None, + snapshot: None, + targets: None, + }; + update_root( + &mut transport, + &mut storage, + 1, + &UtcTime::from_date_time(DateTime::new(2023, 1, 1, 1, 1, 1).unwrap()).unwrap(), + ) + .expect_err("accepted expired root"); + + let mut storage = MockStorage { + root: signed_old.to_der().unwrap(), + uncommitted_root: None, + timestamp: None, + snapshot: None, + targets: None, + }; + tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap() + .block_on(async { + update_root_async( + &mut transport, + &mut storage, + 1, + &UtcTime::from_date_time(DateTime::new(2023, 1, 1, 1, 1, 1).unwrap()) + .unwrap(), + ) + .await + .expect_err("accepted expired root"); + }); + } + #[test] + fn test_update_root_role_key_rotation() { + let mut csprng = OsRng; + + let old_root_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + + let root_pub_spki = spki_from_signing_key(&old_root_key); + let ts_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let ts_pub_spki = spki_from_signing_key(&ts_key); + let snap_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let snap_pub_spki = spki_from_signing_key(&snap_key); + + let old_root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_role_and_key("snapshot", &[snap_pub_spki], 1) + .with_role_and_key("timestamp", &[ts_pub_spki], 1) + .with_expiration_utc(2023, 1, 1, 1, 1, 1) + .with_version(1) + .build(); + + let signing_keys = vec![old_root_key.clone()]; + let signed_old = Signed::from_signed(old_root, &signing_keys).unwrap(); + let root_key_new = Ed25519Dalek(SigningKey::generate(&mut csprng)); + + let root_pub_spki = spki_from_signing_key(&root_key_new); + + let ts_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let ts_pub_spki = spki_from_signing_key(&ts_key); + let snap_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let snap_pub_spki = spki_from_signing_key(&snap_key); + + let root_new = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_role_and_key("snapshot", &[snap_pub_spki], 1) + .with_role_and_key("timestamp", &[ts_pub_spki], 1) + .with_expiration_utc(2023, 1, 1, 1, 1, 1) + .with_version(2) + .build(); + + let signing_keys = vec![root_key_new, old_root_key]; + let signed_new = Signed::from_signed(root_new, &signing_keys).unwrap(); + //eprintln!("{signed_new:#?}"); + let signed_new = signed_new.to_der(); + let signed_new = signed_new.as_ref().unwrap().as_slice(); + let mut transport = MockTransport::<_, &[u8]> { + roots: heapless::FnvIndexMap::from_iter([ + (NonZeroU64::new(1).unwrap(), signed_old.to_der().unwrap()), + (NonZeroU64::new(2).unwrap(), signed_new.to_vec()), + ]), + timestamp: vec![], + snapshot: vec![], + targets: vec![], + target_files: Default::default(), + }; + let mut storage = MockStorage { + root: signed_old.to_der().unwrap(), + uncommitted_root: None, + timestamp: Some(Default::default()), + snapshot: Some(Default::default()), + targets: None, + }; + assert!( + storage.snapshot.is_some(), + "likely implementation error within the test" + ); + assert!( + storage.timestamp.is_some(), + "likely implementation error within the test" + ); + update_root( + &mut transport, + &mut storage, + 1, + &UtcTime::from_date_time(DateTime::new(2023, 1, 1, 1, 1, 1).unwrap()).unwrap(), + ) + .expect("rejected correct update"); + assert!(storage.snapshot.is_none(), "failed to delete snapshots"); + assert!(storage.timestamp.is_none(), "failed to delete timestamps"); + + let mut storage = MockStorage { + root: signed_old.to_der().unwrap(), + uncommitted_root: None, + timestamp: Some(Default::default()), + snapshot: Some(Default::default()), + targets: None, + }; + tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap() + .block_on(async { + update_root_async( + &mut transport, + &mut storage, + 1, + &UtcTime::from_date_time(DateTime::new(2023, 1, 1, 1, 1, 1).unwrap()) + .unwrap(), + ) + .await + .expect("rejected correct update"); + }); + assert!(storage.snapshot.is_none(), "failed to delete snapshots"); + assert!(storage.timestamp.is_none(), "failed to delete timestamps"); + } + } +} diff --git a/tuf-no-std/tuf-no-std/src/role/snapshot.rs b/tuf-no-std/tuf-no-std/src/role/snapshot.rs new file mode 100644 index 0000000..4c9203d --- /dev/null +++ b/tuf-no-std/tuf-no-std/src/role/snapshot.rs @@ -0,0 +1,843 @@ +use crate::canonical::{EncodeCanonically, EncodingError}; +use crate::role::root::TufRoot; +use crate::role::{DecodeRole, RoleUpdate, TufRole, TufSnapshot, TufTimestamp}; +use der::asn1::{BitStringRef, UtcTime}; +use der::Encode; +use tuf_no_std_common::crypto::verify_sha256; +use tuf_no_std_common::remote::TufTransport; +#[cfg(feature = "async")] +use tuf_no_std_common::remote::TufTransportAsync; +use tuf_no_std_common::storage::TufStorage; +use tuf_no_std_common::TufError::InvalidNewVersionNumber; +use tuf_no_std_common::{RoleType, TufError, Version}; +use tuf_no_std_der::root::RootRef; +use tuf_no_std_der::snapshot::{Snapshot, SnapshotRef}; +use tuf_no_std_der::timestamp::TimestampRef; +use tuf_no_std_der::SignedRef; +impl<'a> TufRole for SnapshotRef<'a> { + const TYPE: RoleType = RoleType::Snapshot; +} + +impl<'a> EncodeCanonically for SnapshotRef<'a> { + fn encode_canonically<'o>(&self, out: &'o mut [u8]) -> Result<&'o [u8], EncodingError> { + self.encode_to_slice(out) + .map_err(|_| EncodingError::BufferTooSmall) + } +} + +impl EncodeCanonically for Snapshot { + fn encode_canonically<'o>(&self, out: &'o mut [u8]) -> Result<&'o [u8], EncodingError> { + self.encode_to_slice(out) + .map_err(|_| EncodingError::BufferTooSmall) + } +} + +impl<'a> RoleUpdate for SnapshotRef<'a> { + fn version(&self) -> Version { + self.version + } + + fn expires(&self) -> UtcTime { + self.expires + } +} + +impl<'a> TufSnapshot for SnapshotRef<'a> { + fn targets_hash(&self) -> [u8; 32] { + self.meta + .iter() + .find(|f| f.metapath == BitStringRef::from_bytes(b"targets.der").unwrap()) + .and_then(|h| h.hashes.get(0)) + .and_then(|h| TryFrom::try_from(h.value.raw_bytes()).ok()) + .expect("failed to find hash") + } + + fn targets_version(&self) -> Version { + self.meta + .iter() + .find(|f| f.metapath == BitStringRef::from_bytes(b"targets.der").unwrap()) + .map(|h| h.version) + .expect("failed to find metapath") + } +} + +fn verify_snapshot( + root: &[u8], + timestamp: &[u8], + snapshot_new: &[u8], + snapshot_old: Option<&[u8]>, + update_start: &UtcTime, +) -> Result<(), TufError> { + let root = SignedRef::::decode_role(root)?; + let timestamp_decoded = SignedRef::::decode_role(timestamp)?; + let snapshot_new_decoded = SignedRef::::decode_role(snapshot_new)?; + + // 5.5.2 + verify_sha256(timestamp_decoded.snapshot_hash(), snapshot_new) + .map_err(|_| TufError::InvalidHash)?; + + // 5.5.3 + root.verify_role(&snapshot_new_decoded)?; + + // 5.5.4 + if timestamp_decoded.snapshot_version() != snapshot_new_decoded.version() { + return Err(InvalidNewVersionNumber); + } + // 5.5.5 Ensure every targets metadata file still exists + // and the old version numbers are less or equal to the old one. + if let Some(snapshot_old) = snapshot_old { + let snapshot_old = SignedRef::::decode_role(snapshot_old)?; + + snapshot_old + .signed + .meta + .iter() + .all(|t_old| { + snapshot_new_decoded + .signed + .meta + .iter() + .find(|t_new| t_new.metapath == t_old.metapath) + .map(|t_new| t_new.version >= t_old.version) + .unwrap_or(false) + }) + .then_some(()) + .ok_or(TufError::InvalidTargetsInSnapshot)?; + } + if timestamp_decoded.snapshot_version() != snapshot_new_decoded.version() { + return Err(TufError::InvalidNewVersionNumber); + } + + if &snapshot_new_decoded.expires() < update_start { + return Err(TufError::ExpiredSnapshotFile); + } + Ok(()) +} + +pub(crate) fn update_snapshot( + remote: &mut T, + storage: &mut S, + update_start: &UtcTime, +) -> Result<(), TufError> +where + S: TufStorage, + T: TufTransport, +{ + let current_root = storage.current_root(); + let timestamp = storage + .current_timestamp() + .ok_or(TufError::MissingTimestampFile)?; + let snapshot_old = storage.current_snapshot(); + let mut buf = [0u8; 512]; + let snapshot_new = remote + .fetch_snapshot(&mut buf) + .map_err(|_| TufError::FetchError)?; + verify_snapshot( + current_root, + timestamp, + snapshot_new, + snapshot_old, + update_start, + )?; + storage.persist_snapshot(snapshot_new)?; + Ok(()) +} + +#[cfg(feature = "async")] +pub async fn update_snapshot_async( + remote: &mut T, + storage: &mut S, + update_start: &UtcTime, +) -> Result<(), TufError> +where + S: TufStorage, + T: TufTransportAsync, +{ + let current_root = storage.current_root(); + let timestamp = storage + .current_timestamp() + .ok_or(TufError::MissingTimestampFile)?; + let snapshot_old = storage.current_snapshot(); + let mut buf = [0u8; 512]; + let snapshot_new = remote + .fetch_snapshot(&mut buf) + .await + .map_err(|_| TufError::FetchError)?; + verify_snapshot( + current_root, + timestamp, + snapshot_new, + snapshot_old, + update_start, + )?; + storage.persist_snapshot(snapshot_new)?; + Ok(()) +} + +#[cfg(test)] +mod test { + use core::num::NonZeroU64; + + use crate::builder::{RootBuilder, SnapshotBuilder, TargetsBuilder, TimestampBuilder}; + use crate::utils::{spki_from_signing_key, MockStorage, MockTransport}; + use der::asn1::BitString; + use der::{DateTime, Encode}; + use ed25519_dalek::SigningKey; + use rand_core::OsRng; + use tuf_no_std_common::crypto::sign::SigningKey::Ed25519Dalek; + use tuf_no_std_der::Signed; + + use super::{update_snapshot, verify_snapshot}; + + #[test] + fn test_verify_snapshot() { + let mut csprng = OsRng; + + let root_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key); + + let timestamp_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let timestamp_pub_spki = spki_from_signing_key(×tamp_key); + + let targets_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let targets_pub_spki = spki_from_signing_key(&targets_key); + + let snapshot_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let snapshot_pub_spki = spki_from_signing_key(&snapshot_key); + + let root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_role_and_key("targets", &[targets_pub_spki], 1) + .with_role_and_key("snapshot", &[snapshot_pub_spki], 1) + .with_role_and_key("timestamp", &[timestamp_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_root = Signed::from_signed(root, &[root_key]).unwrap(); + let targets = TargetsBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + let signed_targets = Signed::from_signed(targets, &[(targets_key.clone())]).unwrap(); + + let snapshot = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + let signed_snapshot = + Signed::from_signed(snapshot.clone(), &[(snapshot_key.clone())]).unwrap(); + + let timestamp = TimestampBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_snapshot("snapshot.der", &signed_snapshot) + .build(); + let signed_timestamp = Signed::from_signed(timestamp, &[(timestamp_key.clone())]).unwrap(); + + // Case: valid + verify_snapshot( + &signed_root.to_der().unwrap(), + &signed_timestamp.to_der().unwrap(), + &signed_snapshot.to_der().unwrap(), + None, + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect("failed to verify valid snapshot file"); + + // Case: expired + verify_snapshot( + &signed_root.to_der().unwrap(), + &signed_timestamp.to_der().unwrap(), + &signed_snapshot.to_der().unwrap(), + None, + &DateTime::new(2040, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted expired snapshot"); + + // Case: mismatched hash + let snapshot = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + let signed_snapshot = + Signed::from_signed(snapshot.clone(), &[(snapshot_key.clone())]).unwrap(); + + let mut timestamp = TimestampBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_snapshot("snapshot.der", &signed_snapshot) + .build(); + + // modify hash + timestamp.meta.hashes[0].value = BitString::from_bytes(&[0u8; 32]).unwrap(); + let signed_timestamp = Signed::from_signed(timestamp, &[(timestamp_key.clone())]).unwrap(); + + verify_snapshot( + &signed_root.to_der().unwrap(), + &signed_timestamp.to_der().unwrap(), + &signed_snapshot.to_der().unwrap(), + None, + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted snapshot with invalid hash"); + + // Case: valid step + let snapshot_old = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + let signed_snapshot_old = + Signed::from_signed(snapshot_old.clone(), &[(snapshot_key.clone())]).unwrap(); + + let snapshot_new = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(2) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + let signed_snapshot_new = + Signed::from_signed(snapshot_new.clone(), &[(snapshot_key.clone())]).unwrap(); + + let timestamp_new = TimestampBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_snapshot("snapshot.der", &signed_snapshot_new) + .build(); + let signed_timestamp_new = + Signed::from_signed(timestamp_new, &[(timestamp_key.clone())]).unwrap(); + + verify_snapshot( + &signed_root.to_der().unwrap(), + &signed_timestamp_new.to_der().unwrap(), + &signed_snapshot_new.to_der().unwrap(), + Some(&signed_snapshot_old.to_der().unwrap()), + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect("rejected valid snapshot"); + + // Case: version number does not match timestamps file + let snapshot_new = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + let signed_snapshot_new = + Signed::from_signed(snapshot_new.clone(), &[(snapshot_key.clone())]).unwrap(); + + let mut timestamp_new = TimestampBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_snapshot("snapshot.der", &signed_snapshot_new) + .build(); + // Modify version number in timestamp file + timestamp_new.meta.version = 0; + let signed_timestamp_new = + Signed::from_signed(timestamp_new, &[(timestamp_key.clone())]).unwrap(); + + verify_snapshot( + &signed_root.to_der().unwrap(), + &signed_timestamp_new.to_der().unwrap(), + &signed_snapshot_new.to_der().unwrap(), + None, + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted snapshot file with lower version number"); + } + + #[test] + fn test_verify_snapshot_threshold() { + let mut csprng = OsRng; + + let root_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key); + + let timestamp_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let timestamp_pub_spki = spki_from_signing_key(×tamp_key); + + let targets_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let targets_pub_spki = spki_from_signing_key(&targets_key); + + let snapshot_key_1 = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let snapshot_pub_spki_1 = spki_from_signing_key(&snapshot_key_1); + let snapshot_key_2 = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let snapshot_pub_spki_2 = spki_from_signing_key(&snapshot_key_2); + + let root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_role_and_key("targets", &[targets_pub_spki], 1) + .with_role_and_key("snapshot", &[snapshot_pub_spki_1, snapshot_pub_spki_2], 2) + .with_role_and_key("timestamp", &[timestamp_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_root = Signed::from_signed(root, &[root_key]).unwrap(); + let targets = TargetsBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + let signed_targets = Signed::from_signed(targets, &[(targets_key.clone())]).unwrap(); + + let snapshot = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + let signed_snapshot = Signed::from_signed( + snapshot.clone(), + &[snapshot_key_1.clone(), snapshot_key_2.clone()], + ) + .unwrap(); + + let timestamp = TimestampBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_snapshot("snapshot.der", &signed_snapshot) + .build(); + let signed_timestamp = Signed::from_signed(timestamp, &[(timestamp_key.clone())]).unwrap(); + + // Case: valid + verify_snapshot( + &signed_root.to_der().unwrap(), + &signed_timestamp.to_der().unwrap(), + &signed_snapshot.to_der().unwrap(), + None, + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect("failed to verify valid snapshot file"); + + // Case: signing keys are reused + let signed_snapshot = Signed::from_signed( + snapshot.clone(), + &[snapshot_key_2.clone(), snapshot_key_2.clone()], + ) + .unwrap(); + + let timestamp = TimestampBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_snapshot("snapshot.der", &signed_snapshot) + .build(); + let signed_timestamp = Signed::from_signed(timestamp, &[(timestamp_key.clone())]).unwrap(); + + // Case: valid + verify_snapshot( + &signed_root.to_der().unwrap(), + &signed_timestamp.to_der().unwrap(), + &signed_snapshot.to_der().unwrap(), + None, + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted snapshot file with reused keys"); + + // Case: untrusted keys are used + let signed_snapshot = Signed::from_signed( + snapshot.clone(), + &[ + Ed25519Dalek(SigningKey::generate(&mut csprng)), + Ed25519Dalek(SigningKey::generate(&mut csprng)), + ], + ) + .unwrap(); + + let timestamp = TimestampBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_snapshot("snapshot.der", &signed_snapshot) + .build(); + let signed_timestamp = Signed::from_signed(timestamp, &[(timestamp_key.clone())]).unwrap(); + + // Case: valid + verify_snapshot( + &signed_root.to_der().unwrap(), + &signed_timestamp.to_der().unwrap(), + &signed_snapshot.to_der().unwrap(), + None, + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted snapshot file with invalid signatures"); + } + + #[test] + fn test_verify_snapshot_targets_metadata() { + let mut csprng = OsRng; + + let root_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key); + + let timestamp_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let timestamp_pub_spki = spki_from_signing_key(×tamp_key); + + let targets_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let targets_pub_spki = spki_from_signing_key(&targets_key); + + let snapshot_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let snapshot_pub_spki = spki_from_signing_key(&snapshot_key); + + let root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_role_and_key("targets", &[targets_pub_spki], 1) + .with_role_and_key("snapshot", &[snapshot_pub_spki], 1) + .with_role_and_key("timestamp", &[timestamp_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_root = Signed::from_signed(root, &[root_key]).unwrap(); + let targets = TargetsBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + let signed_targets = Signed::from_signed(targets, &[(targets_key.clone())]).unwrap(); + + let snapshot_old = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + let signed_snapshot_old = + Signed::from_signed(snapshot_old.clone(), &[(snapshot_key.clone())]).unwrap(); + + let snapshot_new = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(2) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 0) + .build(); + let signed_snapshot_new = + Signed::from_signed(snapshot_new.clone(), &[(snapshot_key.clone())]).unwrap(); + + let timestamp = TimestampBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_snapshot("snapshot.der", &signed_snapshot_new) + .build(); + let signed_timestamp = Signed::from_signed(timestamp, &[(timestamp_key.clone())]).unwrap(); + + // Case: invalid version for target in new snapshot file + verify_snapshot( + &signed_root.to_der().unwrap(), + &signed_timestamp.to_der().unwrap(), + &signed_snapshot_new.to_der().unwrap(), + Some(&signed_snapshot_old.to_der().unwrap()), + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted snapshot file with invalid targets version number"); + + let snapshot_old = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + let signed_snapshot_old = + Signed::from_signed(snapshot_old.clone(), &[(snapshot_key.clone())]).unwrap(); + + let snapshot_new = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(2) + .build(); + let signed_snapshot_new = + Signed::from_signed(snapshot_new.clone(), &[(snapshot_key.clone())]).unwrap(); + + let timestamp = TimestampBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_snapshot("snapshot.der", &signed_snapshot_new) + .build(); + let signed_timestamp = Signed::from_signed(timestamp, &[(timestamp_key.clone())]).unwrap(); + + // Case: invalid version for target in new snapshot file + verify_snapshot( + &signed_root.to_der().unwrap(), + &signed_timestamp.to_der().unwrap(), + &signed_snapshot_new.to_der().unwrap(), + Some(&signed_snapshot_old.to_der().unwrap()), + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted snapshot file with missing targets metadata"); + } + + #[test] + fn test_update_snapshot() { + let mut csprng = OsRng; + + let root_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key); + + let timestamp_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let timestamp_pub_spki = spki_from_signing_key(×tamp_key); + + let targets_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let targets_pub_spki = spki_from_signing_key(&targets_key); + + let snapshot_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let snapshot_pub_spki = spki_from_signing_key(&snapshot_key); + + let root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_role_and_key("targets", &[targets_pub_spki], 1) + .with_role_and_key("snapshot", &[snapshot_pub_spki], 1) + .with_role_and_key("timestamp", &[timestamp_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_root = Signed::from_signed(root, &[root_key]).unwrap(); + let root_encoded = signed_root.to_der().unwrap(); + let targets = TargetsBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + let signed_targets = Signed::from_signed(targets, &[(targets_key.clone())]).unwrap(); + let targets_encoded = signed_targets.to_der().unwrap(); + + let snapshot = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + let signed_snapshot = + Signed::from_signed(snapshot.clone(), &[(snapshot_key.clone())]).unwrap(); + let snapshot_encoded = signed_snapshot.to_der().unwrap(); + + let timestamp = TimestampBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_snapshot("snapshot.der", &signed_snapshot) + .build(); + let signed_timestamp = Signed::from_signed(timestamp, &[(timestamp_key.clone())]).unwrap(); + let timestamp_encoded = signed_timestamp.to_der().unwrap(); + + let mut transport = MockTransport::<_, &[u8]> { + roots: heapless::FnvIndexMap::from_iter([( + NonZeroU64::new(1).unwrap(), + root_encoded.clone(), + )]), + timestamp: timestamp_encoded.clone(), + snapshot: snapshot_encoded.clone(), + targets: snapshot_encoded.clone(), + target_files: Default::default(), + }; + let storage = MockStorage { + root: root_encoded.clone(), + uncommitted_root: None, + timestamp: Some(timestamp_encoded.clone()), + snapshot: None, + targets: Some(targets_encoded.clone()), + }; + + // Case: valid + let mut storage_test = storage.clone(); + update_snapshot( + &mut transport, + &mut storage_test, + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect("failed to verify snapshot file"); + assert_eq!(storage_test.root, root_encoded); + assert_eq!(storage_test.timestamp, Some(timestamp_encoded.clone())); + assert_eq!(storage_test.snapshot, Some(snapshot_encoded.clone())); + assert_eq!(storage_test.targets, Some(targets_encoded.clone())); + + // Case: expired + let mut storage_test = storage.clone(); + update_snapshot( + &mut transport, + &mut storage_test, + &DateTime::new(2040, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted expired snapshot file"); + assert_eq!(storage_test.root, root_encoded); + assert_eq!(storage_test.timestamp, Some(timestamp_encoded.clone())); + assert_eq!(storage_test.snapshot, None); + assert_eq!(storage_test.targets, Some(targets_encoded.clone())); + + // Case: mismatched hash + let snapshot = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + let signed_snapshot = + Signed::from_signed(snapshot.clone(), &[(snapshot_key.clone())]).unwrap(); + + let mut timestamp = TimestampBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_snapshot("snapshot.der", &signed_snapshot) + .build(); + + // modify hash + timestamp.meta.hashes[0].value = BitString::from_bytes(&[0u8; 32]).unwrap(); + let signed_timestamp = Signed::from_signed(timestamp, &[(timestamp_key.clone())]).unwrap(); + let timestamp_encoded = signed_timestamp.to_der().unwrap(); + + let mut storage_test = storage.clone(); + storage_test.timestamp = Some(timestamp_encoded.clone()); + + update_snapshot( + &mut transport, + &mut storage_test, + &DateTime::new(2040, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted snapshot with invalid hash"); + assert_eq!(storage_test.root, root_encoded); + assert_eq!(storage_test.timestamp, Some(timestamp_encoded.clone())); + assert_eq!(storage_test.snapshot, None); + assert_eq!(storage_test.targets, Some(targets_encoded.clone())); + + // Case: valid step + let snapshot_old = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + let signed_snapshot_old = + Signed::from_signed(snapshot_old.clone(), &[(snapshot_key.clone())]).unwrap(); + + let snapshot_new = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(2) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + let signed_snapshot_new = + Signed::from_signed(snapshot_new.clone(), &[(snapshot_key.clone())]).unwrap(); + + let timestamp_new = TimestampBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_snapshot("snapshot.der", &signed_snapshot_new) + .build(); + let signed_timestamp = + Signed::from_signed(timestamp_new, &[(timestamp_key.clone())]).unwrap(); + + let timestamp_encoded = signed_timestamp.to_der().unwrap(); + let snapshot_encoded_old = signed_snapshot_old.to_der().unwrap(); + let snapshot_encoded_new = signed_snapshot_new.to_der().unwrap(); + + let mut transport = MockTransport::<_, &[u8]> { + roots: heapless::FnvIndexMap::from_iter([( + NonZeroU64::new(1).unwrap(), + root_encoded.clone(), + )]), + timestamp: timestamp_encoded.clone(), + snapshot: snapshot_encoded_new.clone(), + targets: snapshot_encoded.clone(), + target_files: Default::default(), + }; + let mut storage = MockStorage { + root: root_encoded.clone(), + uncommitted_root: None, + timestamp: Some(timestamp_encoded.clone()), + snapshot: Some(snapshot_encoded_old.clone()), + targets: Some(targets_encoded.clone()), + }; + update_snapshot( + &mut transport, + &mut storage, + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect("rejected valid snapshot"); + assert_eq!(storage.root, root_encoded); + assert_eq!(storage.timestamp, Some(timestamp_encoded.clone())); + assert_eq!(storage.snapshot, Some(snapshot_encoded_new.clone())); + assert_eq!(storage.targets, Some(targets_encoded.clone())); + + // Case: version number does not match timestamps file + let snapshot_new = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + let signed_snapshot_new = + Signed::from_signed(snapshot_new.clone(), &[(snapshot_key.clone())]).unwrap(); + + let mut timestamp_new = TimestampBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_snapshot("snapshot.der", &signed_snapshot_new) + .build(); + // Modify version number in timestamp file + timestamp_new.meta.version = 0; + let signed_timestamp = + Signed::from_signed(timestamp_new, &[(timestamp_key.clone())]).unwrap(); + + let timestamp_encoded = signed_timestamp.to_der().unwrap(); + let snapshot_encoded_new = signed_snapshot_new.to_der().unwrap(); + + let mut transport = MockTransport::<_, &[u8]> { + roots: heapless::FnvIndexMap::from_iter([( + NonZeroU64::new(1).unwrap(), + root_encoded.clone(), + )]), + timestamp: timestamp_encoded.clone(), + snapshot: snapshot_encoded_new.clone(), + targets: snapshot_encoded.clone(), + target_files: Default::default(), + }; + let mut storage = MockStorage { + root: root_encoded.clone(), + uncommitted_root: None, + timestamp: Some(timestamp_encoded.clone()), + snapshot: Some(snapshot_encoded_old.clone()), + targets: Some(targets_encoded.clone()), + }; + update_snapshot( + &mut transport, + &mut storage, + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted snapshot file with lower version number"); + assert_eq!(storage.root, root_encoded); + assert_eq!(storage.timestamp, Some(timestamp_encoded.clone())); + assert_eq!(storage.snapshot, Some(snapshot_encoded_old.clone())); + assert_eq!(storage.targets, Some(targets_encoded.clone())); + } +} diff --git a/tuf-no-std/tuf-no-std/src/role/targets.rs b/tuf-no-std/tuf-no-std/src/role/targets.rs new file mode 100644 index 0000000..bca9f3b --- /dev/null +++ b/tuf-no-std/tuf-no-std/src/role/targets.rs @@ -0,0 +1,423 @@ +use crate::canonical::{EncodeCanonically, EncodingError}; +use crate::format::TufFormat; +use crate::role::root::TufRoot; +use crate::role::{DecodeRole, RoleUpdate, TufRole, TufSnapshot}; +use der::asn1::{BitStringRef, UtcTime}; +use der::Encode; +use tuf_no_std_common::crypto::verify_sha256; +use tuf_no_std_common::remote::TufTransport; +#[cfg(feature = "async")] +use tuf_no_std_common::remote::TufTransportAsync; +use tuf_no_std_common::storage::TufStorage; +use tuf_no_std_common::TufError::{ExpiredTargetsFile, InvalidNewVersionNumber}; +use tuf_no_std_common::{RoleType, TufError, Version}; +use tuf_no_std_der::targets::{Targets, TargetsRef}; +use tuf_no_std_der::{HashRef, TufDer}; + +pub trait TufTargets {} + +impl<'a> TufRole for TargetsRef<'a, 4, 0> { + const TYPE: RoleType = RoleType::Targets; +} + +impl<'a> EncodeCanonically for TargetsRef<'a, 4, 0> { + fn encode_canonically<'o>(&self, out: &'o mut [u8]) -> Result<&'o [u8], EncodingError> { + self.encode_to_slice(out) + .map_err(|_| EncodingError::BufferTooSmall) + } +} + +impl EncodeCanonically for Targets { + fn encode_canonically<'o>(&self, out: &'o mut [u8]) -> Result<&'o [u8], EncodingError> { + self.encode_to_slice(out) + .map_err(|_| EncodingError::BufferTooSmall) + } +} + +impl<'a> RoleUpdate for TargetsRef<'a, 4, 0> { + fn version(&self) -> Version { + self.version + } + + fn expires(&self) -> UtcTime { + self.expires + } +} + +impl<'a> TufTargets for TargetsRef<'a, 4, 0> {} + +pub(crate) fn verify_targets<'a>( + root: &'a [u8], + snapshot: &'a [u8], + targets_new: &'a [u8], + update_start: &UtcTime, +) -> Result<(), TufError> { + let root_decoded = ::Root::decode_role(root)?; + let snapshot_decoded = ::Snapshot::decode_role(snapshot)?; + let targets_new_decoded = ::Targets::decode_role(targets_new)?; + + verify_sha256(snapshot_decoded.targets_hash(), targets_new) + .map_err(|_| TufError::InvalidHash)?; + root_decoded.verify_role(&targets_new_decoded)?; + if targets_new_decoded.version() != snapshot_decoded.targets_version() { + return Err(InvalidNewVersionNumber); + } + if &targets_new_decoded.expires() < update_start { + return Err(ExpiredTargetsFile); + } + Ok(()) +} + +pub(crate) fn update_targets( + remote: &mut T, + storage: &mut S, + update_start: &UtcTime, +) -> Result<(), TufError> +where + S: TufStorage, + T: TufTransport, +{ + let current_root = storage.current_root(); + let snapshot = storage + .current_snapshot() + .ok_or(TufError::MissingSnapshotFile)?; + + let mut buf = [0u8; 512]; + let targets_new = remote + .fetch_targets(&mut buf) + .map_err(|_| TufError::FetchError)?; + verify_targets(current_root, snapshot, targets_new, update_start)?; + storage.persist_targets(targets_new)?; + Ok(()) +} + +#[cfg(feature = "async")] +pub(crate) async fn update_targets_async( + remote: &mut T, + storage: &mut S, + update_start: &UtcTime, +) -> Result<(), TufError> +where + S: TufStorage, + T: TufTransportAsync, +{ + let current_root = storage.current_root(); + let snapshot = storage + .current_snapshot() + .ok_or(TufError::MissingSnapshotFile)?; + + let mut buf = [0u8; 512]; + let targets_new = remote + .fetch_targets(&mut buf) + .await + .map_err(|_| TufError::FetchError)?; + verify_targets(current_root, snapshot, targets_new, update_start)?; + storage.persist_targets(targets_new)?; + Ok(()) +} + +pub(crate) fn verify_target_file( + targets: &[u8], + target_file_metapath: &[u8], + target_file: &[u8], +) -> Result<(), TufError> { + // 5.7.1 Verify the desired target against its targets metadata. + + let targets_decoded = ::Targets::decode_role(targets)?; + let target_file_metapath = + BitStringRef::from_bytes(target_file_metapath).or(Err(TufError::InternalError))?; + let metadata = &targets_decoded + .signed + .targets + .iter() + .find(|t| t.metapath == target_file_metapath) + .ok_or(TufError::MissingTargetMetadata)? + .value; + if metadata + .length + .map(|l| l != target_file.len() as u64) + .unwrap_or(false) + { + return Err(TufError::InvalidLength); + } + let expected_hash = metadata + .hashes + .iter() + .find_map(HashRef::sha256) + .ok_or(TufError::NoSupportedHash)?; + verify_sha256(expected_hash, target_file).map_err(|_| TufError::InvalidHash)?; + Ok(()) +} + +#[cfg(test)] +mod test { + + use der::asn1::BitString; + use der::{DateTime, Encode}; + use ed25519_dalek::SigningKey; + use rand_core::OsRng; + use tuf_no_std_common::crypto::sign::SigningKey::Ed25519Dalek; + use tuf_no_std_der::Signed; + + use crate::builder::{RootBuilder, SnapshotBuilder, TargetsBuilder}; + use crate::utils::spki_from_signing_key; + + use super::{verify_target_file, verify_targets}; + + #[test] + fn test_verify_targets() { + let target_file = "Hello World!"; + let mut csprng = OsRng; + + let root_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key); + + let timestamp_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let timestamp_pub_spki = spki_from_signing_key(×tamp_key); + + let targets_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let targets_pub_spki = spki_from_signing_key(&targets_key); + + let snapshot_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let snapshot_pub_spki = spki_from_signing_key(&snapshot_key); + + let root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_role_and_key("targets", &[targets_pub_spki], 1) + .with_role_and_key("snapshot", &[snapshot_pub_spki], 1) + .with_role_and_key("timestamp", &[timestamp_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_root = Signed::from_signed(root, &[root_key]).unwrap(); + let targets = TargetsBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_target(b"hello-world.txt", target_file.as_bytes()) + .build(); + let signed_targets = Signed::from_signed(targets, &[(targets_key.clone())]).unwrap(); + + let snapshot = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + let signed_snapshot = + Signed::from_signed(snapshot.clone(), &[(snapshot_key.clone())]).unwrap(); + + // Case: valid file + verify_targets( + &signed_root.to_der().unwrap(), + &signed_snapshot.to_der().unwrap(), + &signed_targets.to_der().unwrap(), + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect("failed to verify valid snapshot file"); + + // Case: expired + verify_targets( + &signed_root.to_der().unwrap(), + &signed_snapshot.to_der().unwrap(), + &signed_targets.to_der().unwrap(), + &DateTime::new(2040, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("failed to reject expired snapshot file"); + verify_target_file( + &signed_targets.to_der().unwrap(), + b"hello-world.txt", + target_file.as_bytes(), + ) + .expect("failed to verify targets file"); + + let mut snapshot = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + snapshot.meta[0].hashes[0].value = BitString::from_bytes(&[0u8; 32]).unwrap(); + + let signed_snapshot = + Signed::from_signed(snapshot.clone(), &[(snapshot_key.clone())]).unwrap(); + verify_targets( + &signed_root.to_der().unwrap(), + &signed_snapshot.to_der().unwrap(), + &signed_targets.to_der().unwrap(), + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted invalid targets file"); + + // Case: version number does not match snapshot + let mut snapshot = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + snapshot.meta[0].version = 0; + + let signed_snapshot = + Signed::from_signed(snapshot.clone(), &[(snapshot_key.clone())]).unwrap(); + verify_targets( + &signed_root.to_der().unwrap(), + &signed_snapshot.to_der().unwrap(), + &signed_targets.to_der().unwrap(), + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted invalid targets file"); + } + + #[test] + fn test_verify_targets_threshold() { + let mut csprng = OsRng; + + let root_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key); + + let timestamp_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let timestamp_pub_spki = spki_from_signing_key(×tamp_key); + + let targets_key_1 = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let targets_pub_spki_1 = spki_from_signing_key(&targets_key_1); + let targets_key_2 = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let targets_pub_spki_2 = spki_from_signing_key(&targets_key_2); + + let snapshot_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let snapshot_pub_spki = spki_from_signing_key(&snapshot_key); + + let root = RootBuilder::default() + .with_role_and_key("root", &[root_pub_spki], 1) + .with_role_and_key("targets", &[targets_pub_spki_1, targets_pub_spki_2], 2) + .with_role_and_key("snapshot", &[snapshot_pub_spki], 1) + .with_role_and_key("timestamp", &[timestamp_pub_spki], 1) + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_root = Signed::from_signed(root, &[root_key]).unwrap(); + + // Case: valid, meets threshold + let targets = TargetsBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + let signed_targets = + Signed::from_signed(targets, &[targets_key_1.clone(), targets_key_2.clone()]).unwrap(); + + let snapshot = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + let signed_snapshot = + Signed::from_signed(snapshot.clone(), &[(snapshot_key.clone())]).unwrap(); + + verify_targets( + &signed_root.to_der().unwrap(), + &signed_snapshot.to_der().unwrap(), + &signed_targets.to_der().unwrap(), + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect("failed to verify valid snapshot file"); + + // Case: Does not meet threshold. + let targets = TargetsBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + let signed_targets = Signed::from_signed(targets, &[targets_key_1.clone()]).unwrap(); + + let snapshot = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + let signed_snapshot = + Signed::from_signed(snapshot.clone(), &[(snapshot_key.clone())]).unwrap(); + + verify_targets( + &signed_root.to_der().unwrap(), + &signed_snapshot.to_der().unwrap(), + &signed_targets.to_der().unwrap(), + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted targets file that does not have enough signatures"); + + // Case: Does not meet threshold, keys are reused. + let targets = TargetsBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + let signed_targets = + Signed::from_signed(targets, &[targets_key_1.clone(), targets_key_1.clone()]).unwrap(); + + let snapshot = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + let signed_snapshot = + Signed::from_signed(snapshot.clone(), &[(snapshot_key.clone())]).unwrap(); + + verify_targets( + &signed_root.to_der().unwrap(), + &signed_snapshot.to_der().unwrap(), + &signed_targets.to_der().unwrap(), + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted targets file that reused keys to meet threshold"); + + // Case: signatures from keys not specified for the role. + let targets = TargetsBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + let signed_targets = Signed::from_signed( + targets, + &[ + Ed25519Dalek(SigningKey::generate(&mut csprng)), + Ed25519Dalek(SigningKey::generate(&mut csprng)), + ], + ) + .unwrap(); + + let snapshot = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .with_meta(b"targets.der", &signed_targets.to_der().unwrap(), 1) + .build(); + let signed_snapshot = + Signed::from_signed(snapshot.clone(), &[(snapshot_key.clone())]).unwrap(); + + verify_targets( + &signed_root.to_der().unwrap(), + &signed_snapshot.to_der().unwrap(), + &signed_targets.to_der().unwrap(), + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted targets file that used untrusted keys"); + } +} diff --git a/tuf-no-std/tuf-no-std/src/role/timestamp.rs b/tuf-no-std/tuf-no-std/src/role/timestamp.rs new file mode 100644 index 0000000..370df97 --- /dev/null +++ b/tuf-no-std/tuf-no-std/src/role/timestamp.rs @@ -0,0 +1,544 @@ +use crate::canonical::{EncodeCanonically, EncodingError}; +use crate::role::root::TufRoot; +use crate::role::{DecodeRole, RoleUpdate, TufRole, TufTimestamp}; +use der::asn1::UtcTime; +use der::Encode; +use tuf_no_std_common::remote::TufTransport; +#[cfg(feature = "async")] +use tuf_no_std_common::remote::TufTransportAsync; +use tuf_no_std_common::storage::TufStorage; +use tuf_no_std_common::TufError::{ExpiredTimestampFile, InvalidNewVersionNumber}; +use tuf_no_std_common::{RoleType, TufError, Version}; +use tuf_no_std_der::root::RootRef; +use tuf_no_std_der::timestamp::TimestampRef; +use tuf_no_std_der::SignedRef; + +impl<'a> TufRole for TimestampRef<'a> { + const TYPE: RoleType = RoleType::Timestamp; +} + +impl<'a> EncodeCanonically for TimestampRef<'a> { + fn encode_canonically<'o>(&self, out: &'o mut [u8]) -> Result<&'o [u8], EncodingError> { + self.encode_to_slice(out) + .map_err(|_| EncodingError::BufferTooSmall) + } +} + +impl<'a> RoleUpdate for TimestampRef<'a> { + fn version(&self) -> Version { + self.version + } + + fn expires(&self) -> UtcTime { + self.expires + } +} + +impl<'a> TufTimestamp for TimestampRef<'a> { + fn snapshot_version(&self) -> Version { + self.meta.version + } + + fn snapshot_expires(&self) -> UtcTime { + self.expires + } + + fn snapshot_hash(&self) -> [u8; 32] { + self.meta + .hashes + .get(0) + .expect("expected at least one hash") + .value + .as_bytes() + .and_then(|h| TryInto::try_into(h).ok()) + .unwrap() + } +} + +pub(crate) fn verify_timestamp<'a>( + root: &[u8], + timestamp_old: Option<&'a [u8]>, + timestamp_new: &'a [u8], + update_start: &UtcTime, +) -> Result<&'a [u8], TufError> { + let root = SignedRef::::decode_role(root)?; + let timestamp_new_decoded = SignedRef::::decode_role(timestamp_new)?; + + root.verify_role(×tamp_new_decoded)?; + + if let Some(timestamp_old) = timestamp_old { + let timestamp_old_decoded = SignedRef::::decode_role(timestamp_old)?; + if timestamp_new_decoded.version() < timestamp_old_decoded.version() { + return Err(InvalidNewVersionNumber); + } + if timestamp_new_decoded.snapshot_version() < timestamp_old_decoded.snapshot_version() { + return Err(InvalidNewVersionNumber); + } + // From the TUF spec: 'In case [the version numbers] are equal, + // discard the new timestamp metadata and abort the update cycle. + // This is normal and it shouldn’t raise any error.' + if timestamp_new_decoded.version() == timestamp_old_decoded.version() { + return Ok(timestamp_old); + } + } + + if ×tamp_new_decoded.expires() < update_start { + return Err(ExpiredTimestampFile); + } + Ok(timestamp_new) +} + +pub(crate) fn update_timestamp( + remote: &mut T, + storage: &mut S, + update_start: &UtcTime, +) -> Result<(), TufError> +where + S: TufStorage, + T: TufTransport, +{ + let current_root = storage.current_root(); + let mut buf = [0u8; 512]; + let timestamp_old = storage.current_timestamp_copy(&mut buf); + let mut buf = [0u8; 512]; + let timestamp = remote + .fetch_timestamp(&mut buf) + .map_err(|_| TufError::FetchError)?; + let timestamp = verify_timestamp(current_root, timestamp_old, timestamp, update_start)?; + storage.persist_timestamp(timestamp)?; + Ok(()) +} + +#[cfg(feature = "async")] +pub(crate) async fn update_timestamp_async( + remote: &mut T, + storage: &mut S, + update_start: &UtcTime, +) -> Result<(), TufError> +where + S: TufStorage, + T: TufTransportAsync, +{ + let current_root = storage.current_root(); + let mut buf = [0u8; 512]; + let timestamp_old = storage.current_timestamp_copy(&mut buf); + let mut buf = [0u8; 512]; + let timestamp_new = remote + .fetch_timestamp(&mut buf) + .await + .map_err(|_| TufError::FetchError)?; + let timestamp = verify_timestamp(current_root, timestamp_old, timestamp_new, update_start)?; + storage.persist_timestamp(timestamp)?; + Ok(()) +} + +#[cfg(test)] +mod test { + use crate::builder::{RootBuilder, SnapshotBuilder, TargetsBuilder, TimestampBuilder}; + use crate::role::timestamp::verify_timestamp; + use crate::utils::{build_role, spki_from_signing_key, MockStorage, MockTransport}; + use alloc::vec; + use anyhow::anyhow; + use der::asn1::{BitString, UtcTime}; + use der::referenced::OwnedToRef; + use der::{DateTime, Encode}; + use ed25519_dalek::SigningKey; + use rand_core::OsRng; + use tuf_no_std_common::crypto::sign::SigningKey::Ed25519Dalek; + use tuf_no_std_der::root::Root; + use tuf_no_std_der::Signed; + + use super::update_timestamp; + + #[test] + fn test_verify_timestamp() { + let mut csprng = OsRng; + + let root_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key); + + let timestamp_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let timestamp_pub_spki = spki_from_signing_key(×tamp_key); + + let snapshot_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let snapshot_pub_spki = spki_from_signing_key(&snapshot_key); + + let targets_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let targets_pub_spki = spki_from_signing_key(&targets_key); + + let root = RootBuilder::default() + .with_version(1) + .with_expiration_utc(2023, 1, 1, 1, 0, 0) + .with_role_and_key("root", &[root_pub_spki], 1) + .with_role_and_key("snapshot", &[snapshot_pub_spki], 1) + .with_role_and_key("targets", &[targets_pub_spki], 1) + .with_role_and_key("timestamp", &[timestamp_pub_spki], 1) + .build(); + + let signed_root = Signed::from_signed(root, &[root_key]).unwrap(); + + let targets = TargetsBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_targets = Signed::from_signed(targets, &[targets_key.clone()]).unwrap(); + + let mut buf = [0u8; 4096]; + let encoded_targets = signed_targets.encode_to_slice(&mut buf).unwrap(); + + let snapshot = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_meta(b"targets.der", encoded_targets, 1) + .with_version(1) + .build(); + + let signed_snapshot = + Signed::from_signed(snapshot.clone(), &[snapshot_key.clone()]).unwrap(); + + let timestamp = TimestampBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_snapshot("snapshot.der", &signed_snapshot) + .with_version(1) + .build(); + + let signed_timestamp = Signed::from_signed(timestamp, &[timestamp_key]).unwrap(); + + verify_timestamp( + &signed_root.to_der().unwrap(), + None, + &signed_timestamp.to_der().unwrap(), + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect("failed to verify"); + verify_timestamp( + &signed_root.to_der().unwrap(), + None, + &signed_timestamp.to_der().unwrap(), + &DateTime::new(2031, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted expired timestamp"); + } + + #[test] + fn test_verify_timestamp_threshold_not_reached() { + let mut csprng = OsRng; + + let root_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key); + + let timestamp_key_1 = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let timestamp_pub_spki_1 = spki_from_signing_key(×tamp_key_1); + let timestamp_key_2 = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let timestamp_pub_spki_2 = spki_from_signing_key(×tamp_key_2); + let snapshot_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let snapshot_pub_spki = spki_from_signing_key(&snapshot_key); + + let targets_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let targets_pub_spki = spki_from_signing_key(&targets_key); + + let mut keys = vec![ + root_pub_spki.clone(), + targets_pub_spki.clone(), + timestamp_pub_spki_1.clone(), + timestamp_pub_spki_2.clone(), + snapshot_pub_spki.clone(), + ]; + + keys.sort_by_key(|k| k.owned_to_ref().fingerprint_bytes().unwrap()); + let root = Root { + consistent_snapshot: true, + expires: DateTime::new(2030, 1, 1, 0, 0, 0) + .map_err(|err| anyhow!("failed to create DateTime {err:?}")) + .and_then(|d| { + UtcTime::from_date_time(d) + .map_err(|err| anyhow!("failed to create UtcTime {err:?}")) + }) + .expect("could not create date"), + keys, + roles: vec![ + build_role("root", &[root_pub_spki], 1), + build_role("snapshot", &[snapshot_pub_spki], 1), + build_role("targets", &[targets_pub_spki], 1), + build_role( + "timestamp", + &[timestamp_pub_spki_1, timestamp_pub_spki_2], + 2, + ), + ], + spec_version: BitString::from_bytes(b"1.0").unwrap(), + version: 1, + }; + let signed_root = Signed::from_signed(root, &[root_key]).unwrap(); + + let targets = TargetsBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_targets = Signed::from_signed(targets, &[targets_key.clone()]).unwrap(); + + let mut buf = [0u8; 4096]; + let encoded_targets = signed_targets.encode_to_slice(&mut buf).unwrap(); + + let snapshot = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_meta(b"targets.der", encoded_targets, 1) + .with_version(1) + .build(); + + let signed_snapshot = + Signed::from_signed(snapshot.clone(), &[snapshot_key.clone()]).unwrap(); + + let timestamp = TimestampBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_snapshot("snapshot.der", &signed_snapshot) + .with_version(1) + .build(); + + let signed_timestamp = Signed::from_signed( + timestamp.clone(), + &[ + Ed25519Dalek(SigningKey::generate(&mut csprng)), + Ed25519Dalek(SigningKey::generate(&mut csprng)), + ], + ) + .unwrap(); + verify_timestamp( + &signed_root.to_der().unwrap(), + None, + &signed_timestamp.to_der().unwrap(), + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted timestamp signed by unknown keys"); + + let signed_timestamp = Signed::from_signed(timestamp.clone(), &[]).unwrap(); + verify_timestamp( + &signed_root.to_der().unwrap(), + None, + &signed_timestamp.to_der().unwrap(), + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted timestamp without any signatures"); + + let signed_timestamp = + Signed::from_signed(timestamp.clone(), &[timestamp_key_1.clone()]).unwrap(); + verify_timestamp( + &signed_root.to_der().unwrap(), + None, + &signed_timestamp.to_der().unwrap(), + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted timestamp without meeting threshold"); + + let signed_timestamp = Signed::from_signed( + timestamp, + &[timestamp_key_1.clone(), timestamp_key_1.clone()], + ) + .unwrap(); + + verify_timestamp( + &signed_root.to_der().unwrap(), + None, + &signed_timestamp.to_der().unwrap(), + &DateTime::new(2023, 1, 1, 0, 0, 0) + .unwrap() + .try_into() + .unwrap(), + ) + .expect_err("accepted timestamp with duplicate signatures threshold"); + } + + #[test] + fn test_update_timestamp_version_number() { + let mut csprng = OsRng; + + let root_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let root_pub_spki = spki_from_signing_key(&root_key); + + let timestamp_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let timestamp_pub_spki = spki_from_signing_key(×tamp_key); + let snapshot_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let snapshot_pub_spki = spki_from_signing_key(&snapshot_key); + + let targets_key = Ed25519Dalek(SigningKey::generate(&mut csprng)); + let targets_pub_spki = spki_from_signing_key(&targets_key); + + let mut keys = vec![ + root_pub_spki.clone(), + targets_pub_spki.clone(), + timestamp_pub_spki.clone(), + snapshot_pub_spki.clone(), + ]; + + keys.sort_by_key(|k| k.owned_to_ref().fingerprint_bytes().unwrap()); + let root = Root { + consistent_snapshot: true, + expires: DateTime::new(2030, 1, 1, 0, 0, 0) + .map_err(|err| anyhow!("failed to create DateTime {err:?}")) + .and_then(|d| { + UtcTime::from_date_time(d) + .map_err(|err| anyhow!("failed to create UtcTime {err:?}")) + }) + .expect("could not create date"), + keys, + roles: vec![ + build_role("root", &[root_pub_spki], 1), + build_role("snapshot", &[snapshot_pub_spki], 1), + build_role("targets", &[targets_pub_spki], 1), + build_role("timestamp", &[timestamp_pub_spki], 1), + ], + spec_version: BitString::from_bytes(b"1.0").unwrap(), + version: 1, + }; + let signed_root = Signed::from_signed(root, &[root_key]).unwrap(); + + let targets = TargetsBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_version(1) + .build(); + + let signed_targets = Signed::from_signed(targets, &[targets_key.clone()]).unwrap(); + + let mut buf = [0u8; 4096]; + let encoded_targets = signed_targets.encode_to_slice(&mut buf).unwrap(); + + let snapshot = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_meta(b"targets.der", encoded_targets, 1) + .with_version(1) + .build(); + + let signed_snapshot = + Signed::from_signed(snapshot.clone(), &[snapshot_key.clone()]).unwrap(); + + let timestamp = TimestampBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_snapshot("snapshot.der", &signed_snapshot) + .with_version(1) + .build(); + + let signed_timestamp_old = + Signed::from_signed(timestamp.clone(), &[timestamp_key.clone()]).unwrap(); + + let timestamp = TimestampBuilder::default() + .with_expiration_utc(2031, 1, 1, 0, 0, 0) + .with_snapshot("snapshot.der", &signed_snapshot) + .with_version(1) + .build(); + + let signed_timestamp_new = + Signed::from_signed(timestamp.clone(), &[timestamp_key.clone()]).unwrap(); + let mut transport = MockTransport::<_, &[u8]> { + roots: Default::default(), + timestamp: signed_timestamp_new.to_der().unwrap(), + snapshot: vec![], + targets: vec![], + target_files: Default::default(), + }; + let mut storage = MockStorage { + root: signed_root.to_der().unwrap(), + uncommitted_root: None, + timestamp: Some(signed_timestamp_old.to_der().unwrap()), + snapshot: Some(signed_snapshot.to_der().unwrap()), + targets: Some(signed_targets.to_der().unwrap()), + }; + update_timestamp( + &mut transport, + &mut storage, + &UtcTime::from_date_time(DateTime::new(2030, 1, 1, 0, 0, 0).unwrap()).unwrap(), + ) + .expect("this should succeed"); + assert_eq!( + signed_timestamp_old.to_der().unwrap(), + storage.timestamp.unwrap(), + "expected no update to the timestamp" + ); + + // Case: version number is lower than the previous one + let timestamp = TimestampBuilder::default() + .with_expiration_utc(2031, 1, 1, 0, 0, 0) + .with_snapshot("snapshot.der", &signed_snapshot) + .with_version(0) + .build(); + + let signed_timestamp_new = + Signed::from_signed(timestamp.clone(), &[timestamp_key.clone()]).unwrap(); + let mut transport = MockTransport::<_, &[u8]> { + roots: Default::default(), + timestamp: signed_timestamp_new.to_der().unwrap(), + snapshot: vec![], + targets: vec![], + target_files: Default::default(), + }; + let mut storage = MockStorage { + root: signed_root.to_der().unwrap(), + uncommitted_root: None, + timestamp: Some(signed_timestamp_old.to_der().unwrap()), + snapshot: Some(signed_snapshot.to_der().unwrap()), + targets: Some(signed_targets.to_der().unwrap()), + }; + update_timestamp( + &mut transport, + &mut storage, + &UtcTime::from_date_time(DateTime::new(2030, 1, 1, 0, 0, 0).unwrap()).unwrap(), + ) + .expect_err("this should fail"); + + // Case: version number of the snapshot metadata file in the trusted timestamp metadata file + // not less or equal to the one in the new timestamp. + let snapshot = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 0, 0, 0) + .with_meta(b"targets.der", encoded_targets, 1) + .with_version(0) + .build(); + + let signed_snapshot = + Signed::from_signed(snapshot.clone(), &[snapshot_key.clone()]).unwrap(); + + let timestamp = TimestampBuilder::default() + .with_expiration_utc(2031, 1, 1, 0, 0, 0) + .with_snapshot("snapshot.der", &signed_snapshot) + .with_version(2) + .build(); + + let signed_timestamp_new = + Signed::from_signed(timestamp.clone(), &[timestamp_key.clone()]).unwrap(); + assert_eq!(signed_timestamp_new.signed.meta.version, 0); + let mut transport = MockTransport::<_, &[u8]> { + roots: Default::default(), + timestamp: signed_timestamp_new.to_der().unwrap(), + snapshot: vec![], + targets: vec![], + target_files: Default::default(), + }; + let mut storage = MockStorage { + root: signed_root.to_der().unwrap(), + uncommitted_root: None, + timestamp: Some(signed_timestamp_old.to_der().unwrap()), + snapshot: Some(signed_snapshot.to_der().unwrap()), + targets: Some(signed_targets.to_der().unwrap()), + }; + update_timestamp( + &mut transport, + &mut storage, + &UtcTime::from_date_time(DateTime::new(2030, 1, 1, 0, 0, 0).unwrap()).unwrap(), + ) + .expect_err("this should fail"); + } +} diff --git a/tuf-no-std/tuf-no-std/src/signature.rs b/tuf-no-std/tuf-no-std/src/signature.rs new file mode 100644 index 0000000..fe764f6 --- /dev/null +++ b/tuf-no-std/tuf-no-std/src/signature.rs @@ -0,0 +1,18 @@ +use crate::role::TufSignature; +#[cfg(feature = "der")] +use tuf_no_std_der::SignatureRef; + +#[cfg(feature = "der")] +impl<'a> TufSignature for SignatureRef<'a> { + fn raw_sig(&self) -> &[u8] { + self.sig.as_bytes().unwrap() + } + + fn keyid(&self) -> [u8; 32] { + self.keyid + .as_bytes() + .ok_or(()) + .and_then(|keyid| TryFrom::try_from(keyid).map_err(|_| ())) + .unwrap() + } +} diff --git a/tuf-no-std/tuf-no-std/src/utils.rs b/tuf-no-std/tuf-no-std/src/utils.rs new file mode 100644 index 0000000..5f49b2e --- /dev/null +++ b/tuf-no-std/tuf-no-std/src/utils.rs @@ -0,0 +1,382 @@ +#[cfg(any(test, feature = "memory-transport"))] +use der::asn1::BitString; +#[cfg(any(test, feature = "memory-transport"))] +use spki::SubjectPublicKeyInfoOwned; +#[cfg(any(test, feature = "memory-transport"))] +use tuf_no_std_common::common::Threshold; +#[cfg(any(test, feature = "memory-transport"))] +use tuf_no_std_der::{KeyId, Role}; + +#[cfg(any(test, feature = "memory-transport"))] +use alloc::vec::Vec; +#[cfg(any(test, feature = "memory-transport"))] +use core::num::NonZeroU64; + +#[cfg(any(test, feature = "memory-transport"))] +use tuf_no_std_common::remote::TufTransport; + +use tuf_no_std_common::storage::TufStorage; +use tuf_no_std_common::TufError; + +#[cfg(test)] +pub(crate) fn spki_from_signing_key( + key: &tuf_no_std_common::crypto::sign::SigningKey, +) -> SubjectPublicKeyInfoOwned { + key.as_spki().unwrap() +} + +#[cfg(test)] +pub(crate) fn build_role( + name: &str, + spkis: &[SubjectPublicKeyInfoOwned], + threshold: Threshold, +) -> Role { + Role { + keyids: spkis + .iter() + .map(|spki| KeyId::from_bytes(spki.fingerprint_bytes().unwrap().as_slice()).unwrap()) + .collect(), + threshold, + name: BitString::from_bytes(name.as_bytes()).unwrap(), + } +} + +#[cfg(test)] +#[derive(Default, Clone)] +pub(crate) struct MockStorage { + pub root: Vec, + pub uncommitted_root: Option>, + pub timestamp: Option>, + pub snapshot: Option>, + pub targets: Option>, +} + +#[cfg(test)] +impl TufStorage for MockStorage { + fn delete_timestamp_metadata(&mut self) { + self.timestamp = None + } + + fn delete_snapshot_metadata(&mut self) { + self.snapshot = None + } + + fn persist_root(&mut self, data: &[u8]) -> Result<(), TufError> { + self.uncommitted_root = Some(data.to_vec()); + Ok(()) + } + + fn persist_timestamp(&mut self, data: &[u8]) -> Result<(), TufError> { + self.timestamp = Some(data.to_vec()); + Ok(()) + } + + fn persist_snapshot(&mut self, data: &[u8]) -> Result<(), TufError> { + self.snapshot = Some(data.to_vec()); + Ok(()) + } + + fn persist_targets(&mut self, data: &[u8]) -> Result<(), TufError> { + self.targets = Some(data.to_vec()); + Ok(()) + } + + fn commit_root(&mut self) -> Result<(), TufError> { + //self.root = self.uncommitted_root.as_ref().expect("missing new root").clone(); + //self.uncommitted_root = None; + Ok(()) + } + + fn current_root(&self) -> &[u8] { + &self.root + } + + fn current_root_copy<'o>(&self, out: &'o mut [u8]) -> &'o [u8] { + out[..self.root.len()].copy_from_slice(self.root.as_slice()); + &out[..self.root.len()] + } + + fn current_uncommitted_root_copy<'o>(&self, out: &'o mut [u8]) -> Option<&'o [u8]> { + match self.uncommitted_root.as_ref() { + None => None, + Some(root) => { + out[..root.len()].copy_from_slice(root.as_slice()); + Some(&out[..root.len()]) + } + } + } + + fn current_uncommitted_root(&self) -> Option<&[u8]> { + self.uncommitted_root.as_ref().map(AsRef::as_ref) + } + + fn current_timestamp(&self) -> Option<&[u8]> { + self.timestamp.as_ref().map(AsRef::as_ref) + } + + fn current_timestamp_copy<'o>(&self, out: &'o mut [u8]) -> Option<&'o [u8]> { + let data = self.timestamp.as_deref()?; + let out = &mut out[..data.len()]; + out.copy_from_slice(data); + Some(out) + } + + fn current_snapshot(&self) -> Option<&[u8]> { + self.snapshot.as_ref().map(AsRef::as_ref) + } + + fn current_snapshot_copy<'o>(&self, out: &'o mut [u8]) -> Option<&'o [u8]> { + let data = self.snapshot.as_deref()?; + let out = &mut out[..data.len()]; + out.copy_from_slice(data); + Some(out) + } + + fn current_targets(&self) -> Option<&[u8]> { + self.targets.as_ref().map(AsRef::as_ref) + } +} + +#[cfg(any(test, feature = "memory-transport"))] +#[derive(Default, Clone)] +pub struct MockTransport { + pub roots: heapless::FnvIndexMap, + pub timestamp: V, + pub snapshot: V, + pub targets: V, + pub target_files: heapless::FnvIndexMap, +} + +#[cfg(any(test, feature = "memory-transport"))] +fn check_size_and_copy<'o>( + src: &[u8], + out: &'o mut [u8], +) -> Result<&'o [u8], tuf_no_std_common::remote::TransportError> { + if out.len() < src.len() { + return Err(tuf_no_std_common::remote::TransportError::FetchError); + } + let (out_buf, _) = out.split_at_mut(src.len()); + out_buf.copy_from_slice(src); + Ok(out_buf) +} + +#[cfg(any(test, feature = "memory-transport"))] +impl, K: AsRef<[u8]>> TufTransport for MockTransport { + fn fetch_root<'o>( + &self, + version: NonZeroU64, + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std_common::remote::TransportError> { + let root_file = self + .roots + .get(&version) + .ok_or(tuf_no_std_common::remote::TransportError::FetchError)?; + check_size_and_copy(root_file.as_ref(), out) + } + + fn fetch_timestamp<'o>( + &self, + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std_common::remote::TransportError> { + check_size_and_copy(self.timestamp.as_ref(), out) + } + + fn fetch_snapshot<'o>( + &self, + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std_common::remote::TransportError> { + check_size_and_copy(self.snapshot.as_ref(), out) + } + + fn fetch_targets<'o>( + &self, + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std_common::remote::TransportError> { + check_size_and_copy(self.targets.as_ref(), out) + } + + fn fetch_target_file<'o>( + &self, + metapath: &[u8], + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std_common::remote::TransportError> { + self.target_files + .iter() + .find(|(p, _)| p.as_ref() == metapath) + .ok_or(tuf_no_std_common::remote::TransportError::FetchError) + .and_then(|(_, f)| check_size_and_copy(f.as_ref(), out)) + } +} + +#[cfg(all(feature = "async", any(test, feature = "memory-transport")))] +impl, K: AsRef<[u8]>> tuf_no_std_common::remote::TufTransportAsync + for MockTransport +{ + async fn fetch_root<'o>( + &self, + version: NonZeroU64, + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std_common::remote::TransportError> { + ::fetch_root(self, version, out) + } + + async fn fetch_timestamp<'o>( + &self, + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std_common::remote::TransportError> { + ::fetch_timestamp(self, out) + } + + async fn fetch_snapshot<'o>( + &self, + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std_common::remote::TransportError> { + ::fetch_snapshot(self, out) + } + + async fn fetch_targets<'o>( + &self, + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std_common::remote::TransportError> { + ::fetch_targets(self, out) + } + + async fn fetch_target_file<'o>( + &self, + metapath: &[u8], + out: &'o mut [u8], + ) -> Result<&'o [u8], tuf_no_std_common::remote::TransportError> { + ::fetch_target_file(self, metapath, out) + } +} + +/// In-memory implementation for TUF storage. Stores the files for the root, timestamp, snapshot and targets roles. +pub struct MemoryStorage { + pub root: heapless::Vec, + pub uncommitted_root: Option>, + pub timestamp: Option>, + pub snapshot: Option>, + pub targets: Option>, +} + +fn try_copy_from_slice(src: impl AsRef<[u8]>, dst: &mut [u8]) -> Result<&[u8], ()> { + let src = src.as_ref(); + if dst.len() < src.len() { + return Err(()); + } + let dst = &mut dst[..src.len()]; + dst.copy_from_slice(src); + Ok(dst) +} + +impl TufStorage for MemoryStorage { + fn delete_timestamp_metadata(&mut self) { + self.timestamp = None; + } + + fn delete_snapshot_metadata(&mut self) { + self.snapshot = None; + } + + fn persist_root(&mut self, data: &[u8]) -> Result<(), crate::common::TufError> { + self.uncommitted_root = Some( + heapless::Vec::<_, 2048>::from_slice(data) + .map_err(|_| TufError::CouldNotPersistRootMetadata)?, + ); + Ok(()) + } + + fn persist_timestamp(&mut self, data: &[u8]) -> Result<(), crate::common::TufError> { + self.timestamp = Some( + heapless::Vec::<_, 512>::from_slice(data) + .map_err(|_| TufError::CouldNotPersistRootMetadata)?, + ); + Ok(()) + } + + fn persist_snapshot(&mut self, data: &[u8]) -> Result<(), crate::common::TufError> { + self.snapshot = Some( + heapless::Vec::<_, 512>::from_slice(data) + .map_err(|_| TufError::CouldNotPersistRootMetadata)?, + ); + Ok(()) + } + + fn persist_targets(&mut self, data: &[u8]) -> Result<(), crate::common::TufError> { + self.targets = Some( + heapless::Vec::<_, 512>::from_slice(data) + .map_err(|_| TufError::CouldNotPersistRootMetadata)?, + ); + Ok(()) + } + + fn commit_root(&mut self) -> Result<(), crate::common::TufError> { + self.root = self + .uncommitted_root + .take() + .ok_or(TufError::InternalError)?; + Ok(()) + } + + fn current_root(&self) -> &[u8] { + self.root.as_ref() + } + + fn current_root_copy<'o>(&self, out: &'o mut [u8]) -> &'o [u8] { + try_copy_from_slice(&self.root, out).expect("this should be replaced with a Result") + } + + fn current_uncommitted_root_copy<'o>(&self, out: &'o mut [u8]) -> Option<&'o [u8]> { + self.uncommitted_root + .as_ref() + .and_then(|data| try_copy_from_slice(data, out).ok()) + } + + fn current_uncommitted_root(&self) -> Option<&[u8]> { + self.uncommitted_root.as_ref().map(AsRef::as_ref) + } + + fn current_timestamp(&self) -> Option<&[u8]> { + self.timestamp.as_ref().map(AsRef::as_ref) + } + + fn current_timestamp_copy<'o>(&self, out: &'o mut [u8]) -> Option<&'o [u8]> { + self.timestamp + .as_ref() + .and_then(|data| try_copy_from_slice(data, out).ok()) + } + + fn current_snapshot(&self) -> Option<&[u8]> { + self.snapshot.as_ref().map(AsRef::as_ref) + } + + fn current_snapshot_copy<'o>(&self, out: &'o mut [u8]) -> Option<&'o [u8]> { + self.snapshot + .as_ref() + .and_then(|data| try_copy_from_slice(data, out).ok()) + } + + fn current_targets(&self) -> Option<&[u8]> { + self.targets.as_ref().map(AsRef::as_ref) + } +} + +#[cfg(test)] +mod test { + use super::try_copy_from_slice; + + #[test] + fn test_try_copy_from_slice() { + let src = [1, 2]; + let mut dst_0 = [0u8; 0]; + let mut dst_1 = [0u8; 1]; + let mut dst_2 = [0u8; 2]; + let mut dst_3 = [0u8; 3]; + let mut dst_4 = [0u8; 4]; + assert_eq!(try_copy_from_slice(src, &mut dst_0), Err(())); + assert_eq!(try_copy_from_slice(src, &mut dst_1), Err(())); + assert_eq!(try_copy_from_slice(src, &mut dst_2), Ok([1, 2].as_slice())); + assert_eq!(try_copy_from_slice(src, &mut dst_3), Ok([1, 2].as_slice())); + assert_eq!(try_copy_from_slice(src, &mut dst_4), Ok([1, 2].as_slice())); + } +} diff --git a/tuf-no-std/tuf-no-std/tests/integration_tests.rs b/tuf-no-std/tuf-no-std/tests/integration_tests.rs new file mode 100644 index 0000000..d6b202f --- /dev/null +++ b/tuf-no-std/tuf-no-std/tests/integration_tests.rs @@ -0,0 +1,282 @@ +use der::asn1::UtcTime; +use der::{DateTime, Decode, Encode}; +use rand_core::OsRng; +use std::collections::BTreeMap; +use std::num::NonZeroU64; +use tuf_no_std::builder::{RootBuilder, SnapshotBuilder, TargetsBuilder, TimestampBuilder}; +use tuf_no_std_common::crypto::sign::SigningKey; +use tuf_no_std_common::remote::{TransportError, TufTransport}; +use tuf_no_std_common::storage::TufStorage; +use tuf_no_std_common::TufError; +use tuf_no_std_der::root::Root; +use tuf_no_std_der::snapshot::Snapshot; +use tuf_no_std_der::targets::Targets; +use tuf_no_std_der::timestamp::Timestamp; +use tuf_no_std_der::Signed; + +fn gen_key() -> SigningKey { + let mut csprng = OsRng; + let key = ed25519_dalek::SigningKey::generate(&mut csprng); + + SigningKey::Ed25519Dalek(key) +} + +#[test] +fn test_out_timestamp() { + Signed::::from_der(include_bytes!("../../out/1.timestamp.der")) + .expect("failed to parse timestamp"); +} + +#[test] +fn test_out_root() { + Signed::::from_der(include_bytes!("../../out/1.root.der")).expect("failed to parse root"); +} + +#[test] +fn test_out_snapshot() { + Signed::::from_der(include_bytes!("../../out/1.snapshot.der")) + .expect("failed to parse snapshot"); +} + +#[test] +fn test_out_targets() { + Signed::::from_der(include_bytes!("../../out/1.targets.der")) + .expect("failed to parse targets"); +} + +#[test] +fn test() { + let target_file = b"Hello World!"; + + let root_key = gen_key(); + let timestamp_key = gen_key(); + let snapshot_key = gen_key(); + let targets_key = gen_key(); + + let root = RootBuilder::default() + .with_role_and_key("root", &[root_key.as_spki().unwrap()], 1) + .with_role_and_key("timestamp", &[timestamp_key.as_spki().unwrap()], 1) + .with_role_and_key("targets", &[targets_key.as_spki().unwrap()], 1) + .with_role_and_key("snapshot", &[snapshot_key.as_spki().unwrap()], 1) + .with_version(1) + .with_expiration_utc(2030, 1, 1, 1, 1, 1) + .build(); + + let targets = TargetsBuilder::default() + .with_expiration_utc(2030, 1, 1, 1, 1, 1) + .with_version(1) + .with_target(b"hello.txt", target_file) + .build(); + + let signed_root = Signed::from_signed(root, &[root_key]).unwrap(); + let targets_signed = Signed::from_signed(targets.clone(), &[targets_key]).unwrap(); + + let mut buf = [0u8; 4096]; + let targets_signed_encoded = targets_signed.encode_as_file(&mut buf).unwrap(); + let snapshot = SnapshotBuilder::default() + .with_expiration_utc(2030, 1, 1, 1, 1, 1) + .with_version(1) + .with_meta(b"targets.der", targets_signed_encoded, targets.version) + .build(); + + let signed_snapshot = Signed::from_signed(snapshot, &[snapshot_key]).unwrap(); + let timestamp = TimestampBuilder::default() + .with_expiration_utc(2030, 1, 1, 1, 1, 1) + .with_snapshot("snapshot.der", &signed_snapshot) + .with_version(1) + .build(); + + let signed_timestamp = Signed::from_signed(timestamp, &[timestamp_key]).unwrap(); + + let signed_root_encoded = signed_root.to_der().unwrap(); + let signed_timestamp_encoded = signed_timestamp.to_der().unwrap(); + let signed_snapshot_encoded = signed_snapshot.to_der().unwrap(); + let signed_targets_encoded = targets_signed.to_der().unwrap(); + + let mut storage = MockStorage { + root: signed_root_encoded.to_vec(), + uncommitted_root: None, + timestamp: None, + snapshot: None, + targets: None, + }; + let mut transport = MockTransport { + roots: BTreeMap::from([(NonZeroU64::new(1).unwrap(), signed_root_encoded.to_vec())]), + timestamp: signed_timestamp_encoded.to_vec(), + snapshot: signed_snapshot_encoded.to_vec(), + targets: signed_targets_encoded.to_vec(), + target_files: BTreeMap::from([("hello.txt".to_string(), target_file.to_vec())]), + }; + tuf_no_std::update_repo( + &mut storage, + &mut transport, + 10, + &UtcTime::from_date_time(DateTime::new(2023, 1, 1, 0, 0, 0).unwrap()).unwrap(), + ) + .expect("failed to verify valid repo"); + + let mut buf = [0u8; 2048]; + let output = tuf_no_std::fetch_and_verify_target_file( + &mut storage, + &mut transport, + b"hello.txt", + &mut buf, + ) + .expect("failed to fetch and verify file"); + assert_eq!(output, target_file); +} + +// impl TufRepo for Repo {} + +#[derive(Default, Clone)] +struct MockStorage { + pub root: Vec, + pub uncommitted_root: Option>, + pub timestamp: Option>, + pub snapshot: Option>, + pub targets: Option>, +} + +impl TufStorage for MockStorage { + fn delete_timestamp_metadata(&mut self) { + self.timestamp = None + } + + fn delete_snapshot_metadata(&mut self) { + self.snapshot = None + } + + fn persist_root(&mut self, data: &[u8]) -> Result<(), TufError> { + self.uncommitted_root = Some(data.to_vec()); + Ok(()) + } + + fn persist_timestamp(&mut self, data: &[u8]) -> Result<(), TufError> { + self.timestamp = Some(data.to_vec()); + Ok(()) + } + + fn persist_snapshot(&mut self, data: &[u8]) -> Result<(), TufError> { + self.snapshot = Some(data.to_vec()); + Ok(()) + } + + fn persist_targets(&mut self, data: &[u8]) -> Result<(), TufError> { + self.targets = Some(data.to_vec()); + Ok(()) + } + + fn commit_root(&mut self) -> Result<(), TufError> { + //self.root = self.uncommitted_root.as_ref().expect("missing new root").clone(); + //self.uncommitted_root = None; + Ok(()) + } + + fn current_root(&self) -> &[u8] { + &self.root + } + + fn current_root_copy<'o>(&self, out: &'o mut [u8]) -> &'o [u8] { + out[..self.root.len()].copy_from_slice(self.root.as_slice()); + &out[..self.root.len()] + } + + fn current_uncommitted_root_copy<'o>(&self, out: &'o mut [u8]) -> Option<&'o [u8]> { + match self.uncommitted_root.as_ref() { + None => None, + Some(root) => { + out[..root.len()].copy_from_slice(root.as_slice()); + Some(&out[..root.len()]) + } + } + } + + fn current_uncommitted_root(&self) -> Option<&[u8]> { + self.uncommitted_root.as_ref().map(AsRef::as_ref) + } + + fn current_timestamp(&self) -> Option<&[u8]> { + self.timestamp.as_ref().map(AsRef::as_ref) + } + + fn current_timestamp_copy<'o>(&self, out: &'o mut [u8]) -> Option<&'o [u8]> { + match self.timestamp.as_ref() { + None => None, + Some(root) => { + out[..root.len()].copy_from_slice(root.as_slice()); + Some(&out[..root.len()]) + } + } + } + + fn current_snapshot(&self) -> Option<&[u8]> { + self.snapshot.as_ref().map(AsRef::as_ref) + } + + fn current_snapshot_copy<'o>(&self, out: &'o mut [u8]) -> Option<&'o [u8]> { + match self.snapshot.as_ref() { + None => None, + Some(root) => { + out[..root.len()].copy_from_slice(root.as_slice()); + Some(&out[..root.len()]) + } + } + } + + fn current_targets(&self) -> Option<&[u8]> { + self.targets.as_ref().map(AsRef::as_ref) + } +} + +#[derive(Default, Clone)] +pub struct MockTransport { + pub roots: BTreeMap>, + pub timestamp: Vec, + pub snapshot: Vec, + pub targets: Vec, + pub target_files: BTreeMap>, +} + +fn check_size_and_copy<'o>(src: &[u8], out: &'o mut [u8]) -> Result<&'o [u8], TransportError> { + if out.len() < src.len() { + return Err(TransportError::FetchError); + } + let (out_buf, _) = out.split_at_mut(src.len()); + out_buf.copy_from_slice(src); + Ok(out_buf) +} + +impl TufTransport for MockTransport { + fn fetch_root<'o>( + &self, + version: NonZeroU64, + out: &'o mut [u8], + ) -> Result<&'o [u8], TransportError> { + let root_file = self.roots.get(&version).ok_or(TransportError::FetchError)?; + check_size_and_copy(root_file.as_slice(), out) + } + + fn fetch_timestamp<'o>(&self, out: &'o mut [u8]) -> Result<&'o [u8], TransportError> { + check_size_and_copy(self.timestamp.as_slice(), out) + } + + fn fetch_snapshot<'o>(&self, out: &'o mut [u8]) -> Result<&'o [u8], TransportError> { + check_size_and_copy(self.snapshot.as_slice(), out) + } + + fn fetch_targets<'o>(&self, out: &'o mut [u8]) -> Result<&'o [u8], TransportError> { + check_size_and_copy(self.targets.as_slice(), out) + } + + fn fetch_target_file<'o>( + &self, + metapath: &[u8], + out: &'o mut [u8], + ) -> Result<&'o [u8], TransportError> { + self.target_files + .iter() + .find(|(p, _)| p.as_bytes() == metapath) + .ok_or(TransportError::FetchError) + .and_then(|(_, f)| check_size_and_copy(f.as_slice(), out)) + } +}