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