Add a return value to signer_t.get_signature()
This commit is contained in:
@@ -107,10 +107,11 @@ static size_t lookup_alg(integrity_algorithm_t algo, char **name,
|
||||
return 0;
|
||||
}
|
||||
|
||||
METHOD(signer_t, get_signature, void,
|
||||
METHOD(signer_t, get_signature, bool,
|
||||
private_af_alg_signer_t *this, chunk_t data, u_int8_t *buffer)
|
||||
{
|
||||
this->ops->hash(this->ops, data, buffer, this->block_size);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
METHOD(signer_t, allocate_signature, bool,
|
||||
@@ -119,13 +120,9 @@ METHOD(signer_t, allocate_signature, bool,
|
||||
if (chunk)
|
||||
{
|
||||
*chunk = chunk_alloc(this->block_size);
|
||||
get_signature(this, data, chunk->ptr);
|
||||
return get_signature(this, data, chunk->ptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
get_signature(this, data, NULL);
|
||||
}
|
||||
return TRUE;
|
||||
return get_signature(this, data, NULL);
|
||||
}
|
||||
|
||||
METHOD(signer_t, verify_signature, bool,
|
||||
@@ -137,7 +134,10 @@ METHOD(signer_t, verify_signature, bool,
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
get_signature(this, data, sig);
|
||||
if (!get_signature(this, data, sig))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
return memeq(signature.ptr, sig, signature.len);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user