aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/sa
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcharon/sa')
-rw-r--r--src/libcharon/sa/authenticators/eap_authenticator.c5
-rw-r--r--src/libcharon/sa/tasks/ike_auth.c10
2 files changed, 3 insertions, 12 deletions
diff --git a/src/libcharon/sa/authenticators/eap_authenticator.c b/src/libcharon/sa/authenticators/eap_authenticator.c
index 7284dfc8a..5c8f0b6ce 100644
--- a/src/libcharon/sa/authenticators/eap_authenticator.c
+++ b/src/libcharon/sa/authenticators/eap_authenticator.c
@@ -223,10 +223,7 @@ static void replace_eap_identity(private_eap_authenticator_t *this)
eap_identity = this->eap_identity->clone(this->eap_identity);
cfg = this->ike_sa->get_auth_cfg(this->ike_sa, FALSE);
- if (!cfg->replace_value(cfg, AUTH_RULE_EAP_IDENTITY, eap_identity))
- {
- eap_identity->destroy(eap_identity);
- }
+ cfg->add(cfg, AUTH_RULE_EAP_IDENTITY, eap_identity);
}
/**
diff --git a/src/libcharon/sa/tasks/ike_auth.c b/src/libcharon/sa/tasks/ike_auth.c
index 7552097f9..665468fe8 100644
--- a/src/libcharon/sa/tasks/ike_auth.c
+++ b/src/libcharon/sa/tasks/ike_auth.c
@@ -425,10 +425,7 @@ METHOD(task_t, build_i, status_t,
DBG1(DBG_CFG, "no IDi configured, fall back on IP address");
me = this->ike_sa->get_my_host(this->ike_sa);
idi = identification_create_from_sockaddr(me->get_sockaddr(me));
- if (!cfg->replace_value(cfg, AUTH_RULE_IDENTITY, idi))
- {
- cfg->add(cfg, AUTH_RULE_IDENTITY, idi);
- }
+ cfg->add(cfg, AUTH_RULE_IDENTITY, idi);
}
this->ike_sa->set_my_id(this->ike_sa, idi->clone(idi));
id_payload = id_payload_create_from_identification(ID_INITIATOR, idi);
@@ -702,10 +699,7 @@ METHOD(task_t, build_r, status_t,
me = this->ike_sa->get_my_host(this->ike_sa);
id_cfg = identification_create_from_sockaddr(
me->get_sockaddr(me));
- if (!cfg->replace_value(cfg, AUTH_RULE_IDENTITY, id_cfg))
- {
- cfg->add(cfg, AUTH_RULE_IDENTITY, id_cfg);
- }
+ cfg->add(cfg, AUTH_RULE_IDENTITY, id_cfg);
}
this->ike_sa->set_my_id(this->ike_sa, id_cfg->clone(id_cfg));
id = id_cfg;