xref: /freebsd/lib/libgssapi/gss_export_sec_context.3 (revision 1719886f6d08408b834d270c59ffcfd821c8f63a)
1.\" -*- nroff -*-
2.\"
3.\" Copyright (c) 2005 Doug Rabson
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\" The following commands are required for all man pages.
28.Dd January 26, 2010
29.Dt GSS_EXPORT_SEC_CONTEXT 3 PRM
30.Os
31.Sh NAME
32.Nm gss_export_sec_context
33.Nd Transfer a security context to another process
34.\" This next command is for sections 2 and 3 only.
35.\" .Sh LIBRARY
36.Sh SYNOPSIS
37.In "gssapi/gssapi.h"
38.Ft OM_uint32
39.Fo gss_export_sec_context
40.Fa "OM_uint32 *minor_status"
41.Fa "gss_ctx_id_t *context_handle"
42.Fa "gss_buffer_t interprocess_token"
43.Fc
44.Sh DESCRIPTION
45Provided to support the sharing of work between multiple processes.
46This routine will typically be used by the context-acceptor,
47in an application where a single process receives incoming connection
48requests and accepts security contexts over them,
49then passes the established context to one or more other processes for
50message exchange.
51.Fn gss_export_sec_context
52deactivates the security context for the calling process and creates
53an interprocess token which,
54when passed to
55.Fn gss_import_sec_context
56in another process,
57will re-activate the context in the second process.
58Only a single instantiation of a given context may be active at any
59one time;
60a subsequent attempt by a context exporter to access the exported security context will fail.
61.Pp
62The implementation may constrain the set of processes by which the
63interprocess token may be imported,
64either as a function of local security policy,
65or as a result of implementation decisions.
66For example,
67some implementations may constrain contexts to be passed only between
68processes that run under the same account,
69or which are part of the same process group.
70.Pp
71The interprocess token may contain security-sensitive information
72(for example cryptographic keys).
73While mechanisms are encouraged to either avoid placing such sensitive
74information within interprocess tokens,
75or to encrypt the token before returning it to the application,
76in a typical object-library GSS-API implementation this may not be
77possible.
78Thus the application must take care to protect the interprocess token,
79and ensure that any process to which the token is transferred is
80trustworthy.
81.Pp
82If creation of the interprocess token is successful,
83the implementation shall deallocate all process-wide resources
84associated with the security context,
85and set the context_handle to
86.Dv GSS_C_NO_CONTEXT .
87In the event of an error that makes it impossible to complete the
88export of the security context,
89the implementation must not return an interprocess token,
90and should strive to leave the security context referenced by the
91.Fa context_handle
92parameter untouched.
93If this is impossible,
94it is permissible for the implementation to delete the security
95context,
96providing it also sets the
97.Fa context_handle
98parameter to
99.Dv GSS_C_NO_CONTEXT .
100.Sh PARAMETERS
101.Bl -tag -width ".It interprocess_token"
102.It minor_status
103Mechanism specific status code.
104.It context_handle
105Context handle identifying the context to transfer.
106.It interprocess_token
107Token to be transferred to target process.
108Storage associated with this token must be freed by the application
109after use with a call to
110.Fn gss_release_buffer .
111.El
112.Sh RETURN VALUES
113.Bl -tag -width ".It GSS_S_CONTEXT_EXPIRED"
114.It GSS_S_COMPLETE
115Successful completion
116.It GSS_S_CONTEXT_EXPIRED
117The context has expired
118.It GSS_S_NO_CONTEXT
119The context was invalid
120.It GSS_S_UNAVAILABLE
121The operation is not supported
122.El
123.Sh SEE ALSO
124.Xr gss_import_sec_context 3 ,
125.Xr gss_release_buffer 3
126.Sh STANDARDS
127.Bl -tag -width ".It RFC 2743"
128.It RFC 2743
129Generic Security Service Application Program Interface Version 2, Update 1
130.It RFC 2744
131Generic Security Service API Version 2 : C-bindings
132.El
133.Sh HISTORY
134The
135.Nm
136function first appeared in
137.Fx 7.0 .
138.Sh AUTHORS
139John Wray, Iris Associates
140.Sh COPYRIGHT
141Copyright (C) The Internet Society (2000).  All Rights Reserved.
142.Pp
143This document and translations of it may be copied and furnished to
144others, and derivative works that comment on or otherwise explain it
145or assist in its implementation may be prepared, copied, published
146and distributed, in whole or in part, without restriction of any
147kind, provided that the above copyright notice and this paragraph are
148included on all such copies and derivative works.  However, this
149document itself may not be modified in any way, such as by removing
150the copyright notice or references to the Internet Society or other
151Internet organizations, except as needed for the purpose of
152developing Internet standards in which case the procedures for
153copyrights defined in the Internet Standards process must be
154followed, or as required to translate it into languages other than
155English.
156.Pp
157The limited permissions granted above are perpetual and will not be
158revoked by the Internet Society or its successors or assigns.
159.Pp
160This document and the information contained herein is provided on an
161"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
162TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
163BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
164HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
165MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
166