diff options
Diffstat (limited to 'auth-rsa.c')
-rw-r--r-- | auth-rsa.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/auth-rsa.c b/auth-rsa.c index 5846a0662..de50b8ef8 100644 --- a/auth-rsa.c +++ b/auth-rsa.c | |||
@@ -14,7 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include "includes.h" | 16 | #include "includes.h" |
17 | RCSID("$OpenBSD: auth-rsa.c,v 1.46 2001/12/18 10:06:24 jakob Exp $"); | 17 | RCSID("$OpenBSD: auth-rsa.c,v 1.47 2001/12/27 18:22:16 markus Exp $"); |
18 | 18 | ||
19 | #include <openssl/rsa.h> | 19 | #include <openssl/rsa.h> |
20 | #include <openssl/md5.h> | 20 | #include <openssl/md5.h> |
@@ -68,12 +68,15 @@ auth_rsa_challenge_dialog(RSA *pk) | |||
68 | u_int i; | 68 | u_int i; |
69 | int plen, len; | 69 | int plen, len; |
70 | 70 | ||
71 | encrypted_challenge = BN_new(); | 71 | if ((encrypted_challenge = BN_new()) == NULL) |
72 | challenge = BN_new(); | 72 | fatal("auth_rsa_challenge_dialog: BN_new() failed"); |
73 | if ((challenge = BN_new()) == NULL) | ||
74 | fatal("auth_rsa_challenge_dialog: BN_new() failed"); | ||
73 | 75 | ||
74 | /* Generate a random challenge. */ | 76 | /* Generate a random challenge. */ |
75 | BN_rand(challenge, 256, 0, 0); | 77 | BN_rand(challenge, 256, 0, 0); |
76 | ctx = BN_CTX_new(); | 78 | if ((ctx = BN_CTX_new()) == NULL) |
79 | fatal("auth_rsa_challenge_dialog: BN_CTX_new() failed"); | ||
77 | BN_mod(challenge, challenge, pk->n, ctx); | 80 | BN_mod(challenge, challenge, pk->n, ctx); |
78 | BN_CTX_free(ctx); | 81 | BN_CTX_free(ctx); |
79 | 82 | ||