summaryrefslogtreecommitdiff
path: root/src/libcharon/encoding
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2016-10-20 16:18:38 +0200
committerYves-Alexis Perez <corsac@debian.org>2016-10-20 16:18:38 +0200
commit25663e04c3ab01ef8dc9f906608282319cfea2db (patch)
treea0ca5e70f66d74dbe552c996a4f3a285cdfc35e4 /src/libcharon/encoding
parentbf372706c469764d59e9f29c39e3ecbebd72b8d2 (diff)
downloadvyos-strongswan-25663e04c3ab01ef8dc9f906608282319cfea2db.tar.gz
vyos-strongswan-25663e04c3ab01ef8dc9f906608282319cfea2db.zip
New upstream version 5.5.1
Diffstat (limited to 'src/libcharon/encoding')
-rw-r--r--src/libcharon/encoding/message.c4
-rw-r--r--src/libcharon/encoding/payloads/proposal_substructure.c15
2 files changed, 11 insertions, 8 deletions
diff --git a/src/libcharon/encoding/message.c b/src/libcharon/encoding/message.c
index 1fd644203..50dab9e38 100644
--- a/src/libcharon/encoding/message.c
+++ b/src/libcharon/encoding/message.c
@@ -535,7 +535,7 @@ static payload_rule_t aggressive_i_rules[] = {
{PLV1_NAT_D, 0, MAX_NAT_D_PAYLOADS, FALSE, FALSE},
{PLV1_NAT_D_DRAFT_00_03, 0, MAX_NAT_D_PAYLOADS, FALSE, FALSE},
{PLV1_ID, 0, 1, FALSE, FALSE},
- {PLV1_CERTIFICATE, 0, 1, TRUE, FALSE},
+ {PLV1_CERTIFICATE, 0, MAX_CERT_PAYLOADS, TRUE, FALSE},
{PLV1_SIGNATURE, 0, 1, TRUE, FALSE},
{PLV1_HASH, 0, 1, TRUE, FALSE},
{PLV1_FRAGMENT, 0, 1, FALSE, TRUE},
@@ -575,7 +575,7 @@ static payload_rule_t aggressive_r_rules[] = {
{PLV1_NAT_D, 0, MAX_NAT_D_PAYLOADS, FALSE, FALSE},
{PLV1_NAT_D_DRAFT_00_03, 0, MAX_NAT_D_PAYLOADS, FALSE, FALSE},
{PLV1_ID, 0, 1, FALSE, FALSE},
- {PLV1_CERTIFICATE, 0, 1, FALSE, FALSE},
+ {PLV1_CERTIFICATE, 0, MAX_CERT_PAYLOADS, FALSE, FALSE},
{PLV1_SIGNATURE, 0, 1, FALSE, FALSE},
{PLV1_HASH, 0, 1, FALSE, FALSE},
{PLV1_FRAGMENT, 0, 1, FALSE, TRUE},
diff --git a/src/libcharon/encoding/payloads/proposal_substructure.c b/src/libcharon/encoding/payloads/proposal_substructure.c
index 1a435a823..55641e145 100644
--- a/src/libcharon/encoding/payloads/proposal_substructure.c
+++ b/src/libcharon/encoding/payloads/proposal_substructure.c
@@ -1360,18 +1360,21 @@ static void set_from_proposal_v1(private_proposal_substructure_t *this,
enumerator = proposal->create_enumerator(proposal, INTEGRITY_ALGORITHM);
if (enumerator->enumerate(enumerator, &alg, &key_size))
{
- transid = get_ikev1_transid_from_alg(INTEGRITY_ALGORITHM, alg);
alg = get_ikev1_auth_from_alg(alg);
- if (transid && alg)
+ if (alg)
{
- if (!transform)
+ transid = get_ikev1_transid_from_alg(INTEGRITY_ALGORITHM, alg);
+ if (!transform && transid)
{
transform = transform_substructure_create_type(
PLV1_TRANSFORM_SUBSTRUCTURE, number, transid);
}
- transform->add_transform_attribute(transform,
- transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
- TATTR_PH2_AUTH_ALGORITHM, alg));
+ if (transform)
+ {
+ transform->add_transform_attribute(transform,
+ transform_attribute_create_value(PLV1_TRANSFORM_ATTRIBUTE,
+ TATTR_PH2_AUTH_ALGORITHM, alg));
+ }
}
}
enumerator->destroy(enumerator);