]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cssm/lib/cssmspi.h
Security-57740.51.3.tar.gz
[apple/security.git] / OSX / libsecurity_cssm / lib / cssmspi.h
1 /*
2 * Copyright (c) 1999-2001,2003-2004,2011-2012,2014 Apple Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 *
23 * cssmspi.h -- Service Provider Interface for CSSM Modules
24 */
25
26 #ifndef _CSSMSPI_H_
27 #define _CSSMSPI_H_ 1
28
29 #include <Security/cssmtype.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 #pragma clang diagnostic push
36 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
37
38 typedef CSSM_RETURN (CSSMAPI *CSSM_SPI_ModuleEventHandler)
39 (const CSSM_GUID *ModuleGuid,
40 void *CssmNotifyCallbackCtx,
41 uint32 SubserviceId,
42 CSSM_SERVICE_TYPE ServiceType,
43 CSSM_MODULE_EVENT EventType);
44
45 typedef uint32 CSSM_CONTEXT_EVENT;
46 enum {
47 CSSM_CONTEXT_EVENT_CREATE = 1,
48 CSSM_CONTEXT_EVENT_DELETE = 2,
49 CSSM_CONTEXT_EVENT_UPDATE = 3
50 };
51
52 typedef struct cssm_module_funcs {
53 CSSM_SERVICE_TYPE ServiceType;
54 uint32 NumberOfServiceFuncs;
55 const CSSM_PROC_ADDR *ServiceFuncs;
56 } CSSM_MODULE_FUNCS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_MODULE_FUNCS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
57
58 typedef void *(CSSMAPI *CSSM_UPCALLS_MALLOC)
59 (CSSM_HANDLE AddInHandle,
60 size_t size) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
61
62 typedef void (CSSMAPI *CSSM_UPCALLS_FREE)
63 (CSSM_HANDLE AddInHandle,
64 void *memblock) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
65
66 typedef void *(CSSMAPI *CSSM_UPCALLS_REALLOC)
67 (CSSM_HANDLE AddInHandle,
68 void *memblock,
69 size_t size) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
70
71 typedef void *(CSSMAPI *CSSM_UPCALLS_CALLOC)
72 (CSSM_HANDLE AddInHandle,
73 size_t num,
74 size_t size) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
75
76 typedef struct cssm_upcalls {
77 CSSM_UPCALLS_MALLOC malloc_func;
78 CSSM_UPCALLS_FREE free_func;
79 CSSM_UPCALLS_REALLOC realloc_func;
80 CSSM_UPCALLS_CALLOC calloc_func;
81 CSSM_RETURN (CSSMAPI *CcToHandle_func)
82 (CSSM_CC_HANDLE Cc,
83 CSSM_MODULE_HANDLE_PTR ModuleHandle);
84 CSSM_RETURN (CSSMAPI *GetModuleInfo_func)
85 (CSSM_MODULE_HANDLE Module,
86 CSSM_GUID_PTR Guid,
87 CSSM_VERSION_PTR Version,
88 uint32 *SubServiceId,
89 CSSM_SERVICE_TYPE *SubServiceType,
90 CSSM_ATTACH_FLAGS *AttachFlags,
91 CSSM_KEY_HIERARCHY *KeyHierarchy,
92 CSSM_API_MEMORY_FUNCS_PTR AttachedMemFuncs,
93 CSSM_FUNC_NAME_ADDR_PTR FunctionTable,
94 uint32 NumFunctions);
95 } CSSM_UPCALLS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_UPCALLS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
96
97 CSSM_RETURN CSSMSPI
98 CSSM_SPI_ModuleLoad (const CSSM_GUID *CssmGuid,
99 const CSSM_GUID *ModuleGuid,
100 CSSM_SPI_ModuleEventHandler CssmNotifyCallback,
101 void *CssmNotifyCallbackCtx)
102 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
103
104 CSSM_RETURN CSSMSPI
105 CSSM_SPI_ModuleUnload (const CSSM_GUID *CssmGuid,
106 const CSSM_GUID *ModuleGuid,
107 CSSM_SPI_ModuleEventHandler CssmNotifyCallback,
108 void *CssmNotifyCallbackCtx)
109 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
110
111 CSSM_RETURN CSSMSPI
112 CSSM_SPI_ModuleAttach (const CSSM_GUID *ModuleGuid,
113 const CSSM_VERSION *Version,
114 uint32 SubserviceID,
115 CSSM_SERVICE_TYPE SubServiceType,
116 CSSM_ATTACH_FLAGS AttachFlags,
117 CSSM_MODULE_HANDLE ModuleHandle,
118 CSSM_KEY_HIERARCHY KeyHierarchy,
119 const CSSM_GUID *CssmGuid,
120 const CSSM_GUID *ModuleManagerGuid,
121 const CSSM_GUID *CallerGuid,
122 const CSSM_UPCALLS *Upcalls,
123 CSSM_MODULE_FUNCS_PTR *FuncTbl)
124 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
125
126 CSSM_RETURN CSSMSPI
127 CSSM_SPI_ModuleDetach (CSSM_MODULE_HANDLE ModuleHandle)
128 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
129
130 #pragma clang diagnostic pop
131
132 #ifdef __cplusplus
133 }
134 #endif
135
136 #endif /* _CSSMSPI_H_ */