diff options
Diffstat (limited to 'src/libstrongswan/plugins/af_alg/af_alg_signer.c')
-rw-r--r-- | src/libstrongswan/plugins/af_alg/af_alg_signer.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libstrongswan/plugins/af_alg/af_alg_signer.c b/src/libstrongswan/plugins/af_alg/af_alg_signer.c index 103baa677..83d0e6f84 100644 --- a/src/libstrongswan/plugins/af_alg/af_alg_signer.c +++ b/src/libstrongswan/plugins/af_alg/af_alg_signer.c @@ -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); - } - else - { - get_signature(this, data, NULL); + return get_signature(this, data, chunk->ptr); } - 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); } |