8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / man / man3nsl / rpcsec_gss.3nsl
blobdc3e9bfdbe8f458d870952827d72f7cde4bc327b
1 '\" te
2 .\" Copyright (C) 2001, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH RPCSEC_GSS 3NSL "Jun 29, 2001"
7 .SH NAME
8 rpcsec_gss \- security flavor incorporating GSS-API protections
9 .SH SYNOPSIS
10 .LP
11 .nf
12 cc [ \fIflag\fR... ] \fIfile\fR...  -lnsl [ \fIlibrary\fR... ]
13 #include <rpc/rpcsec_gss.h>
14 .fi
16 .SH DESCRIPTION
17 .sp
18 .LP
19 \fBRPCSEC_GSS\fR is a security flavor which sits "on top" of the \fBGSS-API\fR
20 (Generic Security Service API) for network transmissions. Applications using
21 \fBRPCSEC_GSS\fR can take advantage of \fBGSS-API\fR security features;
22 moreover, they can use any security mechanism (such as RSA public key or
23 Kerberos) that works with  the \fBGSS-API.\fR
24 .sp
25 .LP
26 The \fBGSS-API\fR offers two security services beyond the traditional
27 authentication services \fB(AUTH_DH,\fR \fBAUTH_SYS,\fR and \fBAUTH_KERB):\fR
28 integrity and privacy.  With integrity, the system uses cryptographic
29 checksumming to ensure the authenticity of a message (authenticity of
30 originator, recipient, and data); privacy provides additional security by
31 encrypting data.  Applications using \fBRPCSEC_GSS\fR specify which service
32 they wish to use. Type of security service is mechanism-independent.
33 .sp
34 .LP
35 Before exchanging data with a peer, an application must establish a context for
36 the exchange.   \fBRPCSEC_GSS\fR provides a single function for this purpose,
37 \fBrpc_gss_seccreate()\fR, which allows the application to specify the security
38 mechanism, Quality of Protection (QOP), and type of service at context
39 creation. (The QOP parameter sets the cryptographic algorithms to be used with
40 integrity or privacy, and is mechanism-dependent.) Once a context is
41 established, applications can reset the QOP and type of service for each data
42 unit exchanged, if desired.
43 .sp
44 .LP
45 Valid mechanisms and QOPs may be obtained from configuration files or from the
46 name service.  Each mechanism has a default QOP.
47 .sp
48 .LP
49 Contexts are destroyed with the usual RPC  \fBauth_destroy()\fR call.
50 .SS "Data Structures"
51 .sp
52 .LP
53 Some of the data structures used by the \fBRPCSEC_GSS\fR package are shown
54 below.
55 .SS "\fBrpc_gss_service_t\fR"
56 .sp
57 .LP
58 This enum defines the types of security services the context may have.
59 \fBrpc_gss_seccreate()\fR takes this as one argument when setting the service
60 type for a session.
61 .sp
62 .in +2
63 .nf
64 typedef enum {
65    rpc_gss_svc_default = 0,
66    rpc_gss_svc_none = 1,
67    rpc_gss_svc_integrity = 2,
68    rpc_gss_svc_privacy = 3
69 } rpc_gss_service_t ;
70 .fi
71 .in -2
73 .SS "\fBrpc_gss_options_req_t\fR"
74 .sp
75 .LP
76 Structure containing options passed directly through to the \fBGSS-API.\fR
77 \fBrpc_gss_seccreate()\fR takes this as an argument when creating a context.
78 .sp
79 .in +2
80 .nf
81 typedef struct {
82    int  req_flags;              /*GSS request bits */
83    int  time_req;           /*requested credential lifetime */
84    gss_cred_id_t  my_cred;  /*GSS credential struct*/
85    gss_channel_bindings_t;
86    input_channel_bindings;
87 } rpc_gss_options_req_t ;
88 .fi
89 .in -2
91 .SS "\fBrpc_gss_OID\fR"
92 .sp
93 .LP
94 This data type is used by in-kernel RPC routines, and thus is mentioned here
95 for informational purposes only.
96 .sp
97 .in +2
98 .nf
99 typedef struct {
100    u_int        length;                 
101    void *elements               
102 } *rpc_gss_OID;
104 .in -2
106 .SS "\fBrpc_gss_options_ret_t\fR"
109 Structure containing  \fBGSS-API\fR options returned to the calling function,
110 \fBrpc_gss_seccreate()\fR. \fBMAX_GSS_MECH\fR is defined as 128.
112 .in +2
114 typedef struct {
115    int           major_status;
116    int           minor_status;
117    u_int         rpcsec_version                  /*vers. of RPCSEC_GSS */
118    int           ret_flags
119    int           time_req
120    gss_ctx_id_t  gss_context;
121    char          actual_mechanism[MAX_GSS_MECH]; /*mechanism used*/
122 } rpc_gss_options_ret_t;
124 .in -2
126 .SS "\fBrpc_gss_principal_t\fR"
129 The (mechanism-dependent, opaque) client principal type.  Used as an argument
130 to the \fBrpc_gss_get_principal_name()\fR function, and in the  \fBgsscred\fR
131 table.  Also referenced by the \fBrpc_gss_rawcred_t\fR structure for raw
132 credentials (see below).
134 .in +2
136 typedef struct {
137    int len;                     
138    char name[1];        
139 } *rpc_gss_principal_t;
141 .in -2
143 .SS "\fBrpc_gss_rawcred_t\fR"
146 Structure for raw credentials.  Used by  \fBrpc_gss_getcred()\fR and
147 \fBrpc_gss_set_callback()\fR.
149 .in +2
151 typedef struct {
152    u_int                version;          /*RPC version # */
153    char                 *mechanism;       /*security mechanism*/
154    char                 *qop;             /*Quality of Protection*/
155    rpc_gss_principal_t  client_principal; /*client name*/
156    char                 *svc_principal;   /*server name*/
157    rpc_gss_service_t    service;          /*service (integrity, etc.)*/
158 } rpc_gss_rawcred_t;
160 .in -2
162 .SS "\fBrpc_gss_ucred_t\fR"
165 Structure for UNIX credentials.  Used by  \fBrpc_gss_getcred()\fR as an
166 alternative to  \fBrpc_gss_rawcred_t\fR.
168 .in +2
170 typedef struct {
171    uid_t  uid;      /*user ID*/
172    gid_t  gid;      /*group ID*/
173    short  gidlen;               
174    git_t  *gidlist; /*list of groups*/
175 } rpc_gss_ucred_t;
177 .in -2
179 .SS "\fBrpc_gss_callback_t\fR"
182 Callback structure used by \fBrpc_gss_set_callback()\fR.
184 .in +2
186 typedef struct {
187    u_int   program;       /*RPC program #*/
188    u_int   version;       /*RPC version #*/
189    bool_t  (*callback)(); /*user-defined callback routine*/
190 } rpc_gss_callback_t;
192 .in -2
194 .SS "\fBrpc_gss_lock_t\fR"
197 Structure used by a callback routine to enforce a particular QOP and service
198 for a session.  The \fBlocked\fR field is normally set to \fBFALSE;\fR the
199 server sets it to \fBTRUE\fR in order to lock the session.  (A locked context
200 will reject all requests having different QOP and service values than those
201 found in the \fBraw_cred\fR structure.)  For more information, see the
202 \fBrpc_gss_set_callback\fR(3NSL) man page.
204 .in +2
206 typedef struct {
207    bool_t                 locked;
208    rpc_gss_rawcred_t      *raw_cred;
209 } rpc_gss_lock_t;
211 .in -2
213 .SS "\fBrpc_gss_error_t\fR"
216 Structure used by \fBrpc_gss_get_error()\fR to fetch an error code when a
217 \fBRPCSEC_GSS\fR routine fails.
219 .in +2
221 typedef struct {
222    int  rpc_gss_error;
223    int  system_error;    /*same as errno*/
224 } rpc_gss_error_t;
226 .in -2
228 .SS "Index to Routines"
231 The following  lists  \fBRPCSEC_GSS\fR routines and the manual reference pages
232 on which they are described.  An (S) indicates it is a server-side function:
234 .ne 2
236 \fB\fBRoutine\fR (Manual Page) \fR
238 .sp .6
239 .RS 4n
240 \fBDescription\fR
244 .ne 2
246 \fB\fBrpc_gss_seccreate\fR(3NSL) \fR
248 .sp .6
249 .RS 4n
250 Create a secure \fBRPCSEC_GSS\fR context
254 .ne 2
256 \fB\fBrpc_gss_set_defaults\fR(3NSL) \fR
258 .sp .6
259 .RS 4n
260 Switch service, QOP for a session
264 .ne 2
266 \fB\fBrpc_gss_max_data_length\fR(3NSL) \fR
268 .sp .6
269 .RS 4n
270 Get maximum data length allowed by transport
274 .ne 2
276 \fB\fBrpc_gss_set_svc_name\fR(3NSL) \fR
278 .sp .6
279 .RS 4n
280 Set server's principal name (S)
284 .ne 2
286 \fB\fBrpc_gss_getcred\fR(3NSL) \fR
288 .sp .6
289 .RS 4n
290 Get credentials of caller (S)
294 .ne 2
296 \fB\fBrpc_gss_set_callback\fR(3NSL) \fR
298 .sp .6
299 .RS 4n
300 Specify callback to see context use (S)
304 .ne 2
306 \fB\fBrpc_gss_get_principal_name\fR(3NSL) \fR
308 .sp .6
309 .RS 4n
310 Get client principal name (S)
314 .ne 2
316 \fB\fBrpc_gss_svc_max_data_length\fR(3NSL) \fR
318 .sp .6
319 .RS 4n
320 Get maximum data length allowed by transport (S)
324 .ne 2
326 \fB\fBrpc_gss_get_error\fR(3NSL) \fR
328 .sp .6
329 .RS 4n
330 Get error number
334 .ne 2
336 \fB\fBrpc_gss_get_mechanisms\fR(3NSL) \fR
338 .sp .6
339 .RS 4n
340 Get valid mechanism strings
344 .ne 2
346 \fB\fBrpc_gss_get_mech_info\fR(3NSL) \fR
348 .sp .6
349 .RS 4n
350 Get valid QOP strings, current service
354 .ne 2
356 \fB\fBrpc_gss_get_versions\fR(3NSL) \fR
358 .sp .6
359 .RS 4n
360 Get supported \fBRPCSEC_GSS\fR versions
364 .ne 2
366 \fB\fBrpc_gss_is_installed\fR(3NSL) \fR
368 .sp .6
369 .RS 4n
370 Checks if a mechanism is installed
374 .ne 2
376 \fB\fBrpc_gss_mech_to_oid\fR(3NSL) \fR
378 .sp .6
379 .RS 4n
380 Maps ASCII mechanism to OID representation
384 .ne 2
386 \fB\fBrpc_gss_qop_to_num\fR(3NSL) \fR
388 .sp .6
389 .RS 4n
390 Maps ASCII QOP, mechansim to u_int number
393 .SS "Utilities"
396 The \fBgsscred\fR utility manages the \fBgsscred\fR table, which contains
397 mappings of principal names between network and local credentials.  See
398 \fBgsscred\fR(1M).
399 .SH FILES
401 .ne 2
403 \fB\fB/etc/gss/mech\fR \fR
405 .RS 18n
406 List of installed mechanisms
410 .ne 2
412 \fB\fB/etc/gss/qop\fR \fR
414 .RS 18n
415 List of valid QOPs
418 .SH ATTRIBUTES
421 See \fBattributes\fR(5) for descriptions of the following attributes:
426 box;
427 c | c
428 l | l .
429 ATTRIBUTE TYPE  ATTRIBUTE VALUE
431 MT-Level        MT-Safe
434 .SH SEE ALSO
437 \fBgsscred\fR(1M), \fBrpc\fR(3NSL), \fBrpc_clnt_auth\fR(3NSL), \fBxdr\fR(3NSL), \fBattributes\fR(5), \fBenviron\fR(5)
440 \fIONC+ Developer\&'s Guide\fR