/**
* 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;
}
/**
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;
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;
*/
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);
}