2 // secagent.defs - Client-side Mach RPC interface to SecurityAgent.
4 // Note: one additional message ID code (Client::cancelMessagePseudoID) is used
5 // explicitly without showing up in this file.
7 #include <mach/std_types.defs>
8 #include <mach/mach_types.defs>
10 subsystem secagent 1000;
11 serverprefix secagent_server_;
12 userprefix secagent_client_;
14 import <Security/secagent_types.h>;
20 type OSStatus = int32;
22 type AclAuthorization = unsigned32;
23 type Reason = unsigned32;
24 type String = c_string[*:2048];
25 type ConstString = c_string[*:2048];
26 type Username = c_string[*:80];
27 type Choice = struct[2] of unsigned32;
28 type MigBoolean = unsigned32;
30 type Data = array [] of char;
32 type AuthorizationString = c_string[*:1024];
33 type AuthorizationItemSetBlob = Data
34 ctype: AuthorizationItemSetPtr;
35 type AuthorizationItemSetPtr = unsigned32;
36 type AuthorizationValueVectorBlob = Data
37 ctype: AuthorizationValueVectorPtr;
38 type AuthorizationValueVectorPtr = unsigned32;
40 type AuthorizationResultInt = unsigned32;
44 // Common argument profiles
47 #define UCSP_PORTS requestport sport: mach_port_t; \
48 replyport rport: mach_port_t; \
50 #define IN_BLOB(name,type) in name: type##Blob; in name##Base: type##Ptr
51 #define OUT_BLOB(name,type) out name: type##Blob; out name##Base: type##Ptr
55 // Staged query maintainance (common to all staged queries)
57 routine finishStagedQuery(UCSP_PORTS);
58 routine cancelStagedQuery(UCSP_PORTS; in reason: Reason);
62 // Unlocking keychains by user input
64 routine unlockDatabase(UCSP_PORTS;
65 in requestor: ConstString; in requestPid: pid_t; in database: ConstString;
66 out stagePort: mach_port_copy_send_t; out passphrase: String);
67 routine retryUnlockDatabase(UCSP_PORTS; in reason: Reason; out passphrase: String);
70 // Get a new passphrase for a database
72 routine queryNewPassphrase(UCSP_PORTS;
73 in requestor: ConstString; in requestPid: pid_t; in database: ConstString;
75 out stagePort: mach_port_copy_send_t; out passphrase: String; out oldPassphrase: String);
76 routine retryNewPassphrase(UCSP_PORTS; in reason: Reason; out passphrase: String; out oldPassphrase: String);
79 // "Rogue App" alert/confirm function
81 routine queryKeychainAccess(UCSP_PORTS;
82 in requestor: ConstString; in requestPid: pid_t; in database: ConstString;
83 in item: ConstString; in operation: AclAuthorization; in needPassphrase: MigBoolean;
84 out stagePort: mach_port_copy_send_t; out choice: Choice);
86 routine retryQueryKeychainAccess (UCSP_PORTS;
87 in reason: Reason; out choice: Choice);
89 routine queryCodeIdentity(UCSP_PORTS;
90 in requestor: ConstString; in requestPid: pid_t; in aclPath: ConstString; out choice: Choice);
93 // Generic new/old password prompt interface
95 routine queryNewGenericPassphrase(UCSP_PORTS;
96 in requestor: ConstString; in requestPid: pid_t; in prompt: ConstString;
97 in reason: Reason; out stagePort: mach_port_copy_send_t;
98 in showBox: MigBoolean; inout addBox: MigBoolean; out passphrase: String);
99 routine retryNewGenericPassphrase(UCSP_PORTS; in reason: Reason;
100 out addBox: MigBoolean; out passphrase: String);
102 routine queryOldGenericPassphrase(UCSP_PORTS;
103 in requestor: ConstString; in requestPid: pid_t; in prompt: ConstString;
104 out stagePort: mach_port_copy_send_t;
105 in showBox: MigBoolean; inout addBox: MigBoolean; out passphrase: String);
106 routine retryOldGenericPassphrase(UCSP_PORTS; in reason: Reason;
107 out addBox: MigBoolean; out passphrase: String);
110 // Authorization subsystem authentication option
112 routine authorizationAuthenticate(UCSP_PORTS;
113 in requestor: ConstString; in requestPid: pid_t;
114 in neededGroup: ConstString; in candidateUser: ConstString;
115 out stagePort: mach_port_copy_send_t;
116 out authenticatedUser: Username; out authenticatedPassword: String);
117 routine retryAuthorizationAuthenticate(UCSP_PORTS; in reason: Reason;
118 out authenticatedUser: Username; out authenticatedPassword: String);
120 routine invokeMechanism(UCSP_PORTS;
121 out stagePort: mach_port_copy_send_t;
123 in pluginId: AuthorizationString;
125 in mechanismId: AuthorizationString;
126 IN_BLOB(argumentsIn,AuthorizationValueVector);
127 IN_BLOB(hintsIn,AuthorizationItemSet);
128 IN_BLOB(contextIn,AuthorizationItemSet);
130 out resultOut: AuthorizationResultInt;
131 OUT_BLOB(hintsOut,AuthorizationItemSet);
132 OUT_BLOB(contextOut,AuthorizationItemSet)
135 routine terminate(requestport sport: mach_port_t;
136 replyport rport: mach_port_t);