diff options
author | Darren Tucker <dtucker@zip.com.au> | 2006-11-07 23:14:41 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2006-11-07 23:14:41 +1100 |
commit | 0bc85579a9b5a106826169303dd2ee61c63c161e (patch) | |
tree | d98e767f275d45b4c62984fb73a3484a5b8e134f /auth-rsa.c | |
parent | df0e438a2e4efe0422f6e0deb732d819d5938437 (diff) |
- 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 'auth-rsa.c')
-rw-r--r-- | auth-rsa.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/auth-rsa.c b/auth-rsa.c index 8c43458b0..69f9a5896 100644 --- a/auth-rsa.c +++ b/auth-rsa.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: auth-rsa.c,v 1.71 2006/08/03 03:34:41 deraadt Exp $ */ | 1 | /* $OpenBSD: auth-rsa.c,v 1.72 2006/11/06 21:25:27 markus Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -76,10 +76,12 @@ auth_rsa_generate_challenge(Key *key) | |||
76 | if ((challenge = BN_new()) == NULL) | 76 | if ((challenge = BN_new()) == NULL) |
77 | fatal("auth_rsa_generate_challenge: BN_new() failed"); | 77 | fatal("auth_rsa_generate_challenge: BN_new() failed"); |
78 | /* Generate a random challenge. */ | 78 | /* Generate a random challenge. */ |
79 | BN_rand(challenge, 256, 0, 0); | 79 | if (BN_rand(challenge, 256, 0, 0) == 0) |
80 | fatal("auth_rsa_generate_challenge: BN_rand failed"); | ||
80 | if ((ctx = BN_CTX_new()) == NULL) | 81 | if ((ctx = BN_CTX_new()) == NULL) |
81 | fatal("auth_rsa_generate_challenge: BN_CTX_new() failed"); | 82 | fatal("auth_rsa_generate_challenge: BN_CTX_new failed"); |
82 | BN_mod(challenge, challenge, key->rsa->n, ctx); | 83 | if (BN_mod(challenge, challenge, key->rsa->n, ctx) == 0) |
84 | fatal("auth_rsa_generate_challenge: BN_mod failed"); | ||
83 | BN_CTX_free(ctx); | 85 | BN_CTX_free(ctx); |
84 | 86 | ||
85 | return challenge; | 87 | return challenge; |