Check if we have an RNG for IKEv1 task manager before using it
This commit is contained in:
@@ -334,12 +334,6 @@ METHOD(task_manager_t, initiate, status_t,
|
|||||||
exchange_type_t exchange = EXCHANGE_TYPE_UNDEFINED;
|
exchange_type_t exchange = EXCHANGE_TYPE_UNDEFINED;
|
||||||
bool new_mid = FALSE, expect_response = FALSE, flushed = FALSE;
|
bool new_mid = FALSE, expect_response = FALSE, flushed = FALSE;
|
||||||
|
|
||||||
if (!this->rng)
|
|
||||||
{
|
|
||||||
DBG1(DBG_IKE, "no RNG supported");
|
|
||||||
return FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this->initiating.type != EXCHANGE_TYPE_UNDEFINED)
|
if (this->initiating.type != EXCHANGE_TYPE_UNDEFINED)
|
||||||
{
|
{
|
||||||
DBG2(DBG_IKE, "delaying task initiation, %N exchange in progress",
|
DBG2(DBG_IKE, "delaying task initiation, %N exchange in progress",
|
||||||
@@ -1482,9 +1476,15 @@ task_manager_v1_t *task_manager_v1_create(ike_sa_t *ike_sa)
|
|||||||
"charon.retransmit_base", RETRANSMIT_BASE),
|
"charon.retransmit_base", RETRANSMIT_BASE),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!this->rng)
|
||||||
|
{
|
||||||
|
DBG1(DBG_IKE, "no RNG found, unable to create IKE_SA");
|
||||||
|
destroy(this);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
this->rng->get_bytes(this->rng, sizeof(this->dpd_send_seqnr),
|
this->rng->get_bytes(this->rng, sizeof(this->dpd_send_seqnr),
|
||||||
(void*)&this->dpd_send_seqnr);
|
(void*)&this->dpd_send_seqnr);
|
||||||
|
|
||||||
this->dpd_send_seqnr &= 0x7FFFFFFF;
|
this->dpd_send_seqnr &= 0x7FFFFFFF;
|
||||||
|
|
||||||
return &this->public;
|
return &this->public;
|
||||||
|
|||||||
Reference in New Issue
Block a user