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

Side by Side Diff: net/quic/crypto/channel_id_chromium.cc

Issue 1841863002: Update monet. (Closed) Base URL: https://github.com/domokit/monet.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « net/quic/congestion_control/cubic_bytes.cc ('k') | net/quic/crypto/common_cert_set.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/quic/crypto/channel_id_chromium.h" 5 #include "net/quic/crypto/channel_id_chromium.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 25 matching lines...) Expand all
36 memcpy(&data[len1], ChannelIDVerifier::kClientToServerStr, len2); 36 memcpy(&data[len1], ChannelIDVerifier::kClientToServerStr, len2);
37 memcpy(&data[len1 + len2], signed_data.data(), signed_data.size()); 37 memcpy(&data[len1 + len2], signed_data.data(), signed_data.size());
38 std::vector<uint8> der_signature; 38 std::vector<uint8> der_signature;
39 if (!sig_creator->Sign(&data[0], data.size(), &der_signature)) { 39 if (!sig_creator->Sign(&data[0], data.size(), &der_signature)) {
40 return false; 40 return false;
41 } 41 }
42 std::vector<uint8> raw_signature; 42 std::vector<uint8> raw_signature;
43 if (!sig_creator->DecodeSignature(der_signature, &raw_signature)) { 43 if (!sig_creator->DecodeSignature(der_signature, &raw_signature)) {
44 return false; 44 return false;
45 } 45 }
46 memcpy(WriteInto(out_signature, raw_signature.size() + 1), 46 memcpy(base::WriteInto(out_signature, raw_signature.size() + 1),
47 &raw_signature[0], raw_signature.size()); 47 &raw_signature[0], raw_signature.size());
48 return true; 48 return true;
49 } 49 }
50 50
51 std::string ChannelIDKeyChromium::SerializeKey() const { 51 std::string ChannelIDKeyChromium::SerializeKey() const {
52 std::string out_key; 52 std::string out_key;
53 if (!ec_private_key_->ExportRawPublicKey(&out_key)) { 53 if (!ec_private_key_->ExportRawPublicKey(&out_key)) {
54 return std::string(); 54 return std::string();
55 } 55 }
56 return out_key; 56 return out_key;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 } 240 }
241 return status; 241 return status;
242 } 242 }
243 243
244 void ChannelIDSourceChromium::OnJobComplete(Job* job) { 244 void ChannelIDSourceChromium::OnJobComplete(Job* job) {
245 active_jobs_.erase(job); 245 active_jobs_.erase(job);
246 delete job; 246 delete job;
247 } 247 }
248 248
249 } // namespace net 249 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/cubic_bytes.cc ('k') | net/quic/crypto/common_cert_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698