#include <SSLIOP_Current.h>
Inheritance diagram for TAO::SSLIOP::Current:
Downcast and Reference Counting Methods | |
These are basically the same methods generated by the IDL compiler for all IDL interfaces. | |
virtual const char * | _interface_repository_id (void) const |
Current_ptr | _duplicate (Current_ptr obj) |
Current_ptr | _narrow (CORBA::Object_ptr obj) |
Current_ptr | _nil (void) |
Public Types | |
typedef Current_ptr | _ptr_type |
typedef Current_var | _var_type |
typedef Current_out | _out_type |
Public Member Functions | |
Current (TAO_ORB_Core *orb_core) | |
Constructor. | |
virtual::SSLIOP::ASN_1_Cert * | get_peer_certificate () |
virtual::SSLIOP::SSL_Cert * | get_peer_certificate_chain () |
virtual CORBA::Boolean | no_context (void) |
void | tss_slot (size_t slot) |
Set the TSS slot ID assigned to this object. | |
void | setup (Current_Impl *&prev_impl, Current_Impl *new_impl, bool &setup_done) |
Setup the Current. | |
void | teardown (Current_Impl *prev_impl, bool &setup_done) |
Teardown the Current for this request. | |
Protected Member Functions | |
~Current (void) | |
Destructor. | |
int | implementation (Current_Impl *impl) |
Set the TSS SSLIOP::Current implementation. | |
Current_Impl * | implementation (void) |
Return the TSS SSLIOP::Current implementation. | |
Private Member Functions | |
Current (const Current &) | |
void | operator= (const Current &) |
Private Attributes | |
size_t | tss_slot_ |
TSS slot assigned to this object. | |
TAO_ORB_Core *const | orb_core_ |
This object can be used to obtain SSL session related information about the current execution context. For example, SSL peer certificate chains for the current request can be obtained from this object.
Definition at line 58 of file SSLIOP_Current.h.
|
Reimplemented from CORBA::LocalObject. Definition at line 65 of file SSLIOP_Current.h. |
|
Reimplemented from CORBA::LocalObject. Definition at line 63 of file SSLIOP_Current.h. |
|
Reimplemented from CORBA::LocalObject. Definition at line 64 of file SSLIOP_Current.h. |
|
Constructor.
|
|
Destructor.
Definition at line 22 of file SSLIOP_Current.cpp.
00023 { 00024 } |
|
Prevent copying through the copy constructor and the assignment operator. |
|
Definition at line 127 of file SSLIOP_Current.cpp. References TAO_Local_RefCounted_Object::_add_ref(), TAO::SSLIOP::Current_ptr, and CORBA::is_nil(). Referenced by _narrow(), and tao_TAO_SSLIOP_Current_duplicate().
00128 { 00129 if (!CORBA::is_nil (obj)) 00130 obj->_add_ref (); 00131 00132 return obj; 00133 } |
|
Reimplemented from CORBA::Object. Definition at line 136 of file SSLIOP_Current.cpp.
00137 { 00138 return "IDL:TAO/SSLIOP/Current:1.0"; 00139 } |
|
Reimplemented from CORBA::LocalObject. Definition at line 120 of file SSLIOP_Current.cpp. References _duplicate(). Referenced by ACE_RCSID(), and tao_TAO_SSLIOP_Current_narrow().
00121 { 00122 return TAO::SSLIOP::Current::_duplicate ( 00123 dynamic_cast<TAO::SSLIOP::Current *> (obj)); 00124 } |
|
Reimplemented from CORBA::LocalObject. Definition at line 116 of file SSLIOP_Current.h. References TAO::SSLIOP::Current_ptr. Referenced by tao_TAO_SSLIOP_Current_nil().
00117 { 00118 return (Current_ptr)0; 00119 } |
|
Return the peer certificate associated with the current request. Implements SSLIOP::Current. Definition at line 27 of file SSLIOP_Current.cpp. References ACE_NEW_THROW_EX, SSLIOP::ASN_1_Cert, TAO::SSLIOP::Current_Impl::get_peer_certificate(), and implementation().
00028 { 00029 TAO::SSLIOP::Current_Impl *impl = this->implementation (); 00030 00031 // If the implementation pointer returned from TSS is zero, then 00032 // we're not in the middle of a request or an upcall. Throw an 00033 // exception to indicate that. 00034 if (impl == 0) 00035 throw ::SSLIOP::Current::NoContext (); 00036 00037 // A valid value must always be returned, so instantiate a sequence 00038 // regardless of whether or not it is populated with certificates. 00039 ::SSLIOP::ASN_1_Cert *c = 0; 00040 ACE_NEW_THROW_EX (c, 00041 ::SSLIOP::ASN_1_Cert, 00042 CORBA::NO_MEMORY ( 00043 CORBA::SystemException::_tao_minor_code ( 00044 TAO::VMCID, 00045 ENOMEM), 00046 CORBA::COMPLETED_NO)); 00047 00048 ::SSLIOP::ASN_1_Cert_var certificate = c; 00049 00050 // Populate the sequence with the DER encoded certificate. 00051 impl->get_peer_certificate (c); 00052 00053 return certificate._retn (); 00054 } |
|
Return the certificate chain associated with the current execution context. If no SSL session is being used for the request or upcall, then the NoContext exception is raised. On the client side, the chain does include the peer (server) certficate. However, the certificate chain on the server side does NOT contain the peer (client) certificate. Implements SSLIOP::Current. Definition at line 57 of file SSLIOP_Current.cpp. References ACE_NEW_THROW_EX, TAO::SSLIOP::Current_Impl::get_peer_certificate_chain(), implementation(), and SSLIOP::SSL_Cert.
00058 { 00059 TAO::SSLIOP::Current_Impl *impl = this->implementation (); 00060 00061 // If the implementation pointer returned from TSS is zero, then 00062 // we're not in the middle of a request or an upcall. Throw an 00063 // exception to indicate that. 00064 if (impl == 0) 00065 throw SSLIOP::Current::NoContext (); 00066 00067 // A valid value must always be returned, so instantiate a sequence 00068 // regardless of whether or not it is populated with certificates. 00069 ::SSLIOP::SSL_Cert *c = 0; 00070 ACE_NEW_THROW_EX (c, 00071 ::SSLIOP::SSL_Cert, 00072 CORBA::NO_MEMORY ( 00073 CORBA::SystemException::_tao_minor_code ( 00074 TAO::VMCID, 00075 ENOMEM), 00076 CORBA::COMPLETED_NO)); 00077 00078 ::SSLIOP::SSL_Cert_var cert_chain = c; 00079 00080 // Populate the sequence with the chain of DER encoded certificates. 00081 impl->get_peer_certificate_chain (c); 00082 00083 return cert_chain._retn (); 00084 } |
|
Return the TSS SSLIOP::Current implementation.
Definition at line 23 of file SSLIOP_Current.inl. References TAO_ORB_Core::get_tss_resource(), and TAO::SL3::SecurityCurrent_Impl::tag(). Referenced by get_peer_certificate(), get_peer_certificate_chain(), no_context(), setup(), and teardown().
00024 { 00025 if (this->orb_core_ == 0) 00026 return 0; 00027 00028 TAO::SL3::SecurityCurrent_Impl *impl = 00029 static_cast<TAO::SL3::SecurityCurrent_Impl *> ( 00030 this->orb_core_->get_tss_resource (this->tss_slot_)); 00031 00032 // Make sure we've got SSL session state in TSS before allowing 00033 // further use of the SSLIOP::Current object. 00034 if (impl != 0 && impl->tag () == ::SSLIOP::TAG_SSL_SEC_TRANS) 00035 return dynamic_cast<TAO::SSLIOP::Current_Impl *> (impl); 00036 00037 return 0; 00038 } |
|
Set the TSS SSLIOP::Current implementation.
Definition at line 14 of file SSLIOP_Current.inl. References TAO_ORB_Core::set_tss_resource().
00015 { 00016 if (this->orb_core_ == 0) 00017 return -1; 00018 00019 return this->orb_core_->set_tss_resource (this->tss_slot_, impl); 00020 } |
|
This method is mostly useful as an inexpensive means of determining whether or not SSL session state is available.
Implements SSLIOP::Current. Definition at line 87 of file SSLIOP_Current.cpp. References implementation().
00088 { 00089 return (this->implementation () == 0 ? true : false); 00090 } |
|
Prevent copying through the copy constructor and the assignment operator. |
|
Setup the Current.
Definition at line 93 of file SSLIOP_Current.cpp. References implementation(). Referenced by TAO::Null_SSL_State_Guard::Null_SSL_State_Guard().
00096 { 00097 // Set the current context and remember the old one. 00098 00099 prev_impl = this->implementation (); 00100 00101 (void) this->implementation (new_impl); // Check for error? 00102 00103 // Setup is complete. 00104 setup_done = true; 00105 } |
|
Teardown the Current for this request.
Definition at line 108 of file SSLIOP_Current.cpp. References implementation(). Referenced by TAO::Null_SSL_State_Guard::~Null_SSL_State_Guard().
00110 { 00111 if (setup_done) 00112 { 00113 // Reset the old context. 00114 (void) this->implementation (prev_impl); 00115 setup_done = false; 00116 } 00117 } |
|
Set the TSS slot ID assigned to this object.
Definition at line 8 of file SSLIOP_Current.inl. Referenced by TAO::SSLIOP::Server_Invocation_Interceptor::Server_Invocation_Interceptor().
00009 { 00010 this->tss_slot_ = slot; 00011 } |
|
Pointer to the ORB Core corresponding to the ORB with which this object is registered. Reimplemented from CORBA::Object. Definition at line 151 of file SSLIOP_Current.h. |
|
TSS slot assigned to this object.
Definition at line 147 of file SSLIOP_Current.h. |