Nonce: Let get_nonce, allocate_nonce return boolean

This commit is contained in:
Reto Buerki
2012-07-16 14:53:34 +02:00
committed by Martin Willi
parent f3ca96b2bf
commit 605985d122
6 changed files with 39 additions and 9 deletions
+6 -1
View File
@@ -328,7 +328,12 @@ static bool add_nonce(private_quick_mode_t *this, chunk_t *nonce,
DBG1(DBG_IKE, "no nonce generator found to create nonce");
return FALSE;
}
nonceg->allocate_nonce(nonceg, NONCE_SIZE, nonce);
if (!nonceg->allocate_nonce(nonceg, NONCE_SIZE, nonce))
{
DBG1(DBG_IKE, "nonce allocation failed");
nonceg->destroy(nonceg);
return FALSE;
}
nonceg->destroy(nonceg);
nonce_payload = nonce_payload_create(NONCE_V1);