diff options
Diffstat (limited to 'src')
23 files changed, 54 insertions, 54 deletions
diff --git a/src/libstrongswan/credentials/credential_manager.c b/src/libstrongswan/credentials/credential_manager.c index de19c8d96..3ec0714b6 100644 --- a/src/libstrongswan/credentials/credential_manager.c +++ b/src/libstrongswan/credentials/credential_manager.c @@ -1349,7 +1349,7 @@ credential_manager_t *credential_manager_create() this->local_sets = thread_value_create((thread_cleanup_t)this->sets->destroy); this->exclusive_local_sets = thread_value_create((thread_cleanup_t)this->sets->destroy); - if (lib->settings->get_bool(lib->settings, "libstrongswan.cert_cache", TRUE)) + if (lib->settings->get_bool(lib->settings, "%s.cert_cache", TRUE, lib->ns)) { this->cache = cert_cache_create(); this->sets->insert_first(this->sets, this->cache); diff --git a/src/libstrongswan/crypto/crypto_factory.c b/src/libstrongswan/crypto/crypto_factory.c index edcabfe58..dba3f6f6d 100644 --- a/src/libstrongswan/crypto/crypto_factory.c +++ b/src/libstrongswan/crypto/crypto_factory.c @@ -967,11 +967,11 @@ crypto_factory_t *crypto_factory_create() .lock = rwlock_create(RWLOCK_TYPE_DEFAULT), .tester = crypto_tester_create(), .test_on_add = lib->settings->get_bool(lib->settings, - "libstrongswan.crypto_test.on_add", FALSE), + "%s.crypto_test.on_add", FALSE, lib->ns), .test_on_create = lib->settings->get_bool(lib->settings, - "libstrongswan.crypto_test.on_create", FALSE), + "%s.crypto_test.on_create", FALSE, lib->ns), .bench = lib->settings->get_bool(lib->settings, - "libstrongswan.crypto_test.bench", FALSE), + "%s.crypto_test.bench", FALSE, lib->ns), ); return &this->public; diff --git a/src/libstrongswan/crypto/crypto_tester.c b/src/libstrongswan/crypto/crypto_tester.c index 5a0dccced..30724b16d 100644 --- a/src/libstrongswan/crypto/crypto_tester.c +++ b/src/libstrongswan/crypto/crypto_tester.c @@ -1207,13 +1207,13 @@ crypto_tester_t *crypto_tester_create() .rng = linked_list_create(), .required = lib->settings->get_bool(lib->settings, - "libstrongswan.crypto_test.required", FALSE), + "%s.crypto_test.required", FALSE, lib->ns), .rng_true = lib->settings->get_bool(lib->settings, - "libstrongswan.crypto_test.rng_true", FALSE), + "%s.crypto_test.rng_true", FALSE, lib->ns), .bench_time = lib->settings->get_int(lib->settings, - "libstrongswan.crypto_test.bench_time", 50), + "%s.crypto_test.bench_time", 50, lib->ns), .bench_size = lib->settings->get_int(lib->settings, - "libstrongswan.crypto_test.bench_size", 1024), + "%s.crypto_test.bench_size", 1024, lib->ns), ); /* enforce a block size of 16, should be fine for all algorithms */ diff --git a/src/libstrongswan/crypto/diffie_hellman.c b/src/libstrongswan/crypto/diffie_hellman.c index f71ebc671..5c1d08de2 100644 --- a/src/libstrongswan/crypto/diffie_hellman.c +++ b/src/libstrongswan/crypto/diffie_hellman.c @@ -444,7 +444,7 @@ diffie_hellman_params_t *diffie_hellman_get_params(diffie_hellman_group_t group) { if (!dh_params[i].public.subgroup.len && lib->settings->get_int(lib->settings, - "libstrongswan.dh_exponent_ansi_x9_42", TRUE)) + "%s.dh_exponent_ansi_x9_42", TRUE, lib->ns)) { dh_params[i].public.exp_len = dh_params[i].public.prime.len; } diff --git a/src/libstrongswan/library.c b/src/libstrongswan/library.c index c075fd8b4..0df0c4212 100644 --- a/src/libstrongswan/library.c +++ b/src/libstrongswan/library.c @@ -108,7 +108,7 @@ void library_deinit() } detailed = lib->settings->get_bool(lib->settings, - "libstrongswan.leak_detective.detailed", TRUE); + "%s.leak_detective.detailed", TRUE, lib->ns); /* make sure the cache is clear before unloading plugins */ lib->credmgr->flush_cache(lib->credmgr, CERT_ANY); @@ -318,7 +318,7 @@ bool library_init(char *settings, const char *namespace) } if (lib->settings->get_bool(lib->settings, - "libstrongswan.integrity_test", FALSE)) + "%s.integrity_test", FALSE, lib->ns)) { #ifdef INTEGRITY_TEST this->public.integrity = integrity_checker_create(CHECKSUM_LIBRARY); diff --git a/src/libstrongswan/networking/host_resolver.c b/src/libstrongswan/networking/host_resolver.c index 99a17d17c..10af11a7f 100644 --- a/src/libstrongswan/networking/host_resolver.c +++ b/src/libstrongswan/networking/host_resolver.c @@ -355,11 +355,11 @@ host_resolver_t *host_resolver_create() ); this->min_threads = max(0, lib->settings->get_int(lib->settings, - "libstrongswan.host_resolver.min_threads", - MIN_THREADS_DEFAULT)); + "%s.host_resolver.min_threads", + MIN_THREADS_DEFAULT, lib->ns)); this->max_threads = max(this->min_threads ?: 1, lib->settings->get_int(lib->settings, - "libstrongswan.host_resolver.max_threads", - MAX_THREADS_DEFAULT)); + "%s.host_resolver.max_threads", + MAX_THREADS_DEFAULT, lib->ns)); return &this->public; } diff --git a/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c b/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c index 160db042b..44f3f84b1 100644 --- a/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c +++ b/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c @@ -194,8 +194,8 @@ plugin_t *gcrypt_plugin_create() /* we currently do not use secure memory */ gcry_control(GCRYCTL_DISABLE_SECMEM, 0); - if (lib->settings->get_bool(lib->settings, - "libstrongswan.plugins.gcrypt.quick_random", FALSE)) + if (lib->settings->get_bool(lib->settings, "%s.plugins.gcrypt.quick_random", + FALSE, lib->ns)) { gcry_control(GCRYCTL_ENABLE_QUICK_RANDOM, 0); } diff --git a/src/libstrongswan/plugins/ntru/ntru_drbg.c b/src/libstrongswan/plugins/ntru/ntru_drbg.c index 6fc13aa0a..181a58939 100644 --- a/src/libstrongswan/plugins/ntru/ntru_drbg.c +++ b/src/libstrongswan/plugins/ntru/ntru_drbg.c @@ -230,8 +230,8 @@ ntru_drbg_t *ntru_drbg_create(u_int32_t strength, chunk_t pers_str, } max_requests = lib->settings->get_int(lib->settings, - "libstrongswan.plugins.ntru.max_drbg_requests", - MAX_DRBG_REQUESTS); + "%s.plugins.ntru.max_drbg_requests", + MAX_DRBG_REQUESTS, lib->ns); INIT(this, .public = { diff --git a/src/libstrongswan/plugins/ntru/ntru_ke.c b/src/libstrongswan/plugins/ntru/ntru_ke.c index a23991b27..39fb261cd 100644 --- a/src/libstrongswan/plugins/ntru/ntru_ke.c +++ b/src/libstrongswan/plugins/ntru/ntru_ke.c @@ -316,7 +316,7 @@ ntru_ke_t *ntru_ke_create(diffie_hellman_group_t group, chunk_t g, chunk_t p) u_int32_t strength; parameter_set = lib->settings->get_str(lib->settings, - "libstrongswan.plugins.ntru.parameter_set", "optimum"); + "%s.plugins.ntru.parameter_set", "optimum", lib->ns); if (streq(parameter_set, "x9_98_speed")) { diff --git a/src/libstrongswan/plugins/openssl/openssl_crl.c b/src/libstrongswan/plugins/openssl/openssl_crl.c index 18aa5ceca..cb02c663c 100644 --- a/src/libstrongswan/plugins/openssl/openssl_crl.c +++ b/src/libstrongswan/plugins/openssl/openssl_crl.c @@ -471,7 +471,7 @@ static bool parse_extensions(private_openssl_crl_t *this) default: ok = X509_EXTENSION_get_critical(ext) == 0 || !lib->settings->get_bool(lib->settings, - "libstrongswan.x509.enforce_critical", TRUE); + "%s.x509.enforce_critical", TRUE, lib->ns); if (!ok) { DBG1(DBG_LIB, "found unsupported critical X.509 " diff --git a/src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c b/src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c index 835ed586e..b487d59a5 100644 --- a/src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c +++ b/src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c @@ -201,7 +201,7 @@ static bool compute_shared_key(private_openssl_ec_diffie_hellman_t *this, * http://www.rfc-editor.org/errata_search.php?eid=9 */ x_coordinate_only = lib->settings->get_bool(lib->settings, - "libstrongswan.ecp_x_coordinate_only", TRUE); + "%s.ecp_x_coordinate_only", TRUE, lib->ns); if (!ecp2chunk(this->ec_group, secret, shared_secret, x_coordinate_only)) { goto error; diff --git a/src/libstrongswan/plugins/openssl/openssl_plugin.c b/src/libstrongswan/plugins/openssl/openssl_plugin.c index ff2508609..f4aef8200 100644 --- a/src/libstrongswan/plugins/openssl/openssl_plugin.c +++ b/src/libstrongswan/plugins/openssl/openssl_plugin.c @@ -522,7 +522,7 @@ plugin_t *openssl_plugin_create() int fips_mode; fips_mode = lib->settings->get_int(lib->settings, - "libstrongswan.plugins.openssl.fips_mode", FIPS_MODE); + "%s.plugins.openssl.fips_mode", FIPS_MODE, lib->ns); #ifdef OPENSSL_FIPS if (fips_mode) { diff --git a/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c b/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c index 036f53d23..10a35c1fd 100644 --- a/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c +++ b/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c @@ -558,7 +558,7 @@ openssl_rsa_private_key_t *openssl_rsa_private_key_connect(key_type_t type, if (!engine_id) { engine_id = lib->settings->get_str(lib->settings, - "libstrongswan.plugins.openssl.engine_id", "pkcs11"); + "%s.plugins.openssl.engine_id", "pkcs11", lib->ns); } engine = ENGINE_by_id(engine_id); if (!engine) diff --git a/src/libstrongswan/plugins/openssl/openssl_x509.c b/src/libstrongswan/plugins/openssl/openssl_x509.c index 24b12d50c..7a5b206dd 100644 --- a/src/libstrongswan/plugins/openssl/openssl_x509.c +++ b/src/libstrongswan/plugins/openssl/openssl_x509.c @@ -1012,7 +1012,7 @@ static bool parse_extensions(private_openssl_x509_t *this) default: ok = X509_EXTENSION_get_critical(ext) == 0 || !lib->settings->get_bool(lib->settings, - "libstrongswan.x509.enforce_critical", TRUE); + "%s.x509.enforce_critical", TRUE, lib->ns); if (!ok) { char buf[80] = ""; diff --git a/src/libstrongswan/plugins/pkcs11/pkcs11_dh.c b/src/libstrongswan/plugins/pkcs11/pkcs11_dh.c index 2e5af95ff..36cc284bf 100644 --- a/src/libstrongswan/plugins/pkcs11/pkcs11_dh.c +++ b/src/libstrongswan/plugins/pkcs11/pkcs11_dh.c @@ -135,7 +135,7 @@ METHOD(diffie_hellman_t, set_other_public_value, void, }; if (!lib->settings->get_bool(lib->settings, - "libstrongswan.ecp_x_coordinate_only", TRUE)) + "%s.ecp_x_coordinate_only", TRUE, lib->ns)) { /* we only get the x coordinate back */ return; } diff --git a/src/libstrongswan/plugins/pkcs11/pkcs11_manager.c b/src/libstrongswan/plugins/pkcs11/pkcs11_manager.c index 8bda5b66f..96c4a180d 100644 --- a/src/libstrongswan/plugins/pkcs11/pkcs11_manager.c +++ b/src/libstrongswan/plugins/pkcs11/pkcs11_manager.c @@ -338,7 +338,7 @@ pkcs11_manager_t *pkcs11_manager_create(pkcs11_manager_token_event_t cb, ); enumerator = lib->settings->create_section_enumerator(lib->settings, - "libstrongswan.plugins.pkcs11.modules"); + "%s.plugins.pkcs11.modules", lib->ns); while (enumerator->enumerate(enumerator, &module)) { INIT(entry, @@ -346,7 +346,7 @@ pkcs11_manager_t *pkcs11_manager_create(pkcs11_manager_token_event_t cb, ); entry->path = lib->settings->get_str(lib->settings, - "libstrongswan.plugins.pkcs11.modules.%s.path", NULL, module); + "%s.plugins.pkcs11.modules.%s.path", NULL, lib->ns, module); if (!entry->path) { DBG1(DBG_CFG, "PKCS11 module '%s' lacks library path", module); @@ -355,8 +355,8 @@ pkcs11_manager_t *pkcs11_manager_create(pkcs11_manager_token_event_t cb, } entry->lib = pkcs11_library_create(module, entry->path, lib->settings->get_bool(lib->settings, - "libstrongswan.plugins.pkcs11.modules.%s.os_locking", - FALSE, module)); + "%s.plugins.pkcs11.modules.%s.os_locking", + FALSE, lib->ns, module)); if (!entry->lib) { free(entry); diff --git a/src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c b/src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c index 3faa59cae..bd2a2c114 100644 --- a/src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c +++ b/src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c @@ -83,8 +83,8 @@ static void token_event_cb(private_pkcs11_plugin_t *this, pkcs11_library_t *p11, if (add && this->handle_events) { if (lib->settings->get_bool(lib->settings, - "libstrongswan.plugins.pkcs11.modules.%s.load_certs", - TRUE, p11->get_name(p11))) + "%s.plugins.pkcs11.modules.%s.load_certs", + TRUE, lib->ns, p11->get_name(p11))) { creds = pkcs11_creds_create(p11, slot); if (creds) @@ -174,8 +174,8 @@ static bool handle_certs(private_pkcs11_plugin_t *this, METHOD(plugin_t, reload, bool, private_pkcs11_plugin_t *this) { - if (lib->settings->get_bool(lib->settings, - "libstrongswan.plugins.pkcs11.reload_certs", FALSE)) + if (lib->settings->get_bool(lib->settings, "%s.plugins.pkcs11.reload_certs", + FALSE, lib->ns)) { DBG1(DBG_CFG, "reloading certificates from PKCS#11 tokens"); handle_certs(this, NULL, FALSE, NULL); @@ -247,28 +247,28 @@ METHOD(plugin_t, get_features, int, if (!count) { /* initialize only once */ bool use_ecc = lib->settings->get_bool(lib->settings, - "libstrongswan.plugins.pkcs11.use_ecc", FALSE); + "%s.plugins.pkcs11.use_ecc", FALSE, lib->ns); plugin_features_add(f, f_manager, countof(f_manager), &count); /* private key handling for EC keys is not disabled by use_ecc */ plugin_features_add(f, f_privkey, countof(f_privkey), &count); if (lib->settings->get_bool(lib->settings, - "libstrongswan.plugins.pkcs11.use_pubkey", FALSE)) + "%s.plugins.pkcs11.use_pubkey", FALSE, lib->ns)) { plugin_features_add(f, f_pubkey, countof(f_pubkey) - (use_ecc ? 0 : 1), &count); } if (lib->settings->get_bool(lib->settings, - "libstrongswan.plugins.pkcs11.use_hasher", FALSE)) + "%s.plugins.pkcs11.use_hasher", FALSE, lib->ns)) { plugin_features_add(f, f_hash, countof(f_hash), &count); } if (lib->settings->get_bool(lib->settings, - "libstrongswan.plugins.pkcs11.use_rng", FALSE)) + "%s.plugins.pkcs11.use_rng", FALSE, lib->ns)) { plugin_features_add(f, f_rng, countof(f_rng), &count); } if (lib->settings->get_bool(lib->settings, - "libstrongswan.plugins.pkcs11.use_dh", FALSE)) + "%s.plugins.pkcs11.use_dh", FALSE, lib->ns)) { plugin_features_add(f, f_dh, countof(f_dh), &count); if (use_ecc) diff --git a/src/libstrongswan/plugins/random/random_plugin.c b/src/libstrongswan/plugins/random/random_plugin.c index 8ac1ac366..1f1079240 100644 --- a/src/libstrongswan/plugins/random/random_plugin.c +++ b/src/libstrongswan/plugins/random/random_plugin.c @@ -143,11 +143,11 @@ plugin_t *random_plugin_create() ); strong_equals_true = lib->settings->get_bool(lib->settings, - "libstrongswan.plugins.random.strong_equals_true", FALSE); + "%s.plugins.random.strong_equals_true", FALSE, lib->ns); urandom_file = lib->settings->get_str(lib->settings, - "libstrongswan.plugins.random.urandom", DEV_URANDOM); + "%s.plugins.random.urandom", DEV_URANDOM, lib->ns); random_file = lib->settings->get_str(lib->settings, - "libstrongswan.plugins.random.random", DEV_RANDOM); + "%s.plugins.random.random", DEV_RANDOM, lib->ns); if (!open_dev(urandom_file, &dev_urandom) || !open_dev(random_file, &dev_random)) { diff --git a/src/libstrongswan/plugins/unbound/unbound_resolver.c b/src/libstrongswan/plugins/unbound/unbound_resolver.c index 42cdbc6cc..745e59d5b 100644 --- a/src/libstrongswan/plugins/unbound/unbound_resolver.c +++ b/src/libstrongswan/plugins/unbound/unbound_resolver.c @@ -97,14 +97,14 @@ resolver_t *unbound_resolver_create(void) char *resolv_conf, *trust_anchors, *dlv_anchors; resolv_conf = lib->settings->get_str(lib->settings, - "libstrongswan.plugins.unbound.resolv_conf", - RESOLV_CONF_FILE); + "%s.plugins.unbound.resolv_conf", + RESOLV_CONF_FILE, lib->ns); trust_anchors = lib->settings->get_str(lib->settings, - "libstrongswan.plugins.unbound.trust_anchors", - TRUST_ANCHOR_FILE); + "%s.plugins.unbound.trust_anchors", + TRUST_ANCHOR_FILE, lib->ns); dlv_anchors = lib->settings->get_str(lib->settings, - "libstrongswan.plugins.unbound.dlv_anchors", - NULL); + "%s.plugins.unbound.dlv_anchors", + NULL, lib->ns); INIT(this, .public = { diff --git a/src/libstrongswan/plugins/x509/x509_cert.c b/src/libstrongswan/plugins/x509/x509_cert.c index 85c481552..09eda32b3 100644 --- a/src/libstrongswan/plugins/x509/x509_cert.c +++ b/src/libstrongswan/plugins/x509/x509_cert.c @@ -1446,7 +1446,7 @@ static bool parse_certificate(private_x509_cert_t *this) break; default: if (critical && lib->settings->get_bool(lib->settings, - "libstrongswan.x509.enforce_critical", TRUE)) + "%s.x509.enforce_critical", TRUE, lib->ns)) { DBG1(DBG_ASN, "critical '%s' extension not supported", (extn_oid == OID_UNKNOWN) ? "unknown" : diff --git a/src/libstrongswan/plugins/x509/x509_crl.c b/src/libstrongswan/plugins/x509/x509_crl.c index efb70c94c..d6057c30f 100644 --- a/src/libstrongswan/plugins/x509/x509_crl.c +++ b/src/libstrongswan/plugins/x509/x509_crl.c @@ -325,7 +325,7 @@ static bool parse(private_x509_crl_t *this) break; default: if (critical && lib->settings->get_bool(lib->settings, - "libstrongswan.x509.enforce_critical", TRUE)) + "%s.x509.enforce_critical", TRUE, lib->ns)) { DBG1(DBG_ASN, "critical '%s' extension not supported", (extn_oid == OID_UNKNOWN) ? "unknown" : diff --git a/src/libstrongswan/processing/processor.c b/src/libstrongswan/processing/processor.c index adbd95685..012b169e3 100644 --- a/src/libstrongswan/processing/processor.c +++ b/src/libstrongswan/processing/processor.c @@ -545,7 +545,7 @@ processor_t *processor_create() { this->jobs[i] = linked_list_create(); this->prio_threads[i] = lib->settings->get_int(lib->settings, - "libstrongswan.processor.priority_threads.%N", 0, + "%s.processor.priority_threads.%N", 0, lib->ns, job_priority_names, i); } diff --git a/src/libstrongswan/utils/leak_detective.c b/src/libstrongswan/utils/leak_detective.c index ff80bbc89..6f5a2c87a 100644 --- a/src/libstrongswan/utils/leak_detective.c +++ b/src/libstrongswan/utils/leak_detective.c @@ -754,11 +754,11 @@ METHOD(leak_detective_t, usage, void, size_t sum = 0; thresh = lib->settings->get_int(lib->settings, - "libstrongswan.leak_detective.usage_threshold", 10240); + "%s.leak_detective.usage_threshold", 10240, lib->ns); thresh_count = lib->settings->get_int(lib->settings, - "libstrongswan.leak_detective.usage_threshold_count", 0); + "%s.leak_detective.usage_threshold_count", 0, lib->ns); detailed = lib->settings->get_bool(lib->settings, - "libstrongswan.leak_detective.detailed", TRUE); + "%s.leak_detective.detailed", TRUE, lib->ns); leaks = print_traces(this, cb, user, thresh, thresh_count, detailed, &whitelisted, &sum); |