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

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

Issue 2113143004: Switch to OpenSSL's |EVP_PKEY_up_ref| signature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « crypto/rsa_private_key.cc ('k') | net/ssl/openssl_client_key_store.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // This test suite uses SSLClientSocket to test the implementation of 5 // This test suite uses SSLClientSocket to test the implementation of
6 // SSLServerSocket. In order to establish connections between the sockets 6 // SSLServerSocket. In order to establish connections between the sockets
7 // we need two additional classes: 7 // we need two additional classes:
8 // 1. FakeSocket 8 // 1. FakeSocket
9 // Connects SSL socket to FakeDataChannel. This class is just a stub. 9 // Connects SSL socket to FakeDataChannel. This class is just a stub.
10 // 10 //
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 const char* private_key_file_name) { 443 const char* private_key_file_name) {
444 client_ssl_config_.send_client_cert = true; 444 client_ssl_config_.send_client_cert = true;
445 client_ssl_config_.client_cert = 445 client_ssl_config_.client_cert =
446 ImportCertFromFile(GetTestCertsDirectory(), cert_file_name); 446 ImportCertFromFile(GetTestCertsDirectory(), cert_file_name);
447 ASSERT_TRUE(client_ssl_config_.client_cert); 447 ASSERT_TRUE(client_ssl_config_.client_cert);
448 448
449 std::unique_ptr<crypto::RSAPrivateKey> key = 449 std::unique_ptr<crypto::RSAPrivateKey> key =
450 ReadTestKey(private_key_file_name); 450 ReadTestKey(private_key_file_name);
451 ASSERT_TRUE(key); 451 ASSERT_TRUE(key);
452 452
453 client_ssl_config_.client_private_key = WrapOpenSSLPrivateKey( 453 EVP_PKEY_up_ref(key->key());
454 crypto::ScopedEVP_PKEY(EVP_PKEY_up_ref(key->key()))); 454 client_ssl_config_.client_private_key =
455 WrapOpenSSLPrivateKey(crypto::ScopedEVP_PKEY(key->key()));
455 } 456 }
456 457
457 void ConfigureClientCertsForServer() { 458 void ConfigureClientCertsForServer() {
458 server_ssl_config_.client_cert_type = 459 server_ssl_config_.client_cert_type =
459 SSLServerConfig::ClientCertType::REQUIRE_CLIENT_CERT; 460 SSLServerConfig::ClientCertType::REQUIRE_CLIENT_CERT;
460 461
461 ScopedX509NameStack cert_names( 462 ScopedX509NameStack cert_names(
462 SSL_load_client_CA_file(GetTestCertsDirectory() 463 SSL_load_client_CA_file(GetTestCertsDirectory()
463 .AppendASCII(kClientCertCAFileName) 464 .AppendASCII(kClientCertCAFileName)
464 .MaybeAsASCII() 465 .MaybeAsASCII()
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 int server_ret = server_socket_->Handshake(handshake_callback.callback()); 1113 int server_ret = server_socket_->Handshake(handshake_callback.callback());
1113 1114
1114 client_ret = connect_callback.GetResult(client_ret); 1115 client_ret = connect_callback.GetResult(client_ret);
1115 server_ret = handshake_callback.GetResult(server_ret); 1116 server_ret = handshake_callback.GetResult(server_ret);
1116 1117
1117 ASSERT_EQ(ERR_SSL_VERSION_OR_CIPHER_MISMATCH, client_ret); 1118 ASSERT_EQ(ERR_SSL_VERSION_OR_CIPHER_MISMATCH, client_ret);
1118 ASSERT_EQ(ERR_SSL_VERSION_OR_CIPHER_MISMATCH, server_ret); 1119 ASSERT_EQ(ERR_SSL_VERSION_OR_CIPHER_MISMATCH, server_ret);
1119 } 1120 }
1120 1121
1121 } // namespace net 1122 } // namespace net
OLDNEW
« no previous file with comments | « crypto/rsa_private_key.cc ('k') | net/ssl/openssl_client_key_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698