1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00

SSH2 only support

[originally from svn r1664]
This commit is contained in:
Owen Dunn 2002-05-11 13:08:37 +00:00
parent c14c2ff479
commit c71432cb86
2 changed files with 20 additions and 5 deletions

6
ssh.c
View File

@ -1722,6 +1722,12 @@ static int do_ssh_init(unsigned char c)
sprintf(vlog, "We claim version: %s", verstring); sprintf(vlog, "We claim version: %s", verstring);
logevent(vlog); logevent(vlog);
strcat(verstring, "\n"); strcat(verstring, "\n");
if (cfg.sshprot == 3) {
bombout(("SSH protocol version 2 required by user but not provided by server"));
crReturn(0);
}
logevent("Using SSH protocol version 1"); logevent("Using SSH protocol version 1");
sk_write(s, verstring, strlen(verstring)); sk_write(s, verstring, strlen(verstring));
ssh_protocol = ssh1_protocol; ssh_protocol = ssh1_protocol;

View File

@ -514,6 +514,7 @@ enum { IDCX_ABOUT =
IDC_SSHPROTSTATIC, IDC_SSHPROTSTATIC,
IDC_SSHPROT1, IDC_SSHPROT1,
IDC_SSHPROT2, IDC_SSHPROT2,
IDC_SSHPROT2ONLY,
IDC_CMDSTATIC, IDC_CMDSTATIC,
IDC_CMDEDIT, IDC_CMDEDIT,
IDC_COMPRESS, IDC_COMPRESS,
@ -892,6 +893,7 @@ char *help_context_cmd(int id)
case IDC_SSHPROTSTATIC: case IDC_SSHPROTSTATIC:
case IDC_SSHPROT1: case IDC_SSHPROT1:
case IDC_SSHPROT2: case IDC_SSHPROT2:
case IDC_SSHPROT2ONLY:
return "JI(`',`ssh.protocol')"; return "JI(`',`ssh.protocol')";
case IDC_CMDSTATIC: case IDC_CMDSTATIC:
case IDC_CMDEDIT: case IDC_CMDEDIT:
@ -1149,8 +1151,11 @@ static void init_dlg_ctrls(HWND hwnd, int keepsess)
CheckDlgButton(hwnd, IDC_SSH2DES, cfg.ssh2_des_cbc); CheckDlgButton(hwnd, IDC_SSH2DES, cfg.ssh2_des_cbc);
CheckDlgButton(hwnd, IDC_AGENTFWD, cfg.agentfwd); CheckDlgButton(hwnd, IDC_AGENTFWD, cfg.agentfwd);
CheckDlgButton(hwnd, IDC_CHANGEUSER, cfg.change_username); CheckDlgButton(hwnd, IDC_CHANGEUSER, cfg.change_username);
CheckRadioButton(hwnd, IDC_SSHPROT1, IDC_SSHPROT2, CheckRadioButton(hwnd, IDC_SSHPROT1, IDC_SSHPROT2ONLY,
cfg.sshprot == 1 ? IDC_SSHPROT1 : IDC_SSHPROT2); cfg.sshprot == 1 ? IDC_SSHPROT1 :
cfg.sshprot == 2 ? IDC_SSHPROT2 :
cfg.sshprot == 3 ? IDC_SSHPROT2ONLY :
IDC_SSHPROT1); /* Should we make the default 2? */
CheckDlgButton(hwnd, IDC_AUTHTIS, cfg.try_tis_auth); CheckDlgButton(hwnd, IDC_AUTHTIS, cfg.try_tis_auth);
CheckDlgButton(hwnd, IDC_AUTHKI, cfg.try_ki_auth); CheckDlgButton(hwnd, IDC_AUTHKI, cfg.try_ki_auth);
SetDlgItemText(hwnd, IDC_PKEDIT, cfg.keyfile); SetDlgItemText(hwnd, IDC_PKEDIT, cfg.keyfile);
@ -1808,7 +1813,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
} }
if (panel == sshpanelstart) { if (panel == sshpanelstart) {
/* The SSH panel. Accelerators used: [acgoh] r pe12i sd */ /* The SSH panel. Accelerators used: [acgoh] r pe12ni sd */
struct ctlpos cp; struct ctlpos cp;
ctlposinit(&cp, hwnd, 80, 3, 13); ctlposinit(&cp, hwnd, 80, 3, 13);
if (dlgtype == 0) { if (dlgtype == 0) {
@ -1823,8 +1828,9 @@ static void create_controls(HWND hwnd, int dlgtype, int panel)
checkbox(&cp, "Don't allocate a &pseudo-terminal", IDC_NOPTY); checkbox(&cp, "Don't allocate a &pseudo-terminal", IDC_NOPTY);
checkbox(&cp, "Enable compr&ession", IDC_COMPRESS); checkbox(&cp, "Enable compr&ession", IDC_COMPRESS);
radioline(&cp, "Preferred SSH protocol version:", radioline(&cp, "Preferred SSH protocol version:",
IDC_SSHPROTSTATIC, 2, IDC_SSHPROTSTATIC, 3,
"&1", IDC_SSHPROT1, "&2", IDC_SSHPROT2, NULL); "&1", IDC_SSHPROT1, "&2", IDC_SSHPROT2,
"2 o&nly", IDC_SSHPROT2ONLY, NULL);
checkbox(&cp, "&Imitate SSH 2 MAC bug in commercial <= v2.3.x", checkbox(&cp, "&Imitate SSH 2 MAC bug in commercial <= v2.3.x",
IDC_BUGGYMAC); IDC_BUGGYMAC);
endbox(&cp); endbox(&cp);
@ -3088,12 +3094,15 @@ static int GenericMainDlgProc(HWND hwnd, UINT msg,
break; break;
case IDC_SSHPROT1: case IDC_SSHPROT1:
case IDC_SSHPROT2: case IDC_SSHPROT2:
case IDC_SSHPROT2ONLY:
if (HIWORD(wParam) == BN_CLICKED || if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED) { HIWORD(wParam) == BN_DOUBLECLICKED) {
if (IsDlgButtonChecked(hwnd, IDC_SSHPROT1)) if (IsDlgButtonChecked(hwnd, IDC_SSHPROT1))
cfg.sshprot = 1; cfg.sshprot = 1;
else if (IsDlgButtonChecked(hwnd, IDC_SSHPROT2)) else if (IsDlgButtonChecked(hwnd, IDC_SSHPROT2))
cfg.sshprot = 2; cfg.sshprot = 2;
else if (IsDlgButtonChecked(hwnd, IDC_SSHPROT2ONLY))
cfg.sshprot = 3;
} }
break; break;
case IDC_AUTHTIS: case IDC_AUTHTIS: