Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1079)
- if (RAND_event(iMsg, wParam, lParam) == 1 && seeded == 0) {
- seeded = 1;
- if (RAND_write_file(filename) <= 0)
- MessageBox(hwnd, "Couldn't write random file!",
- "OpenSSL", MB_OK | MB_ICONERROR);
- PostQuitMessage(0);
- }
-
return DefWindowProc(hwnd, iMsg, wParam, lParam);
}
return DefWindowProc(hwnd, iMsg, wParam, lParam);
}
-RAND_add, RAND_seed, RAND_status, RAND_event - add
+RAND_add, RAND_seed, RAND_status - add
entropy to the PRNG
=head1 SYNOPSIS
entropy to the PRNG
=head1 SYNOPSIS
- int RAND_event(UINT iMsg, WPARAM wParam, LPARAM lParam);
-
=head1 DESCRIPTION
RAND_add() mixes the B<num> bytes at B<buf> into the PRNG state. Thus,
=head1 DESCRIPTION
RAND_add() mixes the B<num> bytes at B<buf> into the PRNG state. Thus,
RAND_seed() is equivalent to RAND_add() when B<num == entropy>.
RAND_seed() is equivalent to RAND_add() when B<num == entropy>.
-RAND_event() collects the entropy from Windows events such as mouse
-movements and other user interaction. It should be called with the
-B<iMsg>, B<wParam> and B<lParam> arguments of I<all> messages sent to
-the window procedure. It will estimate the entropy contained in the
-event message (if any), and add it to the PRNG. The program can then
-process the messages as usual.
-
-RAND_status() and RAND_event() return 1 if the PRNG has been seeded
+RAND_status() returns 1 if the PRNG has been seeded
with enough data, 0 otherwise.
The other functions do not return values.
with enough data, 0 otherwise.
The other functions do not return values.
const RAND_METHOD *RAND_get_rand_method(void);
RAND_METHOD *RAND_OpenSSL(void);
const RAND_METHOD *RAND_get_rand_method(void);
RAND_METHOD *RAND_OpenSSL(void);
- /* For Win32 only */
- int RAND_event(UINT, WPARAM, LPARAM);
-
Deprecated:
#if OPENSSL_API_COMPAT < 0x10100000L
Deprecated:
#if OPENSSL_API_COMPAT < 0x10100000L
# if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
# if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
-int RAND_event(UINT, WPARAM, LPARAM);
-
# endif
/* BEGIN ERROR CODES */
# endif
/* BEGIN ERROR CODES */