diff options
author | Tobias Brunner <tobias@strongswan.org> | 2012-06-25 13:22:54 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2012-07-16 14:53:34 +0200 |
commit | 39e807728e275037fcc145015a6f3fa54c62221c (patch) | |
tree | 532ebc86d55c1e780afd32895f4bc7a0d3b3bbc1 /src/libstrongswan/plugins/gcrypt/gcrypt_rng.c | |
parent | 605985d122cd854ea7c1b85ce3ec107752c9f103 (diff) | |
download | strongswan-39e807728e275037fcc145015a6f3fa54c62221c.tar.bz2 strongswan-39e807728e275037fcc145015a6f3fa54c62221c.tar.xz |
RNGs' get_bytes and allocate_bytes return boolean
Diffstat (limited to 'src/libstrongswan/plugins/gcrypt/gcrypt_rng.c')
-rw-r--r-- | src/libstrongswan/plugins/gcrypt/gcrypt_rng.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstrongswan/plugins/gcrypt/gcrypt_rng.c b/src/libstrongswan/plugins/gcrypt/gcrypt_rng.c index d29755de9..dc34a8d66 100644 --- a/src/libstrongswan/plugins/gcrypt/gcrypt_rng.c +++ b/src/libstrongswan/plugins/gcrypt/gcrypt_rng.c @@ -35,7 +35,7 @@ struct private_gcrypt_rng_t { rng_quality_t quality; }; -METHOD(rng_t, get_bytes, void, +METHOD(rng_t, get_bytes, bool, private_gcrypt_rng_t *this, size_t bytes, u_int8_t *buffer) { switch (this->quality) @@ -50,13 +50,15 @@ METHOD(rng_t, get_bytes, void, gcry_randomize(buffer, bytes, GCRY_VERY_STRONG_RANDOM); break; } + return TRUE; } -METHOD(rng_t, allocate_bytes, void, +METHOD(rng_t, allocate_bytes, bool, private_gcrypt_rng_t *this, size_t bytes, chunk_t *chunk) { *chunk = chunk_alloc(bytes); get_bytes(this, chunk->len, chunk->ptr); + return TRUE; } METHOD(rng_t, destroy, void, |