Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: net/socket/ssl_client_socket_openssl_unittest.cc

Issue 206453002: Introduce USE_OPENSSL_CERTS for certificate handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698