diff options
author | Martin Willi <martin@strongswan.org> | 2007-01-08 13:40:36 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2007-01-08 13:40:36 +0000 |
commit | a622c992408bfc939f6f68a8b766e12624fbab0e (patch) | |
tree | 9f28b97374e335723bea68f7f76ee34ede31538c /src/charon/sa/transactions/ike_auth.c | |
parent | e3f83e738da0973ec693d09998b5997ff470de2e (diff) | |
download | strongswan-a622c992408bfc939f6f68a8b766e12624fbab0e.tar.bz2 strongswan-a622c992408bfc939f6f68a8b766e12624fbab0e.tar.xz |
fixed crash when CA for certrequest not found
Diffstat (limited to 'src/charon/sa/transactions/ike_auth.c')
-rw-r--r-- | src/charon/sa/transactions/ike_auth.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/charon/sa/transactions/ike_auth.c b/src/charon/sa/transactions/ike_auth.c index 3ab4d8ae4..5d137f6c6 100644 --- a/src/charon/sa/transactions/ike_auth.c +++ b/src/charon/sa/transactions/ike_auth.c @@ -255,14 +255,21 @@ static status_t get_request(private_ike_auth_t *this, message_t **result) { certreq_payload_t *certreq_payload; identification_t *other_ca = this->policy->get_other_ca(this->policy); - - certreq_payload = (other_ca->get_type(other_ca) == ID_ANY) - ? certreq_payload_create_from_cacerts() - : certreq_payload_create_from_cacert(other_ca); - - if (certreq_payload != NULL) + + if (other_ca) { - request->add_payload(request, (payload_t*)certreq_payload); + if (other_ca->get_type(other_ca) == ID_ANY) + { + certreq_payload = certreq_payload_create_from_cacerts(); + } + else + { + certreq_payload = certreq_payload_create_from_cacert(other_ca); + } + if (certreq_payload != NULL) + { + request->add_payload(request, (payload_t*)certreq_payload); + } } } |