summaryrefslogtreecommitdiffstats
path: root/crypto/rsa/rsa_lib.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2016-06-24 09:49:51 -0400
committerRich Salz <rsalz@openssl.org>2016-06-27 07:39:53 -0400
commit6f4a6a5cd472d56937a8e9d6665e7c9cc6b1b2e2 (patch)
treebc73e9488b56f0e7eb54289e4f2ee8dab07c521a /crypto/rsa/rsa_lib.c
parent56add338b12246fd8670ce3da719a39767a25182 (diff)
RT4586: Remove RSA_memory_lock; unused, not needed
Reviewed-by: Ben Laurie <ben@openssl.org>
Diffstat (limited to 'crypto/rsa/rsa_lib.c')
-rw-r--r--crypto/rsa/rsa_lib.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/crypto/rsa/rsa_lib.c b/crypto/rsa/rsa_lib.c
index 9ba86d856a..14750d177e 100644
--- a/crypto/rsa/rsa_lib.c
+++ b/crypto/rsa/rsa_lib.c
@@ -180,50 +180,6 @@ void *RSA_get_ex_data(const RSA *r, int idx)
return (CRYPTO_get_ex_data(&r->ex_data, idx));
}
-int RSA_memory_lock(RSA *r)
-{
- int i, j, k, off;
- char *p;
- BIGNUM *bn, **t[6], *b;
- BN_ULONG *ul;
-
- if (r->d == NULL)
- return (1);
- t[0] = &r->d;
- t[1] = &r->p;
- t[2] = &r->q;
- t[3] = &r->dmp1;
- t[4] = &r->dmq1;
- t[5] = &r->iqmp;
- k = bn_sizeof_BIGNUM() * 6;
- off = k / sizeof(BN_ULONG) + 1;
- j = 1;
- for (i = 0; i < 6; i++)
- j += bn_get_top(*t[i]);
- if ((p = OPENSSL_malloc((off + j) * sizeof(*p))) == NULL) {
- RSAerr(RSA_F_RSA_MEMORY_LOCK, ERR_R_MALLOC_FAILURE);
- return (0);
- }
- memset(p, 0, sizeof(*p) * (off + j));
- bn = (BIGNUM *)p;
- ul = (BN_ULONG *)&(p[off]);
- for (i = 0; i < 6; i++) {
- b = *(t[i]);
- *(t[i]) = bn_array_el(bn, i);
- memcpy(bn_array_el(bn, i), b, bn_sizeof_BIGNUM());
- memcpy(ul, bn_get_words(b), sizeof(*ul) * bn_get_top(b));
- bn_set_static_words(bn_array_el(bn, i), ul, bn_get_top(b));
- ul += bn_get_top(b);
- BN_clear_free(b);
- }
-
- /* I should fix this so it can still be done */
- r->flags &= ~(RSA_FLAG_CACHE_PRIVATE | RSA_FLAG_CACHE_PUBLIC);
-
- r->bignum_data = p;
- return (1);
-}
-
int RSA_security_bits(const RSA *rsa)
{
return BN_security_bits(BN_num_bits(rsa->n), -1);