Add a return value to signer_t.get_signature()

This commit is contained in:
Martin Willi
2012-07-16 14:53:33 +02:00
parent 5fb719e0de
commit 2e96de60a8
8 changed files with 63 additions and 32 deletions
@@ -40,7 +40,7 @@ struct private_signer_t {
size_t truncation;
};
METHOD(signer_t, get_signature, void,
METHOD(signer_t, get_signature, bool,
private_signer_t *this, chunk_t data, u_int8_t *buffer)
{
if (buffer == NULL)
@@ -54,6 +54,7 @@ METHOD(signer_t, get_signature, void,
this->mac->get_mac(this->mac, data, mac);
memcpy(buffer, mac, this->truncation);
}
return TRUE;
}
METHOD(signer_t, allocate_signature, bool,
+3 -1
View File
@@ -91,8 +91,10 @@ struct signer_t {
*
* @param data a chunk containing the data to sign
* @param buffer pointer where the signature will be written
* @return TRUE if signature created successfully
*/
void (*get_signature) (signer_t *this, chunk_t data, u_int8_t *buffer);
__attribute__((warn_unused_result))
bool (*get_signature) (signer_t *this, chunk_t data, u_int8_t *buffer);
/**
* Generate a signature and allocate space for it.