]> git.saurik.com Git - apple/security.git/blob - Security/libsecurity_cssm/lib/cssmspi.h
Security-57031.10.10.tar.gz
[apple/security.git] / Security / 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 typedef CSSM_RETURN (CSSMAPI *CSSM_SPI_ModuleEventHandler)
36 (const CSSM_GUID *ModuleGuid,
37 void *CssmNotifyCallbackCtx,
38 uint32 SubserviceId,
39 CSSM_SERVICE_TYPE ServiceType,
40 CSSM_MODULE_EVENT EventType);
41
42 typedef uint32 CSSM_CONTEXT_EVENT;
43 enum {
44 CSSM_CONTEXT_EVENT_CREATE = 1,
45 CSSM_CONTEXT_EVENT_DELETE = 2,
46 CSSM_CONTEXT_EVENT_UPDATE = 3
47 };
48
49 typedef struct cssm_module_funcs {
50 CSSM_SERVICE_TYPE ServiceType;
51 uint32 NumberOfServiceFuncs;
52 const CSSM_PROC_ADDR *ServiceFuncs;
53 } 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;
54
55 typedef void *(CSSMAPI *CSSM_UPCALLS_MALLOC)
56 (CSSM_HANDLE AddInHandle,
57 size_t size) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
58
59 typedef void (CSSMAPI *CSSM_UPCALLS_FREE)
60 (CSSM_HANDLE AddInHandle,
61 void *memblock) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
62
63 typedef void *(CSSMAPI *CSSM_UPCALLS_REALLOC)
64 (CSSM_HANDLE AddInHandle,
65 void *memblock,
66 size_t size) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
67
68 typedef void *(CSSMAPI *CSSM_UPCALLS_CALLOC)
69 (CSSM_HANDLE AddInHandle,
70 size_t num,
71 size_t size) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
72
73 typedef struct cssm_upcalls {
74 CSSM_UPCALLS_MALLOC malloc_func;
75 CSSM_UPCALLS_FREE free_func;
76 CSSM_UPCALLS_REALLOC realloc_func;
77 CSSM_UPCALLS_CALLOC calloc_func;
78 CSSM_RETURN (CSSMAPI *CcToHandle_func)
79 (CSSM_CC_HANDLE Cc,
80 CSSM_MODULE_HANDLE_PTR ModuleHandle);
81 CSSM_RETURN (CSSMAPI *GetModuleInfo_func)
82 (CSSM_MODULE_HANDLE Module,
83 CSSM_GUID_PTR Guid,
84 CSSM_VERSION_PTR Version,
85 uint32 *SubServiceId,
86 CSSM_SERVICE_TYPE *SubServiceType,
87 CSSM_ATTACH_FLAGS *AttachFlags,
88 CSSM_KEY_HIERARCHY *KeyHierarchy,
89 CSSM_API_MEMORY_FUNCS_PTR AttachedMemFuncs,
90 CSSM_FUNC_NAME_ADDR_PTR FunctionTable,
91 uint32 NumFunctions);
92 } 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;
93
94 CSSM_RETURN CSSMSPI
95 CSSM_SPI_ModuleLoad (const CSSM_GUID *CssmGuid,
96 const CSSM_GUID *ModuleGuid,
97 CSSM_SPI_ModuleEventHandler CssmNotifyCallback,
98 void *CssmNotifyCallbackCtx)
99 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
100
101 CSSM_RETURN CSSMSPI
102 CSSM_SPI_ModuleUnload (const CSSM_GUID *CssmGuid,
103 const CSSM_GUID *ModuleGuid,
104 CSSM_SPI_ModuleEventHandler CssmNotifyCallback,
105 void *CssmNotifyCallbackCtx)
106 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
107
108 CSSM_RETURN CSSMSPI
109 CSSM_SPI_ModuleAttach (const CSSM_GUID *ModuleGuid,
110 const CSSM_VERSION *Version,
111 uint32 SubserviceID,
112 CSSM_SERVICE_TYPE SubServiceType,
113 CSSM_ATTACH_FLAGS AttachFlags,
114 CSSM_MODULE_HANDLE ModuleHandle,
115 CSSM_KEY_HIERARCHY KeyHierarchy,
116 const CSSM_GUID *CssmGuid,
117 const CSSM_GUID *ModuleManagerGuid,
118 const CSSM_GUID *CallerGuid,
119 const CSSM_UPCALLS *Upcalls,
120 CSSM_MODULE_FUNCS_PTR *FuncTbl)
121 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
122
123 CSSM_RETURN CSSMSPI
124 CSSM_SPI_ModuleDetach (CSSM_MODULE_HANDLE ModuleHandle)
125 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
126
127
128 #ifdef __cplusplus
129 }
130 #endif
131
132 #endif /* _CSSMSPI_H_ */