Add a return value to prf_t.allocate_bytes()
[strongswan.git] / src / libstrongswan / plugins / openssl / openssl_sha1_prf.c
index 03b7fa0..1c6dbd8 100644 (file)
@@ -60,18 +60,15 @@ METHOD(prf_t, get_block_size, size_t,
        return HASH_SIZE_SHA1;
 }
 
-METHOD(prf_t, allocate_bytes, void,
+METHOD(prf_t, allocate_bytes, bool,
        private_openssl_sha1_prf_t *this, chunk_t seed, chunk_t *chunk)
 {
        if (chunk)
        {
                *chunk = chunk_alloc(HASH_SIZE_SHA1);
-               get_bytes(this, seed, chunk->ptr);
-       }
-       else
-       {
-               get_bytes(this, seed, NULL);
+               return get_bytes(this, seed, chunk->ptr);
        }
+       return get_bytes(this, seed, NULL);
 }
 
 METHOD(prf_t, get_key_size, size_t,