diff options
author | Darren Tucker <dtucker@zip.com.au> | 2006-11-07 13:14:41 +0100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2006-11-07 13:14:41 +0100 |
commit | 0bc85579a9b5a106826169303dd2ee61c63c161e (patch) | |
tree | d98e767f275d45b4c62984fb73a3484a5b8e134f /sshconnect1.c | |
parent | - (dtucker) [sshd.c] Use privsep_pw if we have it, but only require it (diff) | |
download | openssh-0bc85579a9b5a106826169303dd2ee61c63c161e.tar.xz openssh-0bc85579a9b5a106826169303dd2ee61c63c161e.zip |
- markus@cvs.openbsd.org 2006/11/06 21:25:28
[auth-rsa.c kexgexc.c kexdhs.c key.c ssh-dss.c sshd.c kexgexs.c
ssh-keygen.c bufbn.c moduli.c scard.c kexdhc.c sshconnect1.c dh.c rsa.c]
add missing checks for openssl return codes; with & ok djm@
Diffstat (limited to 'sshconnect1.c')
-rw-r--r-- | sshconnect1.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/sshconnect1.c b/sshconnect1.c index 90fcb344f..fd07bbf74 100644 --- a/sshconnect1.c +++ b/sshconnect1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshconnect1.c,v 1.69 2006/08/03 03:34:42 deraadt Exp $ */ +/* $OpenBSD: sshconnect1.c,v 1.70 2006/11/06 21:25:28 markus Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -563,14 +563,20 @@ ssh_kex(char *host, struct sockaddr *hostaddr) * the first 16 bytes of the session id. */ if ((key = BN_new()) == NULL) - fatal("respond_to_rsa_challenge: BN_new failed"); - BN_set_word(key, 0); + fatal("ssh_kex: BN_new failed"); + if (BN_set_word(key, 0) == 0) + fatal("ssh_kex: BN_set_word failed"); for (i = 0; i < SSH_SESSION_KEY_LENGTH; i++) { - BN_lshift(key, key, 8); - if (i < 16) - BN_add_word(key, session_key[i] ^ session_id[i]); - else - BN_add_word(key, session_key[i]); + if (BN_lshift(key, key, 8) == 0) + fatal("ssh_kex: BN_lshift failed"); + if (i < 16) { + if (BN_add_word(key, session_key[i] ^ session_id[i]) + == 0) + fatal("ssh_kex: BN_add_word failed"); + } else { + if (BN_add_word(key, session_key[i]) == 0) + fatal("ssh_kex: BN_add_word failed"); + } } /* |