diff options
author | Martin Willi <martin@strongswan.org> | 2007-04-25 06:06:13 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2007-04-25 06:06:13 +0000 |
commit | f47e450be910b2b37808591f7b160ec1145076f6 (patch) | |
tree | 2b1f4b6552d316ced900d3410bb8d0b93fc5af3b /src/charon/sa/tasks/ike_auth.c | |
parent | c80e8ba11a252e8352b2b9523d0939d5a9f1a3c8 (diff) | |
download | strongswan-f47e450be910b2b37808591f7b160ec1145076f6.tar.bz2 strongswan-f47e450be910b2b37808591f7b160ec1145076f6.tar.xz |
properly checking received IDr as initiator
Diffstat (limited to 'src/charon/sa/tasks/ike_auth.c')
-rw-r--r-- | src/charon/sa/tasks/ike_auth.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/charon/sa/tasks/ike_auth.c b/src/charon/sa/tasks/ike_auth.c index 67f1e8bcc..9e2f6b085 100644 --- a/src/charon/sa/tasks/ike_auth.c +++ b/src/charon/sa/tasks/ike_auth.c @@ -215,7 +215,7 @@ static status_t process_auth(private_ike_auth_t *this, message_t *message) */ static status_t process_id(private_ike_auth_t *this, message_t *message) { - identification_t *id; + identification_t *id, *req; id_payload_t *idr, *idi; idi = (id_payload_t*)message->get_payload(message, ID_INITIATOR); @@ -230,6 +230,13 @@ static status_t process_id(private_ike_auth_t *this, message_t *message) if (this->initiator) { id = idr->get_identification(idr); + req = this->ike_sa->get_other_id(this->ike_sa); + if (!id->matches(id, req, NULL)) + { + SIG(IKE_UP_FAILED, "peer ID %D unacceptable, %D required", id, req); + id->destroy(id); + return FAILED; + } this->ike_sa->set_other_id(this->ike_sa, id); } else |