| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/socket/ssl_client_socket_mac.h" | 5 #include "net/socket/ssl_client_socket_mac.h" |
| 6 | 6 |
| 7 #include <CoreServices/CoreServices.h> | 7 #include <CoreServices/CoreServices.h> |
| 8 #include <netdb.h> | 8 #include <netdb.h> |
| 9 #include <sys/socket.h> | 9 #include <sys/socket.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 private: | 479 private: |
| 480 friend struct base::DefaultLazyInstanceTraits<EnabledCipherSuites>; | 480 friend struct base::DefaultLazyInstanceTraits<EnabledCipherSuites>; |
| 481 EnabledCipherSuites(); | 481 EnabledCipherSuites(); |
| 482 ~EnabledCipherSuites() {} | 482 ~EnabledCipherSuites() {} |
| 483 | 483 |
| 484 std::vector<SSLCipherSuite> ciphers_; | 484 std::vector<SSLCipherSuite> ciphers_; |
| 485 | 485 |
| 486 DISALLOW_COPY_AND_ASSIGN(EnabledCipherSuites); | 486 DISALLOW_COPY_AND_ASSIGN(EnabledCipherSuites); |
| 487 }; | 487 }; |
| 488 | 488 |
| 489 static base::LazyInstance<EnabledCipherSuites> g_enabled_cipher_suites( | 489 static base::LazyInstance<EnabledCipherSuites> g_enabled_cipher_suites = |
| 490 base::LINKER_INITIALIZED); | 490 LAZY_INSTANCE_INITIALIZER; |
| 491 | 491 |
| 492 EnabledCipherSuites::EnabledCipherSuites() { | 492 EnabledCipherSuites::EnabledCipherSuites() { |
| 493 SSLContextRef ssl_context; | 493 SSLContextRef ssl_context; |
| 494 OSStatus status = SSLNewContext(false, &ssl_context); | 494 OSStatus status = SSLNewContext(false, &ssl_context); |
| 495 if (status != noErr) | 495 if (status != noErr) |
| 496 return; | 496 return; |
| 497 | 497 |
| 498 size_t num_supported_ciphers; | 498 size_t num_supported_ciphers; |
| 499 status = SSLGetNumberSupportedCiphers(ssl_context, &num_supported_ciphers); | 499 status = SSLGetNumberSupportedCiphers(ssl_context, &num_supported_ciphers); |
| 500 if (status != noErr) { | 500 if (status != noErr) { |
| (...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1427 if (rv < 0 && rv != ERR_IO_PENDING) { | 1427 if (rv < 0 && rv != ERR_IO_PENDING) { |
| 1428 us->write_io_buf_ = NULL; | 1428 us->write_io_buf_ = NULL; |
| 1429 return OSStatusFromNetError(rv); | 1429 return OSStatusFromNetError(rv); |
| 1430 } | 1430 } |
| 1431 | 1431 |
| 1432 // always lie to our caller | 1432 // always lie to our caller |
| 1433 return noErr; | 1433 return noErr; |
| 1434 } | 1434 } |
| 1435 | 1435 |
| 1436 } // namespace net | 1436 } // namespace net |
| OLD | NEW |