mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-20 04:28:07 -05:00
Primitive protection against SSH2 not actually agreeing a cipher in
either direction. [originally from svn r1394]
This commit is contained in:
parent
cce8878289
commit
dd4bfacd9a
10
ssh.c
10
ssh.c
@ -3353,6 +3353,11 @@ static int do_ssh2_transport(unsigned char *in, int inlen, int ispkt)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!cscipher_tobe) {
|
||||||
|
bombout(("Couldn't agree a client-to-server cipher (available: %s)", str));
|
||||||
|
crReturn(0);
|
||||||
|
}
|
||||||
|
|
||||||
ssh2_pkt_getstring(&str, &len); /* server->client cipher */
|
ssh2_pkt_getstring(&str, &len); /* server->client cipher */
|
||||||
warn = 0;
|
warn = 0;
|
||||||
for (i = 0; i < n_preferred_ciphers; i++) {
|
for (i = 0; i < n_preferred_ciphers; i++) {
|
||||||
@ -3373,6 +3378,11 @@ static int do_ssh2_transport(unsigned char *in, int inlen, int ispkt)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!sccipher_tobe) {
|
||||||
|
bombout(("Couldn't agree a server-to-client cipher (available: %s)", str));
|
||||||
|
crReturn(0);
|
||||||
|
}
|
||||||
|
|
||||||
ssh2_pkt_getstring(&str, &len); /* client->server mac */
|
ssh2_pkt_getstring(&str, &len); /* client->server mac */
|
||||||
for (i = 0; i < nmacs; i++) {
|
for (i = 0; i < nmacs; i++) {
|
||||||
if (in_commasep_string(maclist[i]->name, str, len)) {
|
if (in_commasep_string(maclist[i]->name, str, len)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user