diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2001-07-09 09:07:36 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2001-07-09 09:07:36 +0000 |
commit | 58f81c2b8d81ed0a05eba6c35f7efbe5ccbf0bd6 (patch) | |
tree | 48e896264efacafb460e3108ac3bbd45354b1a8a /TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.cpp | |
parent | a41f3431648f0e192564893a5b366db5657cab5d (diff) | |
download | ATCD-58f81c2b8d81ed0a05eba6c35f7efbe5ccbf0bd6.tar.gz |
ChangeLogTag:Mon Jul 09 01:51:27 2001 Ossama Othman <ossama@uci.edu>
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.cpp')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.cpp | 75 |
1 files changed, 41 insertions, 34 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.cpp b/TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.cpp index 930cb1f375e..c63a5257c58 100644 --- a/TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.cpp +++ b/TAO/orbsvcs/orbsvcs/Security/Security_ORBInitializer.cpp @@ -9,8 +9,8 @@ ACE_RCSID (TAO_Security, #include "tao/ORBInitInfo.h" -//#include "Security_PolicyFactory.h" #include "Security_Current.h" +#include "Security_PolicyFactory.h" void @@ -73,63 +73,70 @@ TAO_Security_ORBInitializer::pre_init ( void TAO_Security_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr - TAO_ENV_ARG_DECL_NOT_USED) + PortableInterceptor::ORBInitInfo_ptr info + TAO_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - // @todo: Secure invocation policy support should hopefully be - // ready for TAO 1.2. -#if 0 + TAO_ENV_ARG_DEFN; + this->register_policy_factories (info, ACE_TRY_ENV); ACE_CHECK; -#endif /* 0 */ } -// @todo: Secure invocation policy support should hopefully be -// ready for TAO 1.2. -#if 0 void TAO_Security_ORBInitializer::register_policy_factories ( PortableInterceptor::ORBInitInfo_ptr info, CORBA::Environment &ACE_TRY_ENV) { - /// Register the Security policy factories. - PortableInterceptor::PolicyFactory_ptr temp_factory = - PortableInterceptor::PolicyFactory::_nil (); - PortableInterceptor::PolicyFactory_var policy_factory; + // Register the security policy factories. - // ---------------------------------------------------------------- - // This policy factory is used for all SecureInvocation related - // policies. - ACE_NEW_THROW_EX (temp_factory, - TAO_SecureInvocationPolicyFactory, - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO_DEFAULT_MINOR_CODE, - ENOMEM), - CORBA::COMPLETED_NO)); + // The security policy factory is stateless and reentrant, so share a + // single instance between all ORBs. + PortableInterceptor::PolicyFactory_ptr policy_factory = + &(this->policy_factory_); + + // Bind the same policy factory to all security related policy + // types since a single policy factory is used to create each of + // the different types of security policies. + + CORBA::PolicyType type; + + type = Security::SecQOPPolicy; + info->register_policy_factory (type, + policy_factory, + ACE_TRY_ENV); ACE_CHECK; - policy_factory = temp_factory; + type = Security::SecMechanismsPolicy; + info->register_policy_factory (type, + policy_factory, + ACE_TRY_ENV); + ACE_CHECK; - // Bind the same policy factory to all SecureInvocation related - // policy types since a single policy factory is used to create each - // of the different types of SecureInvocation policies. + type = Security::SecInvocationCredentialsPolicy; + info->register_policy_factory (type, + policy_factory, + ACE_TRY_ENV); + ACE_CHECK; - CORBA::PolicyType type; + type = Security::SecFeaturePolicy; // Deprecated + info->register_policy_factory (type, + policy_factory, + ACE_TRY_ENV); + ACE_CHECK; - type = Security::SecClientSecureInvocation; + type = Security::SecDelegationDirectivePolicy; info->register_policy_factory (type, - policy_factory.in (), + policy_factory, ACE_TRY_ENV); ACE_CHECK; - type = Security::SecTargetSecureInvocation; + type = Security::SecEstablishTrustPolicy; info->register_policy_factory (type, - policy_factory.in (), + policy_factory, ACE_TRY_ENV); ACE_CHECK; + // ---------------------------------------------------------------- } -#endif /* 0 */ |