delta_generator: Include metadata signature in major version 2.
--metadata_signature_file flag does what it should now.
Note that you should only pass this flag if the payload you are signing is
version 2.
Bug: 23981164
TEST=unit test added.
Change-Id: I613cd6a5fef188eca37c46c3f8a0a41d1c22f2fd
diff --git a/payload_generator/payload_signer.h b/payload_generator/payload_signer.h
index c2ba340..8691499 100644
--- a/payload_generator/payload_signer.h
+++ b/payload_generator/payload_signer.h
@@ -107,15 +107,17 @@
brillo::Blob* out_metadata_hash);
// Given an unsigned payload in |payload_path| (with no dummy signature op)
- // and the raw |signatures| updates the payload to include the signature thus
- // turning it into a signed payload. The new payload is stored in
- // |signed_payload_path|. |payload_path| and |signed_payload_path| can point
- // to the same file. Populates |out_metadata_size| with the size of the
- // metadata after adding the signature operation in the manifest.Returns true
- // on success, false otherwise.
+ // and the raw |payload_signatures| and |metadata_signatures| updates the
+ // payload to include the signature thus turning it into a signed payload. The
+ // new payload is stored in |signed_payload_path|. |payload_path| and
+ // |signed_payload_path| can point to the same file. Populates
+ // |out_metadata_size| with the size of the metadata after adding the
+ // signature operation in the manifest. Returns true on success, false
+ // otherwise.
static bool AddSignatureToPayload(
const std::string& payload_path,
- const std::vector<brillo::Blob>& signatures,
+ const std::vector<brillo::Blob>& payload_signatures,
+ const std::vector<brillo::Blob>& metadata_signatures,
const std::string& signed_payload_path,
uint64_t* out_metadata_size);