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);
76 routine retryNewPassphrase(UCSP_PORTS; in reason: Reason; out passphrase: 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;
87 // Generic new/old password prompt interface
89 routine queryNewGenericPassphrase(UCSP_PORTS;
90 in requestor: ConstString; in requestPid: pid_t; in prompt: ConstString;
91 in reason: Reason; out stagePort: mach_port_copy_send_t;
92 in showBox: MigBoolean; inout addBox: MigBoolean; out passphrase: String);
93 routine retryNewGenericPassphrase(UCSP_PORTS; in reason: Reason;
94 out addBox: MigBoolean; out passphrase: String);
96 routine queryOldGenericPassphrase(UCSP_PORTS;
97 in requestor: ConstString; in requestPid: pid_t; in prompt: ConstString;
98 out stagePort: mach_port_copy_send_t;
99 in showBox: MigBoolean; inout addBox: MigBoolean; out passphrase: String);
100 routine retryOldGenericPassphrase(UCSP_PORTS; in reason: Reason;
101 out addBox: MigBoolean; out passphrase: String);
104 // Authorization subsystem authentication option
106 routine authorizationAuthenticate(UCSP_PORTS;
107 in requestor: ConstString; in requestPid: pid_t;
108 in neededGroup: ConstString; in candidateUser: ConstString;
109 out stagePort: mach_port_copy_send_t;
110 out authenticatedUser: Username; out authenticatedPassword: String);
111 routine retryAuthorizationAuthenticate(UCSP_PORTS; in reason: Reason;
112 out authenticatedUser: Username; out authenticatedPassword: String);
114 routine invokeMechanism(UCSP_PORTS;
115 out stagePort: mach_port_copy_send_t;
117 in pluginId: AuthorizationString;
119 in mechanismId: AuthorizationString;
120 IN_BLOB(argumentsIn,AuthorizationValueVector);
121 IN_BLOB(hintsIn,AuthorizationItemSet);
122 IN_BLOB(contextIn,AuthorizationItemSet);
124 out resultOut: AuthorizationResultInt;
125 OUT_BLOB(hintsOut,AuthorizationItemSet);
126 OUT_BLOB(contextOut,AuthorizationItemSet)
129 routine terminate(requestport sport: mach_port_t;
130 replyport rport: mach_port_t);