1 We use the kex compat mechanism here to recognise old SunSSH
2 versions and present a kex proposal that always includes the
3 dh-group14 and -group1 algorithms.
5 Without this, an old SunSSH client cannot connect to our
8 --- hpn-ssh-hpn-18.4.2/compat.c.orig
9 +++ hpn-ssh-hpn-18.4.2/compat.c
16 /* determine bug flags from SSH protocol banner */
19 "OpenSSH_3.1*", SSH_BUG_EXTEOF|SSH_OLD_FORWARD_ADDR|
21 { "OpenSSH_3.*", SSH_OLD_FORWARD_ADDR|SSH_BUG_SIGTYPE },
22 - { "Sun_SSH_1.0*", SSH_BUG_NOREKEY|SSH_BUG_EXTEOF|
27 + "Sun_SSH_1.5*", SSH_OLD_DHGEX},
28 + { "Sun_SSH_1.*", SSH_BUG_NOREKEY|SSH_BUG_EXTEOF|
29 + SSH_BUG_SIGTYPE|SSH_OLD_DHGEX},
32 "OpenSSH_4*", SSH_BUG_SIGTYPE },
34 debug_f("no match: %s", version);
38 + * Adds an algorithm to the end of a proposal list, only if the algorithm is
39 + * not already present.
42 +append_proposal(char *proposal, const char *append)
47 + if (strstr(proposal, append) != NULL)
49 + if ((b = sshbuf_new()) == NULL)
50 + fatal("sshbuf_new()");
51 + sshbuf_put(b, proposal, strlen(proposal));
52 + if (sshbuf_len(b) > 0)
53 + sshbuf_put(b, ",", 1);
54 + sshbuf_put(b, append, strlen(append));
55 + sshbuf_put(b, "\0", 1);
56 + fix_prop = sshbuf_dup_string(b);
62 /* Always returns pointer to allocated memory, caller must free. */
64 compat_kex_proposal(struct ssh *ssh, const char *p)
66 "diffie-hellman-group-exchange-sha256,"
67 "diffie-hellman-group-exchange-sha1")) == NULL)
68 fatal("match_filter_denylist failed");
69 + p = append_proposal(p, "diffie-hellman-group14-sha1");
70 + p = append_proposal(p, "diffie-hellman-group1-sha1");