]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_apple_csp/lib/AppleCSP.cpp
Security-59754.80.3.tar.gz
[apple/security.git] / OSX / libsecurity_apple_csp / lib / AppleCSP.cpp
index ec9e78ca3dcaca1ae0a6d497680a10cb4ed27631..1a32f514f012c82b59f95624739b241a4d4733fc 100644 (file)
 #include "cspdebugging.h" 
 #include <security_cdsa_plugin/CSPsession.h>
 #include <security_utilities/alloc.h>
-#ifdef BSAFE_CSP_ENABLE
-#include "bsafecsp.h"
-#include "bsafecspi.h"
-#endif
 #ifdef CRYPTKIT_CSP_ENABLE
 #include "cryptkitcsp.h"
 #include "FEEKeys.h"
@@ -51,9 +47,6 @@
 AppleCSPPlugin::AppleCSPPlugin() :
        normAllocator(Allocator::standard(Allocator::normal)),
        privAllocator(Allocator::standard(Allocator::sensitive)),
-       #ifdef  BSAFE_CSP_ENABLE
-       bSafe4Factory(new BSafeFactory(&normAllocator, &privAllocator)),
-       #endif
        #ifdef  CRYPTKIT_CSP_ENABLE
        cryptKitFactory(new CryptKitFactory(&normAllocator, &privAllocator)),
        #endif
@@ -69,9 +62,6 @@ AppleCSPPlugin::AppleCSPPlugin() :
 
 AppleCSPPlugin::~AppleCSPPlugin()
 {
-       #ifdef  BSAFE_CSP_ENABLE
-       delete bSafe4Factory;
-       #endif
        #ifdef  CRYPTKIT_CSP_ENABLE
        delete cryptKitFactory;
        #endif
@@ -106,7 +96,6 @@ PluginSession *AppleCSPPlugin::makeSession(
                                upcalls);
         default:
             CssmError::throwMe(CSSMERR_CSSM_INVALID_SERVICE_MASK);
-            return 0;  // placebo
     }
 }
 
@@ -129,9 +118,6 @@ AppleCSPSession::AppleCSPSession(
                        subserviceType,
                        attachFlags, 
                        upcalls),
-               #ifdef  BSAFE_CSP_ENABLE
-               bSafe4Factory(*(dynamic_cast<BSafeFactory *>(plug.bSafe4Factory))), 
-               #endif
                #ifdef  CRYPTKIT_CSP_ENABLE
                cryptKitFactory(*(dynamic_cast<CryptKitFactory *>(plug.cryptKitFactory))),
                #endif
@@ -179,13 +165,6 @@ void AppleCSPSession::setupContext(
         * Note we leave the decision as to whether it's OK to 
         * reuse a context to the individual factories.
         */
-       #ifdef  BSAFE_CSP_ENABLE
-       /* Give BSAFE the firsrt shot if it's present */
-       if (bSafe4Factory.setup(*this, cspCtx, context)) {
-               CASSERT(cspCtx != NULL);
-               return;
-       }
-       #endif
        if (rsaDsaAlgFactory.setup(*this, cspCtx, context)) {
                CASSERT(cspCtx != NULL);
                return;
@@ -244,9 +223,6 @@ bool AppleCSPSession::setup(
                default:
                        return false;
        }
-       /* NOT REACHED */
-       return false;
-
 }
 
 //
@@ -378,7 +354,7 @@ void AppleCSPSession::addRefKey(
        cssmKey.KeyHeader.BlobType = CSSM_KEYBLOB_REFERENCE;
        cssmKey.KeyHeader.Format = CSSM_KEYBLOB_REF_FORMAT_INTEGER;
        keyRefToCssmData(keyRef, cssmKey.KeyData, normAllocator);
-       secdebug("freeKey", "CSP addRefKey key %p keyData %p keyRef %p", 
+       secinfo("freeKey", "CSP addRefKey key %p keyData %p keyRef %p", 
                &cssmKey, cssmKey.KeyData.Data, &binKey);
 }
        
@@ -432,7 +408,7 @@ void AppleCSPSession::FreeKey(
                        StLock<Mutex> _(refKeyMapLock);
                        BinaryKey *binKey = lookupKeyRef(keyRef);
                        if(binKey != NULL) {
-                               secdebug("freeKey", "CSP FreeKey key %p keyData %p binKey %p", 
+                               secinfo("freeKey", "CSP FreeKey key %p keyData %p binKey %p", 
                                        &KeyPtr, KeyPtr.KeyData.Data, binKey);
                                try {
                                        refKeyMap.erase(keyRef);
@@ -444,7 +420,7 @@ void AppleCSPSession::FreeKey(
                                }
                        }
                        else {
-                               secdebug("freeKey", "CSP freeKey unknown key");
+                               secinfo("freeKey", "CSP freeKey unknown key");
                        }
                }
        }
@@ -621,14 +597,6 @@ CSPKeyInfoProvider *AppleCSPSession::infoProvider(
 {
        CSPKeyInfoProvider *provider = NULL;
        
-       #ifdef  BSAFE_CSP_ENABLE
-       /* Give BSAFE first shot, if it's here */
-       provider = BSafe::BSafeKeyInfoProvider::provider(key, *this);
-       if(provider != NULL) {
-               return provider;
-       }
-       #endif
-       
        provider = RSAKeyInfoProvider::provider(key, *this);
        if(provider != NULL) {
                return provider;