aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/plugins/load_tester
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2008-11-10 16:43:15 +0000
committerMartin Willi <martin@strongswan.org>2008-11-10 16:43:15 +0000
commita9f081e5ad86f22a2ec52290fb8249056c5cb7f4 (patch)
tree93fca2fba462ac04c7741e51c5892b6f0f0c1668 /src/charon/plugins/load_tester
parentf821bfb2b38cec99af408f1990f815a1f31700e9 (diff)
downloadstrongswan-a9f081e5ad86f22a2ec52290fb8249056c5cb7f4.tar.bz2
strongswan-a9f081e5ad86f22a2ec52290fb8249056c5cb7f4.tar.xz
make load_tester more strict to use it along stroke
Diffstat (limited to 'src/charon/plugins/load_tester')
-rw-r--r--src/charon/plugins/load_tester/load_tester_config.c9
-rw-r--r--src/charon/plugins/load_tester/load_tester_creds.c12
2 files changed, 17 insertions, 4 deletions
diff --git a/src/charon/plugins/load_tester/load_tester_config.c b/src/charon/plugins/load_tester/load_tester_config.c
index 4b88ff72c..8e93d24bb 100644
--- a/src/charon/plugins/load_tester/load_tester_config.c
+++ b/src/charon/plugins/load_tester/load_tester_config.c
@@ -62,9 +62,14 @@ static enumerator_t* create_ike_cfg_enumerator(private_load_tester_config_t *thi
/**
* implements backend_t.get_peer_cfg_by_name.
*/
-static peer_cfg_t *get_peer_cfg_by_name(private_load_tester_config_t *this, char *name)
+static peer_cfg_t *get_peer_cfg_by_name(private_load_tester_config_t *this,
+ char *name)
{
- return this->peer_cfg->get_ref(this->peer_cfg);;
+ if (streq(name, "load-test"))
+ {
+ return this->peer_cfg->get_ref(this->peer_cfg);;
+ }
+ return NULL;
}
/**
diff --git a/src/charon/plugins/load_tester/load_tester_creds.c b/src/charon/plugins/load_tester/load_tester_creds.c
index 48f38f2c3..ec69a1ac9 100644
--- a/src/charon/plugins/load_tester/load_tester_creds.c
+++ b/src/charon/plugins/load_tester/load_tester_creds.c
@@ -157,6 +157,10 @@ static char cert[] = {
static enumerator_t* create_private_enumerator(private_load_tester_creds_t *this,
key_type_t type, identification_t *id)
{
+ if (this->private == NULL)
+ {
+ return NULL;
+ }
if (type != KEY_ANY && type != KEY_RSA)
{
return NULL;
@@ -181,6 +185,10 @@ static enumerator_t* create_cert_enumerator(private_load_tester_creds_t *this,
certificate_type_t cert, key_type_t key,
identification_t *id, bool trusted)
{
+ if (this->cert == NULL)
+ {
+ return NULL;
+ }
if (cert != CERT_ANY && cert != CERT_X509)
{
return NULL;
@@ -201,8 +209,8 @@ static enumerator_t* create_cert_enumerator(private_load_tester_creds_t *this,
*/
static void destroy(private_load_tester_creds_t *this)
{
- this->private->destroy(this->private);
- this->cert->destroy(this->cert);
+ DESTROY_IF(this->private);
+ DESTROY_IF(this->cert);
free(this);
}