=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/kexgexs.c,v retrieving revision 1.1.16.3 retrieving revision 1.2 diff -u -r1.1.16.3 -r1.2 --- src/usr.bin/ssh/kexgexs.c 2006/11/08 00:44:05 1.1.16.3 +++ src/usr.bin/ssh/kexgexs.c 2005/11/04 05:15:59 1.2 @@ -1,4 +1,3 @@ -/* $OpenBSD: kexgexs.c,v 1.1.16.3 2006/11/08 00:44:05 brad Exp $ */ /* * Copyright (c) 2000 Niels Provos. All rights reserved. * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -24,25 +23,17 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include "includes.h" +RCSID("$OpenBSD: kexgexs.c,v 1.2 2005/11/04 05:15:59 djm Exp $"); -#include -#include -#include - #include "xmalloc.h" -#include "buffer.h" #include "key.h" -#include "cipher.h" #include "kex.h" #include "log.h" #include "packet.h" #include "dh.h" #include "ssh2.h" #include "compat.h" -#ifdef GSSAPI -#include "ssh-gss.h" -#endif #include "monitor_wrap.h" void @@ -52,8 +43,8 @@ Key *server_host_key; DH *dh; u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL; - u_int sbloblen, klen, slen, hashlen; - int min = -1, max = -1, nbits = -1, type, kout; + u_int sbloblen, klen, kout, slen, hashlen; + int min = -1, max = -1, nbits = -1, type; if (kex->load_host_key == NULL) fatal("Cannot load hostkey"); @@ -131,15 +122,13 @@ klen = DH_size(dh); kbuf = xmalloc(klen); - if ((kout = DH_compute_key(kbuf, dh_client_pub, dh)) < 0) - fatal("DH_compute_key: failed"); + kout = DH_compute_key(kbuf, dh_client_pub, dh); #ifdef DEBUG_KEXDH dump_digest("shared secret", kbuf, kout); #endif if ((shared_secret = BN_new()) == NULL) fatal("kexgex_server: BN_new failed"); - if (BN_bin2bn(kbuf, kout, shared_secret) == NULL) - fatal("kexgex_server: BN_bin2bn failed"); + BN_bin2bn(kbuf, kout, shared_secret); memset(kbuf, 0, klen); xfree(kbuf);