summaryrefslogtreecommitdiff
path: root/kexgexc.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2006-11-05 05:32:02 +1100
committerDamien Miller <djm@mindrot.org>2006-11-05 05:32:02 +1100
commit570c2ab1b619ea36a06bfbf21d88a82683cc4213 (patch)
tree7564b301ac020a29c41f456b7e47b6e252af5e9d /kexgexc.c
parent3975ee2c3ce78af4f62ff8e9e5b636ef378b7f6b (diff)
- markus@cvs.openbsd.org 2006/10/31 16:33:12
[kexdhc.c kexdhs.c kexgexc.c kexgexs.c] check DH_compute_key() for -1 even if it should not happen because of earlier calls to dh_pub_is_valid(); report krahmer at suse.de; ok djm
Diffstat (limited to 'kexgexc.c')
-rw-r--r--kexgexc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/kexgexc.c b/kexgexc.c
index 2c19713e..49d50116 100644
--- a/kexgexc.c
+++ b/kexgexc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kexgexc.c,v 1.9 2006/08/03 03:34:42 deraadt Exp $ */
+/* $OpenBSD: kexgexc.c,v 1.10 2006/10/31 16:33:12 markus Exp $ */
/*
* Copyright (c) 2000 Niels Provos. All rights reserved.
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -51,7 +51,8 @@ kexgex_client(Kex *kex)
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;
@@ -150,7 +151,8 @@ kexgex_client(Kex *kex)
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