IDC_BUGD_RSAPAD2,
IDC_BUGS_DHGEX2,
IDC_BUGD_DHGEX2,
+ IDC_BUGS_PKSESSID2,
+ IDC_BUGD_PKSESSID2,
sshbugspanelend,
selectionpanelstart,
static void fmtfont(char *buf)
{
- sprintf(buf, "Font: %s, ", cfg.font);
- if (cfg.fontisbold)
+ sprintf(buf, "Font: %s, ", cfg.font.name);
+ if (cfg.font.isbold)
strcat(buf, "bold, ");
- if (cfg.fontheight == 0)
+ if (cfg.font.height == 0)
strcat(buf, "default height");
else
sprintf(buf + strlen(buf), "%d-point",
- (cfg.fontheight < 0 ? -cfg.fontheight : cfg.fontheight));
+ (cfg.font.height < 0 ? -cfg.font.height : cfg.font.height));
}
char *help_context_cmd(int id)
case IDC_BUGS_DHGEX2:
case IDC_BUGD_DHGEX2:
return "JI(`',`ssh.bugs.dhgex2')";
+ case IDC_BUGS_PKSESSID2:
+ case IDC_BUGD_PKSESSID2:
+ return "JI(`',`ssh.bugs.pksessid2')";
default:
return NULL;
B_IND_DISABLED ? IDC_B_IND_DISABLED : cfg.beep_ind ==
B_IND_FLASH ? IDC_B_IND_FLASH : cfg.beep_ind ==
B_IND_STEADY ? IDC_B_IND_STEADY : IDC_B_IND_DISABLED);
- SetDlgItemText(hwnd, IDC_BELL_WAVEEDIT, cfg.bell_wavefile);
+ SetDlgItemText(hwnd, IDC_BELL_WAVEEDIT, cfg.bell_wavefile.path);
CheckDlgButton(hwnd, IDC_BELLOVL, cfg.bellovl);
SetDlgItemInt(hwnd, IDC_BELLOVLN, cfg.bellovl_n, FALSE);
MySetDlgItemFlt(hwnd, IDC_BELLOVLT, cfg.bellovl_t / 1000.0);
SetDlgItemText(hwnd, IDC_R_TSEDIT, cfg.termspeed);
SetDlgItemText(hwnd, IDC_RLLUSEREDIT, cfg.localusername);
SetDlgItemText(hwnd, IDC_LOGEDIT, cfg.username);
- SetDlgItemText(hwnd, IDC_LGFEDIT, cfg.logfilename);
+ SetDlgItemText(hwnd, IDC_LGFEDIT, cfg.logfilename.path);
CheckRadioButton(hwnd, IDC_LSTATOFF, IDC_LSTATPACKET,
cfg.logtype == LGTYP_NONE ? IDC_LSTATOFF :
cfg.logtype == LGTYP_ASCII ? IDC_LSTATASCII :
cfg.sshprot == 3 ? IDC_SSHPROT2ONLY : IDC_SSHPROT1ONLY);
CheckDlgButton(hwnd, IDC_AUTHTIS, cfg.try_tis_auth);
CheckDlgButton(hwnd, IDC_AUTHKI, cfg.try_ki_auth);
- SetDlgItemText(hwnd, IDC_PKEDIT, cfg.keyfile);
+ SetDlgItemText(hwnd, IDC_PKEDIT, cfg.keyfile.path);
SetDlgItemText(hwnd, IDC_CMDEDIT, cfg.remote_cmd);
{
SendDlgItemMessage(hwnd, IDC_BUGD_DHGEX2, CB_SETCURSEL,
cfg.sshbug_dhgex2 == FORCE_ON ? 2 :
cfg.sshbug_dhgex2 == FORCE_OFF ? 1 : 0, 0);
+ SendDlgItemMessage(hwnd, IDC_BUGD_PKSESSID2, CB_RESETCONTENT, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_BUGD_PKSESSID2, CB_ADDSTRING, 0, (LPARAM)"Auto");
+ SendDlgItemMessage(hwnd, IDC_BUGD_PKSESSID2, CB_ADDSTRING, 0, (LPARAM)"Off");
+ SendDlgItemMessage(hwnd, IDC_BUGD_PKSESSID2, CB_ADDSTRING, 0, (LPARAM)"On");
+ SendDlgItemMessage(hwnd, IDC_BUGD_PKSESSID2, CB_SETCURSEL,
+ cfg.sshbug_pksessid2 == FORCE_ON ? 2 :
+ cfg.sshbug_pksessid2 == FORCE_OFF ? 1 : 0, 0);
}
struct treeview_faff {
IDC_BUGS_RSAPAD2, IDC_BUGD_RSAPAD2, 20);
staticddl(&cp, "Chokes on &Diffie-Hellman group exchange",
IDC_BUGS_DHGEX2, IDC_BUGD_DHGEX2, 20);
+ staticddl(&cp, "Misuses the sessio&n ID in PK auth",
+ IDC_BUGS_PKSESSID2, IDC_BUGD_PKSESSID2, 20);
endbox(&cp);
}
}
struct treeview_faff tvfaff;
HTREEITEM hsession;
OPENFILENAME of;
- char filename[sizeof(cfg.keyfile)];
+ char filename[sizeof(cfg.keyfile.path)];
CHOOSEFONT cf;
LOGFONT lf;
char fontstatic[256];
case IDC_CHOOSEFONT:
{
HDC hdc = GetDC(0);
- lf.lfHeight = -MulDiv(cfg.fontheight,
+ lf.lfHeight = -MulDiv(cfg.font.height,
GetDeviceCaps(hdc, LOGPIXELSY),
72);
ReleaseDC(0, hdc);
}
lf.lfWidth = lf.lfEscapement = lf.lfOrientation = 0;
lf.lfItalic = lf.lfUnderline = lf.lfStrikeOut = 0;
- lf.lfWeight = (cfg.fontisbold ? FW_BOLD : 0);
- lf.lfCharSet = cfg.fontcharset;
+ lf.lfWeight = (cfg.font.isbold ? FW_BOLD : 0);
+ lf.lfCharSet = cfg.font.charset;
lf.lfOutPrecision = OUT_DEFAULT_PRECIS;
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf.lfQuality = DEFAULT_QUALITY;
lf.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE;
- strncpy(lf.lfFaceName, cfg.font,
+ strncpy(lf.lfFaceName, cfg.font.name,
sizeof(lf.lfFaceName) - 1);
lf.lfFaceName[sizeof(lf.lfFaceName) - 1] = '\0';
CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS;
if (ChooseFont(&cf)) {
- strncpy(cfg.font, lf.lfFaceName, sizeof(cfg.font) - 1);
- cfg.font[sizeof(cfg.font) - 1] = '\0';
- cfg.fontisbold = (lf.lfWeight == FW_BOLD);
- cfg.fontcharset = lf.lfCharSet;
- cfg.fontheight = cf.iPointSize / 10;
+ strncpy(cfg.font.name, lf.lfFaceName,
+ sizeof(cfg.font.name) - 1);
+ cfg.font.name[sizeof(cfg.font.name) - 1] = '\0';
+ cfg.font.isbold = (lf.lfWeight == FW_BOLD);
+ cfg.font.charset = lf.lfCharSet;
+ cfg.font.height = cf.iPointSize / 10;
fmtfont(fontstatic);
SetDlgItemText(hwnd, IDC_FONTSTATIC, fontstatic);
}
of.lpstrCustomFilter = NULL;
of.nFilterIndex = 1;
of.lpstrFile = filename;
- strcpy(filename, cfg.bell_wavefile);
+ strcpy(filename, cfg.bell_wavefile.path);
of.nMaxFile = sizeof(filename);
of.lpstrFileTitle = NULL;
of.lpstrInitialDir = NULL;
of.lpstrTitle = "Select Bell Sound File";
of.Flags = 0;
if (GetOpenFileName(&of)) {
- strcpy(cfg.bell_wavefile, filename);
+ strcpy(cfg.bell_wavefile.path, filename);
SetDlgItemText(hwnd, IDC_BELL_WAVEEDIT,
- cfg.bell_wavefile);
+ cfg.bell_wavefile.path);
}
break;
case IDC_BELL_WAVEEDIT:
if (HIWORD(wParam) == EN_CHANGE)
GetDlgItemText(hwnd, IDC_BELL_WAVEEDIT,
- cfg.bell_wavefile,
- sizeof(cfg.bell_wavefile) - 1);
+ cfg.bell_wavefile.path,
+ sizeof(cfg.bell_wavefile.path) - 1);
break;
case IDC_BELLOVL:
if (HIWORD(wParam) == BN_CLICKED ||
case IDC_LGFEDIT:
if (HIWORD(wParam) == EN_CHANGE)
- GetDlgItemText(hwnd, IDC_LGFEDIT, cfg.logfilename,
- sizeof(cfg.logfilename) - 1);
+ GetDlgItemText(hwnd, IDC_LGFEDIT, cfg.logfilename.path,
+ sizeof(cfg.logfilename.path) - 1);
break;
case IDC_LGFBUTTON:
memset(&of, 0, sizeof(of));
of.lpstrCustomFilter = NULL;
of.nFilterIndex = 1;
of.lpstrFile = filename;
- strcpy(filename, cfg.logfilename);
+ strcpy(filename, cfg.logfilename.path);
of.nMaxFile = sizeof(filename);
of.lpstrFileTitle = NULL;
of.lpstrInitialDir = NULL;
of.lpstrTitle = "Select session log file";
of.Flags = 0;
if (GetSaveFileName(&of)) {
- strcpy(cfg.logfilename, filename);
- SetDlgItemText(hwnd, IDC_LGFEDIT, cfg.logfilename);
+ strcpy(cfg.logfilename.path, filename);
+ SetDlgItemText(hwnd, IDC_LGFEDIT, cfg.logfilename.path);
}
break;
case IDC_LSTATOFF:
break;
case IDC_PKEDIT:
if (HIWORD(wParam) == EN_CHANGE)
- GetDlgItemText(hwnd, IDC_PKEDIT, cfg.keyfile,
- sizeof(cfg.keyfile) - 1);
+ GetDlgItemText(hwnd, IDC_PKEDIT, cfg.keyfile.path,
+ sizeof(cfg.keyfile.path) - 1);
break;
case IDC_CMDEDIT:
if (HIWORD(wParam) == EN_CHANGE)
of.lpstrCustomFilter = NULL;
of.nFilterIndex = 1;
of.lpstrFile = filename;
- strcpy(filename, cfg.keyfile);
+ strcpy(filename, cfg.keyfile.path);
of.nMaxFile = sizeof(filename);
of.lpstrFileTitle = NULL;
of.lpstrInitialDir = NULL;
of.lpstrTitle = "Select Private Key File";
of.Flags = 0;
if (GetOpenFileName(&of)) {
- strcpy(cfg.keyfile, filename);
- SetDlgItemText(hwnd, IDC_PKEDIT, cfg.keyfile);
+ strcpy(cfg.keyfile.path, filename);
+ SetDlgItemText(hwnd, IDC_PKEDIT, cfg.keyfile.path);
}
break;
case IDC_RAWCNP:
index == 1 ? FORCE_OFF : FORCE_ON);
}
break;
+ case IDC_BUGD_PKSESSID2:
+ if (HIWORD(wParam) == CBN_SELCHANGE) {
+ int index = SendDlgItemMessage(hwnd, IDC_BUGD_PKSESSID2,
+ CB_GETCURSEL, 0, 0);
+ cfg.sshbug_pksessid2 = (index == 0 ? AUTO :
+ index == 1 ? FORCE_OFF : FORCE_ON);
+ }
+ break;
}
return 0;
case WM_HELP:
* Ask whether to wipe a session log file before writing to it.
* Returns 2 for wipe, 1 for append, 0 for cancel (don't log).
*/
-int askappend(void *frontend, char *filename)
+int askappend(void *frontend, Filename filename)
{
static const char mbtitle[] = "PuTTY Log to File";
static const char msgtemplate[] =
char message[sizeof(msgtemplate) + FILENAME_MAX];
int mbret;
- sprintf(message, msgtemplate, FILENAME_MAX, filename);
+ sprintf(message, msgtemplate, FILENAME_MAX, filename.path);
mbret = MessageBox(NULL, message, mbtitle,
MB_ICONQUESTION | MB_YESNOCANCEL);