]> git.saurik.com Git - apple/security.git/blobdiff - libsecurity_cdsa_client/lib/macclient.cpp
Security-55471.14.8.tar.gz
[apple/security.git] / libsecurity_cdsa_client / lib / macclient.cpp
index 1fdc177ab0130a88e9fcc89d4ecad5a2a447f209..c821cc99abc4c8f339e4111284c4ddeebc25b739 100644 (file)
@@ -29,15 +29,18 @@ using namespace CssmClient;
 //
 void MacContext::activate()
 {
 //
 void MacContext::activate()
 {
-    StLock<Mutex> _(mActivateMutex);
-       if (!mActive) 
-       {
-               check(CSSM_CSP_CreateMacContext(attachment()->handle(), mAlgorithm,
-                         mKey, &mHandle));
-               mActive = true;
-               if (cred())
-                       cred(cred());           // install explicitly
-       }
+    {
+        StLock<Mutex> _(mActivateMutex);
+        if (!mActive) 
+        {
+            check(CSSM_CSP_CreateMacContext(attachment()->handle(), mAlgorithm,
+                  mKey, &mHandle));
+            mActive = true;
+        }
+    }
+
+    if (cred())
+        cred(cred());          // install explicitly
 }
 
 
 }