Commit 5e188a81 authored by Joshua Pawlicki's avatar Joshua Pawlicki Committed by Commit Bot

Rotate network time CUP key.

Bug: 1059868
Fixed: 1059868
Change-Id: I18ef0066a357d0eab02568645a02c4f306ae2abc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2095461Reviewed-by: default avatarEmily Stark <estark@chromium.org>
Commit-Queue: Joshua Pawlicki <waffles@chromium.org>
Auto-Submit: Joshua Pawlicki <waffles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748435}
parent ad93a2cf
......@@ -15,26 +15,27 @@ namespace network_time {
// Update as follows:
//
// curl -i http://clients2.google.com/time/1/current?cup2key=2:123123123
// curl -i http://clients2.google.com/time/1/current?cup2key=4:123123123
//
// where 2 is the key version and 123123123 is the nonce. Copy the
// response and the x-cup-server-proof header into
// |kGoodTimeResponseBody| and |kGoodTimeResponseServerProofHeader|
// respectively, and the 'current_time_millis' value of the response
// into |kGoodTimeResponseHandlerJsTime|.
// where 4 is the key version and 123123123 is the nonce. Copy the response
// and the x-cup-server-proof header into |kGoodTimeResponseBody| and
// |kGoodTimeResponseServerProofHeader| respectively, and the
// 'current_time_millis' value of the response into
// |kGoodTimeResponseHandlerJsTime|. Do this twice, so that the two requests
// appear in order below.
const char* kGoodTimeResponseBody[] = {
")]}'\n{\"current_time_millis\":1522081016324,"
"\"server_nonce\":-1.475187036492045E154}",
")]}'\n{\"current_time_millis\":1522096305984,"
"\"server_nonce\":-1.1926302260014708E-276}"};
")]}'\n{\"current_time_millis\":1583777597124,"
"\"server_nonce\":-1.2173462458909911E256}",
")]}'\n{\"current_time_millis\":1583777940456,"
"\"server_nonce\":1.0627453636135456E-51}"};
const char* kGoodTimeResponseServerProofHeader[] = {
"3046022100c0351a20558bac037253f3969547f82805b340f51de06461e83f33b41f8e85d3"
"022100d04162c448438e5462df4bf6171ef26c53ec7d3a0cb915409e8bec6c99c69c67:"
"3045022100f486431d9e9c8d4b7bef1eb9505eefef326bda6e903615543ed934b7741f4609"
"022019d3edc1b14f7dd404cbe42e70c813d2351468b4fbefdbde101494d4f02d1b9d:"
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"304402201758cc66f7be58692362dad351ee71ecce78bd8491c8bfe903da39ea048ff67d02"
"203aa51acfac9462b19ef3e6d6c885a60cb0858a274ae97506934737d8e66bc081:"
"3045022100c98cb7288bcd56d4bcb83aefc3c137dfc77bbbd9b793155b28af02df51fb2074"
"022022f1436e92febeccefab5dfadbe61ca2dc92447b63426a573fcf6419cfbfdba7:"
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"};
const double kGoodTimeResponseHandlerJsTime[] = {1522081016324, 1522096305984};
const double kGoodTimeResponseHandlerJsTime[] = {1583777597124, 1583777940456};
std::unique_ptr<net::test_server::HttpResponse> GoodTimeResponseHandler(
const net::test_server::HttpRequest& request) {
......
......@@ -124,16 +124,16 @@ const char kVariationsServiceRandomQueryProbability[] =
const char kVariationsServiceFetchBehavior[] = "FetchBehavior";
// This is an ECDSA prime256v1 named-curve key.
const int kKeyVersion = 2;
const int kKeyVersion = 4;
const uint8_t kKeyPubBytes[] = {
0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03,
0x42, 0x00, 0x04, 0xc9, 0xde, 0x8e, 0x72, 0x05, 0xb8, 0xb9, 0xec, 0xa4,
0x26, 0xc8, 0x0d, 0xd9, 0x05, 0x59, 0x67, 0xad, 0xd7, 0xf5, 0xf0, 0x46,
0xe4, 0xab, 0xe9, 0x81, 0x67, 0x8b, 0x9d, 0x2a, 0x21, 0x68, 0x22, 0xfe,
0x83, 0xed, 0x9f, 0x80, 0x19, 0x4f, 0xc5, 0x24, 0xac, 0x12, 0x66, 0xc4,
0x4e, 0xf6, 0x8f, 0x54, 0xb5, 0x0c, 0x49, 0xe9, 0xa5, 0xf1, 0x40, 0xfd,
0xd9, 0x1a, 0x92, 0x90, 0x8a, 0x67, 0x15};
0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02,
0x01, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07, 0x03,
0x42, 0x00, 0x04, 0x6E, 0xF3, 0xC6, 0x54, 0xA9, 0x86, 0x09, 0xF1, 0x1C,
0xEE, 0x7B, 0x9D, 0x33, 0xA6, 0x04, 0x8C, 0x44, 0xA2, 0xF7, 0x8C, 0x2D,
0x62, 0x35, 0xB3, 0x67, 0x6F, 0x1D, 0x38, 0x66, 0xF3, 0xBB, 0xAB, 0x0D,
0x6C, 0xCE, 0x93, 0x30, 0x73, 0xBB, 0x33, 0x1D, 0x94, 0xF1, 0xB5, 0xE9,
0x37, 0x13, 0xD9, 0xB2, 0x64, 0x37, 0x89, 0xD0, 0xE2, 0x49, 0xE3, 0x4B,
0x34, 0x0F, 0x81, 0x8E, 0x5C, 0xA8, 0x61};
std::string GetServerProof(
scoped_refptr<net::HttpResponseHeaders> response_headers) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment