Add a return value to simaka_message_t.generate()
This commit is contained in:
@@ -599,8 +599,8 @@ METHOD(simaka_message_t, verify, bool,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
METHOD(simaka_message_t, generate, chunk_t,
|
||||
private_simaka_message_t *this, chunk_t sigdata)
|
||||
METHOD(simaka_message_t, generate, bool,
|
||||
private_simaka_message_t *this, chunk_t sigdata, chunk_t *gen)
|
||||
{
|
||||
/* buffers large enough for messages we generate */
|
||||
char out_buf[1024], encr_buf[512];
|
||||
@@ -827,7 +827,8 @@ METHOD(simaka_message_t, generate, chunk_t,
|
||||
|
||||
call_hook(this, FALSE, FALSE);
|
||||
|
||||
return chunk_clone(out);
|
||||
*gen = chunk_clone(out);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
METHOD(simaka_message_t, destroy, void,
|
||||
|
||||
@@ -236,9 +236,10 @@ struct simaka_message_t {
|
||||
* Generate a message, optionally encrypt attributes and create a MAC.
|
||||
*
|
||||
* @param sigdata additional data to include in signature, if any
|
||||
* @return allocated data of generated message
|
||||
* @param gen allocated generated data, if successful
|
||||
* @return TRUE if successful
|
||||
*/
|
||||
chunk_t (*generate)(simaka_message_t *this, chunk_t sigdata);
|
||||
bool (*generate)(simaka_message_t *this, chunk_t sigdata, chunk_t *gen);
|
||||
|
||||
/**
|
||||
* Destroy a simaka_message_t.
|
||||
|
||||
Reference in New Issue
Block a user