X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/b1ab9ed8d0e0f1c3b66d7daa8fd5564444c56195..420ff9d9379a8d93f2c90f026a797bdea1eb4517:/libsecurity_cdsa_client/lib/cspclient.cpp?ds=inline diff --git a/libsecurity_cdsa_client/lib/cspclient.cpp b/libsecurity_cdsa_client/lib/cspclient.cpp index 8e4a313f..8f189336 100644 --- a/libsecurity_cdsa_client/lib/cspclient.cpp +++ b/libsecurity_cdsa_client/lib/cspclient.cpp @@ -73,6 +73,7 @@ void Context::init() void Context::deactivate() { + StLock _(mActivateMutex); if (mActive) { mActive = false; @@ -175,6 +176,7 @@ PassThrough::operator() (uint32 passThroughId, const void *inData, void **outDat void PassThrough::activate() { + StLock _(mActivateMutex); if (!mActive) { check(CSSM_CSP_CreatePassThroughContext(attachment()->handle(), mKey, &mHandle)); mActive = true; @@ -187,6 +189,7 @@ void PassThrough::activate() // void Digest::activate() { + StLock _(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 _(mActivateMutex); if (!mActive) { check(CSSM_CSP_CreateRandomGenContext(attachment()->handle(), mAlgorithm, mSeed, mSize, &mHandle));