]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cssm/lib/cssmspi.h
Security-59754.41.1.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 #include <Security/cssmspi.h> /* CSSM_UPCALLS_PTR */
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 #pragma clang diagnostic push
37 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
38
39 typedef CSSM_RETURN (CSSMAPI *CSSM_SPI_ModuleEventHandler)
40 (const CSSM_GUID *ModuleGuid,
41 void *CssmNotifyCallbackCtx,
42 uint32 SubserviceId,
43 CSSM_SERVICE_TYPE ServiceType,
44 CSSM_MODULE_EVENT EventType) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
45
46 typedef uint32 CSSM_CONTEXT_EVENT;
47 enum {
48 CSSM_CONTEXT_EVENT_CREATE = 1,
49 CSSM_CONTEXT_EVENT_DELETE = 2,
50 CSSM_CONTEXT_EVENT_UPDATE = 3
51 };
52
53 typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_module_funcs {
54 CSSM_SERVICE_TYPE ServiceType;
55 uint32 NumberOfServiceFuncs;
56 const CSSM_PROC_ADDR *ServiceFuncs;
57 } 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;
58
59 typedef void *(CSSMAPI *CSSM_UPCALLS_MALLOC)
60 (CSSM_HANDLE AddInHandle,
61 size_t size) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
62
63 typedef void (CSSMAPI *CSSM_UPCALLS_FREE)
64 (CSSM_HANDLE AddInHandle,
65 void *memblock) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
66
67 typedef void *(CSSMAPI *CSSM_UPCALLS_REALLOC)
68 (CSSM_HANDLE AddInHandle,
69 void *memblock,
70 size_t size) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
71
72 typedef void *(CSSMAPI *CSSM_UPCALLS_CALLOC)
73 (CSSM_HANDLE AddInHandle,
74 size_t num,
75 size_t size) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
76
77 typedef struct DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER cssm_upcalls {
78 CSSM_UPCALLS_MALLOC malloc_func;
79 CSSM_UPCALLS_FREE free_func;
80 CSSM_UPCALLS_REALLOC realloc_func;
81 CSSM_UPCALLS_CALLOC calloc_func;
82 CSSM_RETURN (CSSMAPI *CcToHandle_func)
83 (CSSM_CC_HANDLE Cc,
84 CSSM_MODULE_HANDLE_PTR ModuleHandle);
85 CSSM_RETURN (CSSMAPI *GetModuleInfo_func)
86 (CSSM_MODULE_HANDLE Module,
87 CSSM_GUID_PTR Guid,
88 CSSM_VERSION_PTR Version,
89 uint32 *SubServiceId,
90 CSSM_SERVICE_TYPE *SubServiceType,
91 CSSM_ATTACH_FLAGS *AttachFlags,
92 CSSM_KEY_HIERARCHY *KeyHierarchy,
93 CSSM_API_MEMORY_FUNCS_PTR AttachedMemFuncs,
94 CSSM_FUNC_NAME_ADDR_PTR FunctionTable,
95 uint32 NumFunctions);
96 } 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;
97
98 #pragma clang diagnostic pop
99
100 #ifdef __cplusplus
101 }
102 #endif
103
104 #endif /* _CSSMSPI_H_ */