summaryrefslogtreecommitdiffstats
path: root/crypto/rsa/rsa_crpt.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/rsa/rsa_crpt.c')
-rw-r--r--crypto/rsa/rsa_crpt.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/crypto/rsa/rsa_crpt.c b/crypto/rsa/rsa_crpt.c
index 052f42c620..f5f29e0e28 100644
--- a/crypto/rsa/rsa_crpt.c
+++ b/crypto/rsa/rsa_crpt.c
@@ -100,10 +100,8 @@ int RSA_flags(const RSA *r)
void RSA_blinding_off(RSA *rsa)
{
- if (rsa->blinding != NULL) {
- BN_BLINDING_free(rsa->blinding);
- rsa->blinding = NULL;
- }
+ BN_BLINDING_free(rsa->blinding);
+ rsa->blinding = NULL;
rsa->flags &= ~RSA_FLAG_BLINDING;
rsa->flags |= RSA_FLAG_NO_BLINDING;
}
@@ -213,12 +211,11 @@ BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *in_ctx)
CRYPTO_THREADID_current(BN_BLINDING_thread_id(ret));
err:
BN_CTX_end(ctx);
- if (in_ctx == NULL)
+ if (ctx != in_ctx)
BN_CTX_free(ctx);
- if (rsa->e == NULL)
+ if (e != rsa->e)
BN_free(e);
- if (local_n)
- BN_free(local_n);
+ BN_free(local_n);
return ret;
}