- (djm) [kex.c] Slightly more clean deactivation of dhgex-sha256 on old

OpenSSL; ok tim
This commit is contained in:
Damien Miller 2006-03-16 18:22:18 +11:00
parent 425a6886f9
commit b309203ce0
2 changed files with 9 additions and 5 deletions

View File

@ -4,6 +4,8 @@
/usr/include/crypto. Hint from djm@.
- (tim) [kex.c myproposal.h md-sha256.c openbsd-compat/sha2.c,h]
Disable sha256 when openssl < 0.9.7. Patch from djm@.
- (djm) [kex.c] Slightly more clean deactivation of dhgex-sha256 on old
OpenSSL; ok tim
20060315
- (djm) OpenBSD CVS Sync:
@ -4180,4 +4182,4 @@
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
$Id: ChangeLog,v 1.4227 2006/03/16 04:17:05 tim Exp $
$Id: ChangeLog,v 1.4228 2006/03/16 07:22:18 djm Exp $

8
kex.c
View File

@ -44,13 +44,13 @@ RCSID("$OpenBSD: kex.c,v 1.66 2006/03/07 09:07:40 djm Exp $");
#define KEX_COOKIE_LEN 16
#if OPENSSL_VERSION_NUMBER < 0x00907000L
# define evp_ssh_sha256() NULL
#elif defined(HAVE_EVP_SHA256)
#if OPENSSL_VERSION_NUMBER >= 0x00907000L
# if defined(HAVE_EVP_SHA256)
# define evp_ssh_sha256 EVP_sha256
# else
extern const EVP_MD *evp_ssh_sha256(void);
# endif
#endif
/* prototype */
static void kex_kexinit_finish(Kex *);
@ -309,9 +309,11 @@ choose_kex(Kex *k, char *client, char *server)
} else if (strcmp(k->name, KEX_DHGEX_SHA1) == 0) {
k->kex_type = KEX_DH_GEX_SHA1;
k->evp_md = EVP_sha1();
#if OPENSSL_VERSION_NUMBER >= 0x00907000L
} else if (strcmp(k->name, KEX_DHGEX_SHA256) == 0) {
k->kex_type = KEX_DH_GEX_SHA256;
k->evp_md = evp_ssh_sha256();
#endif
} else
fatal("bad kex alg %s", k->name);
}