Check rng return value when generating nonces in libpts
This commit is contained in:
1 parent
10b6ca5fb2
commit
cfd824ccde
1 file changed
+6
-2
@@ -226,9 +226,13 @@ METHOD(pts_t, create_dh_nonce, bool,
|
||||
DBG2(DBG_PTS, "nonce length is %d", nonce_len);
|
||||
nonce = this->is_imc ? &this->responder_nonce : &this->initiator_nonce;
|
||||
chunk_free(nonce);
|
||||
rng->allocate_bytes(rng, nonce_len, nonce);
|
||||
if (!rng->allocate_bytes(rng, nonce_len, nonce))
|
||||
{
|
||||
DBG1(DBG_PTS, "failed to allocate nonce");
|
||||
rng->destroy(rng);
|
||||
return FALSE;
|
||||
}
|
||||
rng->destroy(rng);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user