diff options
author | Damien Miller <djm@mindrot.org> | 2002-01-22 23:09:22 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2002-01-22 23:09:22 +1100 |
commit | da7551677b301c6fd063eb162c7d32b37723a360 (patch) | |
tree | ee731b658802d003930540958f0b7ffc5a4a12bf /rsa.c | |
parent | 154dda73a858a5924c2f5684dfec3e377cc3ab5d (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 'rsa.c')
-rw-r--r-- | rsa.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -60,7 +60,7 @@ | |||
60 | */ | 60 | */ |
61 | 61 | ||
62 | #include "includes.h" | 62 | #include "includes.h" |
63 | RCSID("$OpenBSD: rsa.c,v 1.23 2001/06/27 05:42:24 markus Exp $"); | 63 | RCSID("$OpenBSD: rsa.c,v 1.24 2001/12/27 18:22:16 markus Exp $"); |
64 | 64 | ||
65 | #include "rsa.h" | 65 | #include "rsa.h" |
66 | #include "log.h" | 66 | #include "log.h" |
@@ -120,14 +120,17 @@ rsa_private_decrypt(BIGNUM *out, BIGNUM *in, RSA *key) | |||
120 | return len; | 120 | return len; |
121 | } | 121 | } |
122 | 122 | ||
123 | /* calculate p-1 and q-1 */ | ||
123 | void | 124 | void |
124 | rsa_generate_additional_parameters(RSA *rsa) | 125 | rsa_generate_additional_parameters(RSA *rsa) |
125 | { | 126 | { |
126 | BIGNUM *aux; | 127 | BIGNUM *aux; |
127 | BN_CTX *ctx; | 128 | BN_CTX *ctx; |
128 | /* Generate additional parameters */ | 129 | |
129 | aux = BN_new(); | 130 | if ((aux = BN_new()) == NULL) |
130 | ctx = BN_CTX_new(); | 131 | fatal("rsa_generate_additional_parameters: BN_new failed"); |
132 | if ((ctx = BN_CTX_new()) == NULL) | ||
133 | fatal("rsa_generate_additional_parameters: BN_CTX_new failed"); | ||
131 | 134 | ||
132 | BN_sub(aux, rsa->q, BN_value_one()); | 135 | BN_sub(aux, rsa->q, BN_value_one()); |
133 | BN_mod(rsa->dmq1, rsa->d, aux, ctx); | 136 | BN_mod(rsa->dmq1, rsa->d, aux, ctx); |