summaryrefslogtreecommitdiffstats
path: root/crypto/bn
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2008-07-03 19:59:25 +0000
committerGeoff Thorpe <geoff@openssl.org>2008-07-03 19:59:25 +0000
commit5f834ab123af6444b7cffe21849e434ad6479f8a (patch)
tree0cc48f4fc085f781606cb118b715781651487cb3 /crypto/bn
parent8528128b2a740d34d3ae1d43c525d7e6ea6d7f37 (diff)
Revert my earlier CRYPTO_THREADID commit, I will commit a reworked
version some time soon.
Diffstat (limited to 'crypto/bn')
-rw-r--r--crypto/bn/bn.h7
-rw-r--r--crypto/bn/bn_blind.c17
-rw-r--r--crypto/bn/exptest.c2
3 files changed, 9 insertions, 17 deletions
diff --git a/crypto/bn/bn.h b/crypto/bn/bn.h
index 65202ae9f2..de2cfcf93c 100644
--- a/crypto/bn/bn.h
+++ b/crypto/bn/bn.h
@@ -129,7 +129,6 @@
#ifndef OPENSSL_NO_FP_API
#include <stdio.h> /* FILE */
#endif
-#include <openssl/crypto.h>
#include <openssl/ossl_typ.h>
#ifdef __cplusplus
@@ -565,12 +564,10 @@ int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *);
int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *);
-#ifndef OPENSSL_NO_DEPRECATED
unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *);
void BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long);
-#endif
-void BN_BLINDING_set_thread(BN_BLINDING *);
-int BN_BLINDING_cmp_thread(const BN_BLINDING *, const CRYPTO_THREADID *);
+void *BN_BLINDING_get_thread_idptr(const BN_BLINDING *);
+void BN_BLINDING_set_thread_idptr(BN_BLINDING *, void *);
unsigned long BN_BLINDING_get_flags(const BN_BLINDING *);
void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long);
BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
diff --git a/crypto/bn/bn_blind.c b/crypto/bn/bn_blind.c
index fa48470a57..e9b6173e24 100644
--- a/crypto/bn/bn_blind.c
+++ b/crypto/bn/bn_blind.c
@@ -121,13 +121,10 @@ struct bn_blinding_st
BIGNUM *Ai;
BIGNUM *e;
BIGNUM *mod; /* just a reference */
-/* FIXME: should really try to remove these, but the deprecated APIs that are
- * using them would need to be fudged somehow. */
-#ifndef OPENSSL_NO_DEPRECATED
unsigned long thread_id; /* added in OpenSSL 0.9.6j and 0.9.7b;
* used only by crypto/rsa/rsa_eay.c, rsa_lib.c */
-#endif
- CRYPTO_THREADID tid;
+ void *thread_idptr; /* added in OpenSSL 0.9.9;
+ * used only by crypto/rsa/rsa_eay.c, rsa_lib.c */
unsigned int counter;
unsigned long flags;
BN_MONT_CTX *m_ctx;
@@ -268,7 +265,6 @@ int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *ct
return(ret);
}
-#ifndef OPENSSL_NO_DEPRECATED
unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *b)
{
return b->thread_id;
@@ -278,16 +274,15 @@ void BN_BLINDING_set_thread_id(BN_BLINDING *b, unsigned long n)
{
b->thread_id = n;
}
-#endif
-void BN_BLINDING_set_thread(BN_BLINDING *b)
+void *BN_BLINDING_get_thread_idptr(const BN_BLINDING *b)
{
- CRYPTO_THREADID_set(&b->tid);
+ return b->thread_idptr;
}
-int BN_BLINDING_cmp_thread(const BN_BLINDING *b, const CRYPTO_THREADID *tid)
+void BN_BLINDING_set_thread_idptr(BN_BLINDING *b, void *p)
{
- return CRYPTO_THREADID_cmp(&b->tid, tid);
+ b->thread_idptr = p;
}
unsigned long BN_BLINDING_get_flags(const BN_BLINDING *b)
diff --git a/crypto/bn/exptest.c b/crypto/bn/exptest.c
index 074a8e882a..89ebcc8711 100644
--- a/crypto/bn/exptest.c
+++ b/crypto/bn/exptest.c
@@ -187,7 +187,7 @@ int main(int argc, char *argv[])
BN_free(b);
BN_free(m);
BN_CTX_free(ctx);
- ERR_remove_thread_state(NULL);
+ ERR_remove_state(0);
CRYPTO_mem_leaks(out);
BIO_free(out);
printf(" done\n");