Add a return value to simaka_message_t.generate()

This commit is contained in:
Martin Willi
2012-07-16 14:53:33 +02:00
parent cbfbba7d86
commit 264e702109
6 changed files with 264 additions and 90 deletions
+4 -3
View File
@@ -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,
+3 -2
View File
@@ -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.