summaryrefslogtreecommitdiff
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
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
-rw-r--r--ChangeLog6
-rw-r--r--kexdhc.c8
-rw-r--r--kexdhs.c9
-rw-r--r--kexgexc.c8
-rw-r--r--kexgexs.c9
5 files changed, 25 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index e503acd44..1fbc6a20f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,10 @@
3 - otto@cvs.openbsd.org 2006/10/28 18:08:10 3 - otto@cvs.openbsd.org 2006/10/28 18:08:10
4 [ssh.1] 4 [ssh.1]
5 correct/expand example of usage of -w; ok jmc@ stevesk@ 5 correct/expand example of usage of -w; ok jmc@ stevesk@
6 - markus@cvs.openbsd.org 2006/10/31 16:33:12
7 [kexdhc.c kexdhs.c kexgexc.c kexgexs.c]
8 check DH_compute_key() for -1 even if it should not happen because of
9 earlier calls to dh_pub_is_valid(); report krahmer at suse.de; ok djm
6 10
720061101 1120061101
8 - (dtucker) [openbsd-compat/port-solaris.c] Bug #1255: Make only hwerr 12 - (dtucker) [openbsd-compat/port-solaris.c] Bug #1255: Make only hwerr
@@ -2584,4 +2588,4 @@
2584 OpenServer 6 and add osr5bigcrypt support so when someone migrates 2588 OpenServer 6 and add osr5bigcrypt support so when someone migrates
2585 passwords between UnixWare and OpenServer they will still work. OK dtucker@ 2589 passwords between UnixWare and OpenServer they will still work. OK dtucker@
2586 2590
2587$Id: ChangeLog,v 1.4582 2006/11/04 18:31:33 djm Exp $ 2591$Id: ChangeLog,v 1.4583 2006/11/04 18:32:02 djm Exp $
diff --git a/kexdhc.c b/kexdhc.c
index 64de7af30..61d54fdc2 100644
--- a/kexdhc.c
+++ b/kexdhc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: kexdhc.c,v 1.9 2006/08/03 03:34:42 deraadt Exp $ */ 1/* $OpenBSD: kexdhc.c,v 1.10 2006/10/31 16:33:12 markus Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
4 * 4 *
@@ -50,7 +50,8 @@ kexdh_client(Kex *kex)
50 Key *server_host_key; 50 Key *server_host_key;
51 u_char *server_host_key_blob = NULL, *signature = NULL; 51 u_char *server_host_key_blob = NULL, *signature = NULL;
52 u_char *kbuf, *hash; 52 u_char *kbuf, *hash;
53 u_int klen, kout, slen, sbloblen, hashlen; 53 u_int klen, slen, sbloblen, hashlen;
54 int kout;
54 55
55 /* generate and send 'e', client DH public key */ 56 /* generate and send 'e', client DH public key */
56 switch (kex->kex_type) { 57 switch (kex->kex_type) {
@@ -112,7 +113,8 @@ kexdh_client(Kex *kex)
112 113
113 klen = DH_size(dh); 114 klen = DH_size(dh);
114 kbuf = xmalloc(klen); 115 kbuf = xmalloc(klen);
115 kout = DH_compute_key(kbuf, dh_server_pub, dh); 116 if ((kout = DH_compute_key(kbuf, dh_server_pub, dh)) < 0)
117 fatal("DH_compute_key: failed");
116#ifdef DEBUG_KEXDH 118#ifdef DEBUG_KEXDH
117 dump_digest("shared secret", kbuf, kout); 119 dump_digest("shared secret", kbuf, kout);
118#endif 120#endif
diff --git a/kexdhs.c b/kexdhs.c
index 93ec97f93..5de434309 100644
--- a/kexdhs.c
+++ b/kexdhs.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: kexdhs.c,v 1.7 2006/08/03 03:34:42 deraadt Exp $ */ 1/* $OpenBSD: kexdhs.c,v 1.8 2006/10/31 16:33:12 markus Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2001 Markus Friedl. All rights reserved.
4 * 4 *
@@ -52,8 +52,8 @@ kexdh_server(Kex *kex)
52 DH *dh; 52 DH *dh;
53 Key *server_host_key; 53 Key *server_host_key;
54 u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL; 54 u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL;
55 u_int sbloblen, klen, kout, hashlen; 55 u_int sbloblen, klen, hashlen, slen;
56 u_int slen; 56 int kout;
57 57
58 /* generate server DH public key */ 58 /* generate server DH public key */
59 switch (kex->kex_type) { 59 switch (kex->kex_type) {
@@ -101,7 +101,8 @@ kexdh_server(Kex *kex)
101 101
102 klen = DH_size(dh); 102 klen = DH_size(dh);
103 kbuf = xmalloc(klen); 103 kbuf = xmalloc(klen);
104 kout = DH_compute_key(kbuf, dh_client_pub, dh); 104 if ((kout = DH_compute_key(kbuf, dh_client_pub, dh)) < 0)
105 fatal("DH_compute_key: failed");
105#ifdef DEBUG_KEXDH 106#ifdef DEBUG_KEXDH
106 dump_digest("shared secret", kbuf, kout); 107 dump_digest("shared secret", kbuf, kout);
107#endif 108#endif
diff --git a/kexgexc.c b/kexgexc.c
index 2c19713e1..49d50116a 100644
--- a/kexgexc.c
+++ b/kexgexc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: kexgexc.c,v 1.9 2006/08/03 03:34:42 deraadt Exp $ */ 1/* $OpenBSD: kexgexc.c,v 1.10 2006/10/31 16:33:12 markus Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Niels Provos. All rights reserved. 3 * Copyright (c) 2000 Niels Provos. All rights reserved.
4 * Copyright (c) 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -51,7 +51,8 @@ kexgex_client(Kex *kex)
51 BIGNUM *p = NULL, *g = NULL; 51 BIGNUM *p = NULL, *g = NULL;
52 Key *server_host_key; 52 Key *server_host_key;
53 u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL; 53 u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL;
54 u_int klen, kout, slen, sbloblen, hashlen; 54 u_int klen, slen, sbloblen, hashlen;
55 int kout;
55 int min, max, nbits; 56 int min, max, nbits;
56 DH *dh; 57 DH *dh;
57 58
@@ -150,7 +151,8 @@ kexgex_client(Kex *kex)
150 151
151 klen = DH_size(dh); 152 klen = DH_size(dh);
152 kbuf = xmalloc(klen); 153 kbuf = xmalloc(klen);
153 kout = DH_compute_key(kbuf, dh_server_pub, dh); 154 if ((kout = DH_compute_key(kbuf, dh_server_pub, dh)) < 0)
155 fatal("DH_compute_key: failed");
154#ifdef DEBUG_KEXDH 156#ifdef DEBUG_KEXDH
155 dump_digest("shared secret", kbuf, kout); 157 dump_digest("shared secret", kbuf, kout);
156#endif 158#endif
diff --git a/kexgexs.c b/kexgexs.c
index 5373a633a..863e15172 100644
--- a/kexgexs.c
+++ b/kexgexs.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: kexgexs.c,v 1.8 2006/08/03 03:34:42 deraadt Exp $ */ 1/* $OpenBSD: kexgexs.c,v 1.9 2006/10/31 16:33:12 markus Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Niels Provos. All rights reserved. 3 * Copyright (c) 2000 Niels Provos. All rights reserved.
4 * Copyright (c) 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -55,8 +55,8 @@ kexgex_server(Kex *kex)
55 Key *server_host_key; 55 Key *server_host_key;
56 DH *dh; 56 DH *dh;
57 u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL; 57 u_char *kbuf, *hash, *signature = NULL, *server_host_key_blob = NULL;
58 u_int sbloblen, klen, kout, slen, hashlen; 58 u_int sbloblen, klen, slen, hashlen;
59 int min = -1, max = -1, nbits = -1, type; 59 int min = -1, max = -1, nbits = -1, type, kout;
60 60
61 if (kex->load_host_key == NULL) 61 if (kex->load_host_key == NULL)
62 fatal("Cannot load hostkey"); 62 fatal("Cannot load hostkey");
@@ -134,7 +134,8 @@ kexgex_server(Kex *kex)
134 134
135 klen = DH_size(dh); 135 klen = DH_size(dh);
136 kbuf = xmalloc(klen); 136 kbuf = xmalloc(klen);
137 kout = DH_compute_key(kbuf, dh_client_pub, dh); 137 if ((kout = DH_compute_key(kbuf, dh_client_pub, dh)) < 0)
138 fatal("DH_compute_key: failed");
138#ifdef DEBUG_KEXDH 139#ifdef DEBUG_KEXDH
139 dump_digest("shared secret", kbuf, kout); 140 dump_digest("shared secret", kbuf, kout);
140#endif 141#endif