roll: third_party/pigweed/src 705a4a8..123911b (79 commits)

123911b:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321894 roll: luci
fdebd4b:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321893 roll: fuchsia-infra-bazel-rules 8c8da21..66c9912 (58 commits)
918eb78:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320994 pw_metric: Document the new MetricService.Walk RPC
a05539c:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/316695 pw_metric: Add paginated unary Walk RPC
c9a7dae:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321212 pw_ide: Fix pasting and keyboard events in manual build input
86ae903:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321815 pw_assert: Exclude testing CHECK macros if defined
83502da:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321814 pw_async2: Fix typo
edc738e:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321834 pw_multibuf: Add v2 to Android.bp
0d8c20e:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/319824 cleanup: Fix instances of "the the"
a6bd670:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/318833 pw_kernel: Support system linker script templates
fa201d6:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321673 pw_bluetooth_proxy: Mutex l2cap signal identifier increment
d1754c6:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321672 pw_bluetooth_proxy: Register channel after complete ctor
b9b86d5:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321412 pw_i2c_mcuxpresso: Remove unecessary logging in i3c module
3a26f67:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321192 pw_ide: Save last bazel command in txt file instead of vsc settings
cc1da98:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321236 pw_libcxx: Fix clang-tidy warnings with latest clang
b53afe1:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/319822 pw_kernel: Remove debug_add and debug_noop syscalls
7c6aa2c:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/315672 pw_kernel: Add IPC channels
bf773c2:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320936 pw_ide: Remove unused execution_root
7559f62:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321254 pw_tokenizer: Make Java Detokenizer AutoCloseable
5193f86:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321240 workflows.json: Add UBSAN builds and program
0033a6f:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321239 workflows.json: Add TSAN builds and program
225298b:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321238 workflows.json: Add ASAN builds and program
e8c8cdd:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321237 workflows.json: Add "clang_tidy" build
80ce673:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321253 pw_bluetooth_proxy: Move channel registration atomically
4add45f:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321332 docs: Move pw_allocator to stable
540b923:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321175 pw_bluetooth_proxy: Use flushable flag for to-host ACL packets
0462a9b:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/319852 pw_bluetooth_proxy: Reduce log level for acl disconnect
a0c0584:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/319236 pw_bluetooth_proxy: Add gtest repeat instructions
cda169b:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/317141 pw_bluetooth_proxy: Use libc in multibuf allocators for testing
16a14de:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/317139 pw_bluetooth_proxy: Multi-threaded write tests
749dc69:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/317140 pw_bluetooth_proxy: Move PopFrontPayload after all usages
4a55e5a:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/317138 pw_bluetooth_proxy: Add some more logging around l2cap write
d765d7c:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/317137 pw_bluetooth_proxy: Share kTestL2capQueueCapacity across tests
fccd3fb:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/295175 pw_bluetooth_proxy: Avoid running drain if already running
673b243:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/295114 pw_bluetooth_proxy: Mutex new_tx_since_drain_
c34cb4e:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/319817 pw_toolchain: Workaround for missing builtins
ffda917:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320922 pw_async2: Reword codelab waker instructions
d29fcf1:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/319819 pw_async2: Update docs
efc8002:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/318654 doxygen: Update pw_result and pw_status aliases
3c7eaef:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/315172 pw_thread: Provide non-joining creation tests
9704b22:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/319993 pw_multibuf: Add docs and examples for v2
c09a24e:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321173 pw_multibuf: Make conversion constexpr
fb2938f:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321193 workflows.json: Migrate "kernel" program
c76e0b5:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320997 pw_env_setup: Add CIPD support for Zephyr SDK
29cc658:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321021 pw_ide: Integration test compile commands aspect
872ff8b:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/305452 pw_i2c_mcuxpresso: Use non-blocking calls when sending CCC
79bd73d:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320996 pw_tokenizer: Add default_applicable_licenses to internal build files
8b50893:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/314432 pw_snapshot: Update python processor to display logs
3cf4342:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320995 java: Update Java tests for consistency with internal use
8a038e6:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320355 pw_snapshot: Re-enable bazel processor_test
2bf5b5c:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/319172 googletest: Patch the googletest module
3656ced:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/321036 workflows.json: Migrate "default" program
b54ed1b:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320354 pw_log: Allow LogStreamDecoder decoded_log_handler to be omitted
c182580:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320353 pw_log: Update Log.__str__ to ignore empty fields
11b66b2:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320352 pw_log: Ignore missing timestamp fields in LogStreamDecoder
81d9d93:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320894 [owners] Remove ykyyip@google.com from pw_trace_tokenized/OWNERS
61e4015:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320916 pw_ide: Add tests for the compile command fragment merger
4ce07b7:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320457 pw_tokenizer: Internal BUILD files for pw_tokenizer
f5ac987:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320456 pw_tokenizer: JNI detokenizer fixes
5c1328a:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320829 pw_ide: rm arch arg in python compile commands too
050f6af:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320954 pw_async2: Set default task name; use in missing waker crash
02793b0:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320953 pw_async2: Fix codelab key_press_isr impl
fb66eb6:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320952 pw_async2: Fix a codelab typo
b2213f1:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320939 pw_async2: Retain HardwareInit call in step 1 solution
718d96c:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320416 pw_ide: Release v1.9.9
6417ba1:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320920 pw_async2: Namespace Poll & Pending in codelab
33c4e15:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320917 pw_build: Require experimental_platform_in_output_dir
c5c6cb4:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320871 Revert "pw_ide: Do not emit arguments for headers"
32cbe49:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320828 pw_async2: Remove waker guards
72ba76d:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/319914 pw_kernel: Optimize syscall arg lookup
4abbd58:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320823 pw_async2: ItemDropSensor fixes
52cd776:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320861 pw_async2: Correct CLI usage text
acd4079:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/315533 pw_kernel: Allow partial reconfiguration of the PMP
a5778cd:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320820 pw_async2: Give codelab DispenserTask a name
397b276:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/317452 pw_ide: Do not emit arguments for headers
4925447:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320856 pw_multibuf: Reduce severity of multibuf_v2's warning
099aa1c:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320855 pw_grpc: Use UniquePtr for assembly buffer
02a008c:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320854 pw_grpc: Fix handling of settings frame
e0301cf:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/320812 roll: go

