Use string for Signatures protobuf.
To avoid conversion between brillo::Blob and string.
Also use SerializeToString() instead of AppendToString().
Test: update_engine_unittests
Change-Id: I0ad0fb5f45223f9f51f940de727660a9e62052bb
diff --git a/payload_generator/payload_signer.h b/payload_generator/payload_signer.h
index b2d6606..7854e12 100644
--- a/payload_generator/payload_signer.h
+++ b/payload_generator/payload_signer.h
@@ -54,17 +54,17 @@
brillo::Blob* out_signature);
// Sign |hash_data| blob with all private keys in |private_key_paths|, then
- // convert the signatures to protobuf blob.
+ // convert the signatures to serialized protobuf.
static bool SignHashWithKeys(
const brillo::Blob& hash_data,
const std::vector<std::string>& private_key_paths,
- brillo::Blob* out_signature_blob);
+ std::string* out_serialized_signature);
// Given an unsigned payload in |unsigned_payload_path|, private keys in
// |private_key_path|, metadata size in |metadata_size|, metadata signature
// size in |metadata_signature_size| and signatures offset in
// |signatures_offset|, calculates the payload signature blob into
- // |out_signature_blob|. Note that the payload must already have an
+ // |out_serialized_signature|. Note that the payload must already have an
// updated manifest that includes the dummy signature op and correct metadata
// signature size in header. Returns true on success, false otherwise.
static bool SignPayload(const std::string& unsigned_payload_path,
@@ -72,9 +72,9 @@
const uint64_t metadata_size,
const uint32_t metadata_signature_size,
const uint64_t signatures_offset,
- brillo::Blob* out_signature_blob);
+ std::string* out_serialized_signature);
- // Returns the length of out_signature_blob that will result in a call
+ // Returns the length of out_serialized_signature that will result in a call
// to SignPayload with the given private keys. Returns true on success.
static bool SignatureBlobLength(
const std::vector<std::string>& private_key_paths, uint64_t* out_length);