Lines Matching refs:buffer

41         pool->buffer = OPENSSL_secure_zalloc(pool->alloc_len);
43 pool->buffer = OPENSSL_zalloc(pool->alloc_len);
45 if (pool->buffer == NULL) {
60 * Attach new random pool to the given buffer
65 RAND_POOL *ossl_rand_pool_attach(const unsigned char *buffer, size_t len,
80 pool->buffer = (unsigned char *) buffer;
92 * Free |pool|, securely erasing its buffer.
107 OPENSSL_secure_clear_free(pool->buffer, pool->alloc_len);
109 OPENSSL_clear_free(pool->buffer, pool->alloc_len);
116 * Return the |pool|'s buffer to the caller (readonly).
120 return pool->buffer;
132 * Return the |pool|'s buffer length to the caller.
140 * Detach the |pool| buffer and return it to the caller.
141 * It's the responsibility of the caller to free the buffer
147 unsigned char *ret = pool->buffer;
148 pool->buffer = NULL;
154 * Re-attach the |pool| buffer. It is only allowed to pass
155 * the |buffer| which was previously detached from the same pool.
157 void ossl_rand_pool_reattach(RAND_POOL *pool, unsigned char *buffer)
159 pool->buffer = buffer;
160 OPENSSL_cleanse(pool->buffer, pool->len);
174 * This is the case when entropy count and buffer length are high enough.
177 * |entropy| if the entropy count and buffer size is large enough
229 memcpy(p, pool->buffer, pool->len);
231 OPENSSL_secure_clear_free(pool->buffer, pool->alloc_len);
233 OPENSSL_clear_free(pool->buffer, pool->alloc_len);
234 pool->buffer = p;
270 * Make sure the buffer is large enough for the requested amount
299 * It is expected that the |buffer| contains |len| bytes of
306 const unsigned char *buffer, size_t len, size_t entropy)
313 if (pool->buffer == NULL) {
320 * This is to protect us from accidentally passing the buffer
327 if (pool->alloc_len > pool->len && pool->buffer + pool->len == buffer) {
340 memcpy(pool->buffer + pool->len, buffer, len);
352 * and returns a pointer to the buffer.
353 * The caller is allowed to copy up to |len| bytes into the buffer.
357 * After updating the buffer, ossl_rand_pool_add_end() needs to be called
370 if (pool->buffer == NULL) {
380 * additional data. Then the buffer might need to grow here,
387 return pool->buffer + pool->len;
396 * to the buffer which contain at least |entropy| bits of randomness.