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/crypto/rngs/rng.h | |
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/crypto/rngs/rng.h')
-rw-r--r-- | src/libstrongswan/crypto/rngs/rng.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libstrongswan/crypto/rngs/rng.h b/src/libstrongswan/crypto/rngs/rng.h index 36ef52bb4..48ca52dd8 100644 --- a/src/libstrongswan/crypto/rngs/rng.h +++ b/src/libstrongswan/crypto/rngs/rng.h @@ -1,4 +1,5 @@ /* + * Copyright (C) 2012 Tobias Brunner * Copyright (C) 2008 Martin Willi * Hochschule fuer Technik Rapperswil * @@ -53,16 +54,20 @@ struct rng_t { * * @param len number of bytes to get * @param buffer pointer where the generated bytes will be written + * @return TRUE if bytes successfully written */ - void (*get_bytes) (rng_t *this, size_t len, u_int8_t *buffer); + __attribute__((warn_unused_result)) + bool (*get_bytes) (rng_t *this, size_t len, u_int8_t *buffer); /** * Generates random bytes and allocate space for them. * * @param len number of bytes to get * @param chunk chunk which will hold generated bytes + * @return TRUE if allocation succeeded */ - void (*allocate_bytes) (rng_t *this, size_t len, chunk_t *chunk); + __attribute__((warn_unused_result)) + bool (*allocate_bytes) (rng_t *this, size_t len, chunk_t *chunk); /** * Destroys a rng object. |