~ubuntu-branches/ubuntu/breezy/ace/breezy

« back to all changes in this revision

Viewing changes to TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Accept_Strategy.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad, Benjamin Montgomery, Adam Conrad
  • Date: 2005-09-18 22:51:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge) (0.1.2 woody)
  • Revision ID: james.westby@ubuntu.com-20050918225138-seav22q6fyylb536
Tags: 5.4.7-3ubuntu1
[ Benjamin Montgomery ]
* Added a patch for amd64 and powerpc that disables the compiler
  option -fvisibility-inlines-hidden

[ Adam Conrad ]
* Added DPATCH_OPTION_CPP=1 to debian/patches/00options to make
  Benjamin's above changes work correctly with dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// -*- C++ -*-
2
 
 
3
 
//=============================================================================
4
 
/**
5
 
 *  @file    SSLIOP_Accept_Strategy.h
6
 
 *
7
 
 *  SSLIOP_Accept_Strategy.h,v 1.2 2003/07/21 23:51:33 dhinton Exp
8
 
 *
9
 
 *  IIOP/SSL specific accept strategy
10
 
 *
11
 
 *  @author Ossama Othman <ossama@uci.edu>
12
 
 */
13
 
//=============================================================================
14
 
 
15
 
 
16
 
#ifndef TAO_SSLIOP_ACCEPT_STRATEGY_H
17
 
#define TAO_SSLIOP_ACCEPT_STRATEGY_H
18
 
 
19
 
#include /**/ "ace/pre.h"
20
 
 
21
 
#include "ace/config-all.h"
22
 
 
23
 
#if !defined (ACE_LACKS_PRAGMA_ONCE)
24
 
# pragma once
25
 
#endif /* ACE_LACKS_PRAGMA_ONCE */
26
 
 
27
 
#include "SSLIOP_Connection_Handler.h"
28
 
 
29
 
#include "tao/Acceptor_Impl.h"
30
 
 
31
 
#include "ace/SSL/SSL_SOCK_Acceptor.h"
32
 
 
33
 
 
34
 
/**
35
 
 * @class TAO_SSLIOP_Accept_Strategy
36
 
 *
37
 
 * @brief SSLIOP-specific accept strategy that builds on the
38
 
 *        TAO_Accept_Strategy implementation.
39
 
 *
40
 
 * This accept strategy builds on on the TAO_Accept_Strategy
41
 
 * implementation.  It sub-classes that class, and overrides the
42
 
 * accept_svc_handler() method so that a timeout value may be passed
43
 
 * to the underlying peer acceptor.  This is necessary to defend
44
 
 * against a simple Denial-of-Service attack.
45
 
 * @par
46
 
 * Since SSL requires two handshakes, one TCP and one SSL, it is
47
 
 * possible for a malicious client to establish a TCP connection to
48
 
 * the SSL port, and never complete the SSL handshake.  The underlying
49
 
 * SSL passive connection code would block/hang waiting for the SSL
50
 
 * handshake to complete.  Given enough incomplete connections where
51
 
 * only the TCP handshake is completed, a server process could
52
 
 * potentially run out of available file descriptors, thus preventing
53
 
 * legitimate client connections from being established.
54
 
 * @par.
55
 
 * The timeout defense alluded to above bounds the time this sort of
56
 
 * DoS attack lasts.
57
 
 */
58
 
class TAO_SSLIOP_Accept_Strategy
59
 
  : public TAO_Accept_Strategy<TAO_SSLIOP_Connection_Handler,
60
 
                               ACE_SSL_SOCK_ACCEPTOR>
61
 
{
62
 
public:
63
 
 
64
 
  /// Constructor.
65
 
  TAO_SSLIOP_Accept_Strategy (TAO_ORB_Core * orb_core,
66
 
                              const ACE_Time_Value & timeout);
67
 
 
68
 
  /// Overridden method that forces a passive connection timeout value
69
 
  /// to be passed to the underlying acceptor.
70
 
  virtual int accept_svc_handler (handler_type * svc_handler);
71
 
 
72
 
private:
73
 
 
74
 
  /// The accept() timeout.
75
 
  /**
76
 
   * This timeout includes the overall time to complete the SSL
77
 
   * handshake.  This includes both the TCP handshake and the SSL
78
 
   * handshake.
79
 
   */
80
 
  const ACE_Time_Value timeout_;
81
 
 
82
 
};
83
 
 
84
 
 
85
 
#include /**/ "ace/post.h"
86
 
 
87
 
#endif  /* TAO_SSLIOP_ACCEPT_STRATEGY_H */