| 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 26 matching lines...) Expand all  Loading... | 
| 37   memcpy(&data[len1], ChannelIDVerifier::kClientToServerStr, len2); | 37   memcpy(&data[len1], ChannelIDVerifier::kClientToServerStr, len2); | 
| 38   memcpy(&data[len1 + len2], signed_data.data(), signed_data.size()); | 38   memcpy(&data[len1 + len2], signed_data.data(), signed_data.size()); | 
| 39   std::vector<uint8> der_signature; | 39   std::vector<uint8> der_signature; | 
| 40   if (!sig_creator->Sign(&data[0], data.size(), &der_signature)) { | 40   if (!sig_creator->Sign(&data[0], data.size(), &der_signature)) { | 
| 41     return false; | 41     return false; | 
| 42   } | 42   } | 
| 43   std::vector<uint8> raw_signature; | 43   std::vector<uint8> raw_signature; | 
| 44   if (!sig_creator->DecodeSignature(der_signature, &raw_signature)) { | 44   if (!sig_creator->DecodeSignature(der_signature, &raw_signature)) { | 
| 45     return false; | 45     return false; | 
| 46   } | 46   } | 
| 47   memcpy(WriteInto(out_signature, raw_signature.size() + 1), | 47   memcpy(base::WriteInto(out_signature, raw_signature.size() + 1), | 
| 48          &raw_signature[0], raw_signature.size()); | 48          &raw_signature[0], raw_signature.size()); | 
| 49   return true; | 49   return true; | 
| 50 } | 50 } | 
| 51 | 51 | 
| 52 std::string ChannelIDKeyChromium::SerializeKey() const { | 52 std::string ChannelIDKeyChromium::SerializeKey() const { | 
| 53   std::string out_key; | 53   std::string out_key; | 
| 54   if (!ec_private_key_->ExportRawPublicKey(&out_key)) { | 54   if (!ec_private_key_->ExportRawPublicKey(&out_key)) { | 
| 55     return std::string(); | 55     return std::string(); | 
| 56   } | 56   } | 
| 57   return out_key; | 57   return out_key; | 
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 223   } | 223   } | 
| 224   return status; | 224   return status; | 
| 225 } | 225 } | 
| 226 | 226 | 
| 227 void ChannelIDSourceChromium::OnJobComplete(Job* job) { | 227 void ChannelIDSourceChromium::OnJobComplete(Job* job) { | 
| 228   active_jobs_.erase(job); | 228   active_jobs_.erase(job); | 
| 229   delete job; | 229   delete job; | 
| 230 } | 230 } | 
| 231 | 231 | 
| 232 }  // namespace net | 232 }  // namespace net | 
| OLD | NEW | 
|---|