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/socket/ssl_client_socket.h" | 5 #include "net/socket/ssl_client_socket.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <openssl/bio.h> | 10 #include <openssl/bio.h> |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 // BIO_free is a macro, it can't be used as a template parameter. | 54 // BIO_free is a macro, it can't be used as a template parameter. |
55 void BIO_free_func(BIO* bio) { | 55 void BIO_free_func(BIO* bio) { |
56 BIO_free(bio); | 56 BIO_free(bio); |
57 } | 57 } |
58 | 58 |
59 typedef crypto::ScopedOpenSSL<BIO, BIO_free_func> ScopedBIO; | 59 typedef crypto::ScopedOpenSSL<BIO, BIO_free_func> ScopedBIO; |
60 typedef crypto::ScopedOpenSSL<RSA, RSA_free> ScopedRSA; | 60 typedef crypto::ScopedOpenSSL<RSA, RSA_free> ScopedRSA; |
61 typedef crypto::ScopedOpenSSL<BIGNUM, BN_free> ScopedBIGNUM; | 61 typedef crypto::ScopedOpenSSL<BIGNUM, BN_free> ScopedBIGNUM; |
62 | 62 |
63 const SSLConfig kDefaultSSLConfig; | 63 const SSLConfig kDefaultSSLConfig; |
64 | 64 #if defined(USE_OPENSSL_CERTS) || defined(OS_ANDROID) |
wtc
2014/03/20 21:14:56
Why do you need to comment out this code?
haavardm
2014/03/21 13:08:21
Thanks, I think I got this wrong. It should probab
| |
65 // A ServerBoundCertStore that always returns an error when asked for a | 65 // A ServerBoundCertStore that always returns an error when asked for a |
66 // certificate. | 66 // certificate. |
67 class FailingServerBoundCertStore : public ServerBoundCertStore { | 67 class FailingServerBoundCertStore : public ServerBoundCertStore { |
68 virtual int GetServerBoundCert(const std::string& server_identifier, | 68 virtual int GetServerBoundCert(const std::string& server_identifier, |
69 base::Time* expiration_time, | 69 base::Time* expiration_time, |
70 std::string* private_key_result, | 70 std::string* private_key_result, |
71 std::string* cert_result, | 71 std::string* cert_result, |
72 const GetCertCallback& callback) OVERRIDE { | 72 const GetCertCallback& callback) OVERRIDE { |
73 return ERR_UNEXPECTED; | 73 return ERR_UNEXPECTED; |
74 } | 74 } |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
353 EnabledFailingChannelID(); | 353 EnabledFailingChannelID(); |
354 SSLConfig ssl_config = kDefaultSSLConfig; | 354 SSLConfig ssl_config = kDefaultSSLConfig; |
355 ssl_config.channel_id_enabled = true; | 355 ssl_config.channel_id_enabled = true; |
356 | 356 |
357 int rv; | 357 int rv; |
358 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); | 358 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); |
359 | 359 |
360 EXPECT_EQ(ERR_UNEXPECTED, rv); | 360 EXPECT_EQ(ERR_UNEXPECTED, rv); |
361 EXPECT_FALSE(sock_->IsConnected()); | 361 EXPECT_FALSE(sock_->IsConnected()); |
362 } | 362 } |
363 | 363 #endif // defined(USE_OPENSSL_CERTS) || defined(OS_ANDROID) |
364 } // namespace | 364 } // namespace |
365 } // namespace net | 365 } // namespace net |
OLD | NEW |