2 * Copyright (c) 2000-2001,2011,2013-2014 Apple Inc. All Rights Reserved.
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
20 // AppleFileDL.cpp - File Based DL plug-in module.
22 #include "AppleFileDL.h"
24 #include <security_cdsa_plugin/DLsession.h>
27 // Names and IDs of tables used in a DL database
29 static const AppleDatabaseTableName kTableNames
[] = {
30 { CSSM_DL_DB_SCHEMA_INFO
, "CSSM_DL_DB_SCHEMA_INFO" },
31 { CSSM_DL_DB_SCHEMA_ATTRIBUTES
, "CSSM_DL_DB_SCHEMA_ATTRIBUTES" },
32 { CSSM_DL_DB_SCHEMA_INDEXES
, "CSSM_DL_DB_SCHEMA_INDEXES" },
33 { CSSM_DL_DB_SCHEMA_PARSING_MODULE
, "CSSM_DL_DB_SCHEMA_PARSING_MODULE" },
34 { CSSM_DL_DB_RECORD_CERT
, "CSSM_DL_DB_RECORD_CERT" },
35 { CSSM_DL_DB_RECORD_CRL
, "CSSM_DL_DB_RECORD_CRL" },
36 { CSSM_DL_DB_RECORD_POLICY
, "CSSM_DL_DB_RECORD_POLICY" },
37 { CSSM_DL_DB_RECORD_GENERIC
, "CSSM_DL_DB_RECORD_GENERIC" },
38 { CSSM_DL_DB_RECORD_PUBLIC_KEY
, "CSSM_DL_DB_RECORD_PUBLIC_KEY" },
39 { CSSM_DL_DB_RECORD_PRIVATE_KEY
, "CSSM_DL_DB_RECORD_PRIVATE_KEY" },
40 { CSSM_DL_DB_RECORD_SYMMETRIC_KEY
, "CSSM_DL_DB_RECORD_SYMMETRIC_KEY" },
45 // Make and break the plugin object
47 AppleFileDL::AppleFileDL()
48 : mDatabaseManager(kTableNames
)
52 AppleFileDL::~AppleFileDL()
58 // Create a new plugin session, our way
60 PluginSession
*AppleFileDL::makeSession(CSSM_MODULE_HANDLE handle
,
61 const CSSM_VERSION
&version
,
63 CSSM_SERVICE_TYPE subserviceType
,
64 CSSM_ATTACH_FLAGS attachFlags
,
65 const CSSM_UPCALLS
&upcalls
)
67 switch (subserviceType
) {
69 return new DLPluginSession(handle
,
78 CssmError::throwMe(CSSMERR_CSSM_INVALID_SERVICE_MASK
);