Commit Graph

16 Commits

Author SHA1 Message Date
Ali Zhang
e8af38476f pw_software_update: Generate development keys
Adds a keygen module to generate ECDSA keys for development use only.

No-Docs-Update-Reason: Module in development

Change-Id: I42b1336b88fa1b2c5c41b8cdafd97e40668255f5
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/61783
Pigweed-Auto-Submit: Ali Zhang <alizhang@google.com>
Reviewed-by: Joe Ethier <jethier@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2021-09-23 00:00:10 +00:00
Ewout van Bekkum
2d53a2cbb1 pw_software_update/bundled_update_backend: reorder and rename API
Re-orders the BundledUpdateBackend to match the expected sequencing
and makes some small naming adjustments for consistency and improved
legibility/maintainbility.

No-Docs-Update-Reason: Module still in early development
Change-Id: I61cac374b29013ff08b6b1653b27b5dfc2588785
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/61784
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Reviewed-by: David Rogers <davidrogers@google.com>
Reviewed-by: Ali Zhang <alizhang@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
Reviewed-by: Yecheng Zhao <zyecheng@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2021-09-22 23:20:29 +00:00
Ewout van Bekkum
a9133b059e pw_software_update: fixup update backend API
Renames the backend header to match the object name.

Adjusts the FinalizeUpdate() API to use Status again to report
finalize failures before the reboot.

Also changes ApplyTargetFile() to be pure virtual.

Changes the backend API to use the Manifest object instead of the
nanopb struct for the manifest.

Moves the Manifest definition to a separate header.

Adds missing pw_protobuf dependency.

Change-Id: I295db6021b26d8ba96512f4627e39b5a76d92815
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/61820
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Reviewed-by: David Rogers <davidrogers@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2021-09-22 05:01:50 +00:00
Joe Ethier
e0b03f5a21 pw_software_update: Improve help strings
Testing: Changes are help-string only, but unit tests still pass
Change-Id: Iecbe056622c67854385c56697776bba97c98cfac
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/61782
Reviewed-by: Ali Zhang <alizhang@google.com>
Reviewed-by: David Rogers <davidrogers@google.com>
Commit-Queue: Joe Ethier <jethier@google.com>
2021-09-21 23:16:29 +00:00
David Rogers
054771a4e3 pw_software_update: Add finalize and manifest get/update for backend
Add get/update methods for the current manifest in the update backend.
Add FinalzeUpdate method to finish the update and trigger the device
reboot.

No-Docs-Update-Reason: Module still in early development
Change-Id: Ib59e15cedefc865b60e3bbd111e8f5fd0e64ad88
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/61621
Pigweed-Auto-Submit: David Rogers <davidrogers@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2021-09-21 20:18:19 +00:00
Yecheng Zhao
604695e1bd pw_software_update: Parse bundles
Bug: 456
Change-Id: I21e6f8a4e69a037e4c028fc59f9049be1c3b8cdb
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/61341
Reviewed-by: David Rogers <davidrogers@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Yecheng Zhao <zyecheng@google.com>
2021-09-21 18:34:39 +00:00
David Rogers
14267c4f8e pw_software_update: Fix return type for PrepareForUpdate rpc
Fix typo, return PrepareUpdateResult rather than OperationResult
in PrepareForUpdate.

No-Docs-Update-Reason: Typo fix in proto.
Change-Id: Id5946c27b6a17121c8bffcaa1be7530b61f8ad53
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/61344
Reviewed-by: Eric Hsu <ericchhsu@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: David Rogers <davidrogers@google.com>
2021-09-21 17:47:29 +00:00
Ali Zhang
eaf1e547f5 pw_software_update: Fix bugs in update_bundle.py
No-Docs-Update-Reason: bug fix

Change-Id: I97370b61d49bc51eba6c8e4dcb1430ff4440cad1
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/61300
Reviewed-by: Joe Ethier <jethier@google.com>
Commit-Queue: Ali Zhang <alizhang@google.com>
2021-09-17 18:21:59 +00:00
Zihan Chen
f463acd511 pw_software_update: add update_helper and update_service
No-Docs-Update-Reason: this module is far from stablized
Change-Id: I408d575308bcfeb69d6fcb23448472734c729e95
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/59544
Reviewed-by: David Rogers <davidrogers@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
2021-09-14 21:45:43 +00:00
Joe Ethier
f345faa706 pw_software_update: Create unsigned update bundles
Testing: Includes baseline unit test coverage
Change-Id: Idb0dfed54cb52e600a5d1acb0002bf051225a84d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/60043
Commit-Queue: Joe Ethier <jethier@google.com>
Reviewed-by: Ali Zhang <alizhang@google.com>
2021-09-14 00:14:25 +00:00
David Rogers
7b357427a7 pw_software_update: Update TUF bundle proto
Remove the snapshot from the Manifest and add additional comments
on proper metadata use for project-specific information.

No-Docs-Update-Reason: Module still development.
Change-Id: I31b1623b22d02b639ceac121e5d51c4588ba8afc
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/60321
Commit-Queue: David Rogers <davidrogers@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Ali Zhang <alizhang@google.com>
Reviewed-by: Joe Ethier <jethier@google.com>
2021-09-09 21:58:04 +00:00
Yecheng Zhao
637b773dcc pw_software_update: Add UpdateBundle class
Adds an empty UpdateBundle class. It is used by the "Update
Manager" to parse, verify and provide access to a staged firmware
update bundle.

Bug: 456
Change-Id: I2df3e784ef50545f9066d4c1146f2558445ff5c8
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/58043
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Reviewed-by: David Rogers <davidrogers@google.com>
Reviewed-by: Ali Zhang <alizhang@google.com>
Commit-Queue: Yecheng Zhao <zyecheng@google.com>
2021-09-01 19:17:28 +00:00
David Rogers
633d678a59 pw_software_update: Clean up TUF and update bundle protos
Clean up the protos used for update bundle and TUF. Flatten the TUF
protos to be more directly the specific types of metadata.

Change-Id: Ic453b53c2328845ed19eca80925cd0db8a2706db
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/58880
Reviewed-by: Ali Zhang <alizhang@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: David Rogers <davidrogers@google.com>
2021-09-01 18:27:25 +00:00
Ali Zhang
f5eba29068 pw_software_update: Add credit to TUF spec
No-Docs-Update-Reason: N/A

Change-Id: If3741283a3562b6bba3db1c92420ab60728bfe3b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/58201
Commit-Queue: Ali Zhang <alizhang@google.com>
Reviewed-by: David Rogers <davidrogers@google.com>
2021-08-28 20:41:42 +00:00
Joe Ethier
a8a6f474fe pw_software_update: Fixes for downstream use
The protos weren't quite building previously. This change fixes minor
.proto issues, streamlines directory names, and adds pw_software_update
to modules.gni so downstream projects can easily use it.

Testing: Successfully built downstream project dependent on protos.
Change-Id: Iff42b84b0a493acbd47cb516371d2b11eb3087eb
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/58282
Pigweed-Auto-Submit: Joe Ethier <jethier@google.com>
Reviewed-by: Ali Zhang <alizhang@google.com>
Reviewed-by: David Rogers <davidrogers@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2021-08-26 00:34:20 +00:00
Zihan Chen
a6325cd156 pw_software_update: Introduce new module with TUF protos
No-Docs-Update-Reason: executable code is not landed together
Change-Id: I633035855c06f5a62ac3f557bf5ac5115df59e2f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/58100
Pigweed-Auto-Submit: Zihan Chen <zihanchen@google.com>
Reviewed-by: David Rogers <davidrogers@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2021-08-24 22:49:35 +00:00