#include <SSLIOP_Accept_Strategy.h>
Inheritance diagram for TAO::SSLIOP::Accept_Strategy:
Public Member Functions | |
Accept_Strategy (TAO_ORB_Core *orb_core, const ACE_Time_Value &timeout) | |
Constructor. | |
virtual int | accept_svc_handler (handler_type *svc_handler) |
Private Attributes | |
const ACE_Time_Value | timeout_ |
The accept() timeout. |
This accept strategy builds on on the TAO_Accept_Strategy implementation. It sub-classes that class, and overrides the accept_svc_handler() method so that a timeout value may be passed to the underlying peer acceptor. This is necessary to defend against a simple Denial-of-Service attack.
Definition at line 65 of file SSLIOP_Accept_Strategy.h.
|
Constructor.
|
|
Overridden method that forces a passive connection timeout value to be passed to the underlying acceptor. Definition at line 20 of file SSLIOP_Accept_Strategy.cpp. References ACE_TRACE, and ACE_Reactor::uses_event_associations().
00021 { 00022 ACE_TRACE ("TAO::SSLIOP::Accept_Strategy::accept_svc_handler"); 00023 00024 // The following code is basically the same code found in 00025 // ACE_Accept_Strategy::accept_svc_handler(). The only difference 00026 // is that a timeout value is passed to the peer acceptor's accept() 00027 // method. A timeout is necessary to prevent malicious or 00028 // misbehaved clients from only completing the TCP handshake and not 00029 // the SSL handshake. Without the timeout, a denial-of-service 00030 // vulnerability would exist where multiple incomplete SSL passive 00031 // connections (i.e. where only the TCP handshake is completed) 00032 // could result in the server process running out of file 00033 // descriptors. That would be due to the SSL handshaking process 00034 // blocking/waiting for the handshake to complete. 00035 00036 // The timeout value will be modified. Make a copy. 00037 ACE_Time_Value timeout (this->timeout_); 00038 00039 // Try to find out if the implementation of the reactor that we are 00040 // using requires us to reset the event association for the newly 00041 // created handle. This is because the newly created handle will 00042 // inherit the properties of the listen handle, including its event 00043 // associations. 00044 const int reset_new_handle = this->reactor_->uses_event_associations (); 00045 00046 if (this->peer_acceptor_.accept (svc_handler->peer (), // stream 00047 0, // remote address 00048 &timeout, // timeout 00049 1, // restart 00050 reset_new_handle // reset new handler 00051 ) == -1) 00052 { 00053 // Close down handler to avoid memory leaks. 00054 svc_handler->close (0); 00055 00056 return -1; 00057 } 00058 else 00059 return 0; 00060 } |
|
The accept() timeout. This timeout includes the overall time to complete the SSL handshake. This includes both the TCP handshake and the SSL handshake. Definition at line 87 of file SSLIOP_Accept_Strategy.h. |