X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=sshdh.c;h=48f277a7cf31eaf02a2a34f5a6f8ebce7b22d5ee;hb=49d2cf19accb059b3b68d1fc2b78e606a578c3e8;hp=898ff6405d34066709e48e521b7412c28fc0b036;hpb=56d5dc7eecf52bb1fcb164be161f419dd15c3284;p=PuTTY.git diff --git a/sshdh.c b/sshdh.c index 898ff640..48f277a7 100644 --- a/sshdh.c +++ b/sshdh.c @@ -46,19 +46,52 @@ static const unsigned char P14[] = { */ static const unsigned char G[] = { 2 }; -const struct ssh_kex ssh_diffiehellman_group1 = { +static const struct ssh_kex ssh_diffiehellman_group1_sha1 = { "diffie-hellman-group1-sha1", "group1", - P1, G, lenof(P1), lenof(G) + P1, G, lenof(P1), lenof(G), &ssh_sha1 }; -const struct ssh_kex ssh_diffiehellman_group14 = { +static const struct ssh_kex *const group1_list[] = { + &ssh_diffiehellman_group1_sha1 +}; + +const struct ssh_kexes ssh_diffiehellman_group1 = { + sizeof(group1_list) / sizeof(*group1_list), + group1_list +}; + +static const struct ssh_kex ssh_diffiehellman_group14_sha1 = { "diffie-hellman-group14-sha1", "group14", - P14, G, lenof(P14), lenof(G) + P14, G, lenof(P14), lenof(G), &ssh_sha1 +}; + +static const struct ssh_kex *const group14_list[] = { + &ssh_diffiehellman_group14_sha1 +}; + +const struct ssh_kexes ssh_diffiehellman_group14 = { + sizeof(group14_list) / sizeof(*group14_list), + group14_list +}; + +static const struct ssh_kex ssh_diffiehellman_gex_sha256 = { + "diffie-hellman-group-exchange-sha256", NULL, + NULL, NULL, 0, 0, &ssh_sha256 }; -const struct ssh_kex ssh_diffiehellman_gex = { +static const struct ssh_kex ssh_diffiehellman_gex_sha1 = { "diffie-hellman-group-exchange-sha1", NULL, - NULL, NULL, 0, 0 + NULL, NULL, 0, 0, &ssh_sha1 +}; + +static const struct ssh_kex *const gex_list[] = { + &ssh_diffiehellman_gex_sha256, + &ssh_diffiehellman_gex_sha1 +}; + +const struct ssh_kexes ssh_diffiehellman_gex = { + sizeof(gex_list) / sizeof(*gex_list), + gex_list }; /*