From a21d4e83af767763bc6679d7872bb1a74a952d84 Mon Sep 17 00:00:00 2001 From: miod <> Date: Thu, 10 Jul 2014 12:36:58 +0000 Subject: RSA_setup_blinding() gets a BN with BN_CTX_get(), returns `out of memory' if it fails, then never uses it anymore, and may invoke a function which needs more than one BN from the BN_CTX anyway, so this is pointless - remove the BN_CTX_get() call and the test. ok jsing --- src/lib/libcrypto/rsa/rsa_crpt.c | 7 +------ src/lib/libssl/src/crypto/rsa/rsa_crpt.c | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/lib/libcrypto/rsa/rsa_crpt.c b/src/lib/libcrypto/rsa/rsa_crpt.c index 5edd2d7c5c..5de69a6fb5 100644 --- a/src/lib/libcrypto/rsa/rsa_crpt.c +++ b/src/lib/libcrypto/rsa/rsa_crpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_crpt.c,v 1.8 2014/07/10 11:35:31 jsing Exp $ */ +/* $OpenBSD: rsa_crpt.c,v 1.9 2014/07/10 12:36:58 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -177,11 +177,6 @@ RSA_setup_blinding(RSA *rsa, BN_CTX *in_ctx) ctx = in_ctx; BN_CTX_start(ctx); - e = BN_CTX_get(ctx); - if (e == NULL) { - RSAerr(RSA_F_RSA_SETUP_BLINDING, ERR_R_MALLOC_FAILURE); - goto err; - } if (rsa->e == NULL) { e = rsa_get_public_exp(rsa->d, rsa->p, rsa->q, ctx); diff --git a/src/lib/libssl/src/crypto/rsa/rsa_crpt.c b/src/lib/libssl/src/crypto/rsa/rsa_crpt.c index 5edd2d7c5c..5de69a6fb5 100644 --- a/src/lib/libssl/src/crypto/rsa/rsa_crpt.c +++ b/src/lib/libssl/src/crypto/rsa/rsa_crpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_crpt.c,v 1.8 2014/07/10 11:35:31 jsing Exp $ */ +/* $OpenBSD: rsa_crpt.c,v 1.9 2014/07/10 12:36:58 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -177,11 +177,6 @@ RSA_setup_blinding(RSA *rsa, BN_CTX *in_ctx) ctx = in_ctx; BN_CTX_start(ctx); - e = BN_CTX_get(ctx); - if (e == NULL) { - RSAerr(RSA_F_RSA_SETUP_BLINDING, ERR_R_MALLOC_FAILURE); - goto err; - } if (rsa->e == NULL) { e = rsa_get_public_exp(rsa->d, rsa->p, rsa->q, ctx); -- cgit v1.2.3-55-g6feb