]> git.saurik.com Git - apple/security.git/blobdiff - libsecurity_cdsa_client/lib/cspclient.cpp
Security-55471.14.8.tar.gz
[apple/security.git] / libsecurity_cdsa_client / lib / cspclient.cpp
index 8e4a313f810288a34edecf56bbf23fdda1f53553..8f18933603d369f9d9de26cf1c56ccb809ee111d 100644 (file)
@@ -73,6 +73,7 @@ void Context::init()
 
 void Context::deactivate()
 {
+    StLock<Mutex> _(mActivateMutex);
        if (mActive)
        {
                mActive = false;
@@ -175,6 +176,7 @@ PassThrough::operator() (uint32 passThroughId, const void *inData, void **outDat
 
 void PassThrough::activate()
 {
+    StLock<Mutex> _(mActivateMutex);
        if (!mActive) {
                check(CSSM_CSP_CreatePassThroughContext(attachment()->handle(), mKey, &mHandle));
                mActive = true;
@@ -187,6 +189,7 @@ void PassThrough::activate()
 //
 void Digest::activate()
 {
+    StLock<Mutex> _(mActivateMutex);
        if (!mActive) {
                check(CSSM_CSP_CreateDigestContext(attachment()->handle(), mAlgorithm, &mHandle));
                mActive = true;
@@ -239,6 +242,7 @@ void Random::size(uint32 sz)
 
 void Random::activate()
 {
+    StLock<Mutex> _(mActivateMutex);
        if (!mActive) {
                check(CSSM_CSP_CreateRandomGenContext(attachment()->handle(), mAlgorithm,
                        mSeed, mSize, &mHandle));