aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/config/proposal.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2013-10-11 10:15:43 +0200
committerMartin Willi <martin@revosec.ch>2013-10-11 10:15:43 +0200
commitb59bcba2b38dda5f0f6301b7ae90acc58b4a069b (patch)
tree65c3cee3a20b6f323f5887b95bd88bc1981fa59c /src/libcharon/config/proposal.c
parent4524e128f845f8842cdf9ffecf4c1978218212cb (diff)
parent5fdbb3c6ad49f992c5df7075f920a2a133a81860 (diff)
downloadstrongswan-b59bcba2b38dda5f0f6301b7ae90acc58b4a069b.tar.bz2
strongswan-b59bcba2b38dda5f0f6301b7ae90acc58b4a069b.tar.xz
Merge branch 'ah'
Brings support for Security Associations integrity protected by the Authentication Header protocol, both to IKEv1 and IKEv2. Currently only plain AH is supported, but no (now deprecated) RFC2401 style AH+ESP bundles.
Diffstat (limited to 'src/libcharon/config/proposal.c')
-rw-r--r--src/libcharon/config/proposal.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/libcharon/config/proposal.c b/src/libcharon/config/proposal.c
index 0b702e014..0acc425d6 100644
--- a/src/libcharon/config/proposal.c
+++ b/src/libcharon/config/proposal.c
@@ -429,30 +429,33 @@ static void check_proposal(private_proposal_t *this)
e->destroy(e);
}
- e = create_enumerator(this, ENCRYPTION_ALGORITHM);
- while (e->enumerate(e, &alg, &ks))
+ if (this->protocol == PROTO_ESP)
{
- if (!encryption_algorithm_is_aead(alg))
+ e = create_enumerator(this, ENCRYPTION_ALGORITHM);
+ while (e->enumerate(e, &alg, &ks))
{
- all_aead = FALSE;
- break;
+ if (!encryption_algorithm_is_aead(alg))
+ {
+ all_aead = FALSE;
+ break;
+ }
}
- }
- e->destroy(e);
+ e->destroy(e);
- if (all_aead)
- {
- /* if all encryption algorithms in the proposal are AEADs,
- * we MUST NOT propose any integrity algorithms */
- e = array_create_enumerator(this->transforms);
- while (e->enumerate(e, &entry))
+ if (all_aead)
{
- if (entry->type == INTEGRITY_ALGORITHM)
+ /* if all encryption algorithms in the proposal are AEADs,
+ * we MUST NOT propose any integrity algorithms */
+ e = array_create_enumerator(this->transforms);
+ while (e->enumerate(e, &entry))
{
- array_remove_at(this->transforms, e);
+ if (entry->type == INTEGRITY_ALGORITHM)
+ {
+ array_remove_at(this->transforms, e);
+ }
}
+ e->destroy(e);
}
- e->destroy(e);
}
if (this->protocol == PROTO_AH || this->protocol == PROTO_ESP)