aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/crypto/prfs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/crypto/prfs')
-rw-r--r--src/libstrongswan/crypto/prfs/mac_prf.c3
-rw-r--r--src/libstrongswan/crypto/prfs/prf.h5
2 files changed, 6 insertions, 2 deletions
diff --git a/src/libstrongswan/crypto/prfs/mac_prf.c b/src/libstrongswan/crypto/prfs/mac_prf.c
index 6215a4bec..489797fb7 100644
--- a/src/libstrongswan/crypto/prfs/mac_prf.c
+++ b/src/libstrongswan/crypto/prfs/mac_prf.c
@@ -35,10 +35,11 @@ struct private_prf_t {
mac_t *mac;
};
-METHOD(prf_t, get_bytes, void,
+METHOD(prf_t, get_bytes, bool,
private_prf_t *this, chunk_t seed, u_int8_t *buffer)
{
this->mac->get_mac(this->mac, seed, buffer);
+ return TRUE;
}
METHOD(prf_t, allocate_bytes, void,
diff --git a/src/libstrongswan/crypto/prfs/prf.h b/src/libstrongswan/crypto/prfs/prf.h
index ad15205d3..8b98b41aa 100644
--- a/src/libstrongswan/crypto/prfs/prf.h
+++ b/src/libstrongswan/crypto/prfs/prf.h
@@ -71,13 +71,16 @@ extern enum_name_t *pseudo_random_function_names;
* Generic interface for pseudo-random-functions.
*/
struct prf_t {
+
/**
* Generates pseudo random bytes and writes them in the buffer.
*
* @param seed a chunk containing the seed for the next bytes
* @param buffer pointer where the generated bytes will be written
+ * @return TRUE if bytes generated successfully
*/
- void (*get_bytes) (prf_t *this, chunk_t seed, u_int8_t *buffer);
+ __attribute__((warn_unused_result))
+ bool (*get_bytes) (prf_t *this, chunk_t seed, u_int8_t *buffer);
/**
* Generates pseudo random bytes and allocate space for them.