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

Side by Side Diff: remoting/protocol/jingle_session.cc

Issue 7054010: Update SSLServerSocket to provide the net::StreamSocket interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix net_unittests and rename things consistently to "handshake". Created 9 years, 6 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 | Annotate | Revision Log
OLDNEW
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 "remoting/protocol/jingle_session.h" 5 #include "remoting/protocol/jingle_session.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "crypto/hmac.h" 9 #include "crypto/hmac.h"
10 #include "crypto/rsa_private_key.h" 10 #include "crypto/rsa_private_key.h"
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 cricket_session_->Terminate(); 464 cricket_session_->Terminate();
465 return false; 465 return false;
466 } 466 }
467 } else { 467 } else {
468 // Create server SSL socket. 468 // Create server SSL socket.
469 net::SSLConfig ssl_config; 469 net::SSLConfig ssl_config;
470 net::SSLServerSocket* socket = net::CreateSSLServerSocket( 470 net::SSLServerSocket* socket = net::CreateSSLServerSocket(
471 pseudotcp, local_cert_, local_private_key_.get(), ssl_config); 471 pseudotcp, local_cert_, local_private_key_.get(), ssl_config);
472 ssl_socket->reset(new SocketWrapper(socket)); 472 ssl_socket->reset(new SocketWrapper(socket));
473 473
474 int ret = socket->Accept(&ssl_connect_callback_); 474 int ret = socket->Handshake(&ssl_connect_callback_);
475 if (ret == net::ERR_IO_PENDING) { 475 if (ret == net::ERR_IO_PENDING) {
476 return true; 476 return true;
477 } else if (ret != net::OK) { 477 } else if (ret != net::OK) {
478 LOG(ERROR) << "Failed to establish SSL connection"; 478 LOG(ERROR) << "Failed to establish SSL connection";
479 cricket_session_->Terminate(); 479 cricket_session_->Terminate();
480 return false; 480 return false;
481 } 481 }
482 } 482 }
483 // Reach here if net::OK is received. 483 // Reach here if net::OK is received.
484 ssl_connect_callback_.Run(net::OK); 484 ssl_connect_callback_.Run(net::OK);
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 611
612 state_ = new_state; 612 state_ = new_state;
613 if (!closed_ && state_change_callback_.get()) 613 if (!closed_ && state_change_callback_.get())
614 state_change_callback_->Run(new_state); 614 state_change_callback_->Run(new_state);
615 } 615 }
616 } 616 }
617 617
618 } // namespace protocol 618 } // namespace protocol
619 619
620 } // namespace remoting 620 } // namespace remoting
OLDNEW
« net/socket/ssl_server_socket_unittest.cc ('K') | « net/socket/ssl_server_socket_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698