diff --git a/crypto/diffie-hellman.c b/crypto/diffie-hellman.c index 0461a430..a1ed7cb4 100644 --- a/crypto/diffie-hellman.c +++ b/crypto/diffie-hellman.c @@ -39,7 +39,7 @@ static const struct dh_extra extra_group1 = { false, dh_group1_construct, }; -static const ssh_kex ssh_diffiehellman_group1_sha1 = { +const ssh_kex ssh_diffiehellman_group1_sha1 = { "diffie-hellman-group1-sha1", "group1", KEXTYPE_DH, &ssh_sha1, &extra_group1, }; @@ -54,12 +54,12 @@ static const struct dh_extra extra_group14 = { false, dh_group14_construct, }; -static const ssh_kex ssh_diffiehellman_group14_sha256 = { +const ssh_kex ssh_diffiehellman_group14_sha256 = { "diffie-hellman-group14-sha256", "group14", KEXTYPE_DH, &ssh_sha256, &extra_group14, }; -static const ssh_kex ssh_diffiehellman_group14_sha1 = { +const ssh_kex ssh_diffiehellman_group14_sha1 = { "diffie-hellman-group14-sha1", "group14", KEXTYPE_DH, &ssh_sha1, &extra_group14, }; diff --git a/ssh.h b/ssh.h index c32ff686..7049f2af 100644 --- a/ssh.h +++ b/ssh.h @@ -1023,6 +1023,9 @@ extern const ssh_hashalg ssh_blake2b; extern const ssh_kexes ssh_diffiehellman_group1; extern const ssh_kexes ssh_diffiehellman_group14; extern const ssh_kexes ssh_diffiehellman_gex; +extern const ssh_kex ssh_diffiehellman_group1_sha1; +extern const ssh_kex ssh_diffiehellman_group14_sha256; +extern const ssh_kex ssh_diffiehellman_group14_sha1; extern const ssh_kexes ssh_gssk5_sha1_kex; extern const ssh_kexes ssh_rsa_kex; extern const ssh_kex ssh_ec_kex_curve25519; diff --git a/testcrypt.c b/testcrypt.c index 09f742a5..2fc2ffbf 100644 --- a/testcrypt.c +++ b/testcrypt.c @@ -347,16 +347,16 @@ static const ssh_kex *get_dh_group(BinarySource *in) { static const struct { const char *key; - const ssh_kexes *value; + const ssh_kex *value; } algs[] = { - {"group1", &ssh_diffiehellman_group1}, - {"group14", &ssh_diffiehellman_group14}, + {"group1", &ssh_diffiehellman_group1_sha1}, + {"group14", &ssh_diffiehellman_group14_sha256}, }; ptrlen name = get_word(in); for (size_t i = 0; i < lenof(algs); i++) if (ptrlen_eq_string(name, algs[i].key)) - return algs[i].value->list[0]; + return algs[i].value; fatal_error("dh_group '%.*s': not found", PTRLEN_PRINTF(name)); }