diff options
author | Damien Miller <djm@mindrot.org> | 2006-11-05 05:32:02 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2006-11-05 05:32:02 +1100 |
commit | 570c2ab1b619ea36a06bfbf21d88a82683cc4213 (patch) | |
tree | 7564b301ac020a29c41f456b7e47b6e252af5e9d /kexdhs.c | |
parent | 3975ee2c3ce78af4f62ff8e9e5b636ef378b7f6b (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.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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 |