summaryrefslogtreecommitdiffstats
path: root/kexdhs.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 /kexdhs.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 'kexdhs.c')
-rw-r--r--kexdhs.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/kexdhs.c b/kexdhs.c
index 93ec97f9..5de43430 100644
--- a/kexdhs.c
+++ b/kexdhs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kexdhs.c,v 1.7 2006/08/03 03:34:42 deraadt Exp $ */
+/* $OpenBSD: kexdhs.c,v 1.8 2006/10/31 16:33:12 markus Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
@@ -52,8 +52,8 @@ kexdh_server(Kex *kex)
DH *dh;
Key *server_host_key;
u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL;
- u_int sbloblen, klen, kout, hashlen;
- u_int slen;
+ u_int sbloblen, klen, hashlen, slen;
+ int kout;
/* generate server DH public key */
switch (kex->kex_type) {
@@ -101,7 +101,8 @@ kexdh_server(Kex *kex)
klen = DH_size(dh);
kbuf = xmalloc(klen);
- kout = DH_compute_key(kbuf, dh_client_pub, dh);
+ if ((kout = DH_compute_key(kbuf, dh_client_pub, dh)) < 0)
+ fatal("DH_compute_key: failed");
#ifdef DEBUG_KEXDH
dump_digest("shared secret", kbuf, kout);
#endif