encoding: Allow ke_payload_create_from_diffie_hellman() to fail

This commit is contained in:
Martin Willi
2015-03-23 17:54:02 +01:00
parent bace1d6479
commit 520d58e010
5 changed files with 59 additions and 13 deletions
+7 -1
View File
@@ -694,7 +694,13 @@ METHOD(phase1_t, add_nonce_ke, bool,
nonce_gen_t *nonceg;
chunk_t nonce;
ke_payload = ke_payload_create_from_diffie_hellman(PLV1_KEY_EXCHANGE, this->dh);
ke_payload = ke_payload_create_from_diffie_hellman(PLV1_KEY_EXCHANGE,
this->dh);
if (!ke_payload)
{
DBG1(DBG_IKE, "creating KE payload failed");
return FALSE;
}
message->add_payload(message, &ke_payload->payload_interface);
nonceg = this->keymat->keymat.create_nonce_gen(&this->keymat->keymat);