OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/crypto_handshake_message.h" | 5 #include "net/quic/crypto/crypto_handshake_message.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "net/quic/crypto/crypto_framer.h" | 9 #include "net/quic/crypto/crypto_framer.h" |
10 #include "net/quic/crypto/crypto_protocol.h" | 10 #include "net/quic/crypto/crypto_protocol.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 case kMSPC: | 245 case kMSPC: |
246 case kSWND: | 246 case kSWND: |
247 // uint32 value | 247 // uint32 value |
248 if (it->second.size() == 4) { | 248 if (it->second.size() == 4) { |
249 uint32 value; | 249 uint32 value; |
250 memcpy(&value, it->second.data(), sizeof(value)); | 250 memcpy(&value, it->second.data(), sizeof(value)); |
251 ret += base::UintToString(value); | 251 ret += base::UintToString(value); |
252 done = true; | 252 done = true; |
253 } | 253 } |
254 break; | 254 break; |
255 case kVERS: | |
256 // uint16 value | |
257 if (it->second.size() == 2) { | |
258 uint16 value; | |
259 memcpy(&value, it->second.data(), sizeof(value)); | |
260 ret += base::UintToString(value); | |
261 done = true; | |
262 } | |
263 break; | |
264 case kKEXS: | 255 case kKEXS: |
265 case kAEAD: | 256 case kAEAD: |
266 case kCGST: | 257 case kCGST: |
267 case kPDMD: | 258 case kPDMD: |
268 case kVER: | 259 case kVER: |
269 // tag lists | 260 // tag lists |
270 if (it->second.size() % sizeof(QuicTag) == 0) { | 261 if (it->second.size() % sizeof(QuicTag) == 0) { |
271 for (size_t j = 0; j < it->second.size(); j += sizeof(QuicTag)) { | 262 for (size_t j = 0; j < it->second.size(); j += sizeof(QuicTag)) { |
272 QuicTag tag; | 263 QuicTag tag; |
273 memcpy(&tag, it->second.data() + j, sizeof(tag)); | 264 memcpy(&tag, it->second.data() + j, sizeof(tag)); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 ret += "0x" + base::HexEncode(it->second.data(), it->second.size()); | 306 ret += "0x" + base::HexEncode(it->second.data(), it->second.size()); |
316 } | 307 } |
317 ret += "\n"; | 308 ret += "\n"; |
318 } | 309 } |
319 --indent; | 310 --indent; |
320 ret += string(2 * indent, ' ') + ">"; | 311 ret += string(2 * indent, ' ') + ">"; |
321 return ret; | 312 return ret; |
322 } | 313 } |
323 | 314 |
324 } // namespace net | 315 } // namespace net |
OLD | NEW |