diff options
author | Rich Salz <rsalz@openssl.org> | 2016-06-24 09:49:51 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-06-27 07:39:53 -0400 |
commit | 6f4a6a5cd472d56937a8e9d6665e7c9cc6b1b2e2 (patch) | |
tree | bc73e9488b56f0e7eb54289e4f2ee8dab07c521a /crypto/rsa | |
parent | 56add338b12246fd8670ce3da719a39767a25182 (diff) |
RT4586: Remove RSA_memory_lock; unused, not needed
Reviewed-by: Ben Laurie <ben@openssl.org>
Diffstat (limited to 'crypto/rsa')
-rw-r--r-- | crypto/rsa/rsa_err.c | 1 | ||||
-rw-r--r-- | crypto/rsa/rsa_lib.c | 44 |
2 files changed, 0 insertions, 45 deletions
diff --git a/crypto/rsa/rsa_err.c b/crypto/rsa/rsa_err.c index a92ea5d026..0bde045583 100644 --- a/crypto/rsa/rsa_err.c +++ b/crypto/rsa/rsa_err.c @@ -32,7 +32,6 @@ static ERR_STRING_DATA RSA_str_functs[] = { {ERR_FUNC(RSA_F_RSA_CHECK_KEY_EX), "RSA_check_key_ex"}, {ERR_FUNC(RSA_F_RSA_CMS_DECRYPT), "rsa_cms_decrypt"}, {ERR_FUNC(RSA_F_RSA_ITEM_VERIFY), "rsa_item_verify"}, - {ERR_FUNC(RSA_F_RSA_MEMORY_LOCK), "RSA_memory_lock"}, {ERR_FUNC(RSA_F_RSA_METH_DUP), "RSA_meth_dup"}, {ERR_FUNC(RSA_F_RSA_METH_NEW), "RSA_meth_new"}, {ERR_FUNC(RSA_F_RSA_METH_SET1_NAME), "RSA_meth_set1_name"}, 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); |