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