=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/kexgexc.c,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -u -r1.3.2.1 -r1.3.2.2 --- src/usr.bin/ssh/kexgexc.c 2006/09/30 04:06:50 1.3.2.1 +++ src/usr.bin/ssh/kexgexc.c 2006/11/08 00:17:14 1.3.2.2 @@ -1,4 +1,4 @@ -/* $OpenBSD: kexgexc.c,v 1.3.2.1 2006/09/30 04:06:50 brad Exp $ */ +/* $OpenBSD: kexgexc.c,v 1.3.2.2 2006/11/08 00:17:14 brad Exp $ */ /* * Copyright (c) 2000 Niels Provos. All rights reserved. * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -48,7 +48,8 @@ BIGNUM *p = NULL, *g = NULL; Key *server_host_key; u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL; - u_int klen, kout, slen, sbloblen, hashlen; + u_int klen, slen, sbloblen, hashlen; + int kout; int min, max, nbits; DH *dh; @@ -147,13 +148,15 @@ klen = DH_size(dh); kbuf = xmalloc(klen); - kout = DH_compute_key(kbuf, dh_server_pub, dh); + if ((kout = DH_compute_key(kbuf, dh_server_pub, dh)) < 0) + fatal("DH_compute_key: failed"); #ifdef DEBUG_KEXDH dump_digest("shared secret", kbuf, kout); #endif if ((shared_secret = BN_new()) == NULL) fatal("kexgex_client: BN_new failed"); - BN_bin2bn(kbuf, kout, shared_secret); + if (BN_bin2bn(kbuf, kout, shared_secret) == NULL) + fatal("kexgex_client: BN_bin2bn failed"); memset(kbuf, 0, klen); xfree(kbuf);