commit | 4af0512ae99e061ab8319487fa3f70a01114b47b | [log] [tgz] |
---|---|---|
author | pigweed-roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com> | Mon Sep 23 00:45:02 2024 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Sep 23 00:45:02 2024 +0000 |
tree | d2205722d02b54c3f45fcee7e325b1b2d479020c | |
parent | cf3f4cc7a3506a33ee3a437544ef6f40056b3563 [diff] |
roll: third_party/pigweed/src f2d25b9..a5a1995 (100 commits) a5a1995:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/237092 targets: Remove implicit extern C cc365b0:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/237227 roll: 310, 311 50af4ca:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/237253 roll: ninja 198260e:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/237252 roll: host, aarch64-unknown-linux-gnu, x86_64-unknown-linux-gnu, aarch64-apple-darwin, x86_64-apple-darwin, thumbv7m-none-eabi e31487f:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/230893 pw_multibuf: Remove MultiBuf's Chunk iterator wrappers 6b20a02:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/237133 bazel: Generate compile commands for Fuchsia da9a7e7:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/237095 pw_transfer: Fix offset receive transfer startup 2db0e0c:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/237046 docs: Update changelog 08c49a4:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236793 bazel: Sort flags in bazelrc 130903f:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/207550 pw_toolchain: Migrate host clang to rules_cc toolchains 0ffb69d:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/237112 pw_result: Add missing CTAD guide to pw::unexpected df5369e:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236797 pw_bluetooth_sapphire: Migrate bt-hci-virtual driver 905bce3:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236453 SEED-123: Reject the SEED 81a348e:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/215742 pw_presubmit: Expand coverage dfbb287:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236992 pw_containers: Fix incorrect comments fd5c648:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236876 docs: Remove borders from inline code 213b6e1:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235857 roll: gn 8a3250d:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/216828 pw_containers: Add IntrusiveMap and IntrusiveMultiMap e8ab2b0:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236896 pw_uart_mcuxpresso: Add support for configuring flow control c1c7dac:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236895 pw_build: Ensure PythonPackages dir tree exists 7f4759a:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235105 pw_containers: Make item type deduction generic 25c8b84:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236795 pw_thread: Comment / docs updates f1f654a:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236572 pw_transfer: Bugfix for start handshake, and rate limit logs 1364b42:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236792 pw_bluetooth_sapphire: Only statically link libc++ 145b457:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236475 pw_ide: Don't fail sync on missing clangd cda5ba6:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235104 pw_bytes: Add PackedPtr faac617:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/233411 pw_system: Make log library header public bec7844:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236741 bazel: Remove redundant flags from bazelrc c5cf4e3:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/215232 pw_thread_freertos: Build unit tests 8a67d6b:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236454 pw_thread: Mark legacy function* / void* constructor as deprecated f8994ac:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236012 pw_bluetooth: Fixes to IsoDataFramePacket b1facaf:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236439 pw_unit_test: Fix failing test with latest GN d5fcc90:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/232211 pw_allocator: Add module config a5c19d3:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236613 pw_bluetooth_sapphire: Statically link bt_host_bin 176d86a:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/232216 pw_toolchain: llvm_clang.BUILD -> llvm_clang_legacy.BUILD part 2/2 01f0043:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236455 docs: Remove emoji in front of links to Gerrit b299522:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235873 pw_protobuf/pw_protobuf_compiler: Basic edition support f27cc84:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236452 pw_toolchain_bazel: Add missing dep in Arm GCC ed299e5:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236266 pw_env_setup: Support patching CIPD packages 49ac120:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236256 roll: buildifier 9d17506:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236232 pw_spi_mcuxpresso: Rename DoConfigure() to DoConfigureLocked() a14882b:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236292 pw_spi: Minor doc enhancements bbe5cd6:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236332 pw_bluetooth_sapphire: Add copts to fuchsia config for boringssl 461c43a:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/229730 pw_toolchain: llvm_clang.BUILD -> llvm_clang_legacy.BUILD part 1/2 170ea86:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236278 roll: bazelisk-as-bazel a4d0441:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236235 bazel: Update BoringSSL to 0.20240913.0 from BCR 4ceb5b8:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/223492 bazel: Introduce do_not_build, do_no_run_test tags eefd313:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235877 pw_spi_linux: Avoid unneccessary ioctl()s in Configure() f66eafb:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235856 roll: ninja cbc47ee:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236152 roll: fuchsia-infra-bazel-rules 905e8e2..b875b81 (4 commits) cc8eb4e:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/234672 pw_env_setup: Add bindgen executable from CIPD 5d8da2e:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/236072 roll: fuchsia-infra-bazel-rules 25df383..905e8e2 (13 commits) 993b55e:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/216112 pw_fuzzer: Improve .bazelrc fuzzing support 82759cc:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235312 pw_allocator: Check for room to split the first block 62d79c9:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235874 pw_env_setup: PyPI version bump to 0.0.18 cac24bc:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235912 bazel: Update to rules_cc 0.0.10 9fb87e7:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/234968 pw_tokenizer: Add token domain support to Detokenizer 22fa494:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235736 pw_env_setup: PyPI version bump to 0.0.17 40f756e:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235712 pw_toolchain: Make toolchain registration configurable 08ff555:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/234412 pw_tokenizer: Use domains in the Python tokens.Database class 7795cfc:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235639 pw_bluetooth_sapphire: Add riscv64 prebuilt 1b888ec:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235633 pw_multibuf: Add missing space to fix docs rendering a60f57b:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235612 pw_env_setup: Update clang next version 900a866:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235317 pw_bluetooth_sapphire: Migrate LEAdvertisingSetTerminated to Emboss b003f5c:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235495 pw_env_setup: Fix out of date constraints 55ff480:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235316 pw_bluetooth_sapphire: Remove unnecessary handle tracking d63a18b:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235354 pw_bluetooth_sapphire: Turn on ISO Host bit if supported 008082a:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235353 pw_bluetooth_sapphire: Basic ServerSupportedFeatures support 0db6c1f:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235315 pw_bluetooth_sapphire: Migrate LERemoveAdvertisingSet command to Emboss 5b61c39:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235374 pw_bluetooth_sapphire: Add structured config values to bt-host pkg 73627bf:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235352 pw_bluetooth_sapphire: Migrate LELongTermKeyRequest event to Emboss 9de41b0:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235314 pw_bluetooth_sapphire: Migrate LE Read Buffer Size v1 event to Emboss cff65b9:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235400 pw_containers: Add test missing from CMake build e017497:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235313 pw_bluetooth_sapphire: Reland "[bt][gap] Update inspect properties for pairing" aae9c54:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235236 Revert "bazel: Skip license collection for now" 2496aee:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235100 pw_transfer: Send continue parameters for already recevied chunks 382fb98:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235394 bazel: Add flag required by ResultStore b0f73fe:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235332 pw_sys_io_stm32cube: Fix UART RX GPIO mode for f1xx family 67b62ad:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/232778 pw_bluetooth_sapphire: Embossify ReadInquiryModeReturnParams cfcbaf5:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/234929 pw_async2: Add more SimulatedTimeProvider utilities 4cf921e:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/234727 pw_bluetooth_sapphire: Import bt_host ab255ad:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235103 bazel: Remove --deleted_packages from bazelrc 5d20ebe:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/234925 pw_crypto: Document micro_ecc's maintenance status 5cf5859:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235159 roll: fuchsia-infra-bazel-rules 0a69be8..25df383 (26 commits) bcff67b:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235155 bazel: Update BoringSSL to 40ec347 7d9c604:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235158 third_party/pigweed: Fix license declaration to make copybara happy 7632a0f:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235232 pw_containers: Fix IntrusiveList iterator cast 88e5d30:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235213 bazel: Update rules_license to 1.0.0 982c7f4:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/233531 pigweed: Use @fuchsia_clang as a cipd repository 3919d96:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/232371 pw_build: Fix Undefined identifier 703588e:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/233945 bazel: Remove dependency on 'products' rule in the SDK 17f512c:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/235212 bazel: Update lockfile 5e148c1:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/234931 pw_system: Support timestamp parser as an argument 3ddcea6:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/234921 bazel: Skip license collection for now bd41046:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/234411 docs: Remove banner 3d63ba4:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/234991 bazel: Fixing license bazel rule for 3p/fuchsia directory 03466a7:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/234913 bazel: Move stm32f429i defines into cc_library df3b7ba:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/233651 pw_containers: Add IntrusiveForwardList size report to the docs 392b259:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/234952 SEED-0103: Reopen for comments 0f14ff3:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/234992 bazel: Increase bes_timeout Rolled-Repo: https://pigweed.googlesource.com/pigweed/pigweed Rolled-Commits: f2d25b993ef813..a5a199593f1375 Roller-URL: https://ci.chromium.org/b/8736048492770338369 GitWatcher: ignore CQ-Do-Not-Cancel-Tryjobs: true Change-Id: I28fe34db2380c4a0744a2adb0c909badb95874de Reviewed-on: https://pigweed-review.googlesource.com/c/open-dice/+/237292 Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com> Bot-Commit: Pigweed Roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com> Commit-Queue: Pigweed Roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com>
This repository contains the specification for the Open Profile for DICE along with production-quality code. This profile is a specialization of the Hardware Requirements for a Device Identifier Composition Engine and DICE Layering Architecture specifications published by the Trusted Computing Group (TCG). For readers already familiar with those specs, notable distinctives of this profile include:
You can find us (and join us!) at https://groups.google.com/g/open-profile-for-dice. We're happy to answer questions and discuss proposed changes or features.
The specification can be found here. It is versioned using a major.minor scheme. Compatibility is maintained across minor versions but not necessarily across major versions.
Production quality, portable C code is included. The main code is in dice.h and dice.c. Cryptographic and certificate generation operations are injected via a set of callbacks. Multiple implementations of these operations are provided, all equally acceptable. Integrators should choose just one of these, or write their own.
Tests are included for all code and the build files in this repository can be used to build and run these tests.
Disclaimer: This is not an officially supported Google product.
Different implementations use different third party libraries. The third_party directory contains build files and git submodules for each of these. The submodules must be initialized once after cloning the repo, using git submodule update --init
, and updated after pulling commits that roll the submodules using git submodule update
.
To setup the build environment the first time:
$ git submodule update --init $ source bootstrap.sh $ gn gen out
To build and run tests:
$ ninja -C out
The easiest way, and currently the only supported way, to build and run tests is from a Pigweed environment on Linux. Pigweed does support other host platforms so it shouldn't be too hard to get this running on Windows for example, but we use Linux.
There are two scripts to help set this up:
bootstrap.sh will initialize submodules, bootstrap a Pigweed environment, and generate build files. This can take some time and may download on the order of 1GB of dependencies so the normal workflow is to just do this once.
activate.sh quickly reactivates an environment that has been previously bootstrapped.
These scripts must be sourced into the current session: source activate.sh
.
In the environment, from the base directory of the dice-profile checkout, run ninja -C out
to build everything and run all tests. You can also run pw watch
which will build, run tests, and continue to watch for changes.
This will build and run tests on the host using the clang toolchain. Pigweed makes it easy to configure other targets and toolchains. See toolchains/BUILD.gn and the Pigweed documentation.
The code is designed to be portable and should work with a variety of modern toolchains and in a variety of environments. The main code in dice.h and dice.c is C99; it uses uint8_t, size_t, and memcpy from the C standard library. The various ops implementations are as portable as their dependencies (often not C99 but still very portable). Notably, this code uses designated initializers for readability. This is a feature available in C since C99 but missing from C++ until C++20 where it appears in a stricter form.
The Google C++ Style Guide is used. A .clang-format
file is provided for convenience.
To incorporate the code into another project, there are a few options:
Copy only the necessary code. For example:
Take the main code as is: include/dice/dice.h, src/dice.c
Choose an implementation for crypto and certificate generation or choose to write your own. If you choose the boringssl implementation, for example, take include/dice/utils.h, include/dice/boringssl_ops.h, src/utils.c, and src/boringssl_ops.c. Taking a look at the library targets in BUILD.gn may be helpful.
Add this repository as a git submodule and integrate into the project build, optionally using the gn library targets provided.
Integrate into a project already using Pigweed using the gn build files provided.
The build reports code size using Bloaty McBloatface via the pw_bloat Pigweed module. There are two reports generated:
Library sizes - This report includes just the library code in this repository. It shows the baseline DICE code with no ops selected, and it shows the delta introduced by choosing various ops implementations. This report does not include the size of the third party dependencies.
Executable sizes - This report includes sizes for the library code in this repository plus all dependencies linked into a simple main function which makes a single DICE call with all-zero input. It shows the baseline DICE code with no ops (and therefore no dependencies other than libc), and it shows the delta introduced by choosing various ops implementations. This report does include the size of the third party dependencies. Note that rows specialized from ‘Boringssl Ops’ use that as a baseline for sizing.
The reports will be in the build output, but you can also find the reports in .txt
files in the build output. For example, cat out/host_optimized/gen/*.txt | less
will display all reports.
This code does not itself use mutable global variables, or any other type of shared data structure so there is no thread-safety concerns. However, additional care is needed to ensure dependencies are configured to be thread-safe. For example, the current boringssl configuration defines OPENSSL_NO_THREADS_CORRUPT_MEMORY_AND_LEAK_SECRETS_IF_THREADED, and that would need to be changed before running in a threaded environment.
This code makes a reasonable effort to clear memory holding sensitive data. This may help with a broader strategy to clear sensitive data but it is not sufficient on its own. Here are a few things to consider.