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;
32 // Common argument profiles
34 #define UCSP_PORTS requestport sport: mach_port_t; \
35 replyport rport: mach_port_t; \
37 #define IN_BLOB(name) in name: name##Blob; in name##Base: name##Ptr
41 // Staged query maintainance (common to all staged queries)
43 routine finishStagedQuery(UCSP_PORTS);
44 routine cancelStagedQuery(UCSP_PORTS; in reason: Reason);
48 // Unlocking keychains by user input
50 routine unlockDatabase(UCSP_PORTS;
51 in requestor: ConstString; in requestPid: pid_t; in database: ConstString;
52 out stagePort: mach_port_copy_send_t; out passphrase: String);
53 routine retryUnlockDatabase(UCSP_PORTS; in reason: Reason; out passphrase: String);
56 // Get a new passphrase for a database
58 routine queryNewPassphrase(UCSP_PORTS;
59 in requestor: ConstString; in requestPid: pid_t; in database: ConstString;
61 out stagePort: mach_port_copy_send_t; out passphrase: String);
62 routine retryNewPassphrase(UCSP_PORTS; in reason: Reason; out passphrase: String);
65 // "Rogue App" alert/confirm function
67 routine queryKeychainAccess(UCSP_PORTS;
68 in requestor: ConstString; in requestPid: pid_t; in database: ConstString;
69 in item: ConstString; in operation: AclAuthorization;
73 // Generic new/old password prompt interface
75 routine queryNewGenericPassphrase(UCSP_PORTS;
76 in requestor: ConstString; in requestPid: pid_t; in prompt: ConstString;
77 in reason: Reason; out stagePort: mach_port_copy_send_t;
78 in showBox: MigBoolean; inout addBox: MigBoolean; out passphrase: String);
79 routine retryNewGenericPassphrase(UCSP_PORTS; in reason: Reason;
80 out addBox: MigBoolean; out passphrase: String);
82 routine queryOldGenericPassphrase(UCSP_PORTS;
83 in requestor: ConstString; in requestPid: pid_t; in prompt: ConstString;
84 out stagePort: mach_port_copy_send_t;
85 in showBox: MigBoolean; inout addBox: MigBoolean; out passphrase: String);
86 routine retryOldGenericPassphrase(UCSP_PORTS; in reason: Reason;
87 out addBox: MigBoolean; out passphrase: String);
90 // Authorization subsystem authentication option
92 routine authorizationAuthenticate(UCSP_PORTS;
93 in requestor: ConstString; in requestPid: pid_t;
94 in neededGroup: ConstString; in candidateUser: ConstString;
95 out stagePort: mach_port_copy_send_t;
96 out authenticatedUser: Username; out authenticatedPassword: String);
97 routine retryAuthorizationAuthenticate(UCSP_PORTS; in reason: Reason;
98 out authenticatedUser: Username; out authenticatedPassword: String);