42 : entry_name_(entryName)
43 , auth_name_(DEFAULT_PLUGIN_NAME)
44 , access_ctrl_name_(DEFAULT_PLUGIN_NAME)
45 , crypto_name_(DEFAULT_PLUGIN_NAME)
107 iter->second->shutdown();
121 ACE_TEXT(
"(%P|%t) SecurityRegistry::register_plugin: ")
122 ACE_TEXT(
"plugin=%C already exists.\n"),
123 plugin_name.c_str()));
136 return existing_config;
142 ConfigEntryMap::const_iterator iEntry =
config_entries_.find(config_name);
145 ACE_TEXT(
"(%P|%t) SecurityRegistry::create_config: ")
146 ACE_TEXT(
"config=%C does not exist.\n"),
147 config_name.c_str()));
155 if (auth_plugin_inst.
is_nil()) {
157 ACE_TEXT(
"(%P|%t) SecurityRegistry::create_config: ")
158 ACE_TEXT(
"Failed to load authentication plugin %C\n"),
159 entry->get_auth_name().c_str()));
164 if (ac_plugin_inst.
is_nil()) {
166 ACE_TEXT(
"(%P|%t) SecurityRegistry::create_config: ")
167 ACE_TEXT(
"Failed to load access control plugin %C\n"),
168 entry->get_access_control_name().c_str()));
173 if (crypto_plugin_inst.
is_nil()) {
175 ACE_TEXT(
"(%P|%t) SecurityRegistry::create_config: ")
176 ACE_TEXT(
"Failed to load crypto plugin %C\n"),
177 entry->get_crypto_name().c_str()));
185 DCPS::make_rch<SecurityConfig>(config_name,
186 #ifdef OPENDDS_SECURITY 187 auth_plugin_inst->create_authentication(),
188 ac_plugin_inst->create_access_control(),
189 crypto_plugin_inst->create_crypto_key_exchange(),
190 crypto_plugin_inst->create_crypto_key_factory(),
191 crypto_plugin_inst->create_crypto_transform(),
194 entry->get_properties());
198 ACE_TEXT(
"(%P|%t) SecurityRegistry::create_config: ")
199 ACE_TEXT(
"Error storing config instance %C\n"),
200 config_name.c_str()));
211 #ifndef OPENDDS_SECURITY 212 ACE_UNUSED_ARG(plugin);
217 return existing_config;
221 DCPS::make_rch<SecurityConfig>(config_name,
222 #ifdef OPENDDS_SECURITY 223 plugin->create_authentication(),
224 plugin->create_access_control(),
225 plugin->create_crypto_key_exchange(),
226 plugin->create_crypto_key_factory(),
227 plugin->create_crypto_transform(),
228 plugin->create_utility(),
230 ConfigPropertyList());
234 ACE_TEXT(
"(%P|%t) SecurityRegistry::create_config: ")
235 ACE_TEXT(
"Error storing config instance %C\n"),
236 config_name.c_str()));
247 ConfigMap::const_iterator found =
config_map_.find(config_name);
254 #if defined(OPENDDS_SECURITY) 257 Authentication_var a;
259 CryptoKeyExchange_var c;
260 CryptoKeyFactory_var d;
261 CryptoTransform_var e;
262 default_config_ = DCPS::make_rch<SecurityConfig>(
"NoPlugins", a, b, c, d, e,
264 ConfigPropertyList());
280 #if defined(OPENDDS_SECURITY) 284 #if !defined(ACE_AS_STATIC_LIBS) 316 ACE_TEXT(
"(%P|%t) SecurityRegistry::load_plugin_properties: ")
317 ACE_TEXT(
"failed to open section %s\n"),
327 ACE_TEXT(
"(%P|%t) SecurityRegistry::load_plugin_properties: ")
328 ACE_TEXT(
"[%s] sections must have a section name\n"),
336 ACE_TEXT(
"(%P|%t) SecurityRegistry::load_plugin_properties: ")
337 ACE_TEXT(
"too many nesting layers in [%s] section.\n"),
343 for (DCPS::KeyList::const_iterator it = keys.begin(); it != keys.end(); ++it) {
348 ACE_TEXT(
"(%P|%t) SecurityRegistry::load_plugin_properties: ")
349 ACE_TEXT(
"duplicate sections named [%s/%C].\n"),
350 sect_name.
c_str(), entry_name.c_str()),
357 DCPS::make_rch<SecurityConfigEntry>(it->first);
358 DCPS::ValueMap values;
360 for (DCPS::ValueMap::const_iterator val = values.begin(); val != values.end(); ++val) {
361 newEntry->add_property(val->first, val->second);
375 ACE_UNUSED_ARG(security_plugin_type);
376 #if !defined(ACE_AS_STATIC_LIBS) 392 bool found_config =
false;
393 ConfigMap::iterator iConfig =
config_map_.find(name);
395 config = iConfig->second;
407 bool added_config =
false;
408 ConfigMap::iterator iConfig =
config_map_.find(name);
414 config = iConfig->second;
429 #if !defined(ACE_AS_STATIC_LIBS)
static const char * DEFAULT_INST_PREFIX
ConfigEntryMap config_entries_
const char * c_str(void) const
const LogLevel::Value value
ConfigPropertyList properties_
static const char * BUILTIN_CONFIG_NAME
int load_security_configuration(ACE_Configuration_Heap &cf)
bool add_config(const OPENDDS_STRING &name, SecurityConfig_rch &config)
SecurityConfig_rch builtin_config_
static int process_directive(const ACE_TCHAR directive[])
static SecurityRegistry * instance()
Return a singleton instance of this class.
bool find_config(const OPENDDS_STRING &name, SecurityConfig_rch &config)
LockType default_load_lock_
#define OPENDDS_ASSERT(C)
SecurityConfig_rch default_config() const
virtual const ACE_Configuration_Section_Key & root_section(void) const
static const char * AUTHENTICATION_PLUGIN_NAME
static const char * ACCESS_CTRL_PLUGIN_NAME
InstMap registered_plugins_
SecurityConfig_rch default_config_
static TYPE * instance(void)
SecurityConfig_rch builtin_config() const
static const char * DEFAULT_PLUGIN_NAME
void register_plugin(const OPENDDS_STRING &plugin_name, SecurityPluginInst_rch plugin)
static const char * SECURITY_SECTION_NAME
void add_property(const OPENDDS_STRING &name, const OPENDDS_STRING &value)
SecurityConfigEntry(const OPENDDS_STRING &entryNamee)
#define ACE_TEXT_CHAR_TO_TCHAR(STRING)
int strcmp(const char *s, const char *t)
int find(const PG_Property_Set &decoder, const ACE_CString &key, TYPE &value)
LibDirectiveMap lib_directive_map_
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
SecurityConfig_rch get_config(const OPENDDS_STRING &config_name) const
SecurityPluginInst_rch get_plugin_inst(const OPENDDS_STRING &plugin_name, bool attempt_fix=true)
virtual int open_section(const ACE_Configuration_Section_Key &base, const ACE_TCHAR *sub_section, bool create, ACE_Configuration_Section_Key &result)
void load_security_plugin_lib(const OPENDDS_STRING &security_plugin_type)
static const char * DEFAULT_CONFIG_NAME
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
int processSections(ACE_Configuration_Heap &cf, const ACE_Configuration_Section_Key &key, KeyList &subsections)
SecurityConfig_rch create_config(const OPENDDS_STRING &config_name)
virtual int enumerate_sections(const ACE_Configuration_Section_Key &key, int index, ACE_TString &name)
#define ACE_ERROR_RETURN(X, Y)
int pullValues(ACE_Configuration_Heap &cf, const ACE_Configuration_Section_Key &key, ValueMap &values)
DCPS::RcHandle< SecurityConfig > SecurityConfig_rch
static const char * CRYPTO_PLUGIN_NAME
#define TheServiceParticipant
bool has_no_configs() const
The Internal API and Implementation of OpenDDS.
static void close()
Close the singleton instance of this class.