summaryrefslogtreecommitdiff
path: root/src/libcharon/config
diff options
context:
space:
mode:
authorRomain Francoise <rfrancoise@debian.org>2014-10-21 19:28:38 +0200
committerRomain Francoise <rfrancoise@debian.org>2014-10-21 19:28:38 +0200
commit2b8de74ff4c334c25e89988c4a401b24b5bcf03d (patch)
tree10fb49ca94bfd0c8b8a583412281abfc0186836e /src/libcharon/config
parent81c63b0eed39432878f78727f60a1e7499645199 (diff)
downloadvyos-strongswan-2b8de74ff4c334c25e89988c4a401b24b5bcf03d.tar.gz
vyos-strongswan-2b8de74ff4c334c25e89988c4a401b24b5bcf03d.zip
Import upstream release 5.2.1
Diffstat (limited to 'src/libcharon/config')
-rw-r--r--src/libcharon/config/child_cfg.c11
-rw-r--r--src/libcharon/config/proposal.c10
2 files changed, 16 insertions, 5 deletions
diff --git a/src/libcharon/config/child_cfg.c b/src/libcharon/config/child_cfg.c
index 7e4a1433d..ed7c0d406 100644
--- a/src/libcharon/config/child_cfg.c
+++ b/src/libcharon/config/child_cfg.c
@@ -163,6 +163,11 @@ METHOD(child_cfg_t, add_proposal, void,
}
}
+static bool match_proposal(proposal_t *item, proposal_t *proposal)
+{
+ return item->equals(item, proposal);
+}
+
METHOD(child_cfg_t, get_proposals, linked_list_t*,
private_child_cfg_t *this, bool strip_dh)
{
@@ -178,6 +183,12 @@ METHOD(child_cfg_t, get_proposals, linked_list_t*,
{
current->strip_dh(current, MODP_NONE);
}
+ if (proposals->find_first(proposals, (linked_list_match_t)match_proposal,
+ NULL, current) == SUCCESS)
+ {
+ current->destroy(current);
+ continue;
+ }
proposals->insert_last(proposals, current);
}
enumerator->destroy(enumerator);
diff --git a/src/libcharon/config/proposal.c b/src/libcharon/config/proposal.c
index 4d881cd2f..50d3c6f66 100644
--- a/src/libcharon/config/proposal.c
+++ b/src/libcharon/config/proposal.c
@@ -337,7 +337,7 @@ static bool algo_list_equals(private_proposal_t *this, proposal_t *other,
break;
}
}
- if (e2->enumerate(e2, &alg2, ks2))
+ if (e2->enumerate(e2, &alg2, &ks2))
{
/* other has more algs */
equals = FALSE;
@@ -594,7 +594,7 @@ METHOD(proposal_t, destroy, void,
}
/*
- * Describtion in header-file
+ * Described in header
*/
proposal_t *proposal_create(protocol_id_t protocol, u_int number)
{
@@ -787,7 +787,7 @@ static bool proposal_add_supported_ike(private_proposal_t *this, bool aead)
}
/*
- * Describtion in header-file
+ * Described in header
*/
proposal_t *proposal_create_default(protocol_id_t protocol)
{
@@ -826,7 +826,7 @@ proposal_t *proposal_create_default(protocol_id_t protocol)
}
/*
- * Describtion in header-file
+ * Described in header
*/
proposal_t *proposal_create_default_aead(protocol_id_t protocol)
{
@@ -853,7 +853,7 @@ proposal_t *proposal_create_default_aead(protocol_id_t protocol)
}
/*
- * Describtion in header-file
+ * Described in header
*/
proposal_t *proposal_create_from_string(protocol_id_t protocol, const char *algs)
{