Apache HTTPD
Classes | Macros | Typedefs | Functions | Variables
apr_random.c File Reference
#include "apr.h"
#include "apr_pools.h"
#include "apr_random.h"
#include "apr_thread_proc.h"
#include <assert.h>

Go to the source code of this file.

Classes

struct  apr_random_pool_t
 
struct  apr_random_t
 

Macros

#define min(a, b)   ((a) < (b) ? (a) : (b))
 
#define APR_RANDOM_DEFAULT_POOLS   32
 
#define APR_RANDOM_DEFAULT_REHASH_SIZE   1024
 
#define APR_RANDOM_DEFAULT_RESEED_SIZE   32
 
#define APR_RANDOM_DEFAULT_HASH_SECRET_SIZE   32
 
#define APR_RANDOM_DEFAULT_G_FOR_INSECURE   32
 
#define APR_RANDOM_DEFAULT_G_FOR_SECURE   320
 
#define hash_init(h)   (h)->init(h)
 
#define hash_add(h, b, n)   (h)->add(h,b,n)
 
#define hash_finish(h, r)   (h)->finish(h,r)
 
#define hash(h, r, b, n)   hash_init(h),hash_add(h,b,n),hash_finish(h,r)
 
#define crypt_setkey(c, k)   (c)->set_key((c)->data,k)
 
#define crypt_crypt(c, out, in)   (c)->crypt((c)->date,out,in)
 
#define K_size(g)   ((g)->key_hash->size)
 
#define B_size(g)   ((g)->prng_hash->size)
 
#define H_size(g)   (B_size(g)+K_size(g))
 
#define H_current(g)
 

Typedefs

typedef struct apr_random_pool_t apr_random_pool_t
 

Functions

static apr_status_t random_cleanup (void *data)
 
 APR_DECLARE (void)
 
static void mix_pid (apr_random_t *g, unsigned char *H, pid_t pid)
 
static void mixer (apr_random_t *g, pid_t pid)
 
 APR_DECLARE (apr_random_t *)
 
static void rekey (apr_random_t *g)
 
static void apr_random_block (apr_random_t *g, unsigned char *random)
 
static void apr_random_bytes (apr_random_t *g, unsigned char *random, apr_size_t bytes)
 
 APR_DECLARE (apr_status_t)
 

Variables

static apr_random_tall_random
 

Macro Definition Documentation

◆ APR_RANDOM_DEFAULT_G_FOR_INSECURE

#define APR_RANDOM_DEFAULT_G_FOR_INSECURE   32

Definition at line 38 of file apr_random.c.

◆ APR_RANDOM_DEFAULT_G_FOR_SECURE

#define APR_RANDOM_DEFAULT_G_FOR_SECURE   320

Definition at line 39 of file apr_random.c.

◆ APR_RANDOM_DEFAULT_HASH_SECRET_SIZE

#define APR_RANDOM_DEFAULT_HASH_SECRET_SIZE   32

Definition at line 37 of file apr_random.c.

◆ APR_RANDOM_DEFAULT_POOLS

#define APR_RANDOM_DEFAULT_POOLS   32

Definition at line 34 of file apr_random.c.

◆ APR_RANDOM_DEFAULT_REHASH_SIZE

#define APR_RANDOM_DEFAULT_REHASH_SIZE   1024

Definition at line 35 of file apr_random.c.

◆ APR_RANDOM_DEFAULT_RESEED_SIZE

#define APR_RANDOM_DEFAULT_RESEED_SIZE   32

Definition at line 36 of file apr_random.c.

◆ B_size

#define B_size (   g)    ((g)->prng_hash->size)

Definition at line 68 of file apr_random.c.

◆ crypt_crypt

#define crypt_crypt (   c,
  out,
  in 
)    (c)->crypt((c)->date,out,in)

Definition at line 54 of file apr_random.c.

◆ crypt_setkey

#define crypt_setkey (   c,
 
)    (c)->set_key((c)->data,k)

Definition at line 53 of file apr_random.c.

◆ H_current

#define H_current (   g)
Value:
(((g)->insecure_started && !(g)->secure_started) \
? (g)->H_waiting : (g)->H)
#define H(x, y, z)
Definition apr_md4.c:90
apr_size_t size

Definition at line 73 of file apr_random.c.

◆ H_size

#define H_size (   g)    (B_size(g)+K_size(g))

Definition at line 72 of file apr_random.c.

◆ hash

#define hash (   h,
  r,
  b,
  n 
)    hash_init(h),hash_add(h,b,n),hash_finish(h,r)

Definition at line 51 of file apr_random.c.

◆ hash_add

#define hash_add (   h,
  b,
  n 
)    (h)->add(h,b,n)

Definition at line 48 of file apr_random.c.

◆ hash_finish

#define hash_finish (   h,
  r 
)    (h)->finish(h,r)

Definition at line 49 of file apr_random.c.

◆ hash_init

#define hash_init (   h)    (h)->init(h)

Definition at line 47 of file apr_random.c.

◆ K_size

#define K_size (   g)    ((g)->key_hash->size)

Definition at line 66 of file apr_random.c.

◆ min

#define min (   a,
  b 
)    ((a) < (b) ? (a) : (b))

Definition at line 32 of file apr_random.c.

Typedef Documentation

◆ apr_random_pool_t

Function Documentation

◆ apr_random_block()

static void apr_random_block ( apr_random_t g,
unsigned char random 
)
static

Definition at line 262 of file apr_random.c.

◆ apr_random_bytes()

static void apr_random_bytes ( apr_random_t g,
unsigned char random,
apr_size_t  bytes 
)
static

Definition at line 269 of file apr_random.c.

◆ mix_pid()

static void mix_pid ( apr_random_t g,
unsigned char H,
pid_t  pid 
)
static

Definition at line 151 of file apr_random.c.

◆ mixer()

static void mixer ( apr_random_t g,
pid_t  pid 
)
static

Definition at line 159 of file apr_random.c.

◆ random_cleanup()

static apr_status_t random_cleanup ( void *  data)
static

Definition at line 89 of file apr_random.c.

◆ rekey()

static void rekey ( apr_random_t g)
static

Definition at line 197 of file apr_random.c.

Variable Documentation

◆ all_random

apr_random_t* all_random
static

Definition at line 87 of file apr_random.c.