| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/http/http_response_info.h" | 5 #include "net/http/http_response_info.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/pickle.h" | 8 #include "base/pickle.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "net/base/auth.h" | 10 #include "net/base/auth.h" |
| 11 #include "net/base/io_buffer.h" | 11 #include "net/base/io_buffer.h" |
| 12 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
| 13 #include "net/cert/sct_status_flags.h" |
| 13 #include "net/cert/signed_certificate_timestamp.h" | 14 #include "net/cert/signed_certificate_timestamp.h" |
| 14 #include "net/cert/x509_certificate.h" | 15 #include "net/cert/x509_certificate.h" |
| 15 #include "net/http/http_response_headers.h" | 16 #include "net/http/http_response_headers.h" |
| 16 #include "net/ssl/ssl_cert_request_info.h" | 17 #include "net/ssl/ssl_cert_request_info.h" |
| 17 | 18 |
| 18 using base::Time; | 19 using base::Time; |
| 19 | 20 |
| 20 namespace net { | 21 namespace net { |
| 21 | 22 |
| 22 namespace { | 23 namespace { |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 if (flags & RESPONSE_INFO_HAS_SIGNED_CERTIFICATE_TIMESTAMPS) { | 233 if (flags & RESPONSE_INFO_HAS_SIGNED_CERTIFICATE_TIMESTAMPS) { |
| 233 int num_scts; | 234 int num_scts; |
| 234 if (!iter.ReadInt(&num_scts)) | 235 if (!iter.ReadInt(&num_scts)) |
| 235 return false; | 236 return false; |
| 236 for (int i = 0; i < num_scts; ++i) { | 237 for (int i = 0; i < num_scts; ++i) { |
| 237 scoped_refptr<ct::SignedCertificateTimestamp> sct( | 238 scoped_refptr<ct::SignedCertificateTimestamp> sct( |
| 238 ct::SignedCertificateTimestamp::CreateFromPickle(&iter)); | 239 ct::SignedCertificateTimestamp::CreateFromPickle(&iter)); |
| 239 uint16_t status; | 240 uint16_t status; |
| 240 if (!sct.get() || !iter.ReadUInt16(&status)) | 241 if (!sct.get() || !iter.ReadUInt16(&status)) |
| 241 return false; | 242 return false; |
| 243 if (!net::ct::IsValidSCTStatus(status)) |
| 244 return false; |
| 242 ssl_info.signed_certificate_timestamps.push_back( | 245 ssl_info.signed_certificate_timestamps.push_back( |
| 243 SignedCertificateTimestampAndStatus( | 246 SignedCertificateTimestampAndStatus( |
| 244 sct, static_cast<ct::SCTVerifyStatus>(status))); | 247 sct, static_cast<ct::SCTVerifyStatus>(status))); |
| 245 } | 248 } |
| 246 } | 249 } |
| 247 | 250 |
| 248 // Read vary-data | 251 // Read vary-data |
| 249 if (flags & RESPONSE_INFO_HAS_VARY_DATA) { | 252 if (flags & RESPONSE_INFO_HAS_VARY_DATA) { |
| 250 if (!vary_data.InitFromPickle(&iter)) | 253 if (!vary_data.InitFromPickle(&iter)) |
| 251 return false; | 254 return false; |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 case CONNECTION_INFO_HTTP1_0: | 445 case CONNECTION_INFO_HTTP1_0: |
| 443 return "http/1.0"; | 446 return "http/1.0"; |
| 444 case NUM_OF_CONNECTION_INFOS: | 447 case NUM_OF_CONNECTION_INFOS: |
| 445 break; | 448 break; |
| 446 } | 449 } |
| 447 NOTREACHED(); | 450 NOTREACHED(); |
| 448 return ""; | 451 return ""; |
| 449 } | 452 } |
| 450 | 453 |
| 451 } // namespace net | 454 } // namespace net |
| OLD | NEW |