#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
+#include <time.h>
#include "ssh.h"
#include "putty.h"
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]);
IDC_CIPHER3DES,
IDC_CIPHERBLOWF,
IDC_CIPHERDES,
+ IDC_CIPHERAES,
IDC_BUGGYMAC,
IDC_AUTHTIS,
IDC_PKSTATIC,
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) {
CheckDlgButton (hwnd, IDC_COMPRESS, cfg.compression);
CheckDlgButton (hwnd, IDC_BUGGYMAC, cfg.buggymac);
CheckDlgButton (hwnd, IDC_AGENTFWD, cfg.agentfwd);
- CheckRadioButton (hwnd, IDC_CIPHER3DES, IDC_CIPHERDES,
+ CheckRadioButton (hwnd, IDC_CIPHER3DES, IDC_CIPHERAES,
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);
}
if (panel == sshpanelstart) {
- /* The SSH panel. Accelerators used: [acgo] rmfkw pe123bd i */
+ /* The SSH panel. Accelerators used: [acgo] rmfkw pe123bds i */
struct ctlpos cp;
ctlposinit(&cp, hwnd, 80, 3, 13);
if (dlgtype == 0) {
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,
- "&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);
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);
}
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))
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:
}
void logevent (char *string) {
+ char timebuf[40];
+ time_t t;
+
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,
- 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);
}
+ nevents++;
}
void showeventlog (HWND hwnd) {