~mdw
/
sgt
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Gaaah, I might have known. Split combined app cursor / app keypad
[sgt/putty]
/
puttygen.c
diff --git
a/puttygen.c
b/puttygen.c
index
eb5a698
..
4fae90c
100644
(file)
--- a/
puttygen.c
+++ b/
puttygen.c
@@
-5,10
+5,8
@@
#include <windows.h>
#include <commctrl.h>
#include <time.h>
#include <windows.h>
#include <commctrl.h>
#include <time.h>
-#ifndef NO_SECURITY
-#include <aclapi.h>
-#endif
#include <stdio.h>
#include <stdio.h>
+#include <stdlib.h>
#define PUTTY_DO_GLOBALS
#define PUTTY_DO_GLOBALS
@@
-324,6
+322,8
@@
static int CALLBACK MainDlgProc (HWND hwnd, UINT msg,
case WM_INITDIALOG:
state = malloc(sizeof(*state));
state->generation_thread_exists = FALSE;
case WM_INITDIALOG:
state = malloc(sizeof(*state));
state->generation_thread_exists = FALSE;
+ state->collecting_entropy = FALSE;
+ state->entropy = NULL;
state->key_exists = FALSE;
SetWindowLong(hwnd, GWL_USERDATA, (LONG)state);
{
state->key_exists = FALSE;
SetWindowLong(hwnd, GWL_USERDATA, (LONG)state);
{
@@
-365,8
+365,8
@@
static int CALLBACK MainDlgProc (HWND hwnd, UINT msg,
staticbtn(&cp, "Save the generated key to a new file",
IDC_SAVESTATIC, "&Save", IDC_SAVE);
endbox(&cp);
staticbtn(&cp, "Save the generated key to a new file",
IDC_SAVESTATIC, "&Save", IDC_SAVE);
endbox(&cp);
- beginbox(&cp, "
Action
s",
- IDC_BOX_
ACTIONS, IDC_BOXT_ACTION
S);
+ beginbox(&cp, "
Parameter
s",
+ IDC_BOX_
PARAMS, IDC_BOXT_PARAM
S);
staticedit(&cp, "Number of &bits in a generated key:",
IDC_BITSSTATIC, IDC_BITS, 20);
endbox(&cp);
staticedit(&cp, "Number of &bits in a generated key:",
IDC_BITSSTATIC, IDC_BITS, 20);
endbox(&cp);
@@
-387,7
+387,9
@@
static int CALLBACK MainDlgProc (HWND hwnd, UINT msg,
return 1;
case WM_MOUSEMOVE:
state = (struct MainDlgState *)GetWindowLong(hwnd, GWL_USERDATA);
return 1;
case WM_MOUSEMOVE:
state = (struct MainDlgState *)GetWindowLong(hwnd, GWL_USERDATA);
- if (state->collecting_entropy) {
+ if (state->collecting_entropy &&
+ state->entropy &&
+ state->entropy_got < state->entropy_required) {
state->entropy[state->entropy_got++] = lParam;
state->entropy[state->entropy_got++] = GetMessageTime();
SendDlgItemMessage(hwnd, IDC_PROGRESS, PBM_SETPOS,
state->entropy[state->entropy_got++] = lParam;
state->entropy[state->entropy_got++] = GetMessageTime();
SendDlgItemMessage(hwnd, IDC_PROGRESS, PBM_SETPOS,
@@
-402,6
+404,7
@@
static int CALLBACK MainDlgProc (HWND hwnd, UINT msg,
random_add_heavynoise(state->entropy, state->entropy_size);
memset(state->entropy, 0, state->entropy_size);
free(state->entropy);
random_add_heavynoise(state->entropy, state->entropy_size);
memset(state->entropy, 0, state->entropy_size);
free(state->entropy);
+ state->collecting_entropy = FALSE;
SetDlgItemText(hwnd, IDC_GENERATING, generating_msg);
SendDlgItemMessage(hwnd, IDC_PROGRESS, PBM_SETRANGE, 0,
SetDlgItemText(hwnd, IDC_GENERATING, generating_msg);
SendDlgItemMessage(hwnd, IDC_PROGRESS, PBM_SETRANGE, 0,
@@
-423,7
+426,6
@@
static int CALLBACK MainDlgProc (HWND hwnd, UINT msg,
free(params);
} else {
state->generation_thread_exists = TRUE;
free(params);
} else {
state->generation_thread_exists = TRUE;
- state->collecting_entropy = FALSE;
}
}
}
}
}
}