| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |