Print this page
first pass
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libgss/g_unseal.c
+++ new/usr/src/lib/libgss/g_unseal.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
23 23 */
24 24
25 25 /*
26 26 * glue routine gss_unseal
27 27 */
28 28
29 29 #include <mechglueP.h>
30 30 #include "gssapiP_generic.h"
31 31
32 32 OM_uint32
33 33 gss_unseal(minor_status,
34 34 context_handle,
35 35 input_message_buffer,
36 36 output_message_buffer,
37 37 conf_state,
↓ open down ↓ |
37 lines elided |
↑ open up ↑ |
38 38 qop_state)
39 39
40 40 OM_uint32 * minor_status;
41 41 gss_ctx_id_t context_handle;
42 42 gss_buffer_t input_message_buffer;
43 43 gss_buffer_t output_message_buffer;
44 44 int * conf_state;
45 45 int * qop_state;
46 46
47 47 {
48 -/* EXPORT DELETE START */
49 48 OM_uint32 status;
50 49 gss_union_ctx_id_t ctx;
51 50 gss_mechanism mech;
52 51
53 52 if (minor_status != NULL)
54 53 *minor_status = 0;
55 54
56 55 if (output_message_buffer != GSS_C_NO_BUFFER) {
57 56 output_message_buffer->length = 0;
58 57 output_message_buffer->value = NULL;
59 58 }
60 59
61 60 if (minor_status == NULL)
62 61 return (GSS_S_CALL_INACCESSIBLE_WRITE);
63 62
64 63 if (context_handle == GSS_C_NO_CONTEXT)
65 64 return (GSS_S_CALL_INACCESSIBLE_READ | GSS_S_NO_CONTEXT);
66 65
67 66 if (input_message_buffer == GSS_C_NO_BUFFER ||
68 67 GSS_EMPTY_BUFFER(input_message_buffer))
69 68 return (GSS_S_CALL_INACCESSIBLE_READ);
70 69
71 70 if (output_message_buffer == GSS_C_NO_BUFFER)
72 71 return (GSS_S_CALL_INACCESSIBLE_WRITE);
73 72
74 73 /*
75 74 * select the approprate underlying mechanism routine and
76 75 * call it.
77 76 */
78 77
79 78 ctx = (gss_union_ctx_id_t) context_handle;
80 79 mech = __gss_get_mechanism(ctx->mech_type);
81 80
82 81 if (mech) {
83 82 if (mech->gss_unseal) {
84 83 status = mech->gss_unseal(
85 84 mech->context,
86 85 minor_status,
87 86 ctx->internal_ctx_id,
88 87 input_message_buffer,
89 88 output_message_buffer,
↓ open down ↓ |
31 lines elided |
↑ open up ↑ |
90 89 conf_state,
91 90 qop_state);
92 91 if (status != GSS_S_COMPLETE)
93 92 map_error(minor_status, mech);
94 93 } else
95 94 status = GSS_S_UNAVAILABLE;
96 95
97 96 return (status);
98 97 }
99 98
100 -/* EXPORT DELETE END */
101 -
102 99 return (GSS_S_BAD_MECH);
103 100 }
104 101
105 102 OM_uint32
106 103 gss_unwrap(minor_status,
107 104 context_handle,
108 105 input_message_buffer,
109 106 output_message_buffer,
110 107 conf_state,
111 108 qop_state)
112 109
113 110 OM_uint32 * minor_status;
114 111 const gss_ctx_id_t context_handle;
115 112 const gss_buffer_t input_message_buffer;
116 113 gss_buffer_t output_message_buffer;
117 114 int * conf_state;
118 115 gss_qop_t * qop_state;
119 116
120 117 {
121 118 return (gss_unseal(minor_status, (gss_ctx_id_t)context_handle,
122 119 (gss_buffer_t)input_message_buffer,
123 120 output_message_buffer, conf_state, (int *) qop_state));
124 121 }
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX