summaryrefslogtreecommitdiff
path: root/kex.c
diff options
context:
space:
mode:
Diffstat (limited to 'kex.c')
-rw-r--r--kex.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/kex.c b/kex.c
index 8610a7dab..23d8d2923 100644
--- a/kex.c
+++ b/kex.c
@@ -44,12 +44,12 @@ RCSID("$OpenBSD: kex.c,v 1.66 2006/03/07 09:07:40 djm Exp $");
44 44
45#define KEX_COOKIE_LEN 16 45#define KEX_COOKIE_LEN 16
46 46
47#if OPENSSL_VERSION_NUMBER < 0x00907000L 47#if OPENSSL_VERSION_NUMBER >= 0x00907000L
48# define evp_ssh_sha256() NULL 48# if defined(HAVE_EVP_SHA256)
49#elif defined(HAVE_EVP_SHA256)
50# define evp_ssh_sha256 EVP_sha256 49# define evp_ssh_sha256 EVP_sha256
51#else 50# else
52extern const EVP_MD *evp_ssh_sha256(void); 51extern const EVP_MD *evp_ssh_sha256(void);
52# endif
53#endif 53#endif
54 54
55/* prototype */ 55/* prototype */
@@ -309,9 +309,11 @@ choose_kex(Kex *k, char *client, char *server)
309 } else if (strcmp(k->name, KEX_DHGEX_SHA1) == 0) { 309 } else if (strcmp(k->name, KEX_DHGEX_SHA1) == 0) {
310 k->kex_type = KEX_DH_GEX_SHA1; 310 k->kex_type = KEX_DH_GEX_SHA1;
311 k->evp_md = EVP_sha1(); 311 k->evp_md = EVP_sha1();
312#if OPENSSL_VERSION_NUMBER >= 0x00907000L
312 } else if (strcmp(k->name, KEX_DHGEX_SHA256) == 0) { 313 } else if (strcmp(k->name, KEX_DHGEX_SHA256) == 0) {
313 k->kex_type = KEX_DH_GEX_SHA256; 314 k->kex_type = KEX_DH_GEX_SHA256;
314 k->evp_md = evp_ssh_sha256(); 315 k->evp_md = evp_ssh_sha256();
316#endif
315 } else 317 } else
316 fatal("bad kex alg %s", k->name); 318 fatal("bad kex alg %s", k->name);
317} 319}