diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2000-10-12 21:28:52 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2000-10-12 21:28:52 +0000 |
commit | 86d1184c0eb1796c99fa10ed6d7529072d01c27d (patch) | |
tree | 2c35987de315e90b6d69ff0a71692c8cc9be21df | |
parent | 339025d03e8eaf8c9efb2d2d91a4b7b787e57d11 (diff) | |
download | ATCD-86d1184c0eb1796c99fa10ed6d7529072d01c27d.tar.gz |
ChangeLogTag:Thu Oct 12 14:24:03 2000 Ossama Othman <ossama@uci.edu>
26 files changed, 472 insertions, 210 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 94cf819d8cb..85f3776c26b 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,167 @@ +Thu Oct 12 14:24:03 2000 Ossama Othman <ossama@uci.edu> + + * tao/Acceptor_Registry.cpp (open_default, open_i, + extract_endpoint_version): + + Initialize major and minor endpoint versions to + TAO_DEF_GIOP_MAJOR and TAO_DEF_GIOP_MINOR, respectively, instead + of -1 so that a valid version is passed to pluggable protocol + open() and/or open_default() methods. This makes things less + error prone, especially since initializing to -1 did not provide + us with anything useful. + + * docs/Options.html: + + Updated ORB option documentation in accordance with the changes + made to the TAO_ORB_Core::init() method described below. + + * tao/ORB_Core.cpp (init): + + Added warning message about the fact that the "-ORBPreconnect" + option is obsolete, and that validate_connection() should be + used instead. + + Removed support for the long obsolete + "-ORB{Name,Trading,ImplRepo}ServiceIOR" options. Their + functionality is already provided by the standard -ORBInitRef + ORB option. + + * tao/Connector_Registry.h (connect): + + Removed the default value for the ACE_Time_Value pointer + argument. There is no reason why it should have a default value + since TAO's invocation code always passes an ACE_Time_Value when + calling connect(), even if that value is zero. + + * tao/Connector_Registry.cpp (connect): + * tao/Pluggable.h (connect): + * tao/IIOP_Connector.h (connect): + * tao/IIOP_Connector.cpp (connect): + * tao/SHMIOP_Connector.h (connect): + * tao/SHMIOP_Connector.cpp (connect): + * tao/UIOP_Connector.h (connect): + * tao/UIOP_Connector.cpp (connect): + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h (connect): + + Added CORBA::Environment argument to the connect() call to make + it possible to throw exceptions within that method. Most + pluggable protocols may not need this argument, and can rely on + the GIOP_Invocation class to figure out the appropriate exception + to throw, if any. However, the SSLIOP pluggable protocol may + need to throw the CORBA::NO_PERMISSION exception when attempting + to connect to an endpoint. + + * tao/Invocation.cpp (start): + + Pass the CORBA::Environment variable ACE_TRY_ENV to the + TAO_Connector_Registry::connect() call. + + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp (connect): + + Only allow connection to the insecure IIOP port if the endpoint + explicitly allows it, i.e. if the Security::NoProtection + security association bit is set in the + SSLIOP::SSL::target_supports field. The server will soon + perform the same permission check, so this check is an + optimization since a connection will not be established + needlessly, i.e. rejected due to lack of permission. + + Removed the check that causes an attempt to connect to the + insecure port if the SSL port is set to zero. The SSL port will + never be set to zero on the client side. It will default to + port 684, the IANA assigned port for IIOP over SSL. + + Note that it is still possible for the standard non-SSLIOP aware + IIOP pluggable protocol to attempt to connect to the insecure + port. In that case, the server will have to prevent the + connection, and subsequently the request, from completing. This + feature will be added soon. + + If the endpoint requires an insecure connection, i.e. the + Security::NoProtection security association bit in the + SSLIOP::SSL::target_requires field is enabled, then prevent an + SSL connection from occuring. This seems silly, but nothing + appears to be in the spec that states this can't be done. + + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h: + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp (TAO_SSLIOP_Endpoint): + + Pass pointer to entire SSLIOP::SSL component so that its + entire contents may be copied, not just the port. This is + particularly necessary to make it possible to keep track of the + security associations corresponding to the given endpoint. If + the pointer is zero, then initialize the SSLIOP::SSL component + with conservative security association options, and set the port + to be the IANA assigned port for IIOP over SSL, 684. + + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i (ssl_port): + + Removed this method. It is more useful to return the entire + SSLIOP::SSL component in most cases, hence the newly added + ssl_component() accessor described below. + + (ssl_component): + + Accessor method that returns a constant reference to the + SSLIOP::SSL component associated with the given SSLIOP endpoint. + In most cases, we need to check the "target_supports" and + "target_requires" fields, not just the "port" field. + + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h: + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp: + + The constructor now accepts an argument that sets the default + value for the Security::NoProtection bit in the + SSLIOP::SSL::target_supports field. The need for this change + will obviated once the security policy support is added. + + (create_mprofile, create_rt_mprofile): + + Pass pointer to the entire SSLIOP::SSL component, not just the + port. Its other fields are important for enforcing security. + + (verify_secure_configuration): + + New method that ensures neither the endpoint configuration nor + the ORB configuration violate security measures. + + In order to support a secure connection, the SSLIOP::SSL tagged + component must be embedded in the IOR. This isn't possible if + the user elects to disable standard profile components. + Similarly, IIOP 1.0 does not support tagged components, which it + makes it impossible to embed the SSLIOP::SSL tagged component + within the IOR. If the given object explicitly disallows + insecure invocations and standard profile components are + disabled, then return with an error since secure invocations + cannot be supported without standard profile components. Note + that it isn't enough to support Security::NoProtection. + Security::NoProtection must be required since "support" does not + preclude the secure port from being used. + + (open, open_default): + + Call the newly added verify_secure_configuration() method prior + to opening any endpoints to ensure that neither the endpoint + configuration nor the ORB configuration violate security + measures. + + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.h: + + The new "no_protection_" field is now used instead of the old + "use_ssl_" field. + + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.cpp (init): + + Deprecated the "-SSLDisable" option. It has been superseded by + the "-SSLNoProtection" option since it is better emphasizes the + consequences of disabling SSL support, and since it is also + applicable on the server side. + + (make_acceptor): + + Pass the newly added "no_protection_" field to the + SSLIOP_Acceptor constructor. + Thu Oct 12 15:29:06 2000 Balachandran Natarajan <bala@cs.wustl.edu> * orbsvcs/orbsvcs/FaultTolerance/FT_Service_Activate.cpp: @@ -106,7 +270,6 @@ Thu Oct 12 00:07:36 2000 Angelo Corsaro <corsaro@cs.wustl.edu> Fixed problem with double checked locking. Thanks to Marina for noting that. - Wed Oct 11 23:12:03 2000 Angelo Corsaro <corsaro@cs.wustl.edu> * tao/PortableServer/Strategized_Object_Proxy_Broker.cpp: diff --git a/TAO/docs/Options.html b/TAO/docs/Options.html index 53e0d1021b9..8af3fe8ad61 100644 --- a/TAO/docs/Options.html +++ b/TAO/docs/Options.html @@ -217,26 +217,12 @@ merged with <a href="#-ORBCollocation"><code>-ORBCollocation</code></a>. TAO_DEFAULT_NAME_SERVICE_REQUEST_PORT, which is 10013 is used.</TD> </TR> <TR> - <TD><CODE>-ORBNameServiceIOR</CODE> <EM>ior</EM></TD> - <TD>Specifies the IOR for the Naming Service. Note, this option - is deprecated since its functionality can be achieved with the - standard <CODE>-ORBInitRef</CODE> option defined by the <A - HREF="INS.html">Interoperable Naming Service</A>. </TD> - </TR> - <TR> <TD><CODE>-ORBTradingServicePort</CODE> <EM>portspec</EM></TD> <TD>Specifies to which port the Trading Service is listening on for multicast requests. By default, TAO_DEFAULT_TRADING_SERVICE_REQUEST_PORT which is 10016 is used.</TD> </TR> <TR> - <TD><CODE>-ORBTradingServiceIOR</CODE> <EM>ior</EM></TD> - <TD>Specifies the IOR for the Trading Service. Note, this option - is deprecated since its functionality can be achieved with the - standard <CODE>-ORBInitRef</CODE> option defined by the <A - HREF="INS.html">Interoperable Naming Service</A>.</TD> - </TR> - <TR> <TD><CODE>-ORBImplRepoServicePort</CODE> <EM>portspec</EM></TD> <TD>Specifies to which port the Implementation Repository is listening on for multicast requests. By default, @@ -244,13 +230,6 @@ merged with <a href="#-ORBCollocation"><code>-ORBCollocation</code></a>. be used.</TD> </TR> <TR> - <TD><CODE>-ORBImplRepoServiceIOR</CODE> <EM>ior</EM></TD> - <TD>Specifies the IOR for the Implementation Repository. Note, this option - is deprecated since its functionality can be achieved with the - standard <CODE>-ORBInitRef</CODE> option defined by the <A - HREF="INS.html">Interoperable Naming Service</A>.</TD> - </TR> - <TR> <TD><CODE>-ORBMulticastDiscoveryEndpoint</CODE> <EM>end_point</EM></TD> <TD>Specifies the endpoint that should be used for locating the Naming Service through multicast. <EM>end_point</EM> is of the @@ -297,6 +276,14 @@ merged with <a href="#-ORBCollocation"><code>-ORBCollocation</code></a>. <CODE>-ORBEndpoint</CODE> option. <P> This is a client-side option. + <P> + <FONT COLOR=RED>-ORBPreconnect is <STRONG>deprecated</STRONG>. + The Real-Time CORBA standard + <CODE>validate_connection()</CODE> method should be used + instead. See the section on <I>Implicit & Explicit + Binding</I> in TAO's + <A HREF="releasenotes/RTCorba.html">Real-Time CORBA release + notes</A>. This option will be removed in the near future. </TD> </TR> <TR> diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp index 38d7a9daef5..f4fff397228 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp @@ -45,7 +45,7 @@ template class TAO_Accept_Strategy<TAO_SSLIOP_Server_Connection_Handler, ACE_SSL #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -TAO_SSLIOP_Acceptor::TAO_SSLIOP_Acceptor (void) +TAO_SSLIOP_Acceptor::TAO_SSLIOP_Acceptor (int support_no_protection) : TAO_IIOP_Acceptor (), ssl_acceptor_ (), creation_strategy_ (0), @@ -60,20 +60,23 @@ TAO_SSLIOP_Acceptor::TAO_SSLIOP_Acceptor (void) ACE_SET_BITS (this->ssl_component_.target_requires, Security::Integrity | Security::Confidentiality - | Security::DetectReplay - | Security::DetectMisordering | Security::NoDelegation); // SSLIOP supports these Security::AssociationOptions by default. ACE_SET_BITS (this->ssl_component_.target_supports, Security::Integrity | Security::Confidentiality - | Security::DetectReplay - | Security::DetectMisordering + | Security::EstablishTrustInTarget | Security::NoDelegation); // Initialize the default SSL port to zero (wild card port). this->ssl_component_.port = 0; + + // @@ This should go away once we support setting security + // association options through policies. + if (support_no_protection) + ACE_SET_BITS (this->ssl_component_.target_supports, + Security::NoProtection); } TAO_SSLIOP_Acceptor::~TAO_SSLIOP_Acceptor (void) @@ -119,6 +122,14 @@ TAO_SSLIOP_Acceptor::create_mprofile (const TAO_ObjectKey &object_key, for (size_t i = 0; i < this->endpoint_count_; ++i) { TAO_SSLIOP_Profile *pfile = 0; + + // @@ We need to create an SSLIOP::SSL component for the object + // we're creating an MProfile for. This will allow us to + // properly embed secure invocation policies in the generated + // IOR, i.e. secure invocation policies on a per-object + // basis, rather than on a per-endpoint basis. If no secure + // invocation policies have been set then we should use the + // below default SSLIOP::SSL component. ACE_NEW_RETURN (pfile, TAO_SSLIOP_Profile (this->hosts_[i], this->addrs_[i].get_port_number (), @@ -126,7 +137,7 @@ TAO_SSLIOP_Acceptor::create_mprofile (const TAO_ObjectKey &object_key, this->addrs_[i], this->version_, this->orb_core_, - this->ssl_component_.port), + &(this->ssl_component_)), -1); if (mprofile.give_profile (pfile) == -1) @@ -211,6 +222,13 @@ TAO_SSLIOP_Acceptor::create_rt_mprofile (const TAO_ObjectKey &object_key, // one. if (ssliop_profile == 0) { + // @@ We need to create an SSLIOP::SSL component for the object + // we're creating an MProfile for. This will allow us to + // properly embed secure invocation policies in the generated + // IOR, i.e. secure invocation policies on a per-object + // basis, rather than on a per-endpoint basis. If no secure + // invocation policies have been set then we should use the + // below default SSLIOP::SSL component. ACE_NEW_RETURN (ssliop_profile, TAO_SSLIOP_Profile (this->hosts_[0], this->addrs_[0].get_port_number (), @@ -218,7 +236,7 @@ TAO_SSLIOP_Acceptor::create_rt_mprofile (const TAO_ObjectKey &object_key, this->addrs_[0], this->version_, this->orb_core_, - this->ssl_component_.port), + &(this->ssl_component_)), -1); TAO_SSLIOP_Endpoint *ssliop_endp = @@ -278,7 +296,7 @@ TAO_SSLIOP_Acceptor::create_rt_mprofile (const TAO_ObjectKey &object_key, ssliop_profile->tagged_components ().set_component (component); } - index = 1; + index = 1; } // Add any remaining endpoints to the SSLIOP_Profile. @@ -296,7 +314,7 @@ TAO_SSLIOP_Acceptor::create_rt_mprofile (const TAO_ObjectKey &object_key, iiop_endp->priority (this->priority_); ACE_NEW_RETURN (ssl_endp, - TAO_SSLIOP_Endpoint (this->ssl_component_.port, + TAO_SSLIOP_Endpoint (&(this->ssl_component_), iiop_endp), -1); @@ -345,6 +363,13 @@ TAO_SSLIOP_Acceptor::open (TAO_ORB_Core *orb_core, const char *address, const char *options) { + // Ensure that neither the endpoint configuration nor the ORB + // configuration violate security measures. + if (this->verify_secure_configuration (orb_core, + major, + minor) != 0) + return -1; + // Open the non-SSL enabled endpoints, then open the SSL enabled // endpoints. if (this->TAO_IIOP_Acceptor::open (orb_core, @@ -368,6 +393,13 @@ TAO_SSLIOP_Acceptor::open_default (TAO_ORB_Core *orb_core, int minor, const char *options) { + // Ensure that neither the endpoint configuration nor the ORB + // configuration violate security measures. + if (this->verify_secure_configuration (orb_core, + major, + minor) != 0) + return -1; + // Open the non-SSL enabled endpoints, then open the SSL enabled // endpoints. if (this->TAO_IIOP_Acceptor::open_default (orb_core, @@ -590,4 +622,52 @@ TAO_SSLIOP_Acceptor::parse_options (const char *str) return 0; } +int +TAO_SSLIOP_Acceptor::verify_secure_configuration (TAO_ORB_Core *orb_core, + int major, + int minor) +{ + // Sanity check. + if (major < 1) + { + // There is no such thing as IIOP 0.x. + errno = EINVAL; + return -1; + } + + // In order to support a secure connection, the SSLIOP::SSL tagged + // component must be embedded in the IOR. This isn't possible if + // the user elects to disable standard profile components. + // Similarly, IIOP 1.0 does not support tagged components, which it + // makes it impossible to embed the SSLIOP::SSL tagged component + // within the IOR. If the given object explicitly disallows + // insecure invocations and standard profile components are + // disabled, then return with an error since secure invocations + // cannot be supported without standard profile components. + // + // Note that it isn't enough to support NoProtection. NoProtection + // must be required since "support" does not preclude the secure + // port from being used. + + if ((orb_core->orb_params ()->std_profile_components () == 0 + || (major == 1 && minor == 0)) + && ACE_BIT_DISABLED (this->ssl_component_.target_requires, + Security::NoProtection)) + { + if (TAO_debug_level > 0) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) Cannot support secure ") + ACE_TEXT ("IIOP over SSL connection if\n") + ACE_TEXT ("(%P|%t) standard profile ") + ACE_TEXT ("components are disabled\n") + ACE_TEXT ("(%P|%t) or IIOP 1.0 endpoint is ") + ACE_TEXT ("used.\n"))); + + errno = EINVAL; + return -1; + } + + return 0; +} + #endif /* ACE_HAS_SSL */ diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h index bebd485cc24..6c57985e0fc 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.h @@ -47,7 +47,7 @@ class TAO_SSLIOP_Export TAO_SSLIOP_Acceptor : public TAO_IIOP_Acceptor // The SSLIOP-specific bridge class for the concrete acceptor. // public: - TAO_SSLIOP_Acceptor (void); + TAO_SSLIOP_Acceptor (int support_no_protection); // Constructor. ~TAO_SSLIOP_Acceptor (void); @@ -89,6 +89,12 @@ private: // single SSLIOP profile, i.e., <mprofile> will not contain more than // one SSLIOP_Profile, no matter how many acceptors there are. + int verify_secure_configuration (TAO_ORB_Core *orb_core, + int major, + int minor); + // Ensure that neither the endpoint configuration nor the ORB + // configuration violate security measures. + private: TAO_SSLIOP_BASE_ACCEPTOR ssl_acceptor_; // The concrete acceptor, as a pointer to it's base class. diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.cpp index 63f0550a52f..0a2bd5e6f84 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connect.cpp @@ -161,7 +161,7 @@ TAO_SSLIOP_Server_Connection_Handler::open (void*) (void) addr.addr_to_string (client, sizeof (client)); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) IIOP connection from ") + ACE_TEXT ("TAO (%P|%t) SSLIOP connection from ") ACE_TEXT ("client <%s> on %d\n"), client, this->peer ().get_handle ())); @@ -205,7 +205,7 @@ TAO_SSLIOP_Server_Connection_Handler::activate (long flags, int TAO_SSLIOP_Server_Connection_Handler::handle_close (ACE_HANDLE handle, - ACE_Reactor_Mask rm) + ACE_Reactor_Mask rm) { if (TAO_orbdebug) ACE_DEBUG ((LM_DEBUG, @@ -375,7 +375,7 @@ TAO_SSLIOP_Client_Connection_Handler (ACE_Thread_Manager *t) TAO_SSLIOP_Client_Connection_Handler:: TAO_SSLIOP_Client_Connection_Handler (ACE_Thread_Manager *t, TAO_ORB_Core* orb_core, - CORBA::Boolean /* flag */, + CORBA::Boolean /* lite_flag */, void *arg) : TAO_SSLIOP_Handler_Base (t), transport_ (this, orb_core), @@ -451,7 +451,7 @@ TAO_SSLIOP_Client_Connection_Handler::open (void *) (void) addr.addr_to_string (server, sizeof (server)); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) IIOP connection to server ") + ACE_TEXT ("TAO (%P|%t) SSLIOP connection to server ") ACE_TEXT ("<%s> on %d\n"), server, this->peer ().get_handle ())); diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp index d50d5831242..d6f18f05823 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.cpp @@ -350,9 +350,9 @@ typedef ACE_Cached_Connect_Strategy<TAO_SSLIOP_Client_Connection_Handler, TAO_CACHED_CONNECT_STRATEGY; #endif /* ! TAO_USES_ROBUST_CONNECTION_MGMT */ -TAO_SSLIOP_Connector::TAO_SSLIOP_Connector (int default_is_ssl) +TAO_SSLIOP_Connector::TAO_SSLIOP_Connector (int no_protection) : TAO_IIOP_Connector (), - default_is_ssl_ (default_is_ssl), + no_protection_ (no_protection), base_connector_ () #if defined (TAO_USES_ROBUST_CONNECTION_MGMT) , @@ -453,7 +453,8 @@ TAO_SSLIOP_Connector::close (void) int TAO_SSLIOP_Connector::connect (TAO_Endpoint *endpoint, TAO_Transport *&transport, - ACE_Time_Value *max_wait_time) + ACE_Time_Value *max_wait_time, + CORBA::Environment &ACE_TRY_ENV) { if (endpoint->tag () != TAO_TAG_IIOP_PROFILE) return -1; @@ -462,15 +463,59 @@ TAO_SSLIOP_Connector::connect (TAO_Endpoint *endpoint, ACE_dynamic_cast (TAO_SSLIOP_Endpoint *, endpoint); if (endpoint == 0) - return -1; + return -1; + + const SSLIOP::SSL &ssl_component = ssl_endpoint->ssl_component (); // @@ Use the policies to decide if SSL is the right protocol... - if (!this->default_is_ssl_ - || ssl_endpoint->ssl_port () == 0) - return this->TAO_IIOP_Connector::connect - (ssl_endpoint->iiop_endpoint (), - transport, - max_wait_time); + if (this->no_protection_) + { + // Only allow connection to the insecure IIOP port if the + // endpoint explicitly allows it, i.e. if the + // Security::NoProtection security association bit is set in the + // SSLIOP::SSL::target_supports field. The server performs the + // same permission check, so this check is an optimization since + // a connection will not be established needlessly, + // i.e. rejected due to lack of permission. + // + // Note that it is still possible for the standard non-SSLIOP + // aware IIOP pluggable protocol to attempt to connect to the + // insecure port. In that case, the server will have to prevent + // the connection, and subsequently the request, from + // completing. + if (ACE_BIT_DISABLED (ssl_component.target_supports, + Security::NoProtection)) + ACE_THROW_RETURN (CORBA::NO_PERMISSION ( + CORBA_SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + EPERM), + CORBA::COMPLETED_NO), + -1); + + return this->TAO_IIOP_Connector::connect ( + ssl_endpoint->iiop_endpoint (), + transport, + max_wait_time, + ACE_TRY_ENV); + } + + // @@ The following check for "required insecurity" seems odd, but + // I haven't seen anything in the Security spec that says this + // policy isn't possible. + // -Ossama + + // If the endpoint requires an insecure connection, i.e. the + // Security::NoProtection security association bit in the + // SSLIOP::SSL::target_requires field is enabled, then prevent an + // SSL connection from occuring. + if (ACE_BIT_ENABLED (ssl_component.target_requires, + Security::NoProtection)) + ACE_THROW_RETURN (CORBA::NO_PERMISSION ( + CORBA_SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + EPERM), + CORBA::COMPLETED_NO), + -1); ACE_INET_Addr remote_address = ssl_endpoint->iiop_endpoint ()->object_addr (); @@ -483,7 +528,7 @@ TAO_SSLIOP_Connector::connect (TAO_Endpoint *endpoint, if (TAO_debug_level > 0) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) IIOP connection failed.\n") + ACE_TEXT ("TAO (%P|%t) SSLIOP connection failed.\n") ACE_TEXT ("TAO (%P|%t) This is most likely ") ACE_TEXT ("due to a hostname lookup ") ACE_TEXT ("failure.\n"))); @@ -492,7 +537,7 @@ TAO_SSLIOP_Connector::connect (TAO_Endpoint *endpoint, return -1; } - remote_address.set_port_number (ssl_endpoint->ssl_port ()); + remote_address.set_port_number (ssl_component.port); TAO_SSLIOP_Client_Connection_Handler *svc_handler = 0; int result = 0; @@ -528,14 +573,15 @@ TAO_SSLIOP_Connector::connect (TAO_Endpoint *endpoint, if (TAO_orbdebug) { char buffer [MAXHOSTNAMELEN + 6 + 1]; - endpoint->addr_to_string (buffer, + ssl_endpoint->addr_to_string (buffer, sizeof (buffer) - 1); ACE_DEBUG ((LM_ERROR, ACE_TEXT ("(%P|%t) %s:%u, connection to ") - ACE_TEXT ("%s failed (%p)\n"), + ACE_TEXT ("%s, SSL port %d failed (%p)\n"), __FILE__, __LINE__, buffer, + remote_address.get_port_number (), ACE_TEXT ("errno"))); } return -1; diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h index ea7b3aab96e..bb9808e8c58 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connector.h @@ -93,7 +93,7 @@ class TAO_SSLIOP_Export TAO_SSLIOP_Connector : public TAO_IIOP_Connector // public: // = Initialization and termination methods. - TAO_SSLIOP_Connector (int default_is_ssl = 0); + TAO_SSLIOP_Connector (int no_protection); // Constructor. // = The TAO_Connector methods, please check the documentation on @@ -102,7 +102,8 @@ public: virtual int close (void); virtual int connect (TAO_Endpoint *endpoint, TAO_Transport *&transport, - ACE_Time_Value *max_wait_time); + ACE_Time_Value *max_wait_time, + CORBA::Environment &ACE_TRY_ENV); virtual TAO_Profile *create_profile (TAO_InputCDR& cdr); #if defined (TAO_USES_ROBUST_CONNECTION_MGMT) @@ -189,8 +190,9 @@ public: TAO_NULL_CREATION_STRATEGY; private: - int default_is_ssl_; - // If not zero it tries to use SSL by default. + int no_protection_; + // If zero, connect to IIOP over SSL port by default. + // Otherwise, connect to the insecure IIOP port. TAO_NULL_ACTIVATION_STRATEGY null_activation_strategy_; TAO_NULL_CREATION_STRATEGY null_creation_strategy_; diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp index 8f235e35b4a..d01ff0edf9f 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.cpp @@ -16,24 +16,58 @@ ACE_RCSID(tao, SSLIOP_Endpoint, "$Id$") # include "SSLIOP_Endpoint.i" #endif /* __ACE_INLINE__ */ -TAO_SSLIOP_Endpoint::TAO_SSLIOP_Endpoint (u_short ssl_port, +TAO_SSLIOP_Endpoint::TAO_SSLIOP_Endpoint (const SSLIOP::SSL *ssl_component, TAO_IIOP_Endpoint *iiop_endp) : TAO_Endpoint (TAO_TAG_IIOP_PROFILE), ssl_hint_ (0), next_ (0), iiop_endpoint_ (iiop_endp) { - this->ssl_component_.port = ssl_port; + if (ssl_component != 0) + { + this->ssl_component_.target_supports = ssl_component->target_supports; + this->ssl_component_.target_requires = ssl_component->target_requires; + this->ssl_component_.port = ssl_component->port; + } + else + { + // Clear all bits in the SSLIOP::SSL association option fields. + this->ssl_component_.target_supports = 0; + this->ssl_component_.target_requires = 0; + + // SSLIOP requires these Security::AssociationOptions by default. + ACE_SET_BITS (this->ssl_component_.target_requires, + Security::Integrity + | Security::Confidentiality + | Security::DetectReplay + | Security::DetectMisordering + | Security::NoDelegation); + + // SSLIOP supports these Security::AssociationOptions by default. + ACE_SET_BITS (this->ssl_component_.target_supports, + Security::Integrity + | Security::Confidentiality + | Security::DetectReplay + | Security::DetectMisordering + | Security::EstablishTrustInTarget + | Security::NoDelegation); + + // Initialize the default SSL port to the IANA assigned IIOP + // over SSL port. We usually only get here if we're creating a + // profile on the client side. + this->ssl_component_.port = 684; + } } TAO_SSLIOP_Endpoint::~TAO_SSLIOP_Endpoint (void) { } - int TAO_SSLIOP_Endpoint::addr_to_string (char *buffer, size_t length) { + // @@ Marina, this is broken. You're returning the IIOP address, + // not the SSLIOP one, meaning that the port will be incorrect. return this->iiop_endpoint_->addr_to_string (buffer, length); } diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h index 0abd29fab64..c7386ee8e71 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.h @@ -55,7 +55,7 @@ public: // = Initialization and termination methods. - TAO_SSLIOP_Endpoint (u_short ssl_port, + TAO_SSLIOP_Endpoint (const SSLIOP::SSL *ssl_component, TAO_IIOP_Endpoint *iiop_endp); // Constructor. @@ -71,8 +71,8 @@ public: // = SSLIOP_Endpoint-specific methods. - CORBA::UShort ssl_port (void) const; - // Return port used for SSL communication. + const SSLIOP::SSL &ssl_component (void) const; + // Return SSL component corresponding to this endpoint. TAO_SSLIOP_Client_Connection_Handler *&ssl_hint (void); // Access to our <hint_>. diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i index c1bc7c4f1a4..d705c544949 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Endpoint.i @@ -8,10 +8,10 @@ TAO_SSLIOP_Endpoint::iiop_endpoint (void) const return this->iiop_endpoint_; } -ACE_INLINE CORBA::UShort -TAO_SSLIOP_Endpoint::ssl_port (void) const +ACE_INLINE const SSLIOP::SSL & +TAO_SSLIOP_Endpoint::ssl_component (void) const { - return this->ssl_component_.port; + return this->ssl_component_; } ACE_INLINE TAO_SSLIOP_Client_Connection_Handler *& diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.cpp index cf9fb3b0b5a..43b2b39bde1 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.cpp @@ -9,7 +9,7 @@ #include "SSLIOP_Connector.h" #include "ace/SSL/SSL_Context.h" -ACE_RCSID(TAO_SSLIOP, SSLIOP_Factory, "$Id$") +ACE_RCSID (TAO_SSLIOP, SSLIOP_Factory, "$Id$") static const char prefix_[] = "iiop"; @@ -17,7 +17,7 @@ TAO_SSLIOP_Protocol_Factory::TAO_SSLIOP_Protocol_Factory (void) : TAO_Protocol_Factory (TAO_TAG_IIOP_PROFILE), major_ (TAO_DEF_GIOP_MAJOR), minor_ (TAO_DEF_GIOP_MINOR), - use_ssl_ (1) + no_protection_ (0) { } @@ -50,7 +50,7 @@ TAO_SSLIOP_Protocol_Factory::make_acceptor (void) TAO_Acceptor *acceptor = 0; ACE_NEW_RETURN (acceptor, - TAO_SSLIOP_Acceptor (), + TAO_SSLIOP_Acceptor (this->no_protection_), 0); return acceptor; @@ -65,7 +65,18 @@ TAO_SSLIOP_Protocol_Factory::init (int argc, if (ACE_OS::strcasecmp (argv[curarg], "-SSLDisable") == 0) { - this->use_ssl_ = 0; + ACE_ERROR ((LM_WARNING, + ACE_TEXT ("(%P|%t) \"-SSLDisable\" has been ") + ACE_TEXT ("superceded by the ") + ACE_TEXT ("\"-SSLNoProtection\" option.\n"))); + + this->no_protection_ = 1; + } + + else if (ACE_OS::strcasecmp (argv[curarg], + "-SSLNoProtection") == 0) + { + this->no_protection_ = 1; } else if (ACE_OS::strcasecmp (argv[curarg], @@ -151,7 +162,7 @@ TAO_SSLIOP_Protocol_Factory::make_connector (void) TAO_Connector *connector = 0; ACE_NEW_RETURN (connector, - TAO_SSLIOP_Connector (this->use_ssl_), + TAO_SSLIOP_Connector (this->no_protection_), 0); return connector; } diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.h index 5a90b5a67ef..4828791fca9 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.h +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Factory.h @@ -65,8 +65,11 @@ private: // Changing the version number can be used to provide backwards // compatibility with old clients. - int use_ssl_; - // Use SSL when establishing connections + int no_protection_; + // In the case of the server side, allow connections to the insecure + // IIOP port. + // In the case of the client side, connect to the insecure IIOP port + // instead of the secure IIOP over SSL port. }; ACE_STATIC_SVC_DECLARE (TAO_SSLIOP_Protocol_Factory) diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.cpp index a5a9edaf9e2..acd988187b2 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.cpp @@ -21,12 +21,12 @@ TAO_SSLIOP_Profile::TAO_SSLIOP_Profile (const ACE_INET_Addr &addr, const TAO_ObjectKey &object_key, const TAO_GIOP_Version &version, TAO_ORB_Core *orb_core, - u_short ssl_port) + const SSLIOP::SSL *ssl_component) : TAO_IIOP_Profile (addr, object_key, version, orb_core), - ssl_endpoint_ (ssl_port, 0) + ssl_endpoint_ (ssl_component, 0) { this->ssl_endpoint_.iiop_endpoint_ = &this->endpoint_; } @@ -37,24 +37,24 @@ TAO_SSLIOP_Profile::TAO_SSLIOP_Profile (const char* host, const ACE_INET_Addr &addr, const TAO_GIOP_Version &version, TAO_ORB_Core *orb_core, - u_short ssl_port) + const SSLIOP::SSL *ssl_component) : TAO_IIOP_Profile (host, port, object_key, addr, version, orb_core), - ssl_endpoint_ (ssl_port, 0) + ssl_endpoint_ (ssl_component, 0) { this->ssl_endpoint_.iiop_endpoint_ = &this->endpoint_; } TAO_SSLIOP_Profile::TAO_SSLIOP_Profile (const char *string, TAO_ORB_Core *orb_core, - u_short ssl_port, + const SSLIOP::SSL *ssl_component, CORBA::Environment &ACE_TRY_ENV) : TAO_IIOP_Profile (string, orb_core, ACE_TRY_ENV), - ssl_endpoint_ (ssl_port, 0) + ssl_endpoint_ (ssl_component, 0) { this->ssl_endpoint_.iiop_endpoint_ = &this->endpoint_; } @@ -92,19 +92,17 @@ TAO_SSLIOP_Profile::decode (TAO_InputCDR& cdr) if (r != 1) return r; - // Attempt to decode ssl tagged component. It may not be there if - // we are dealing with pure IIOP profile. + // Attempt to decode SSLIOP::SSL tagged component. It may not be + // there if we are dealing with pure IIOP profile. int ssl_component_found = 0; IOP::TaggedComponent component; component.tag = SSLIOP::TAG_SSL_SEC_TRANS; - if (this->tagged_components ().get_component (component) == 0) - this->ssl_endpoint_.ssl_component_.port = 0; - else + if (this->tagged_components ().get_component (component)) { - TAO_InputCDR cdr ( - ACE_reinterpret_cast (const char*, - component.component_data.get_buffer ()), + TAO_InputCDR cdr (ACE_reinterpret_cast ( + const char*, + component.component_data.get_buffer ()), component.component_data.length ()); CORBA::Boolean byte_order; if ((cdr >> ACE_InputCDR::to_boolean (byte_order)) == 0) diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.h index 9f5bdfacd9c..1fc57062dc6 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.h +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Profile.h @@ -53,7 +53,7 @@ public: const TAO_ObjectKey &object_key, const TAO_GIOP_Version &version, TAO_ORB_Core *orb_core, - u_short ssl_port = 0); + const SSLIOP::SSL *ssl_component); // Profile constructor, same as above except the object_key has // already been marshaled. @@ -63,15 +63,14 @@ public: const ACE_INET_Addr &addr, const TAO_GIOP_Version &version, TAO_ORB_Core *orb_core, - u_short ssl_port = 0); + const SSLIOP::SSL *ssl_component); // Profile constructor, this is the most efficient since it // doesn't require any address resolution processing. TAO_SSLIOP_Profile (const char *string, TAO_ORB_Core *orb_core, - u_short ssl_port, - CORBA::Environment &ACE_TRY_ENV = - TAO_default_environment ()); + const SSLIOP::SSL *ssl_component, + CORBA::Environment &ACE_TRY_ENV); // Create object using a string ior. TAO_SSLIOP_Profile (TAO_ORB_Core *orb_core); diff --git a/TAO/tao/Acceptor_Registry.cpp b/TAO/tao/Acceptor_Registry.cpp index 9cd0466c746..00597f7c98d 100644 --- a/TAO/tao/Acceptor_Registry.cpp +++ b/TAO/tao/Acceptor_Registry.cpp @@ -296,8 +296,8 @@ int TAO_Acceptor_Registry::open_default (TAO_ORB_Core *orb_core, if (!(*i)->factory ()->requires_explicit_endpoint ()) { if (this->open_default (orb_core, - -1, /* use default major version */ - -1, /* use default minor version */ + TAO_DEF_GIOP_MAJOR, // default major + TAO_DEF_GIOP_MINOR, // default minor i, options) != 0) return -1; @@ -423,8 +423,8 @@ TAO_Acceptor_Registry::extract_endpoint_version (ACE_CString &address, { // Check if an "N.n@" version prefix was // specified. - major = -1; - minor = -1; + major = TAO_DEF_GIOP_MAJOR; + minor = TAO_DEF_GIOP_MINOR; if (isdigit (address[0]) && address[1] == '.' && isdigit (address[2]) @@ -476,8 +476,8 @@ TAO_Acceptor_Registry::open_i (TAO_ORB_Core *orb_core, { // Extract the desired endpoint/protocol version if one // exists. - int major = -1; - int minor = -1; + int major = TAO_DEF_GIOP_MAJOR; + int minor = TAO_DEF_GIOP_MINOR; this->extract_endpoint_version (address, major, minor); diff --git a/TAO/tao/Connector_Registry.cpp b/TAO/tao/Connector_Registry.cpp index 2348f087ea3..b28bb49718d 100644 --- a/TAO/tao/Connector_Registry.cpp +++ b/TAO/tao/Connector_Registry.cpp @@ -265,7 +265,8 @@ TAO_Connector_Registry::preprocess_preconnects (TAO_ORB_Core *orb_core, int TAO_Connector_Registry::connect (TAO_Endpoint *endpoint, TAO_Transport *&transport, - ACE_Time_Value *max_wait_time) + ACE_Time_Value *max_wait_time, + CORBA::Environment &ACE_TRY_ENV) { // Find the appropriate connector object TAO_Connector *connector = @@ -274,7 +275,10 @@ TAO_Connector_Registry::connect (TAO_Endpoint *endpoint, if (connector == 0) return -1; - return connector->connect (endpoint, transport, max_wait_time); + return connector->connect (endpoint, + transport, + max_wait_time, + ACE_TRY_ENV); } int diff --git a/TAO/tao/Connector_Registry.h b/TAO/tao/Connector_Registry.h index 646deb7cac2..068a484b019 100644 --- a/TAO/tao/Connector_Registry.h +++ b/TAO/tao/Connector_Registry.h @@ -77,7 +77,8 @@ public: int connect (TAO_Endpoint *endpoint, TAO_Transport *&transport, - ACE_Time_Value *max_wait_time = 0); + ACE_Time_Value *max_wait_time, + CORBA::Environment &ACE_TRY_ENV); // This is where the transport protocol is selected based on some // policy. This member will call the connect member of the // TAO_Connector class which in turn will call the concrete diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp index 89e9ddd2917..8ce28491d1b 100644 --- a/TAO/tao/IIOP_Connector.cpp +++ b/TAO/tao/IIOP_Connector.cpp @@ -461,7 +461,8 @@ TAO_IIOP_Connector::close (void) int TAO_IIOP_Connector::connect (TAO_Endpoint *endpoint, TAO_Transport *&transport, - ACE_Time_Value *max_wait_time) + ACE_Time_Value *max_wait_time, + CORBA::Environment &) { if (endpoint->tag () != TAO_TAG_IIOP_PROFILE) return -1; diff --git a/TAO/tao/IIOP_Connector.h b/TAO/tao/IIOP_Connector.h index 536eab7df3d..27c50361fbd 100644 --- a/TAO/tao/IIOP_Connector.h +++ b/TAO/tao/IIOP_Connector.h @@ -109,7 +109,8 @@ public: int close (void); int connect (TAO_Endpoint *endpoint, TAO_Transport *&transport, - ACE_Time_Value *max_wait_time); + ACE_Time_Value *max_wait_time, + CORBA::Environment &ACE_TRY_ENV); int preconnect (const char *preconnections); TAO_Profile *create_profile (TAO_InputCDR& cdr); diff --git a/TAO/tao/Invocation.cpp b/TAO/tao/Invocation.cpp index d966ac0311b..f0a0dfd8e6c 100644 --- a/TAO/tao/Invocation.cpp +++ b/TAO/tao/Invocation.cpp @@ -136,7 +136,11 @@ TAO_GIOP_Invocation::start (CORBA::Environment &ACE_TRY_ENV) // assert (this->stub_ != 0); if (this->stub_ == 0) - ACE_THROW (CORBA::INTERNAL ()); + ACE_THROW (CORBA::INTERNAL ( + CORBA_SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + EINVAL), + CORBA::COMPLETED_NO)); // Get a pointer to the connector registry, which might be in // thread-specific storage, depending on the concurrency model. @@ -144,7 +148,11 @@ TAO_GIOP_Invocation::start (CORBA::Environment &ACE_TRY_ENV) this->orb_core_->connector_registry (); if (conn_reg == 0) - ACE_THROW (CORBA::INTERNAL ()); + ACE_THROW (CORBA::INTERNAL ( + CORBA_SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + EINVAL), + CORBA::COMPLETED_NO)); // Initialize endpoint selection strategy. if (!this->is_selector_initialized_) @@ -201,7 +209,10 @@ TAO_GIOP_Invocation::start (CORBA::Environment &ACE_TRY_ENV) int result = conn_reg->connect (this->endpoint_, this->transport_, - this->max_wait_time_); + this->max_wait_time_, + ACE_TRY_ENV); + ACE_CHECK; + if (result == 0) { // Now that we have the client connection handler object we need to @@ -214,7 +225,8 @@ TAO_GIOP_Invocation::start (CORBA::Environment &ACE_TRY_ENV) if (TAO_debug_level > 0) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%N|%l|%p|%t) init_mesg_protocol () failed \n"))); + ACE_TEXT ("(%N|%l|%p|%t) ") + ACE_TEXT ("messaging_init() failed\n"))); } } else diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index 8148f36eb25..88e68c6850a 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -497,36 +497,6 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV) arg_shifter.consume_arg (); } else if ((current_arg = arg_shifter.get_the_parameter - - ("-ORBNameServiceIOR"))) - { - // Specify the IOR of the NameService. - // Issue a warning since this backward compatibilty support - // may be dropped in future releases. - ACE_DEBUG ((LM_WARNING, - ACE_TEXT ("(%P|%t) \nWARNING: The `-ORBNameServiceIOR' option ") - ACE_TEXT ("is obsolete.\n") - ACE_TEXT ("Please use the `-ORBInitRef ' option instead.\n"))); - - ACE_CString object_id (TAO_OBJID_NAMESERVICE); - ACE_CString IOR (current_arg); - if (this->init_ref_map_.bind (object_id, IOR) != 0) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Cannot store NameServiceIOR ") - ACE_TEXT ("argument '%s'\n"), - current_arg)); - ACE_THROW_RETURN (CORBA::INTERNAL ( - CORBA::SystemException::_tao_minor_code ( - TAO_ORB_CORE_INIT_LOCATION_CODE, - 0), - CORBA::COMPLETED_NO), - -1); - } - - arg_shifter.consume_arg (); - } - else if ((current_arg = arg_shifter.get_the_parameter ("-ORBNameServicePort"))) { // Specify the port number for the NameService. @@ -556,44 +526,6 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV) arg_shifter.consume_arg (); } else if ((current_arg = arg_shifter.get_the_parameter - ("-ORBTradingServiceIOR"))) - { - // Specify the IOR of the Trading Service. - - // Issue a warning since this backward compatibilty support - // may be dropped in future releases. - ACE_DEBUG ((LM_WARNING, - ACE_TEXT ("(%P|%t) \nWARNING: The `-ORBTradingServiceIOR' ") - ACE_TEXT ("option is obsolete.\n") - ACE_TEXT ("Please use the `-ORBInitRef' option instead.\n"))); - - // Construct an argument that would be equivalent to - // "-ORBInitRef TradingService=....." - - ACE_CString init_ref = - ACE_CString (TAO_OBJID_TRADINGSERVICE) + - ACE_CString ('=') + - ACE_CString (current_arg); - - ACE_CString object_id (TAO_OBJID_TRADINGSERVICE); - ACE_CString IOR (current_arg); - if (this->init_ref_map_.bind (object_id, IOR) != 0) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Cannot store TradingServiceIOR ") - ACE_TEXT ("argument '%s'\n"), - current_arg)); - ACE_THROW_RETURN (CORBA::INTERNAL ( - CORBA::SystemException::_tao_minor_code ( - TAO_ORB_CORE_INIT_LOCATION_CODE, - 0), - CORBA::COMPLETED_NO), - -1); - } - - arg_shifter.consume_arg (); - } - else if ((current_arg = arg_shifter.get_the_parameter ("-ORBTradingServicePort"))) { // Specify the port number for the NameService. @@ -603,39 +535,6 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV) arg_shifter.consume_arg (); } else if ((current_arg = arg_shifter.get_the_parameter - ("-ORBImplRepoServiceIOR"))) - { - // Specify the IOR of the Implementation Repository - - // Issue a warning since this backward compatibilty support - // may be dropped in future releases. - ACE_DEBUG ((LM_WARNING, - ACE_TEXT ("(%P|%t) \nWARNING: The `-ORBImplRepoServiceIOR' ") - ACE_TEXT ("option is obsolete.\n") - ACE_TEXT ("Please use the `-ORBInitRef' option instead.\n"))); - - // Construct an argument that would be equivalent to - // "-ORBInitRef ImplRepoService=....." - - ACE_CString object_id (TAO_OBJID_IMPLREPOSERVICE); - ACE_CString IOR (current_arg); - if (this->init_ref_map_.bind (object_id, IOR) != 0) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Cannot store ImplRepoServiceIOR ") - ACE_TEXT ("argument '%s'\n"), - current_arg)); - ACE_THROW_RETURN (CORBA::INTERNAL ( - CORBA::SystemException::_tao_minor_code ( - TAO_ORB_CORE_INIT_LOCATION_CODE, - 0), - CORBA::COMPLETED_NO), - -1); - } - - arg_shifter.consume_arg (); - } - else if ((current_arg = arg_shifter.get_the_parameter ("-ORBImplRepoServicePort"))) { // Specify the multicast port number for the Implementation @@ -805,6 +704,16 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV) -1); } + // validate_connection() supports the same functionality as + // the -ORBPreconnect option, and more. Multiple + // preconnections are also provided by validate_connection() + // via "banded connections." + ACE_ERROR ((LM_WARNING, + ACE_TEXT ("(%P|%t) -ORBPreconnect is ") + ACE_TEXT ("deprecated.\n") + ACE_TEXT ("(%P|%t) Use validate_connection()") + ACE_TEXT ("at run-time, instead.\n"))); + arg_shifter.consume_arg (); } else if ((current_arg = arg_shifter.get_the_parameter diff --git a/TAO/tao/Pluggable.h b/TAO/tao/Pluggable.h index a2d0a205d34..df22b4516e6 100644 --- a/TAO/tao/Pluggable.h +++ b/TAO/tao/Pluggable.h @@ -365,7 +365,8 @@ public: virtual int connect (TAO_Endpoint *endpoint, TAO_Transport *&, - ACE_Time_Value *max_wait_time) = 0; + ACE_Time_Value *max_wait_time, + CORBA::Environment &ACE_TRY_ENV) = 0; // To support pluggable we need to abstract away the connect() // method so it can be called from the GIOP code independant of the // actual transport protocol in use. diff --git a/TAO/tao/SHMIOP_Connector.cpp b/TAO/tao/SHMIOP_Connector.cpp index f7c71f68978..a0983a9255b 100644 --- a/TAO/tao/SHMIOP_Connector.cpp +++ b/TAO/tao/SHMIOP_Connector.cpp @@ -439,7 +439,8 @@ TAO_SHMIOP_Connector::close (void) int TAO_SHMIOP_Connector::connect (TAO_Endpoint *endpoint, TAO_Transport *&transport, - ACE_Time_Value *max_wait_time) + ACE_Time_Value *max_wait_time, + CORBA::Environment &) { if (endpoint->tag () != TAO_TAG_SHMEM_PROFILE) return -1; diff --git a/TAO/tao/SHMIOP_Connector.h b/TAO/tao/SHMIOP_Connector.h index 2444851d9ac..460973b99c9 100644 --- a/TAO/tao/SHMIOP_Connector.h +++ b/TAO/tao/SHMIOP_Connector.h @@ -105,7 +105,8 @@ public: int close (void); int connect (TAO_Endpoint *endpoint, TAO_Transport *&transport, - ACE_Time_Value *max_wait_time); + ACE_Time_Value *max_wait_time, + CORBA::Environment &ACE_TRY_ENV); int preconnect (const char *preconnections); TAO_Profile *create_profile (TAO_InputCDR& cdr); diff --git a/TAO/tao/UIOP_Connector.cpp b/TAO/tao/UIOP_Connector.cpp index 8dfb1690d47..4b03784faf3 100644 --- a/TAO/tao/UIOP_Connector.cpp +++ b/TAO/tao/UIOP_Connector.cpp @@ -466,7 +466,8 @@ TAO_UIOP_Connector::close (void) int TAO_UIOP_Connector::connect (TAO_Endpoint *endpoint, TAO_Transport *& transport, - ACE_Time_Value *max_wait_time) + ACE_Time_Value *max_wait_time, + CORBA::Environment &) { if (endpoint->tag () != TAO_TAG_UIOP_PROFILE) return -1; diff --git a/TAO/tao/UIOP_Connector.h b/TAO/tao/UIOP_Connector.h index 3da76a32a9c..5ccc8c6ce5e 100644 --- a/TAO/tao/UIOP_Connector.h +++ b/TAO/tao/UIOP_Connector.h @@ -112,7 +112,8 @@ public: int close (void); int connect (TAO_Endpoint *endpoint, TAO_Transport *&transport, - ACE_Time_Value *max_wait_time); + ACE_Time_Value *max_wait_time, + CORBA::Environment &ACE_TRY_ENV); int preconnect (const char *preconnections); TAO_Profile *create_profile (TAO_InputCDR& cdr); |