Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: delta_performer_unittest.cc

Issue 6778029: AU: detect failure when using public key verification (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: merge master Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « delta_performer.cc ('k') | download_action.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: delta_performer_unittest.cc
diff --git a/delta_performer_unittest.cc b/delta_performer_unittest.cc
index 0c2d9b9a1dd25c56c65c34c10508ecd21725ebd8..9c926d58794fe48d50a2aea3acd0ea67d734db77 100755
--- a/delta_performer_unittest.cc
+++ b/delta_performer_unittest.cc
@@ -450,18 +450,21 @@ void DoSmallImageTest(bool full_kernel, bool full_rootfs, bool noop,
strlen(new_data_string)));
EXPECT_TRUE(utils::FileExists(kUnittestPublicKeyPath));
- bool expect_verify_success =
- signature_test != kSignatureNone &&
- signature_test != kSignatureGeneratedShellBadKey;
- EXPECT_EQ(expect_verify_success,
- performer.VerifyPayload(
- kUnittestPublicKeyPath,
- OmahaHashCalculator::OmahaHashOfData(delta),
- delta.size()));
+ const bool expect_public_verify_failure =
+ signature_test == kSignatureNone ||
+ signature_test == kSignatureGeneratedShellBadKey;
+ bool public_verify_failure = false;
+ EXPECT_TRUE(performer.VerifyPayload(
+ kUnittestPublicKeyPath,
+ OmahaHashCalculator::OmahaHashOfData(delta),
+ delta.size(),
+ &public_verify_failure));
+ EXPECT_EQ(expect_public_verify_failure, public_verify_failure);
EXPECT_TRUE(performer.VerifyPayload(
"/public/key/does/not/exists",
OmahaHashCalculator::OmahaHashOfData(delta),
- delta.size()));
+ delta.size(),
+ NULL));
uint64_t new_kernel_size;
vector<char> new_kernel_hash;
« no previous file with comments | « delta_performer.cc ('k') | download_action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698