Adds support for importing ECDSA (NIST-P256) public keys from standard
pem files as KeyMapping objects.
Also refactors key generation to persist keys in standard pem formats
instead of customized JSON format. The pem formats are much more
recognizable in general and also removes the need for the
securesystemslib module.
No-Docs-Update-Reason: module in early development
Change-Id: Ie06808728137e70e35afdceb5254cf6abf20f1ea
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/62441
Commit-Queue: Ali Zhang <alizhang@google.com>
Reviewed-by: Joe Ethier <jethier@google.com>
Adds support for including a root metadata when creating a bundle.
No-Docs-Update-Reason: module in early development.
Change-Id: Ibdced04fd355e8f520d0d3ba6e5cf25276929d72
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/63640
Commit-Queue: Ali Zhang <alizhang@google.com>
Reviewed-by: Joe Ethier <jethier@google.com>
Specifies the targets metadata version when creating an update bundle.
No-Docs-Update-Reason: module in early development
Change-Id: If070da38f7a48b94c282d360ba4af3d8c905f99b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/63166
Reviewed-by: Joe Ethier <jethier@google.com>
Commit-Queue: Ali Zhang <alizhang@google.com>
Since Pigweed already uses virtualenvs for all projects this default
pip feature isn't required. This greatly reduces pip install and thus
bootstrap run times.
Bootstrap Python setup times on a Linux host (three samples):
Before: 3m45s average
3m58.7s
3m40.5s
3m38.3s
After: 1m42s average
1m31.3s
1m48.1s
1m47.6s
No-Docs-Update-Reason: Small Python pip install change.
Change-Id: I0f862a29b4d38aae923021880e99a8696add9b0a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/65940
Pigweed-Auto-Submit: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
- Log errors when attempting to connect.
- Remap "localhost" to the loopback address.
- Add log when the system RPC server starts.
Change-Id: Iffa10fb1ce6a7f8e1e81d32cb955d7549b39146c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/65747
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Display a clear error message when pw::Function is instantiated with
anything other than a function type.
Change-Id: I658b28118c927e38a7ed523b0884ed7131856a32
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/65746
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Unlike FreeRTOS upstream's uxTaskGetSystemState implementation,
we'd like to be able to report on the state of the IDLE task and
any of the user's tasks at that same priority level in case
configIDLE_SHOULD_YIELD is used.
Ergo the thread iteration is changed to include reporting active
threads at priority 0.
No-Docs-Update-Reason: No API change.
Change-Id: I7485457d4dfafb19bd495f31658429acbbd36e9f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/65860
Reviewed-by: Kevin Zeng <zengk@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
pw_hdlc and pw_web_ui can now be embedded into downstream apps.
How to do it:
- craft a downstream WORKSPACE with `local_repository` pointing to
pigweed, and the following `yarn_install` rule:
```
yarn_install(
# Name this npm so that Bazel Label references look like @npm//package
name = "npm",
package_json = "//:package.json",
yarn_lock = "//:yarn.lock",
generate_local_modules_build_files = False,
)
```
You may need (many) more thinggies in your WORKSPACE file.
- add the modules you want in your package.json:
```
yarn link path/to/pigweed/pw_hdlc/ts
```
- in `BUILD.bazel`, add dependencies to your `ts_project` rule:
```
ts_project(
name = "lib",
tsconfig = ":tsconfig",
source_map = True,
declaration = True,
srcs = [
"index.tsx",
],
deps = [
"@npm//:node_modules",
"@pigweed//pw_hdlc/ts:pw_hdlc",
],
)
```
No-Docs-Update-Reason: build system change
Change-Id: I027f01f5eb79d198e94a04580fbf9904b10b75da
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/65600
Reviewed-by: Jared Weinstein <jaredweinstein@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Paul Mathieu <paulmathieu@google.com>
Before this change, the autogenerated TOC also included the top-level
headings within the module documents if they were at the same heading
level as the document title. Example section:
[snip]
* pw_bloat
* pw_blob_store
* Usage
* FileSystem RPC integration
* Size report
* pw_bluetooth_hci
* pw_boot
[snip]
The "Usage" (etc) are subsections of pw_blob_store docs. Arguably we
should not have any headings in the docs at the same level as the title,
but the simplest and most robust fix is just not to display them here.
Change-Id: Ic32843d7572b11edc14af382e893ee4bef6ea946
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/65724
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
Commit-Queue: Ted Pudlik <tpudlik@google.com>
This variable is no longer set by recipe code (pwrev/65640).
Change-Id: Id63d6f33dfffb9dcb406251b39a7770d676fecc2
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/65740
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Commit-Queue: Rob Mohr <mohrr@google.com>
- Update Raw/NanopbFakeChannelOutput so it can be used for both client
and service testing. Record all packets sent and support iterating
over payloads by RPC. Store payloads in a single buffer rather than a
list of fixed-size buffers to support different payload sizes with
less memory.
- Allow encoding/decoding individual proto methods with NanopbSerde.
- Update tests to use the new FakeChannelOutput API.
- Adapt the test method contexts to use the new FakeChannelOutput. A
test server class with improved functionality (and no macros) will be
created in the future.
Requires: pigweed-internal:16580
Change-Id: I10eb11cdf8e7a3ee656d2a00d5a6517bc0179281
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/64962
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
- Rename constexpr variables to use constant style.
- Reduce the number of randomly generated tests. There is plenty of
with the reduced number of tests.
Change-Id: Ifa3179427872fc38921417992080d50972ffa281
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/65500
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
This change adds a user-defined "user_manifest" option to the GN
template for creating update bundles. The user manifest is treated like
any other target payload for the purpose of bundle creation, but has a
unique API on the GN side because it will be treated differently in the
update client on the firmware side.
Tested: Built downtream with and without user_manifest
Change-Id: Id15d8138e17e4a85808ae04b3c014be5f6e3ea18
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/65360
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Joe Ethier <jethier@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
Instead of embedding user metadata in the TargetsMetadata, a
reserved "user_manifest" target file is used to pass the user's
metadata as an opaque blob.
During verification this blob is handed to the backend to verify
when desired.
Requires: pigweed-internal:16500
Change-Id: I111d8cbbfb2a43b68baea0c4b0545e6005a0a9de
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/65361
Reviewed-by: David Rogers <davidrogers@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
- Add the "static_analysis" group that runs clang-tidy to the default
build.
- Remove the "clang_tidy" presubmit step. Instead, have the
"static_analysis" step run clang-tidy and python.lint from GN.
- Fix a few clang-tidy warnings.
- Exclude mbedtls headers from checks.
Change-Id: Ied832e48c9ba46efaebb911ddb82ab0592944ee7
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/64624
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
Update flash-related log messages to use the PW_LOG_MODULE_NAME of
"PW_FLASH" instead of "KVS". Update the error log in
FlashPartition::CheckBounds() to be more clear what the error is.
Change-Id: If35a914162a45aaec1fd029dc4ec09bc05c5ea37
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/65340
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: David Rogers <davidrogers@google.com>
When trying to build a simple CMake project with pw_rpc I found that
I was getting errors importing "pw_log/log.h". This change fixes the
error. It seems that this dependency is included in the BUILD.gn files
and was missing in the CMakeLists.txt
Change-Id: Ica05a7f6004a63a8526f27ff9255456151105695
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/65380
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
Commit-Queue: Yuval Peress <peress@google.com>
- Attempt to seek on read transfers if an out-of-order offset is
requested.
- Remap prepare status codes to standard codes for pw_transfer.
- Update status documentation.
Change-Id: I708c8598fee7d87d5badb1ffa0aff8f46596107b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/65080
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
clang-tidy does not have a simple way to filter specific headers from
checks. This change adds a build arg that filters include paths, rather
than individual header files, from checks. This is done by replacing -I
with -isystem for these paths in the clang-tidy invocation.
Change-Id: Ib0e8739e67fdf57f1dccf23843011f7d85886368
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/64980
Commit-Queue: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Adam MacBeth <amacbeth@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
The language_features.h header was expected to be included in all source
files with the -include option. It was only adding support for one
feature, static_assert with no message, which is easy to avoid when
required. Removing language_features.h simplifies building Pigweed,
particularly when integrating it with an existing build system, and
avoids some hidden "magic" functionality.
Change-Id: Ibb87ed7da6bbbc1bfc3438b8547a14ede9bcce9a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/65241
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
This change adds a new GN template called pw_update_bundle that can be
used to easily serialize update bundles as part of a GN build.
In addition, the API for bundle generation is adjusted so that normal
usage is to explicitly state a full mapping of target names to paths
containing payloads rather than giving a directory and masking out
excludes. The directory-ingesting tooling is left in place as a utility
function that can be used to feed into the new API if desired.
Testing: Includes baseline unit test coverage
Requires: pigweed-internal:16380
Change-Id: Ib8f873c436e00acbab5c84c12eaec56ca33ffdce
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/64201
Reviewed-by: Armando Montanez <amontanez@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Joe Ethier <jethier@google.com>
C++14 is now required for all Pigweed modules.
- Add a section to the style guide about the C++ standard.
- Remove the tokenizer and polyfill C++11 tests.
- Remove the cpp11 GN config.
- Remove unnecessary features and workarounds for C++11.
- Update C++14 tests to use EXPECT_EQ, EXPECT_NE, etc. since these are
supported by C++14, but not C++11.
Change-Id: I6082ff01b4410db8a322cf8cefee60d3787443ff
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/65240
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
WrappedIterator makes it simple to create an iterator that yields items
derived from items in another iterator.
Change-Id: I6146da5fba60866265081905fea6753d328ddefe
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/64961
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
Provides a GN template to use mcuxpresso_builder to generate a
pw_source_set` for a target using an NXP MCUXpresso SDK.
No-Docs-Update-Reason: docs in $dir_pw_build_mcuxpresso
Change-Id: Ibc97a92f3ed2ec54299bc2c9b2201aedb5d781f9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/61801
Commit-Queue: Scott James Remnant <keybuk@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Provides a utility that parses the manifest XML files shipped inside
NXP MCUXpresso SDK packages detailing the SDK components and outputs
the list of sources, headers, etc. corresponding to an included and
excluded list of components.
Change-Id: I0e41cc046fe327860170e48bb561434730ebab55
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/61800
Commit-Queue: Scott James Remnant <keybuk@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
- The FilteredView class applies a filter to a container, allowing
iteration over only matching elements.
- Prevent copying an IntrusiveList::Item, since this would break the
intrusive list the item is in.
Change-Id: Ifefb95c421e057e746440532f0af6505fb2dc32d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/64960
Commit-Queue: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Watching for changes can fail when the max number of instances is
reached. Catch the error and print instructions on how to increase the
max value. This is different from inotify watches which can also fail in
the same way for the same reason.
No-Docs-Update-Reason: bugfix
Change-Id: Ia9df0c21ffcd118b99679476ee8bcebefa91f9ce
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/64802
Commit-Queue: Keir Mierle <keir@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Move the Manager to client.py and keep the transfer classes in
transfer.py. Have pw_transfer itself provide the public interface.
Change-Id: I9825139c0009747f444f687ba16ba10c3d0b63ad
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/64628
Commit-Queue: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Removes the TRANSFERRING state precondition from
NotifyTransferSucceeded, given that the software update service
state may go out of sync with the transfer state in case the
transfer is aborted after the software update state is aborted.
Change-Id: Iff557fd74f949897b55aa3d6f594aba4113bb6fd
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/64625
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Removes the temporary state transitions which permitted
TRANSFERRING state when entering verify and/or apply, instead the
TRANSFERRED state is now required in those places.
Requires: pigweed-internal:16200
Change-Id: I13ad8cd63313e44c79c4e851f80f603a1e9936a4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/64581
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: David Rogers <davidrogers@google.com>
Open() allows an RPC to be created without failing due to early errors.
This is useful when starting a logging RPC at boot, for example.
Bug: b/194329554
Change-Id: I68a0282a6bd5bbe9715444b28b12afd1476e5faa
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/63292
Pigweed-Auto-Submit: Jared Weinstein <jaredweinstein@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Paul Mathieu <paulmathieu@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Refactors the NotifyTransferFinished() hook to instead only be
called on success as NotifyTransferSucceeded().
In addition the method is updated to disable the transfer handler
after transferring is done.
Change-Id: I831a787f48566375cf4d095d5c0a866bc189b59e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/64580
Reviewed-by: David Rogers <davidrogers@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Using call() rather than invoke() will force users to await a response
promise.
Future work is planned to avoid allowing simultaneously using the
callback and promise methods; see b/201680506.
Bug: b/194329554
Change-Id: Ia8529303d227b22f8060a07e9880835c7cc70827
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/63161
Pigweed-Auto-Submit: Jared Weinstein <jaredweinstein@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Paul Mathieu <paulmathieu@google.com>
Testing done:
- bazel run //pw_web_ui:devserver
No-Docs-Update-Reason: infra change with no downstream impact
Change-Id: Ib1a9b9e684bedc803ccf4a43251bcf30cec98899
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/64023
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Paul Mathieu <paulmathieu@google.com>