summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/rsa.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2001-12-27 18:22:17 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2001-12-27 18:22:17 +0000
commit2ec000d5480d557632594199897f58e3cfb6aa79 (patch)
tree9e3ec502a9b19860e5d5a6e123c0b1967fd9192c /usr.bin/ssh/rsa.c
parentfb712980169edaed215ac2c11bb2a86a029f6037 (diff)
call fatal() for openssl allocation failures
Diffstat (limited to 'usr.bin/ssh/rsa.c')
-rw-r--r--usr.bin/ssh/rsa.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/ssh/rsa.c b/usr.bin/ssh/rsa.c
index 113ee7fc423..66561a4213b 100644
--- a/usr.bin/ssh/rsa.c
+++ b/usr.bin/ssh/rsa.c
@@ -60,7 +60,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: rsa.c,v 1.23 2001/06/27 05:42:24 markus Exp $");
+RCSID("$OpenBSD: rsa.c,v 1.24 2001/12/27 18:22:16 markus Exp $");
#include "rsa.h"
#include "log.h"
@@ -120,14 +120,17 @@ rsa_private_decrypt(BIGNUM *out, BIGNUM *in, RSA *key)
return len;
}
+/* calculate p-1 and q-1 */
void
rsa_generate_additional_parameters(RSA *rsa)
{
BIGNUM *aux;
BN_CTX *ctx;
- /* Generate additional parameters */
- aux = BN_new();
- ctx = BN_CTX_new();
+
+ if ((aux = BN_new()) == NULL)
+ fatal("rsa_generate_additional_parameters: BN_new failed");
+ if ((ctx = BN_CTX_new()) == NULL)
+ fatal("rsa_generate_additional_parameters: BN_CTX_new failed");
BN_sub(aux, rsa->q, BN_value_one());
BN_mod(rsa->dmq1, rsa->d, aux, ctx);