summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormiod <>2014-07-10 12:36:58 +0000
committermiod <>2014-07-10 12:36:58 +0000
commita21d4e83af767763bc6679d7872bb1a74a952d84 (patch)
treec2323e8a8295623e3b0caaade991b8da223bb6e7 /src
parentaf5801cef5d1cd3e1d06ac740c6ddd3aac4e7d8f (diff)
downloadopenbsd-a21d4e83af767763bc6679d7872bb1a74a952d84.tar.gz
openbsd-a21d4e83af767763bc6679d7872bb1a74a952d84.tar.bz2
openbsd-a21d4e83af767763bc6679d7872bb1a74a952d84.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/rsa/rsa_crpt.c7
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_crpt.c7
2 files changed, 2 insertions, 12 deletions
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 @@
1/* $OpenBSD: rsa_crpt.c,v 1.8 2014/07/10 11:35:31 jsing Exp $ */ 1/* $OpenBSD: rsa_crpt.c,v 1.9 2014/07/10 12:36:58 miod Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -177,11 +177,6 @@ RSA_setup_blinding(RSA *rsa, BN_CTX *in_ctx)
177 ctx = in_ctx; 177 ctx = in_ctx;
178 178
179 BN_CTX_start(ctx); 179 BN_CTX_start(ctx);
180 e = BN_CTX_get(ctx);
181 if (e == NULL) {
182 RSAerr(RSA_F_RSA_SETUP_BLINDING, ERR_R_MALLOC_FAILURE);
183 goto err;
184 }
185 180
186 if (rsa->e == NULL) { 181 if (rsa->e == NULL) {
187 e = rsa_get_public_exp(rsa->d, rsa->p, rsa->q, ctx); 182 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 @@
1/* $OpenBSD: rsa_crpt.c,v 1.8 2014/07/10 11:35:31 jsing Exp $ */ 1/* $OpenBSD: rsa_crpt.c,v 1.9 2014/07/10 12:36:58 miod Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -177,11 +177,6 @@ RSA_setup_blinding(RSA *rsa, BN_CTX *in_ctx)
177 ctx = in_ctx; 177 ctx = in_ctx;
178 178
179 BN_CTX_start(ctx); 179 BN_CTX_start(ctx);
180 e = BN_CTX_get(ctx);
181 if (e == NULL) {
182 RSAerr(RSA_F_RSA_SETUP_BLINDING, ERR_R_MALLOC_FAILURE);
183 goto err;
184 }
185 180
186 if (rsa->e == NULL) { 181 if (rsa->e == NULL) {
187 e = rsa_get_public_exp(rsa->d, rsa->p, rsa->q, ctx); 182 e = rsa_get_public_exp(rsa->d, rsa->p, rsa->q, ctx);