diff options
| author | miod <> | 2014-04-15 16:52:50 +0000 |
|---|---|---|
| committer | miod <> | 2014-04-15 16:52:50 +0000 |
| commit | 7a19a50981d49325d35ae058d54f915cbfa1a027 (patch) | |
| tree | cd099da9298b8ab84a5dbbead9a6560737057c97 /src/lib/libcrypto/rand/rand.h | |
| parent | 2d3ffc156e48e292feaa28edc341e694571d2b00 (diff) | |
| download | openbsd-7a19a50981d49325d35ae058d54f915cbfa1a027.tar.gz openbsd-7a19a50981d49325d35ae058d54f915cbfa1a027.tar.bz2 openbsd-7a19a50981d49325d35ae058d54f915cbfa1a027.zip | |
Replace the old OpenSSL PRNG by direct use of arc4random_buf(), keeping the
existing RAND interfaces unchanged.
All interfaces allowing external feed or seed of the RNG (either from a file
or a local entropy gathering daemon) are kept for ABI compatibility, but are
no longer do anything.
While the OpenSSL PRNG was required 15+ years ago when many systems lacked
proper entropy collection, things have evolved and one can reasonably assume
it is better to use the kernel (system global) entropy pool rather than trying
to build one's own and having to compensate for thread scheduling...
<RANT>
Whoever thought that RAND_screen(), feeding the PRNG with the contents of the
local workstation's display, under Win32, was a smart idea, ought to be banned
from security programming.
</RANT>
ok beck@ deraadt@ tedu@
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/rand/rand.h | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/src/lib/libcrypto/rand/rand.h b/src/lib/libcrypto/rand/rand.h index bb5520e80a..e65b4b2e35 100644 --- a/src/lib/libcrypto/rand/rand.h +++ b/src/lib/libcrypto/rand/rand.h | |||
| @@ -63,18 +63,10 @@ | |||
| 63 | #include <openssl/ossl_typ.h> | 63 | #include <openssl/ossl_typ.h> |
| 64 | #include <openssl/e_os2.h> | 64 | #include <openssl/e_os2.h> |
| 65 | 65 | ||
| 66 | #if defined(OPENSSL_SYS_WINDOWS) | ||
| 67 | #include <windows.h> | ||
| 68 | #endif | ||
| 69 | |||
| 70 | #ifdef __cplusplus | 66 | #ifdef __cplusplus |
| 71 | extern "C" { | 67 | extern "C" { |
| 72 | #endif | 68 | #endif |
| 73 | 69 | ||
| 74 | #if defined(OPENSSL_FIPS) | ||
| 75 | #define FIPS_RAND_SIZE_T size_t | ||
| 76 | #endif | ||
| 77 | |||
| 78 | /* Already defined in ossl_typ.h */ | 70 | /* Already defined in ossl_typ.h */ |
| 79 | /* typedef struct rand_meth_st RAND_METHOD; */ | 71 | /* typedef struct rand_meth_st RAND_METHOD; */ |
| 80 | 72 | ||
| @@ -88,10 +80,6 @@ struct rand_meth_st | |||
| 88 | int (*status)(void); | 80 | int (*status)(void); |
| 89 | }; | 81 | }; |
| 90 | 82 | ||
| 91 | #ifdef BN_DEBUG | ||
| 92 | extern int rand_predictable; | ||
| 93 | #endif | ||
| 94 | |||
| 95 | int RAND_set_rand_method(const RAND_METHOD *meth); | 83 | int RAND_set_rand_method(const RAND_METHOD *meth); |
| 96 | const RAND_METHOD *RAND_get_rand_method(void); | 84 | const RAND_METHOD *RAND_get_rand_method(void); |
| 97 | #ifndef OPENSSL_NO_ENGINE | 85 | #ifndef OPENSSL_NO_ENGINE |
| @@ -112,25 +100,13 @@ int RAND_egd(const char *path); | |||
| 112 | int RAND_egd_bytes(const char *path,int bytes); | 100 | int RAND_egd_bytes(const char *path,int bytes); |
| 113 | int RAND_poll(void); | 101 | int RAND_poll(void); |
| 114 | 102 | ||
| 115 | #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) | ||
| 116 | |||
| 117 | void RAND_screen(void); | ||
| 118 | int RAND_event(UINT, WPARAM, LPARAM); | ||
| 119 | |||
| 120 | #endif | ||
| 121 | |||
| 122 | #ifdef OPENSSL_FIPS | ||
| 123 | void RAND_set_fips_drbg_type(int type, int flags); | ||
| 124 | int RAND_init_fips(void); | ||
| 125 | #endif | ||
| 126 | |||
| 127 | /* BEGIN ERROR CODES */ | 103 | /* BEGIN ERROR CODES */ |
| 128 | /* The following lines are auto generated by the script mkerr.pl. Any changes | 104 | /* The following lines are auto generated by the script mkerr.pl. Any changes |
| 129 | * made after this point may be overwritten when the script is next run. | 105 | * made after this point may be overwritten when the script is next run. |
| 130 | */ | 106 | */ |
| 131 | void ERR_load_RAND_strings(void); | 107 | void ERR_load_RAND_strings(void); |
| 132 | 108 | ||
| 133 | /* Error codes for the RAND functions. */ | 109 | /* Error codes for the RAND functions. (no longer used) */ |
| 134 | 110 | ||
| 135 | /* Function codes. */ | 111 | /* Function codes. */ |
| 136 | #define RAND_F_RAND_GET_RAND_METHOD 101 | 112 | #define RAND_F_RAND_GET_RAND_METHOD 101 |
