| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived | 5 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived |
| 6 // from AuthCertificateCallback() in | 6 // from AuthCertificateCallback() in |
| 7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. | 7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. |
| 8 | 8 |
| 9 /* ***** BEGIN LICENSE BLOCK ***** | 9 /* ***** BEGIN LICENSE BLOCK ***** |
| 10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 const unsigned char* hello_data; | 352 const unsigned char* hello_data; |
| 353 unsigned hello_data_len; | 353 unsigned hello_data_len; |
| 354 rv = SSL_GetPredictedServerHelloData(nss_fd_, &hello_data, &hello_data_len); | 354 rv = SSL_GetPredictedServerHelloData(nss_fd_, &hello_data, &hello_data_len); |
| 355 if (rv != SECSuccess) { | 355 if (rv != SECSuccess) { |
| 356 NOTREACHED(); | 356 NOTREACHED(); |
| 357 return; | 357 return; |
| 358 } | 358 } |
| 359 if (hello_data_len > std::numeric_limits<uint16>::max()) | 359 if (hello_data_len > std::numeric_limits<uint16>::max()) |
| 360 return; | 360 return; |
| 361 SSLHostInfo::State* state = ssl_host_info_->mutable_state(); | 361 SSLHostInfo::State* state = ssl_host_info_->mutable_state(); |
| 362 state->server_hello = | |
| 363 std::string(reinterpret_cast<const char *>(hello_data), hello_data_len); | |
| 364 | 362 |
| 365 if (hello_data_len > 0) { | 363 if (hello_data_len > 0) { |
| 364 state->server_hello = |
| 365 std::string(reinterpret_cast<const char *>(hello_data), hello_data_len); |
| 366 state->npn_valid = true; | 366 state->npn_valid = true; |
| 367 state->npn_status = GetNextProto(&state->npn_protocol); | 367 state->npn_status = GetNextProto(&state->npn_protocol); |
| 368 } else { | 368 } else { |
| 369 state->server_hello.clear(); |
| 369 state->npn_valid = false; | 370 state->npn_valid = false; |
| 370 } | 371 } |
| 371 | 372 |
| 372 state->certs.clear(); | 373 state->certs.clear(); |
| 373 PeerCertificateChain certs(nss_fd_); | 374 PeerCertificateChain certs(nss_fd_); |
| 374 for (unsigned i = 0; i < certs.size(); i++) { | 375 for (unsigned i = 0; i < certs.size(); i++) { |
| 375 if (certs[i]->derCert.len > std::numeric_limits<uint16>::max()) | 376 if (certs[i]->derCert.len > std::numeric_limits<uint16>::max()) |
| 376 return; | 377 return; |
| 377 | 378 |
| 378 state->certs.push_back(std::string( | 379 state->certs.push_back(std::string( |
| (...skipping 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2482 case SSL_CONNECTION_VERSION_TLS1_1: | 2483 case SSL_CONNECTION_VERSION_TLS1_1: |
| 2483 UpdateConnectionTypeHistograms(CONNECTION_SSL_TLS1_1); | 2484 UpdateConnectionTypeHistograms(CONNECTION_SSL_TLS1_1); |
| 2484 break; | 2485 break; |
| 2485 case SSL_CONNECTION_VERSION_TLS1_2: | 2486 case SSL_CONNECTION_VERSION_TLS1_2: |
| 2486 UpdateConnectionTypeHistograms(CONNECTION_SSL_TLS1_2); | 2487 UpdateConnectionTypeHistograms(CONNECTION_SSL_TLS1_2); |
| 2487 break; | 2488 break; |
| 2488 }; | 2489 }; |
| 2489 } | 2490 } |
| 2490 | 2491 |
| 2491 } // namespace net | 2492 } // namespace net |
| OLD | NEW |