summaryrefslogtreecommitdiff
path: root/kexdh.c
diff options
context:
space:
mode:
authordjm <djm>2002-01-22 12:09:22 +0000
committerdjm <djm>2002-01-22 12:09:22 +0000
commit29a88c5bb55927a7d8ca53a5b5089f7474765bc6 (patch)
treed06b1746d357f3f90ba9255aa3343ffaed26b650 /kexdh.c
parent35fc43990c0cf8c3e28afed01d1f7d1cd942d540 (diff)
downloadopenssh-29a88c5bb55927a7d8ca53a5b5089f7474765bc6.tar.gz
- markus@cvs.openbsd.org 2001/12/27 18:22:16
[auth1.c authfile.c auth-rsa.c dh.c kexdh.c kexgex.c key.c rsa.c scard.c ssh-agent.c sshconnect1.c sshd.c ssh-dss.c] call fatal() for openssl allocation failures
Diffstat (limited to 'kexdh.c')
-rw-r--r--kexdh.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/kexdh.c b/kexdh.c
index b850a1a2..1e9f3583 100644
--- a/kexdh.c
+++ b/kexdh.c
@@ -23,7 +23,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: kexdh.c,v 1.7 2001/09/17 19:27:15 stevesk Exp $");
+RCSID("$OpenBSD: kexdh.c,v 1.8 2001/12/27 18:22:16 markus Exp $");
#include <openssl/crypto.h>
#include <openssl/bn.h>
@@ -129,8 +129,7 @@ kexdh_client(Kex *kex)
fatal("server_host_key verification failed");
/* DH paramter f, server public DH key */
- dh_server_pub = BN_new();
- if (dh_server_pub == NULL)
+ if ((dh_server_pub = BN_new()) == NULL)
fatal("dh_server_pub == NULL");
packet_get_bignum2(dh_server_pub, &dlen);
@@ -154,7 +153,8 @@ kexdh_client(Kex *kex)
#ifdef DEBUG_KEXDH
dump_digest("shared secret", kbuf, kout);
#endif
- shared_secret = BN_new();
+ if ((shared_secret = BN_new()) == NULL)
+ fatal("kexdh_client: BN_new failed");
BN_bin2bn(kbuf, kout, shared_secret);
memset(kbuf, 0, klen);
xfree(kbuf);
@@ -217,8 +217,7 @@ kexdh_server(Kex *kex)
fatal("Unsupported hostkey type %d", kex->hostkey_type);
/* key, cert */
- dh_client_pub = BN_new();
- if (dh_client_pub == NULL)
+ if ((dh_client_pub = BN_new()) == NULL)
fatal("dh_client_pub == NULL");
packet_get_bignum2(dh_client_pub, &dlen);
@@ -244,7 +243,8 @@ kexdh_server(Kex *kex)
#ifdef DEBUG_KEXDH
dump_digest("shared secret", kbuf, kout);
#endif
- shared_secret = BN_new();
+ if ((shared_secret = BN_new()) == NULL)
+ fatal("kexdh_server: BN_new failed");
BN_bin2bn(kbuf, kout, shared_secret);
memset(kbuf, 0, klen);
xfree(kbuf);