Add a return value to prf_t.allocate_bytes()
This commit is contained in:
@@ -42,7 +42,7 @@ METHOD(prf_t, get_bytes, bool,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
METHOD(prf_t, allocate_bytes, void,
|
||||
METHOD(prf_t, allocate_bytes, bool,
|
||||
private_prf_t *this, chunk_t seed, chunk_t *chunk)
|
||||
{
|
||||
if (!chunk)
|
||||
@@ -54,6 +54,7 @@ METHOD(prf_t, allocate_bytes, void,
|
||||
*chunk = chunk_alloc(this->mac->get_mac_size(this->mac));
|
||||
this->mac->get_mac(this->mac, seed, chunk->ptr);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
METHOD(prf_t, get_block_size, size_t,
|
||||
|
||||
@@ -87,8 +87,10 @@ struct prf_t {
|
||||
*
|
||||
* @param seed a chunk containing the seed for the next bytes
|
||||
* @param chunk chunk which will hold generated bytes
|
||||
* @return TRUE if bytes allocated and generated successfully
|
||||
*/
|
||||
void (*allocate_bytes) (prf_t *this, chunk_t seed, chunk_t *chunk);
|
||||
__attribute__((warn_unused_result))
|
||||
bool (*allocate_bytes) (prf_t *this, chunk_t seed, chunk_t *chunk);
|
||||
|
||||
/**
|
||||
* Get the block size of this prf_t object.
|
||||
|
||||
Reference in New Issue
Block a user