Update from HEAD.
[openssl.git] / crypto / bn / bn_blind.c
index fa48470a57feb7bf30d608ed12ad0bce2cce2338..e060592fdc53415dc407b12d835fc4d5a986798e 100644 (file)
@@ -121,8 +121,6 @@ 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 */
@@ -163,6 +161,7 @@ BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod)
                BN_set_flags(ret->mod, BN_FLG_CONSTTIME);
 
        ret->counter = BN_BLINDING_COUNTER;
+       CRYPTO_THREADID_current(&ret->tid);
        return(ret);
 err:
        if (ret != NULL) BN_BLINDING_free(ret);
@@ -280,14 +279,9 @@ void BN_BLINDING_set_thread_id(BN_BLINDING *b, unsigned long n)
        }
 #endif
 
-void BN_BLINDING_set_thread(BN_BLINDING *b)
+CRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *b)
        {
-       CRYPTO_THREADID_set(&b->tid);
-       }
-
-int BN_BLINDING_cmp_thread(const BN_BLINDING *b, const CRYPTO_THREADID *tid)
-       {
-       return CRYPTO_THREADID_cmp(&b->tid, tid);
+       return &b->tid;
        }
 
 unsigned long BN_BLINDING_get_flags(const BN_BLINDING *b)