summaryrefslogtreecommitdiffstats
path: root/auth-rsa.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 /auth-rsa.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 'auth-rsa.c')
-rw-r--r--auth-rsa.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/auth-rsa.c b/auth-rsa.c
index 5846a066..de50b8ef 100644
--- a/auth-rsa.c
+++ b/auth-rsa.c
@@ -14,7 +14,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: auth-rsa.c,v 1.46 2001/12/18 10:06:24 jakob Exp $");
+RCSID("$OpenBSD: auth-rsa.c,v 1.47 2001/12/27 18:22:16 markus Exp $");
#include <openssl/rsa.h>
#include <openssl/md5.h>
@@ -68,12 +68,15 @@ auth_rsa_challenge_dialog(RSA *pk)
u_int i;
int plen, len;
- encrypted_challenge = BN_new();
- challenge = BN_new();
+ if ((encrypted_challenge = BN_new()) == NULL)
+ fatal("auth_rsa_challenge_dialog: BN_new() failed");
+ if ((challenge = BN_new()) == NULL)
+ fatal("auth_rsa_challenge_dialog: BN_new() failed");
/* Generate a random challenge. */
BN_rand(challenge, 256, 0, 0);
- ctx = BN_CTX_new();
+ if ((ctx = BN_CTX_new()) == NULL)
+ fatal("auth_rsa_challenge_dialog: BN_CTX_new() failed");
BN_mod(challenge, challenge, pk->n, ctx);
BN_CTX_free(ctx);