]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cssm/lib/emmspi.h
Security-57336.10.29.tar.gz
[apple/security.git] / OSX / libsecurity_cssm / lib / emmspi.h
1 /*
2 * Copyright (c) 1999-2001,2004,2011,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 * emmspi.h -- Service Provider Interface for Elective Module Managers
24 */
25
26 #ifndef _EMMSPI_H_
27 #define _EMMSPI_H_ 1
28
29 #include <Security/cssmtype.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 typedef struct cssm_state_funcs {
36 CSSM_RETURN (CSSMAPI *cssm_GetAttachFunctions)
37 (CSSM_MODULE_HANDLE hAddIn,
38 CSSM_SERVICE_MASK AddinType,
39 void **SPFunctions,
40 CSSM_GUID_PTR Guid,
41 CSSM_BOOL *Serialized);
42 CSSM_RETURN (CSSMAPI *cssm_ReleaseAttachFunctions)
43 (CSSM_MODULE_HANDLE hAddIn);
44 CSSM_RETURN (CSSMAPI *cssm_GetAppMemoryFunctions)
45 (CSSM_MODULE_HANDLE hAddIn,
46 CSSM_UPCALLS_PTR UpcallTable);
47 CSSM_RETURN (CSSMAPI *cssm_IsFuncCallValid)
48 (CSSM_MODULE_HANDLE hAddin,
49 CSSM_PROC_ADDR SrcAddress,
50 CSSM_PROC_ADDR DestAddress,
51 CSSM_PRIVILEGE InPriv,
52 CSSM_PRIVILEGE *OutPriv,
53 CSSM_BITMASK Hints,
54 CSSM_BOOL *IsOK);
55 CSSM_RETURN (CSSMAPI *cssm_DeregisterManagerServices)
56 (const CSSM_GUID *GUID);
57 CSSM_RETURN (CSSMAPI *cssm_DeliverModuleManagerEvent)
58 (const CSSM_MANAGER_EVENT_NOTIFICATION *EventDescription);
59 } CSSM_STATE_FUNCS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_STATE_FUNCS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
60
61 typedef struct cssm_manager_registration_info {
62 /* loading, unloading, dispatch table, and event notification */
63 CSSM_RETURN (CSSMAPI *Initialize)
64 (uint32 VerMajor,
65 uint32 VerMinor);
66 CSSM_RETURN (CSSMAPI *Terminate) (void);
67 CSSM_RETURN (CSSMAPI *RegisterDispatchTable)
68 (CSSM_STATE_FUNCS_PTR CssmStateCallTable);
69 CSSM_RETURN (CSSMAPI *DeregisterDispatchTable) (void);
70 CSSM_RETURN (CSSMAPI *EventNotifyManager)
71 (const CSSM_MANAGER_EVENT_NOTIFICATION *EventDescription);
72 CSSM_RETURN (CSSMAPI *RefreshFunctionTable)
73 (CSSM_FUNC_NAME_ADDR_PTR FuncNameAddrPtr,
74 uint32 NumOfFuncNameAddr);
75 } CSSM_MANAGER_REGISTRATION_INFO DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_MANAGER_REGISTRATION_INFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
76
77 enum {
78 CSSM_HINT_NONE = 0,
79 CSSM_HINT_ADDRESS_APP = 1 << 0,
80 CSSM_HINT_ADDRESS_SP = 1 << 1
81 };
82
83 CSSM_RETURN CSSMAPI
84 ModuleManagerAuthenticate (CSSM_KEY_HIERARCHY KeyHierarchy,
85 const CSSM_GUID *CssmGuid,
86 const CSSM_GUID *AppGuid,
87 CSSM_MANAGER_REGISTRATION_INFO_PTR FunctionTable)
88 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
89
90 #ifdef __cplusplus
91 }
92 #endif
93
94 #endif /* _EMMSPI_H_ */