1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-03 04:22:47 -05:00

Add more random-number noise collection calls.

Mostly on the Unix side: there are lots of places the Windows code was
collecting noise that the corresponding Unix/GTK code wasn't bothering
to, such as mouse movements, keystrokes and various network events.
Also, both platforms had forgotten to collect noise when reading data
from a pipe to a local proxy process, even though in that
configuration that's morally equivalent to the network packet timings
that we'd normally be collecting from.
This commit is contained in:
Simon Tatham
2019-01-22 21:01:26 +00:00
parent c0de1cbbad
commit 76aa3f6f7a
6 changed files with 15 additions and 0 deletions

View File

@ -987,6 +987,8 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
bool generated_something = false;
char num_keypad_key = '\0';
noise_ultralight(event->keyval);
#ifdef OSX_META_KEY_CONFIG
if (event->state & inst->system_mod_mask)
return false; /* let GTK process OS X Command key */
@ -2057,6 +2059,8 @@ static gboolean button_internal(GtkFrontend *inst, GdkEventButton *event)
/* Remember the timestamp. */
inst->input_event_time = event->time;
noise_ultralight(event->button);
show_mouseptr(inst, true);
shift = event->state & GDK_SHIFT_MASK;
@ -2183,6 +2187,8 @@ gint motion_event(GtkWidget *widget, GdkEventMotion *event, gpointer data)
/* Remember the timestamp. */
inst->input_event_time = event->time;
noise_ultralight(((uint32_t)event->x << 16) | (uint32_t)event->y);
show_mouseptr(inst, true);
shift = event->state & GDK_SHIFT_MASK;