Add a return value to signer_t.get_signature()
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user