projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Oops - don't invent an X authorisation when doing agent forwarding!
[u/mdw/putty]
/
windlg.c
diff --git
a/windlg.c
b/windlg.c
index
d2ca6c0
..
80b1adf
100644
(file)
--- a/
windlg.c
+++ b/
windlg.c
@@
-3,6
+3,8
@@
#include <commdlg.h>
#include <stdio.h>
#include <stdlib.h>
#include <commdlg.h>
#include <stdio.h>
#include <stdlib.h>
+#include <ctype.h>
+#include <time.h>
#include "ssh.h"
#include "putty.h"
#include "ssh.h"
#include "putty.h"
@@
-47,6
+49,11
@@
static int CALLBACK LogProc (HWND hwnd, UINT msg,
switch (msg) {
case WM_INITDIALOG:
switch (msg) {
case WM_INITDIALOG:
+ {
+ static int tabs[4] = {78, 108};
+ SendDlgItemMessage (hwnd, IDN_LIST, LB_SETTABSTOPS, 2,
+ (LPARAM) tabs);
+ }
for (i=0; i<nevents; i++)
SendDlgItemMessage (hwnd, IDN_LIST, LB_ADDSTRING,
0, (LPARAM)events[i]);
for (i=0; i<nevents; i++)
SendDlgItemMessage (hwnd, IDN_LIST, LB_ADDSTRING,
0, (LPARAM)events[i]);
@@
-203,6
+210,9
@@
enum { IDCX_ABOUT = IDC_ABOUT, IDCX_TVSTATIC, IDCX_TREEVIEW, controlstartvalue,
IDC_SESSSAVE,
IDC_SESSDEL,
IDC_CLOSEEXIT,
IDC_SESSSAVE,
IDC_SESSDEL,
IDC_CLOSEEXIT,
+ IDC_COEALWAYS,
+ IDC_COENEVER,
+ IDC_COENORMAL,
sessionpanelend,
loggingpanelstart,
sessionpanelend,
loggingpanelstart,
@@
-356,6
+366,7
@@
enum { IDCX_ABOUT = IDC_ABOUT, IDCX_TVSTATIC, IDCX_TREEVIEW, controlstartvalue,
IDC_CIPHER3DES,
IDC_CIPHERBLOWF,
IDC_CIPHERDES,
IDC_CIPHER3DES,
IDC_CIPHERBLOWF,
IDC_CIPHERDES,
+ IDC_CIPHERAES,
IDC_BUGGYMAC,
IDC_AUTHTIS,
IDC_PKSTATIC,
IDC_BUGGYMAC,
IDC_AUTHTIS,
IDC_PKSTATIC,
@@
-456,9
+467,8
@@
static void fmtfont (char *buf) {
if (cfg.fontheight == 0)
strcat (buf, "default height");
else
if (cfg.fontheight == 0)
strcat (buf, "default height");
else
- sprintf (buf+strlen(buf), "%d-%s",
- (cfg.fontheight < 0 ? -cfg.fontheight : cfg.fontheight),
- (cfg.fontheight < 0 ? "pixel" : "point"));
+ sprintf (buf+strlen(buf), "%d-point",
+ (cfg.fontheight < 0 ? -cfg.fontheight : cfg.fontheight));
}
static void init_dlg_ctrls(HWND hwnd) {
}
static void init_dlg_ctrls(HWND hwnd) {
@@
-536,7
+546,9
@@
static void init_dlg_ctrls(HWND hwnd) {
CheckDlgButton (hwnd, IDC_BLINKCUR, cfg.blink_cur);
CheckDlgButton (hwnd, IDC_SCROLLBAR, cfg.scrollbar);
CheckDlgButton (hwnd, IDC_LOCKSIZE, cfg.locksize);
CheckDlgButton (hwnd, IDC_BLINKCUR, cfg.blink_cur);
CheckDlgButton (hwnd, IDC_SCROLLBAR, cfg.scrollbar);
CheckDlgButton (hwnd, IDC_LOCKSIZE, cfg.locksize);
- CheckDlgButton (hwnd, IDC_CLOSEEXIT, cfg.close_on_exit);
+ CheckRadioButton (hwnd, IDC_COEALWAYS, IDC_COENORMAL,
+ cfg.close_on_exit==COE_NORMAL ? IDC_COENORMAL :
+ cfg.close_on_exit==COE_NEVER ? IDC_COENEVER : IDC_COEALWAYS);
CheckDlgButton (hwnd, IDC_CLOSEWARN, cfg.warn_on_close);
SetDlgItemText (hwnd, IDC_TTEDIT, cfg.termtype);
CheckDlgButton (hwnd, IDC_CLOSEWARN, cfg.warn_on_close);
SetDlgItemText (hwnd, IDC_TTEDIT, cfg.termtype);
@@
-566,9
+578,10
@@
static void init_dlg_ctrls(HWND hwnd) {
CheckDlgButton (hwnd, IDC_COMPRESS, cfg.compression);
CheckDlgButton (hwnd, IDC_BUGGYMAC, cfg.buggymac);
CheckDlgButton (hwnd, IDC_AGENTFWD, cfg.agentfwd);
CheckDlgButton (hwnd, IDC_COMPRESS, cfg.compression);
CheckDlgButton (hwnd, IDC_BUGGYMAC, cfg.buggymac);
CheckDlgButton (hwnd, IDC_AGENTFWD, cfg.agentfwd);
- CheckRadioButton (hwnd, IDC_CIPHER3DES, IDC_CIPHER
D
ES,
+ CheckRadioButton (hwnd, IDC_CIPHER3DES, IDC_CIPHER
A
ES,
cfg.cipher == CIPHER_BLOWFISH ? IDC_CIPHERBLOWF :
cfg.cipher == CIPHER_DES ? IDC_CIPHERDES :
cfg.cipher == CIPHER_BLOWFISH ? IDC_CIPHERBLOWF :
cfg.cipher == CIPHER_DES ? IDC_CIPHERDES :
+ cfg.cipher == CIPHER_AES ? IDC_CIPHERAES :
IDC_CIPHER3DES);
CheckRadioButton (hwnd, IDC_SSHPROT1, IDC_SSHPROT2,
cfg.sshprot == 1 ? IDC_SSHPROT1 : IDC_SSHPROT2);
IDC_CIPHER3DES);
CheckRadioButton (hwnd, IDC_SSHPROT1, IDC_SSHPROT2,
cfg.sshprot == 1 ? IDC_SSHPROT1 : IDC_SSHPROT2);
@@
-658,7
+671,7
@@
static HTREEITEM treeview_insert(struct treeview_faff *faff,
*/
static void create_controls(HWND hwnd, int dlgtype, int panel) {
if (panel == sessionpanelstart) {
*/
static void create_controls(HWND hwnd, int dlgtype, int panel) {
if (panel == sessionpanelstart) {
- /* The Session panel. Accelerators used: [acgo] nprtih elsd
x
*/
+ /* The Session panel. Accelerators used: [acgo] nprtih elsd
w
*/
struct ctlpos cp;
ctlposinit(&cp, hwnd, 80, 3, 13);
bartitle(&cp, "Basic options for your PuTTY session",
struct ctlpos cp;
ctlposinit(&cp, hwnd, 80, 3, 13);
bartitle(&cp, "Basic options for your PuTTY session",
@@
-698,7
+711,10
@@
static void create_controls(HWND hwnd, int dlgtype, int panel) {
endbox(&cp);
}
beginbox(&cp, NULL, IDC_BOX_SESSION3);
endbox(&cp);
}
beginbox(&cp, NULL, IDC_BOX_SESSION3);
- checkbox(&cp, "Close Window on E&xit", IDC_CLOSEEXIT);
+ radioline(&cp, "Close &window on exit:", IDC_CLOSEEXIT, 4,
+ "Always", IDC_COEALWAYS,
+ "Never", IDC_COENEVER,
+ "Only on clean exit", IDC_COENORMAL, NULL);
endbox(&cp);
}
endbox(&cp);
}
@@
-947,7
+963,7
@@
static void create_controls(HWND hwnd, int dlgtype, int panel) {
beginbox(&cp, "Sending of null packets to keep session active",
IDC_BOX_CONNECTION2);
staticedit(&cp, "Seconds between &keepalives (0 to turn off)",
beginbox(&cp, "Sending of null packets to keep session active",
IDC_BOX_CONNECTION2);
staticedit(&cp, "Seconds between &keepalives (0 to turn off)",
- IDC_PINGSTATIC, IDC_PINGEDIT, 2
5
);
+ IDC_PINGSTATIC, IDC_PINGEDIT, 2
0
);
endbox(&cp);
}
endbox(&cp);
}
@@
-990,7
+1006,7
@@
static void create_controls(HWND hwnd, int dlgtype, int panel) {
}
if (panel == sshpanelstart) {
}
if (panel == sshpanelstart) {
- /* The SSH panel. Accelerators used: [acgo] rmfkw pe123bd i */
+ /* The SSH panel. Accelerators used: [acgo] rmfkw pe123bd
s
i */
struct ctlpos cp;
ctlposinit(&cp, hwnd, 80, 3, 13);
if (dlgtype == 0) {
struct ctlpos cp;
ctlposinit(&cp, hwnd, 80, 3, 13);
if (dlgtype == 0) {
@@
-1016,10
+1032,12
@@
static void create_controls(HWND hwnd, int dlgtype, int panel) {
radioline(&cp, "Preferred SSH protocol version:",
IDC_SSHPROTSTATIC, 2,
"&1", IDC_SSHPROT1, "&2", IDC_SSHPROT2, NULL);
radioline(&cp, "Preferred SSH protocol version:",
IDC_SSHPROTSTATIC, 2,
"&1", IDC_SSHPROT1, "&2", IDC_SSHPROT2, NULL);
- radioline(&cp, "Preferred encryption algorithm:", IDC_CIPHERSTATIC,
3
,
+ radioline(&cp, "Preferred encryption algorithm:", IDC_CIPHERSTATIC,
4
,
"&3DES", IDC_CIPHER3DES,
"&Blowfish", IDC_CIPHERBLOWF,
"&3DES", IDC_CIPHER3DES,
"&Blowfish", IDC_CIPHERBLOWF,
- "&DES", IDC_CIPHERDES, NULL);
+ "&DES", IDC_CIPHERDES,
+ "AE&S", IDC_CIPHERAES,
+ NULL);
checkbox(&cp, "&Imitate SSH 2 MAC bug in commercial <= v2.3.x",
IDC_BUGGYMAC);
endbox(&cp);
checkbox(&cp, "&Imitate SSH 2 MAC bug in commercial <= v2.3.x",
IDC_BUGGYMAC);
endbox(&cp);
@@
-1530,7
+1548,7
@@
static int GenericMainDlgProc (HWND hwnd, UINT msg,
cfg.font[sizeof(cfg.font)-1] = '\0';
cfg.fontisbold = (lf.lfWeight == FW_BOLD);
cfg.fontcharset = lf.lfCharSet;
cfg.font[sizeof(cfg.font)-1] = '\0';
cfg.fontisbold = (lf.lfWeight == FW_BOLD);
cfg.fontcharset = lf.lfCharSet;
- cfg.fontheight =
lf.lfHeight
;
+ cfg.fontheight =
cf.iPointSize / 10
;
fmtfont (fontstatic);
SetDlgItemText (hwnd, IDC_FONTSTATIC, fontstatic);
}
fmtfont (fontstatic);
SetDlgItemText (hwnd, IDC_FONTSTATIC, fontstatic);
}
@@
-1595,11
+1613,16
@@
static int GenericMainDlgProc (HWND hwnd, UINT msg,
GetDlgItemText (hwnd, IDC_WINEDIT, cfg.wintitle,
sizeof(cfg.wintitle)-1);
break;
GetDlgItemText (hwnd, IDC_WINEDIT, cfg.wintitle,
sizeof(cfg.wintitle)-1);
break;
- case IDC_CLOSEEXIT:
- if (HIWORD(wParam) == BN_CLICKED ||
- HIWORD(wParam) == BN_DOUBLECLICKED)
- cfg.close_on_exit = IsDlgButtonChecked (hwnd, IDC_CLOSEEXIT);
- break;
+ case IDC_COEALWAYS:
+ case IDC_COENEVER:
+ case IDC_COENORMAL:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED) {
+ cfg.close_on_exit = IsDlgButtonChecked (hwnd, IDC_COEALWAYS) ? COE_ALWAYS :
+ IsDlgButtonChecked (hwnd, IDC_COENEVER) ? COE_NEVER :
+ COE_NORMAL;
+ }
+ break;
case IDC_CLOSEWARN:
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED)
case IDC_CLOSEWARN:
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED)
@@
-1759,6
+1782,7
@@
static int GenericMainDlgProc (HWND hwnd, UINT msg,
case IDC_CIPHER3DES:
case IDC_CIPHERBLOWF:
case IDC_CIPHERDES:
case IDC_CIPHER3DES:
case IDC_CIPHERBLOWF:
case IDC_CIPHERDES:
+ case IDC_CIPHERAES:
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED) {
if (IsDlgButtonChecked (hwnd, IDC_CIPHER3DES))
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED) {
if (IsDlgButtonChecked (hwnd, IDC_CIPHER3DES))
@@
-1767,6
+1791,8
@@
static int GenericMainDlgProc (HWND hwnd, UINT msg,
cfg.cipher = CIPHER_BLOWFISH;
else if (IsDlgButtonChecked (hwnd, IDC_CIPHERDES))
cfg.cipher = CIPHER_DES;
cfg.cipher = CIPHER_BLOWFISH;
else if (IsDlgButtonChecked (hwnd, IDC_CIPHERDES))
cfg.cipher = CIPHER_DES;
+ else if (IsDlgButtonChecked (hwnd, IDC_CIPHERAES))
+ cfg.cipher = CIPHER_AES;
}
break;
case IDC_SSHPROT1:
}
break;
case IDC_SSHPROT1:
@@
-1968,8
+1994,6
@@
static int GenericMainDlgProc (HWND hwnd, UINT msg,
static int CALLBACK MainDlgProc (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam) {
static int CALLBACK MainDlgProc (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam) {
- static HWND page = NULL;
-
if (msg == WM_COMMAND && LOWORD(wParam) == IDOK) {
}
if (msg == WM_COMMAND && LOWORD(wParam) == IDCX_ABOUT) {
if (msg == WM_COMMAND && LOWORD(wParam) == IDOK) {
}
if (msg == WM_COMMAND && LOWORD(wParam) == IDCX_ABOUT) {
@@
-1984,7
+2008,6
@@
static int CALLBACK MainDlgProc (HWND hwnd, UINT msg,
static int CALLBACK ReconfDlgProc (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam) {
static int CALLBACK ReconfDlgProc (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam) {
- static HWND page;
return GenericMainDlgProc (hwnd, msg, wParam, lParam, 1);
}
return GenericMainDlgProc (hwnd, msg, wParam, lParam, 1);
}
@@
-2027,20
+2050,28
@@
int do_reconfig (HWND hwnd) {
}
void logevent (char *string) {
}
void logevent (char *string) {
+ char timebuf[40];
+ time_t t;
+
if (nevents >= negsize) {
negsize += 64;
events = srealloc (events, negsize * sizeof(*events));
}
if (nevents >= negsize) {
negsize += 64;
events = srealloc (events, negsize * sizeof(*events));
}
- events[nevents] = smalloc(1+strlen(string));
- strcpy (events[nevents], string);
- nevents++;
+
+ time(&t);
+ strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S\t", localtime(&t));
+
+ events[nevents] = smalloc(strlen(timebuf)+strlen(string)+1);
+ strcpy(events[nevents], timebuf);
+ strcat(events[nevents], string);
if (logbox) {
int count;
SendDlgItemMessage (logbox, IDN_LIST, LB_ADDSTRING,
if (logbox) {
int count;
SendDlgItemMessage (logbox, IDN_LIST, LB_ADDSTRING,
- 0, (LPARAM)
string
);
+ 0, (LPARAM)
events[nevents]
);
count = SendDlgItemMessage (logbox, IDN_LIST, LB_GETCOUNT, 0, 0);
SendDlgItemMessage (logbox, IDN_LIST, LB_SETTOPINDEX, count-1, 0);
}
count = SendDlgItemMessage (logbox, IDN_LIST, LB_GETCOUNT, 0, 0);
SendDlgItemMessage (logbox, IDN_LIST, LB_SETTOPINDEX, count-1, 0);
}
+ nevents++;
}
void showeventlog (HWND hwnd) {
}
void showeventlog (HWND hwnd) {