AU: Verify delta payload signature and signed hash.
The signature and hash are verified only if the public key file exists.
This means that currently this feature is desabled until we install a public
key.
BUG=5663
TEST=unit tests, applied a signed delta update on the server
Change-Id: I5be72f7fde88400587f8aae0c7d5745c79fc4428
Review URL: http://codereview.chromium.org/3592008
diff --git a/delta_performer_unittest.cc b/delta_performer_unittest.cc
index 09a4c7d..8c7d2cd 100755
--- a/delta_performer_unittest.cc
+++ b/delta_performer_unittest.cc
@@ -29,6 +29,7 @@
using std::vector;
extern const char* kUnittestPrivateKeyPath;
+extern const char* kUnittestPublicKeyPath;
class DeltaPerformerTest : public ::testing::Test { };
@@ -255,6 +256,9 @@
EXPECT_TRUE(utils::ReadFile(old_kernel, &updated_kernel_partition));
EXPECT_EQ(0, strncmp(&updated_kernel_partition[0], new_data_string,
strlen(new_data_string)));
+
+ EXPECT_TRUE(utils::FileExists(kUnittestPublicKeyPath));
+ EXPECT_TRUE(performer.VerifyPayload(kUnittestPublicKeyPath));
}
} // namespace chromeos_update_engine