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

Unified Diff: components/client_update_protocol/ecdsa_unittest.cc

Issue 1956173002: Revert of network_time_tracker: add temporary time protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « components/client_update_protocol/ecdsa.cc ('k') | components/network_time/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/client_update_protocol/ecdsa_unittest.cc
diff --git a/components/client_update_protocol/ecdsa_unittest.cc b/components/client_update_protocol/ecdsa_unittest.cc
index 8c1e933d9038d3327602e631f2a88cbead6b0c4c..ecb4341aae384b23413f21f5b9637700955c1a82 100644
--- a/components/client_update_protocol/ecdsa_unittest.cc
+++ b/components/client_update_protocol/ecdsa_unittest.cc
@@ -46,6 +46,11 @@
ASSERT_TRUE(cup_.get());
}
+ void OverrideNonce(uint32_t nonce) {
+ cup_->request_query_cup2key_ =
+ base::StringPrintf("%d:%u", cup_->pub_key_version_, nonce);
+ }
+
Ecdsa& CUP() { return *cup_.get(); }
private:
@@ -81,7 +86,7 @@
// Invalid ETags must be gracefully rejected without a crash.
std::string query_discard;
CUP().SignRequest("Request_A", &query_discard);
- CUP().OverrideNonceForTesting(8, 12345);
+ OverrideNonce(12345);
// Expect a pass for a well-formed etag.
EXPECT_TRUE(CUP().ValidateResponse(
@@ -233,7 +238,7 @@
TEST_F(CupEcdsaTest, ValidateResponse_TestSigning) {
std::string query_discard;
CUP().SignRequest("Request_A", &query_discard);
- CUP().OverrideNonceForTesting(8, 12345);
+ OverrideNonce(12345);
// How to generate an ECDSA signature:
// echo -n Request_A | sha256sum | cut -d " " -f 1 > h
« no previous file with comments | « components/client_update_protocol/ecdsa.cc ('k') | components/network_time/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698