xref: /freebsd/lib/libgssapi/gss_wrap.3 (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
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_WRAP 3 PRM
30.Os
31.Sh NAME
32.Nm gss_wrap ,
33.Nm gss_seal
34.Nd Attach a cryptographic MIC and optionally encrypt a message
35.\" This next command is for sections 2 and 3 only.
36.\" .Sh LIBRARY
37.Sh SYNOPSIS
38.In "gssapi/gssapi.h"
39.Ft OM_uint32
40.Fo gss_wrap
41.Fa "OM_uint32 *minor_status"
42.Fa "const gss_ctx_id_t context_handle"
43.Fa "int conf_req_flag"
44.Fa "gss_qop_t qop_req"
45.Fa "const gss_buffer_t input_message_buffer"
46.Fa "int *conf_state"
47.Fa "gss_buffer_t output_message_buffer"
48.Fc
49.Ft OM_uint32
50.Fo gss_seal
51.Fa "OM_uint32 *minor_status"
52.Fa "gss_ctx_id_t context_handle"
53.Fa "int conf_req_flag"
54.Fa "gss_qop_t qop_req"
55.Fa "gss_buffer_t input_message_buffer"
56.Fa "int *conf_state"
57.Fa "gss_buffer_t output_message_buffer"
58.Fc
59.Sh DESCRIPTION
60Attaches a cryptographic MIC and optionally encrypts the specified
61.Dv input_message .
62The output_message contains both the MIC and the message.
63The
64.Dv qop_req
65parameter allows a choice between several cryptographic algorithms,
66if supported by the chosen mechanism.
67.Pp
68Since some application-level protocols may wish to use tokens emitted
69by
70.Fn gss_wrap
71to provide "secure framing",
72implementations must support the wrapping of zero-length messages.
73.Pp
74The
75.Fn gss_seal
76routine is an obsolete variant of
77.Fn gss_wrap .
78It is
79provided for backwards
80compatibility with applications using the GSS-API V1 interface.
81A distinct entrypoint (as opposed to #define) is provided,
82both to allow GSS-API V1 applications to link
83and to retain the slight parameter type differences between the
84obsolete versions of this routine and its current form.
85.Sh PARAMETERS
86.Bl -tag -width ".It output_message_buffer"
87.It minor_status
88Mechanism specific status code.
89.It context_handle
90Identifies the context on which the message will be sent.
91.It conf_req_flag
92.Bl -tag -width "Non-zero" -compact
93.It Non-zero
94Both confidentiality and integrity services are requested.
95.It Zero
96Only integrity service is requested.
97.El
98.It qop_req
99Specifies required quality of protection.
100A mechanism-specific default may be requested by setting qop_req to
101.Dv GSS_C_QOP_DEFAULT .
102If an unsupported protection strength is requested,
103.Fn gss_wrap
104will return a major_status of
105.Dv GSS_S_BAD_QOP .
106.It input_message_buffer
107Message to be protected.
108.It conf_state
109.Bl -tag -width "Non-zero" -compact
110.It Non-zero
111Confidentiality, data origin authentication and integrity services
112have been applied.
113.It Zero
114Integrity and data origin services only has been applied.
115.El
116.It output_message_buffer
117Buffer to receive protected message.
118Storage associated with this buffer must
119be freed by the application after use
120with a call to
121.Xr gss_release_buffer 3 .
122.El
123.Sh RETURN VALUES
124.Bl -tag -width ".It GSS_S_CONTEXT_EXPIRED"
125.It GSS_S_COMPLETE
126Successful completion.
127.It GSS_S_CONTEXT_EXPIRED
128The context has already expired
129.It GSS_S_NO_CONTEXT
130The context_handle parameter did not identify a valid context.
131.It GSS_S_BAD_QOP
132The specified QOP is not supported by the mechanism.
133.El
134.Sh SEE ALSO
135.Xr gss_release_buffer 3 ,
136.Xr gss_unwrap 3
137.Sh STANDARDS
138.Bl -tag -width ".It RFC 2743"
139.It RFC 2743
140Generic Security Service Application Program Interface Version 2, Update 1
141.It RFC 2744
142Generic Security Service API Version 2 : C-bindings
143.El
144.Sh HISTORY
145The
146.Nm
147function first appeared in
148.Fx 7.0 .
149.Sh AUTHORS
150John Wray, Iris Associates
151.Sh COPYRIGHT
152Copyright (C) The Internet Society (2000).  All Rights Reserved.
153.Pp
154This document and translations of it may be copied and furnished to
155others, and derivative works that comment on or otherwise explain it
156or assist in its implementation may be prepared, copied, published
157and distributed, in whole or in part, without restriction of any
158kind, provided that the above copyright notice and this paragraph are
159included on all such copies and derivative works.  However, this
160document itself may not be modified in any way, such as by removing
161the copyright notice or references to the Internet Society or other
162Internet organizations, except as needed for the purpose of
163developing Internet standards in which case the procedures for
164copyrights defined in the Internet Standards process must be
165followed, or as required to translate it into languages other than
166English.
167.Pp
168The limited permissions granted above are perpetual and will not be
169revoked by the Internet Society or its successors or assigns.
170.Pp
171This document and the information contained herein is provided on an
172"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
173TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
174BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
175HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
176MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
177