Rolled-Repo: https://pigweed.googlesource.com/pigweed/pigweed
Rolled-Commits: 705a4a8e890874..123911bae1b45f
Roll-Count: 1
Roller-URL: https://cr-buildbucket.appspot.com/build/8703705374735187153
GitWatcher: ignore
CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: I761fa1eb6dc723ec211be8658e41aa7757411062
Reviewed-on: https://pigweed-review.googlesource.com/c/open-dice/+/322232
Bot-Commit: Pigweed Roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Commit-Queue: Pigweed Roller <pigweed-roller@pigweed-service-accounts.iam.gserviceaccount.com>
1 file changed
tree: 4c4eba23d644666666747f0f4aa54249384e247e
  1. build_overrides/
  2. docs/
  3. dpe-rs/
  4. images/
  5. include/
  6. src/
  7. third_party/
  8. toolchains/
  9. tools/
  10. .clang-format
  11. .gitignore
  12. .gitmodules
  13. .gn
  14. banner.txt
  15. bootstrap.sh
  16. BUILD.gn
  17. BUILDCONFIG.gn
  18. generate_test_values.py
  19. LICENSE
  20. navbar.md
  21. OWNERS
  22. pigweed.json
  23. pyproject.toml
  24. README.md
  25. run_fuzzer.sh
  26. rustfmt.toml
README.md

Open Profile for DICE

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:

  • Separate CDIs for attestation and sealing use cases
  • Categorized inputs, including values related to verified boot
  • Certified UDS values
  • X.509 or CBOR certificates

Mailing List

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.

Specification

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.

Code

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.

Thirdparty Dependencies

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.

Building and Running Tests

Quick setup

To setup the build environment the first time:

$ git submodule update --init --recursive
$ source bootstrap.sh
$ gn gen out

To build and run tests:

$ ninja -C out

More details

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.

Porting

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.

Style

The Google C++ Style Guide is used. A .clang-format file is provided for convenience.

Incorporating

To incorporate the code into another project, there are a few options:

  • Copy only the necessary code. For example:

    1. Take the main code as is: include/dice/dice.h, src/dice.c

    2. 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.

Size Reports

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.

Thread Safety

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.

Clearing Sensitive Data

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.

  • The caller of this code is responsible for buffers they own (of course).
  • The ops implementations need to clear any copies they make of sensitive data. Both boringssl and mbedtls attempt to zeroize but this may need additional care to integrate correctly. For example, boringssl skips optimization prevention when OPENSSL_NO_ASM is defined (and it is currently defined).
  • Sensitive data may remain in cache.
  • Sensitive data may have been swapped out.
  • Sensitive data may be included in a crash dump.