X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Frand%2Frand.h;h=ac6c0217636f14d0af801360ae7b0b7ac46fb571;hb=82877ea449c322fce79d1b46c9ad354c15513f63;hp=99ca47d6cf9e6c1d8a9d5578d0c30e571ee344c5;hpb=d02b48c63a58ea4367a0e905979f140b7d090f86;p=oweals%2Fopenssl.git diff --git a/crypto/rand/rand.h b/crypto/rand/rand.h index 99ca47d6cf..ac6c021763 100644 --- a/crypto/rand/rand.h +++ b/crypto/rand/rand.h @@ -1,5 +1,5 @@ /* crypto/rand/rand.h */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written @@ -59,34 +59,82 @@ #ifndef HEADER_RAND_H #define HEADER_RAND_H +#include +#include +#include + +#if defined(OPENSSL_SYS_WINDOWS) +#include +#endif + #ifdef __cplusplus extern "C" { #endif -#ifndef NOPROTO -void RAND_cleanup(void ); -void RAND_bytes( unsigned char *buf,int num); -void RAND_seed( unsigned char *buf,int num); -int RAND_load_file(char *file,long max_bytes); -int RAND_write_file(char *file); -char *RAND_file_name(char *file,int num); -#ifdef WINDOWS -void RAND_screen(void); +#if defined(OPENSSL_FIPS) +#define FIPS_RAND_SIZE_T size_t #endif -#else -void RAND_cleanup(); -void RAND_bytes(); -void RAND_seed(); -int RAND_load_file(); -int RAND_write_file(); -char *RAND_file_name(); -#ifdef WINDOWS -void RAND_screen(); + +/* Already defined in ossl_typ.h */ +/* typedef struct rand_meth_st RAND_METHOD; */ + +struct rand_meth_st + { + void (*seed)(const void *buf, int num); + int (*bytes)(unsigned char *buf, int num); + void (*cleanup)(void); + void (*add)(const void *buf, int num, double entropy); + int (*pseudorand)(unsigned char *buf, int num); + int (*status)(void); + }; + +#ifdef BN_DEBUG +extern int rand_predictable; #endif + +int RAND_set_rand_method(const RAND_METHOD *meth); +const RAND_METHOD *RAND_get_rand_method(void); +#ifndef OPENSSL_NO_ENGINE +int RAND_set_rand_engine(ENGINE *engine); #endif +RAND_METHOD *RAND_SSLeay(void); +void RAND_cleanup(void ); +int RAND_bytes(unsigned char *buf,int num); +int RAND_pseudo_bytes(unsigned char *buf,int num); +void RAND_seed(const void *buf,int num); +void RAND_add(const void *buf,int num,double entropy); +int RAND_load_file(const char *file,long max_bytes); +int RAND_write_file(const char *file); +const char *RAND_file_name(char *file,size_t num); +int RAND_status(void); +int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes); +int RAND_egd(const char *path); +int RAND_egd_bytes(const char *path,int bytes); +int RAND_poll(void); + +#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) + +void RAND_screen(void); +int RAND_event(UINT, WPARAM, LPARAM); + +#endif + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ +void ERR_load_RAND_strings(void); + +/* Error codes for the RAND functions. */ + +/* Function codes. */ +#define RAND_F_RAND_GET_RAND_METHOD 101 +#define RAND_F_SSLEAY_RAND_BYTES 100 + +/* Reason codes. */ +#define RAND_R_PRNG_NOT_SEEDED 100 #ifdef __cplusplus } #endif - #endif