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

Side by Side Diff: net/cert/ct_log_response_parser.cc

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 unified diff | Download patch
« no previous file with comments | « net/cert/crl_set_storage.cc ('k') | net/cert/x509_certificate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/cert/ct_log_response_parser.h" 5 #include "net/cert/ct_log_response_parser.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/json/json_value_converter.h" 9 #include "base/json/json_value_converter.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 return false; 120 return false;
121 } 121 }
122 122
123 if (!IsJsonSTHStructurallyValid(parsed_sth)) 123 if (!IsJsonSTHStructurallyValid(parsed_sth))
124 return false; 124 return false;
125 125
126 signed_tree_head->version = SignedTreeHead::V1; 126 signed_tree_head->version = SignedTreeHead::V1;
127 signed_tree_head->tree_size = parsed_sth.tree_size; 127 signed_tree_head->tree_size = parsed_sth.tree_size;
128 signed_tree_head->timestamp = 128 signed_tree_head->timestamp =
129 base::Time::UnixEpoch() + 129 base::Time::UnixEpoch() +
130 base::TimeDelta::FromMilliseconds(parsed_sth.timestamp); 130 base::TimeDelta::FromMilliseconds(
131 static_cast<int64>(parsed_sth.timestamp));
131 signed_tree_head->signature = parsed_sth.signature; 132 signed_tree_head->signature = parsed_sth.signature;
132 memcpy(signed_tree_head->sha256_root_hash, 133 memcpy(signed_tree_head->sha256_root_hash,
133 parsed_sth.sha256_root_hash.c_str(), 134 parsed_sth.sha256_root_hash.c_str(),
134 kSthRootHashLength); 135 kSthRootHashLength);
135 return true; 136 return true;
136 } 137 }
137 138
138 } // namespace ct 139 } // namespace ct
139 140
140 } // namespace net 141 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/crl_set_storage.cc ('k') | net/cert/x509_certificate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698