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 |