1// Copyright 2021 The Pigweed Authors 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); you may not 4// use this file except in compliance with the License. You may obtain a copy of 5// the License at 6// 7// https://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12// License for the specific language governing permissions and limitations under 13// the License. 14 15syntax = "proto3"; 16 17package pw.software_update; 18 19import "pw_software_update/tuf.proto"; 20 21message UpdateBundle { 22 // The timestamp role is used for freshness check of the snapshot. Any 23 // project-specific update metadata should go in the top-level 24 // targets_metadata or with the TargetFile information 25 optional SignedTimestampMetadata timestamp_metadata = 1; 26 27 // The snapshot role is used to ensure that the collection of targets_metadata 28 // files is securely consistent (no target metadata mix and match). Any 29 // project-specific update metadata should go in the top-level 30 // targets_metadata or with the TargetFile information 31 optional SignedSnapshotMetadata snapshot_metadata = 2; 32 33 // Map of target metadata name to target metadata. 34 // Target metadata name can be an arbitrary name or a path that describes 35 // where the file lives relative to the base directory of the repository, as 36 // described in the snapshot metadata. e.g. "path/to/target/0". 37 map<string, SignedTargetsMetadata> targets_metadata = 3; 38 39 // Map of target file name to target payload bytes. 40 // Target file name can be an arbitrary name or a path that describes where 41 // the file lives relative to the base directory of the repository, as 42 // described in the target metadata. e.g. "path/to/amber_tools/0". 43 map<string, bytes> target_payloads = 4; 44 45 // If present, a client will attempt to upgrade its on-device trusted root 46 // metadata to the root metadata included in the bundle, following the 47 // standard "Update the root role" flow specified in the TUF spec, but 48 // without "version climbing". 49 // 50 // The exact steps are: 51 // 1. Check if there is a root metadata in the bundle. 52 // 2. If the root metadata IS NOT included, assume on-device root metadata 53 // is up-to-date and continue with the rest of metadata verification. 54 // 3. If the root metadata IS included, verify the new root metadata using 55 // the on-device root metadata. 56 // 4. If the verification is successful, persist new root metadata and 57 // continue with the rest of metadata verification. Otherwise abort the 58 // update session. 59 // 60 // The key deviation from standard flow is the client assumes it can always 61 // directly upgrade to the single new root metadata in the update bundle, 62 // without any step-stone history root metadata. This works only because 63 // we are not supporting (more than 1) root key rotations. 64 optional SignedRootMetadata root_metadata = 5; 65} 66 67// Update bundle metadata 68// Designed to inform the update server what the device currently has in-place. 69// Also used to persist the TUF metadata for use in the verification process. 70// Stored manifest is only written/erased by the update service. In all other 71// contexts the stored manifest is considered read-only. 72message Manifest { 73 map<string, TargetsMetadata> targets_metadata = 1; 74 75 // Insert user manifest target file content here 76 optional bytes user_manifest = 2; 77} 78