aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2011-04-18 15:43:59 +0200
committerMartin Willi <martin@revosec.ch>2011-04-20 12:26:58 +0200
commit390b38b8c98151df7326185d83cd95b56e95a068 (patch)
tree2772b676e5e47a66fc160e6b57312e1580b19527
parentf8b26c452a37094495f5b6321984bb698cb7dc6e (diff)
downloadstrongswan-390b38b8c98151df7326185d83cd95b56e95a068.tar.bz2
strongswan-390b38b8c98151df7326185d83cd95b56e95a068.tar.xz
Add NO_EXT_SEQ_NUMBER to proposal only if it has not been specified in string
-rw-r--r--src/libcharon/config/proposal.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/libcharon/config/proposal.c b/src/libcharon/config/proposal.c
index 956edac21..2251b82dd 100644
--- a/src/libcharon/config/proposal.c
+++ b/src/libcharon/config/proposal.c
@@ -544,6 +544,16 @@ static void check_proposal(private_proposal_t *this)
free(alg);
}
}
+
+ if (this->protocol == PROTO_AH || this->protocol == PROTO_ESP)
+ {
+ e = this->esns->create_enumerator(this->esns);
+ if (!e->enumerate(e, &alg))
+ { /* ESN not specified, assume not supported */
+ add_algorithm(this, EXTENDED_SEQUENCE_NUMBERS, NO_EXT_SEQ_NUMBERS, 0);
+ }
+ e->destroy(e);
+ }
}
/**
@@ -913,9 +923,5 @@ proposal_t *proposal_create_from_string(protocol_id_t protocol, const char *algs
check_proposal(this);
- if (protocol == PROTO_AH || protocol == PROTO_ESP)
- {
- add_algorithm(this, EXTENDED_SEQUENCE_NUMBERS, NO_EXT_SEQ_NUMBERS, 0);
- }
return &this->public;
}