00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file IIOP_SSL_Connection_Handler.h 00006 * 00007 * IIOP_SSL_Connection_Handler.h,v 1.11 2006/03/14 06:14:35 jtc Exp 00008 * 00009 * @author Ossama Othman <ossama@dre.vanderbilt.edu> 00010 */ 00011 //============================================================================= 00012 00013 00014 #ifndef TAO_IIOP_SSL_CONNECTION_HANDLER_H 00015 #define TAO_IIOP_SSL_CONNECTION_HANDLER_H 00016 00017 #include /**/ "ace/pre.h" 00018 00019 #include "orbsvcs/SSLIOP/SSLIOP_Export.h" 00020 00021 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00022 #pragma once 00023 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00024 00025 #include "orbsvcs/SSLIOP/SSLIOP_Current.h" 00026 00027 #include "orbsvcs/SSLIOPC.h" 00028 #include "tao/IIOP_Connection_Handler.h" 00029 00030 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00031 00032 namespace TAO 00033 { 00034 00035 /** 00036 * @class IIOP_SSL_Connection_Handler 00037 * 00038 * @brief 00039 * IIOP connection handler designed to be "SSL aware," i.e. it is 00040 * aware of the existence of the SSLIOP connection handler. It 00041 * makes sure that SSL session state from a previous connection is 00042 * not associated with the non-SSL connection handled by this 00043 * handler. 00044 * 00045 * This class is just a place holder to create the 00046 * TAO_IIOP_SSL_Transport which does the work of clearing the TSS 00047 * SSL state. 00048 */ 00049 class IIOP_SSL_Connection_Handler : public TAO_IIOP_Connection_Handler 00050 { 00051 public: 00052 00053 /// Constructor. 00054 IIOP_SSL_Connection_Handler (ACE_Thread_Manager* t = 0); 00055 IIOP_SSL_Connection_Handler (TAO_ORB_Core *orb_core, 00056 CORBA::Boolean flag); 00057 00058 /// Destructor. 00059 ~IIOP_SSL_Connection_Handler (void); 00060 00061 }; 00062 00063 // **************************************************************** 00064 00065 /** 00066 * @class Null_SSL_State_Guard 00067 * 00068 * @brief 00069 * This class sets up null TSS SSL state upon instantiation, and 00070 * restores the previous TSS SSL state when that instance goes out 00071 * of scope. 00072 * 00073 * This guard is used to make TSS SSL state configuration and 00074 * deconfiguration during an upcall exception safe. Exceptions are 00075 * not supposed to be propagated up to the scope this guard is used 00076 * in, so this guard may be unnecessary. However, since proper TSS 00077 * SSL state configuration/deconfiguration is critical to proper 00078 * security support, this guard is used to ensure that 00079 * configuration/deconfiguration is exception safe. 00080 */ 00081 class Null_SSL_State_Guard 00082 { 00083 public: 00084 00085 /// Constructor that sets up the null TSS SSL state. 00086 Null_SSL_State_Guard (TAO::SSLIOP::Current_ptr current, 00087 int &result); 00088 00089 /// Destructor that restores the previous TSS SSL state. 00090 ~Null_SSL_State_Guard (void); 00091 00092 private: 00093 00094 /// The SSLIOP::Current implementation that was previously 00095 /// associated with the current thread and invocation. 00096 /** 00097 * It is stored here until the invocation completes, after which 00098 * it placed back into TSS. 00099 */ 00100 TAO::SSLIOP::Current_Impl *previous_current_impl_; 00101 00102 /// Reference to the SSLIOP::Current object. 00103 TAO::SSLIOP::Current_ptr current_; 00104 00105 /// Flag that specifies whether or not setup of the SSLIOP::Current 00106 /// object completed for the current thread and invocation. 00107 bool setup_done_; 00108 00109 }; 00110 00111 } // End TAO namespace. 00112 00113 TAO_END_VERSIONED_NAMESPACE_DECL 00114 00115 #if defined (__ACE_INLINE__) 00116 #include "orbsvcs/SSLIOP/IIOP_SSL_Connection_Handler.inl" 00117 #endif /* __ACE_INLINE__ */ 00118 00119 00120 #include /**/ "ace/post.h" 00121 00122 #endif /* TAO_IIOP_SSL_CONNECTION_HANDLER_H */