=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/kexdh.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- src/usr.bin/ssh/kexdh.c 2015/01/19 20:16:15 1.25 +++ src/usr.bin/ssh/kexdh.c 2016/05/02 10:26:04 1.26 @@ -1,4 +1,4 @@ -/* $OpenBSD: kexdh.c,v 1.25 2015/01/19 20:16:15 markus Exp $ */ +/* $OpenBSD: kexdh.c,v 1.26 2016/05/02 10:26:04 djm Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. * @@ -39,6 +39,7 @@ int kex_dh_hash( + int hash_alg, const char *client_version_string, const char *server_version_string, const u_char *ckexinit, size_t ckexinitlen, @@ -52,7 +53,7 @@ struct sshbuf *b; int r; - if (*hashlen < ssh_digest_bytes(SSH_DIGEST_SHA1)) + if (*hashlen < ssh_digest_bytes(hash_alg)) return SSH_ERR_INVALID_ARGUMENT; if ((b = sshbuf_new()) == NULL) return SSH_ERR_ALLOC_FAIL; @@ -75,12 +76,12 @@ #ifdef DEBUG_KEX sshbuf_dump(b, stderr); #endif - if (ssh_digest_buffer(SSH_DIGEST_SHA1, b, hash, *hashlen) != 0) { + if (ssh_digest_buffer(hash_alg, b, hash, *hashlen) != 0) { sshbuf_free(b); return SSH_ERR_LIBCRYPTO_ERROR; } sshbuf_free(b); - *hashlen = ssh_digest_bytes(SSH_DIGEST_SHA1); + *hashlen = ssh_digest_bytes(hash_alg); #ifdef DEBUG_KEX dump_digest("hash", hash, *hashlen); #endif