/**
* generate a new nonce to include in a CREATE_CHILD_SA message
*/
-static status_t generate_nonce(private_child_create_t *this)
+static bool generate_nonce(private_child_create_t *this)
{
+ if (!this->nonceg)
+ {
+ DBG1(DBG_IKE, "no nonce generator found to create nonce");
+ return FALSE;
+ }
if (!this->nonceg->allocate_nonce(this->nonceg, NONCE_SIZE,
&this->my_nonce))
{
DBG1(DBG_IKE, "nonce allocation failed");
- return FAILED;
+ return FALSE;
}
- return SUCCESS;
+ return TRUE;
}
/**
case IKE_SA_INIT:
return get_nonce(message, &this->my_nonce);
case CREATE_CHILD_SA:
- if (generate_nonce(this) != SUCCESS)
+ if (!generate_nonce(this))
{
- message->add_notify(message, FALSE, NO_PROPOSAL_CHOSEN, chunk_empty);
+ message->add_notify(message, FALSE, NO_PROPOSAL_CHOSEN,
+ chunk_empty);
return SUCCESS;
}
if (!this->retry)
case IKE_SA_INIT:
return get_nonce(message, &this->my_nonce);
case CREATE_CHILD_SA:
- if (generate_nonce(this) != SUCCESS )
+ if (!generate_nonce(this))
{
message->add_notify(message, FALSE, NO_PROPOSAL_CHOSEN,
chunk_empty);
.rekey = rekey,
.retry = FALSE,
);
-
this->nonceg = this->keymat->keymat.create_nonce_gen(&this->keymat->keymat);
- if (!this->nonceg)
- {
- DBG1(DBG_IKE, "no nonce generator found to create nonce");
- free(this);
- return NULL;
- }
if (config)
{
this->public.task.process = _process_r;
this->initiator = FALSE;
}
-
return &this->public;
}