projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix WIN32 warnings
[openssl.git]
/
crypto
/
rand
/
rand.h
diff --git
a/crypto/rand/rand.h
b/crypto/rand/rand.h
index 971880edaa2a3d46790a0461d46ff017ab696625..d446c38daf43e86908e0b1ad6f64e96755605a65 100644
(file)
--- a/
crypto/rand/rand.h
+++ b/
crypto/rand/rand.h
@@
-59,26
+59,44
@@
#ifndef HEADER_RAND_H
#define HEADER_RAND_H
#ifndef HEADER_RAND_H
#define HEADER_RAND_H
+#include <stdlib.h>
+#include <openssl/ossl_typ.h>
+#include <openssl/e_os2.h>
+
+#if defined(OPENSSL_SYS_WINDOWS)
+#include <windows.h>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
extern "C" {
#endif
-typedef struct rand_meth_st
+#if defined(OPENSSL_FIPS)
+#define FIPS_RAND_SIZE_T size_t
+#endif
+
+/* 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
(*seed)(const void *buf, int num);
int (*bytes)(unsigned char *buf, int num);
void (*cleanup)(void);
int (*bytes)(unsigned char *buf, int num);
void (*cleanup)(void);
-
void
(*add)(const void *buf, int num, double entropy);
+
int
(*add)(const void *buf, int num, double entropy);
int (*pseudorand)(unsigned char *buf, int num);
int (*status)(void);
int (*pseudorand)(unsigned char *buf, int num);
int (*status)(void);
- }
RAND_METHOD
;
+ };
#ifdef BN_DEBUG
extern int rand_predictable;
#endif
#ifdef BN_DEBUG
extern int rand_predictable;
#endif
-void RAND_set_rand_method(RAND_METHOD *meth);
-RAND_METHOD *RAND_get_rand_method(void );
+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);
RAND_METHOD *RAND_SSLeay(void);
void RAND_cleanup(void );
int RAND_bytes(unsigned char *buf,int num);
@@
-87,44
+105,51
@@
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);
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,
in
t num);
+const char *RAND_file_name(char *file,
size_
t num);
int RAND_status(void);
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_egd(const char *path);
int RAND_egd_bytes(const char *path,int bytes);
-void ERR_load_RAND_strings(void);
int RAND_poll(void);
int RAND_poll(void);
-#ifdef __cplusplus
-}
-#endif
-
-#if defined(WINDOWS) || defined(WIN32)
-#include <windows.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
void RAND_screen(void);
int RAND_event(UINT, WPARAM, LPARAM);
void RAND_screen(void);
int RAND_event(UINT, WPARAM, LPARAM);
-#ifdef __cplusplus
-}
#endif
#endif
+
+#ifdef OPENSSL_FIPS
+int RAND_init_fips(void);
#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.
*/
#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. */
/* Error codes for the RAND functions. */
/* Function codes. */
+#define RAND_F_FIPS_RAND 102
+#define RAND_F_FIPS_RAND_SET_DT 103
+#define RAND_F_FIPS_SET_PRNG_SEED 104
+#define RAND_F_FIPS_SET_TEST_MODE 105
+#define RAND_F_FIPS_X931_SET_DT 106
+#define RAND_F_RAND_GET_RAND_METHOD 101
#define RAND_F_SSLEAY_RAND_BYTES 100
/* Reason codes. */
#define RAND_F_SSLEAY_RAND_BYTES 100
/* Reason codes. */
+#define RAND_R_NOT_IN_TEST_MODE 101
+#define RAND_R_NO_KEY_SET 102
+#define RAND_R_PRNG_ERROR 103
+#define RAND_R_PRNG_KEYED 104
#define RAND_R_PRNG_NOT_SEEDED 100
#define RAND_R_PRNG_NOT_SEEDED 100
+#define RAND_R_PRNG_SEED_MUST_NOT_MATCH_KEY 105
+#define RAND_R_PRNG_STUCK 106
+#ifdef __cplusplus
+}
+#endif
#endif
#endif
-