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