summaryrefslogtreecommitdiff
path: root/kexgex.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-01-22 23:09:22 +1100
committerDamien Miller <djm@mindrot.org>2002-01-22 23:09:22 +1100
commitda7551677b301c6fd063eb162c7d32b37723a360 (patch)
treeee731b658802d003930540958f0b7ffc5a4a12bf /kexgex.c
parent154dda73a858a5924c2f5684dfec3e377cc3ab5d (diff)
- 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 'kexgex.c')
-rw-r--r--kexgex.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/kexgex.c b/kexgex.c
index a35b301fc..b4fdac695 100644
--- a/kexgex.c
+++ b/kexgex.c
@@ -24,7 +24,7 @@
24 */ 24 */
25 25
26#include "includes.h" 26#include "includes.h"
27RCSID("$OpenBSD: kexgex.c,v 1.10 2001/12/05 10:06:12 deraadt Exp $"); 27RCSID("$OpenBSD: kexgex.c,v 1.11 2001/12/27 18:22:16 markus Exp $");
28 28
29#include <openssl/bn.h> 29#include <openssl/bn.h>
30 30
@@ -183,8 +183,7 @@ kexgex_client(Kex *kex)
183 fatal("server_host_key verification failed"); 183 fatal("server_host_key verification failed");
184 184
185 /* DH paramter f, server public DH key */ 185 /* DH paramter f, server public DH key */
186 dh_server_pub = BN_new(); 186 if ((dh_server_pub = BN_new()) == NULL)
187 if (dh_server_pub == NULL)
188 fatal("dh_server_pub == NULL"); 187 fatal("dh_server_pub == NULL");
189 packet_get_bignum2(dh_server_pub, &dlen); 188 packet_get_bignum2(dh_server_pub, &dlen);
190 189
@@ -208,7 +207,8 @@ kexgex_client(Kex *kex)
208#ifdef DEBUG_KEXDH 207#ifdef DEBUG_KEXDH
209 dump_digest("shared secret", kbuf, kout); 208 dump_digest("shared secret", kbuf, kout);
210#endif 209#endif
211 shared_secret = BN_new(); 210 if ((shared_secret = BN_new()) == NULL)
211 fatal("kexgex_client: BN_new failed");
212 BN_bin2bn(kbuf, kout, shared_secret); 212 BN_bin2bn(kbuf, kout, shared_secret);
213 memset(kbuf, 0, klen); 213 memset(kbuf, 0, klen);
214 xfree(kbuf); 214 xfree(kbuf);
@@ -315,8 +315,7 @@ kexgex_server(Kex *kex)
315 packet_read_expect(&plen, SSH2_MSG_KEX_DH_GEX_INIT); 315 packet_read_expect(&plen, SSH2_MSG_KEX_DH_GEX_INIT);
316 316
317 /* key, cert */ 317 /* key, cert */
318 dh_client_pub = BN_new(); 318 if ((dh_client_pub = BN_new()) == NULL)
319 if (dh_client_pub == NULL)
320 fatal("dh_client_pub == NULL"); 319 fatal("dh_client_pub == NULL");
321 packet_get_bignum2(dh_client_pub, &dlen); 320 packet_get_bignum2(dh_client_pub, &dlen);
322 321
@@ -342,7 +341,8 @@ kexgex_server(Kex *kex)
342#ifdef DEBUG_KEXDH 341#ifdef DEBUG_KEXDH
343 dump_digest("shared secret", kbuf, kout); 342 dump_digest("shared secret", kbuf, kout);
344#endif 343#endif
345 shared_secret = BN_new(); 344 if ((shared_secret = BN_new()) == NULL)
345 fatal("kexgex_server: BN_new failed");
346 BN_bin2bn(kbuf, kout, shared_secret); 346 BN_bin2bn(kbuf, kout, shared_secret);
347 memset(kbuf, 0, klen); 347 memset(kbuf, 0, klen);
348 xfree(kbuf); 348 xfree(kbuf);