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