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

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

Issue 1158923005: Use the exact-width integer types defined in <stdint.h> rather than (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweak comments. Exclude mime_sniffer*. Rebase. Created 5 years, 6 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 unified diff | Download patch
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 DVLOG(1) << "Invalid Signed Tree Head JSON."; 119 DVLOG(1) << "Invalid Signed Tree Head JSON.";
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() + base::TimeDelta::FromMilliseconds(
130 base::TimeDelta::FromMilliseconds( 130 static_cast<int64_t>(parsed_sth.timestamp));
131 static_cast<int64>(parsed_sth.timestamp));
132 signed_tree_head->signature = parsed_sth.signature; 131 signed_tree_head->signature = parsed_sth.signature;
133 memcpy(signed_tree_head->sha256_root_hash, 132 memcpy(signed_tree_head->sha256_root_hash,
134 parsed_sth.sha256_root_hash.c_str(), 133 parsed_sth.sha256_root_hash.c_str(),
135 kSthRootHashLength); 134 kSthRootHashLength);
136 return true; 135 return true;
137 } 136 }
138 137
139 } // namespace ct 138 } // namespace ct
140 139
141 } // namespace net 140 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698