Print this page
7127 remove -Wno-missing-braces from Makefile.uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/gssapi/mechs/krb5/include/gssapiP_generic.h
+++ new/usr/src/uts/common/gssapi/mechs/krb5/include/gssapiP_generic.h
1 1 /*
2 2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
3 3 */
4 4 /*
5 5 * Copyright 1993 by OpenVision Technologies, Inc.
6 6 *
7 7 * Permission to use, copy, modify, distribute, and sell this software
8 8 * and its documentation for any purpose is hereby granted without fee,
9 9 * provided that the above copyright notice appears in all copies and
10 10 * that both that copyright notice and this permission notice appear in
11 11 * supporting documentation, and that the name of OpenVision not be used
12 12 * in advertising or publicity pertaining to distribution of the software
13 13 * without specific, written prior permission. OpenVision makes no
14 14 * representations about the suitability of this software for any
15 15 * purpose. It is provided "as is" without express or implied warranty.
16 16 *
17 17 * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
18 18 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
19 19 * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
20 20 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
21 21 * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
22 22 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23 23 * PERFORMANCE OF THIS SOFTWARE.
24 24 */
25 25
26 26 #ifndef _GSSAPIP_GENERIC_H_
27 27 #define _GSSAPIP_GENERIC_H_
28 28
29 29 /*
30 30 * $Id: gssapiP_generic.h 18396 2006-07-25 20:29:43Z lxs $
31 31 */
32 32
33 33 #if defined(_WIN32)
34 34 #include "k5-int.h"
35 35 #else
36 36 #include "autoconf.h"
37 37 #ifndef _KERNEL
38 38 #ifdef HAVE_STDLIB_H
39 39 #include <stdlib.h>
40 40 #endif /* !_KERNEL */
41 41 #endif
42 42 #endif
43 43
44 44 #include "k5-thread.h"
45 45
46 46 #include "gssapi_generic.h"
47 47
48 48 #include "gssapi_err_generic.h"
49 49 #ifndef _KERNEL
50 50 #include <errno.h>
51 51 #else
52 52 #include <sys/errno.h>
53 53 #endif /* !_KERNEL */
54 54
55 55 #include "k5-platform.h"
56 56 typedef UINT64_TYPE gssint_uint64;
57 57
58 58 #include "gssapi/gssapi_ext.h"
59 59
60 60 /** helper macros **/
61 61
62 62 #if 0 /* SUNW15resync - on Solaris g_OID_equal is in gssapi_ext.h */
63 63 #define g_OID_equal(o1, o2) \
64 64 (((o1)->length == (o2)->length) && \
65 65 (memcmp((o1)->elements,(o2)->elements,(unsigned int) (o1)->length) == 0))
66 66 #endif
67 67
68 68 /* this code knows that an int on the wire is 32 bits. The type of
69 69 num should be at least this big, or the extra shifts may do weird
70 70 things */
71 71
72 72 #define TWRITE_INT(ptr, num, bigend) \
73 73 (ptr)[0] = (char) ((bigend)?((num)>>24):((num)&0xff)); \
74 74 (ptr)[1] = (char) ((bigend)?(((num)>>16)&0xff):(((num)>>8)&0xff)); \
75 75 (ptr)[2] = (char) ((bigend)?(((num)>>8)&0xff):(((num)>>16)&0xff)); \
76 76 (ptr)[3] = (char) ((bigend)?((num)&0xff):((num)>>24)); \
77 77 (ptr) += 4;
78 78
79 79 #define TWRITE_INT16(ptr, num, bigend) \
80 80 (ptr)[0] = (char) ((bigend)?((num)>>24):((num)&0xff)); \
81 81 (ptr)[1] = (char) ((bigend)?(((num)>>16)&0xff):(((num)>>8)&0xff)); \
82 82 (ptr) += 2;
83 83
84 84 #define TREAD_INT(ptr, num, bigend) \
85 85 (num) = (((ptr)[0]<<((bigend)?24: 0)) | \
86 86 ((ptr)[1]<<((bigend)?16: 8)) | \
87 87 ((ptr)[2]<<((bigend)? 8:16)) | \
88 88 ((ptr)[3]<<((bigend)? 0:24))); \
89 89 (ptr) += 4;
90 90
91 91 #define TREAD_INT16(ptr, num, bigend) \
92 92 (num) = (((ptr)[0]<<((bigend)?24: 0)) | \
93 93 ((ptr)[1]<<((bigend)?16: 8))); \
94 94 (ptr) += 2;
95 95
96 96 #define TWRITE_STR(ptr, str, len) \
97 97 (void) memcpy((ptr), (char *) (str), (len)); \
98 98 (ptr) += (len);
99 99
100 100 #define TREAD_STR(ptr, str, len) \
101 101 (str) = (ptr); \
102 102 (ptr) += (len);
103 103
104 104 #define TWRITE_BUF(ptr, buf, bigend) \
105 105 TWRITE_INT((ptr), (buf).length, (bigend)); \
106 106 TWRITE_STR((ptr), (buf).value, (buf).length);
107 107
108 108 /** malloc wrappers; these may actually do something later */
109 109
110 110 #ifdef _KERNEL
111 111 #define xmalloc(n) MALLOC(n)
112 112 #else
113 113 #define xmalloc(n) malloc(n)
114 114 #endif
115 115
116 116 #define xrealloc(p,n) realloc(p,n)
117 117 #ifdef xfree
118 118 #undef xfree
119 119 #endif
120 120
121 121 #ifdef _KERNEL
122 122 #define xfree_wrap(p,sze) kmem_free(p,sze)
123 123 #else
124 124 #define xfree_wrap(p,sze) free(p)
125 125 #define xfree(p) free(p)
126 126 #endif
127 127
128 128 /** helper functions **/
129 129
130 130 /* hide names from applications, especially glib applications */
131 131 #define g_set_init gssint_g_set_init
132 132 #define g_set_destroy gssint_g_set_destroy
133 133 #define g_set_entry_add gssint_g_set_entry_add
134 134 #define g_set_entry_delete gssint_g_set_entry_delete
135 135 #define g_set_entry_get gssint_g_set_entry_get
136 136 #define g_save_name gssint_g_save_name
137 137 #define g_save_cred_id gssint_g_save_cred_id
138 138 #define g_save_ctx_id gssint_g_save_ctx_id
139 139 #define g_save_lucidctx_id gssint_g_save_lucidctx_id
140 140 #define g_validate_name gssint_g_validate_name
141 141 #define g_validate_cred_id gssint_g_validate_cred_id
142 142 #define g_validate_ctx_id gssint_g_validate_ctx_id
143 143 #define g_validate_lucidctx_id gssint_g_validate_lucidctx_id
144 144 #define g_delete_name gssint_g_delete_name
145 145 #define g_delete_cred_id gssint_g_delete_cred_id
146 146 #define g_delete_ctx_id gssint_g_delete_ctx_id
147 147 #define g_delete_lucidctx_id gssint_g_delete_lucidctx_id
148 148 #define g_make_string_buffer gssint_g_make_string_buffer
149 149 #define g_token_size gssint_g_token_size
150 150 #define g_make_token_header gssint_g_make_token_header
151 151 #define g_verify_token_header gssint_g_verify_token_header
152 152 #define g_display_major_status gssint_g_display_major_status
153 153 #define g_display_com_err_status gssint_g_display_com_err_status
154 154 #define g_order_init gssint_g_order_init
155 155 #define g_order_check gssint_g_order_check
156 156 #define g_order_free gssint_g_order_free
157 157 #define g_queue_size gssint_g_queue_size
158 158 #define g_queue_externalize gssint_g_queue_externalize
↓ open down ↓ |
158 lines elided |
↑ open up ↑ |
159 159 #define g_queue_internalize gssint_g_queue_internalize
160 160 #define g_canonicalize_host gssint_g_canonicalize_host
161 161 #define g_local_host_name gssint_g_local_host_name
162 162 #define g_strdup gssint_g_strdup
163 163
164 164 typedef struct _g_set_elt *g_set_elt;
165 165 typedef struct {
166 166 k5_mutex_t mutex;
167 167 void *data;
168 168 } g_set;
169 -#define G_SET_INIT { K5_MUTEX_PARTIAL_INITIALIZER, 0 }
169 +#define G_SET_INIT { K5_MUTEX_PARTIAL_INITIALIZER, NULL }
170 170
171 171 int g_set_init (g_set_elt *s);
172 172 int g_set_destroy (g_set_elt *s);
173 173 int g_set_entry_add (g_set_elt *s, void *key, void *value);
174 174 int g_set_entry_delete (g_set_elt *s, void *key);
175 175 int g_set_entry_get (g_set_elt *s, void *key, void **value);
176 176
177 177 int g_save_name (g_set *vdb, gss_name_t name);
178 178 int g_save_cred_id (g_set *vdb, gss_cred_id_t cred);
179 179 int g_save_ctx_id (g_set *vdb, gss_ctx_id_t ctx);
180 180 int g_save_lucidctx_id (g_set *vdb, void *lctx);
181 181
182 182 int g_validate_name (g_set *vdb, gss_name_t name);
183 183 int g_validate_cred_id (g_set *vdb, gss_cred_id_t cred);
184 184 int g_validate_ctx_id (g_set *vdb, gss_ctx_id_t ctx);
185 185 int g_validate_lucidctx_id (g_set *vdb, void *lctx);
186 186
187 187 int g_delete_name (g_set *vdb, gss_name_t name);
188 188 int g_delete_cred_id (g_set *vdb, gss_cred_id_t cred);
189 189 int g_delete_ctx_id (g_set *vdb, gss_ctx_id_t ctx);
190 190 int g_delete_lucidctx_id (g_set *vdb, void *lctx);
191 191
192 192 int g_make_string_buffer (const char *str, gss_buffer_t buffer);
193 193
194 194 unsigned int g_token_size (const gss_OID_desc * mech, unsigned int body_size);
195 195
196 196 void g_make_token_header (const gss_OID_desc * mech, unsigned int body_size,
197 197 unsigned char **buf, int tok_type);
198 198
199 199 gss_int32 g_verify_token_header (const gss_OID_desc * mech,
200 200 unsigned int *body_size,
201 201 unsigned char **buf, int tok_type,
202 202 unsigned int toksize_in,
203 203 int wrapper_required);
204 204
205 205 OM_uint32 g_display_major_status (OM_uint32 *minor_status,
206 206 OM_uint32 status_value,
207 207 OM_uint32 *message_context,
208 208 gss_buffer_t status_string);
209 209
210 210 OM_uint32 g_display_com_err_status (OM_uint32 *minor_status,
211 211 OM_uint32 status_value,
212 212 gss_buffer_t status_string);
213 213
214 214 gss_int32 g_order_init (void **queue, gssint_uint64 seqnum,
215 215 int do_replay, int do_sequence, int wide);
216 216
217 217 gss_int32 g_order_check (void **queue, gssint_uint64 seqnum);
218 218
219 219 void g_order_free (void **queue);
220 220
221 221 gss_uint32 g_queue_size(void *vqueue, size_t *sizep);
222 222 gss_uint32 g_queue_externalize(void *vqueue, unsigned char **buf,
223 223 size_t *lenremain);
224 224 gss_uint32 g_queue_internalize(void **vqueue, unsigned char **buf,
225 225 size_t *lenremain);
226 226
227 227 char *g_strdup (char *str);
228 228
229 229 /** declarations of internal name mechanism functions **/
230 230
231 231 #if 0 /* SUNW15resync - mved to mglueP.h for sake of non-krb5 mechs */
232 232 OM_uint32 generic_gss_release_buffer
233 233 (OM_uint32*, /* minor_status */
234 234 gss_buffer_t /* buffer */
235 235 );
236 236
237 237 OM_uint32 generic_gss_release_oid_set
238 238 (OM_uint32*, /* minor_status */
239 239 gss_OID_set* /* set */
240 240 );
241 241
242 242 OM_uint32 generic_gss_release_oid
243 243 (OM_uint32*, /* minor_status */
244 244 gss_OID* /* set */
245 245 );
246 246
247 247 OM_uint32 generic_gss_copy_oid
248 248 (OM_uint32 *, /* minor_status */
249 249 gss_OID_desc * const, /* oid */ /* SUNW15resync */
250 250 gss_OID * /* new_oid */
251 251 );
252 252
253 253 OM_uint32 generic_gss_create_empty_oid_set
254 254 (OM_uint32 *, /* minor_status */
255 255 gss_OID_set * /* oid_set */
256 256 );
257 257
258 258 OM_uint32 generic_gss_add_oid_set_member
259 259 (OM_uint32 *, /* minor_status */
260 260 const gss_OID_desc * const, /* member_oid */
261 261 gss_OID_set * /* oid_set */
262 262 );
263 263
264 264 OM_uint32 generic_gss_test_oid_set_member
265 265 (OM_uint32 *, /* minor_status */
266 266 const gss_OID_desc * const, /* member */
267 267 gss_OID_set, /* set */
268 268 int * /* present */
269 269 );
270 270
271 271 OM_uint32 generic_gss_oid_to_str
272 272 (OM_uint32 *, /* minor_status */
273 273 const gss_OID_desc * const, /* oid */
274 274 gss_buffer_t /* oid_str */
275 275 );
276 276
277 277 OM_uint32 generic_gss_str_to_oid
278 278 (OM_uint32 *, /* minor_status */
279 279 gss_buffer_t, /* oid_str */
280 280 gss_OID * /* oid */
281 281 );
282 282
283 283 OM_uint32
284 284 generic_gss_oid_compose(
285 285 OM_uint32 *, /* minor_status */
286 286 const char *, /* prefix */
287 287 size_t, /* prefix_len */
288 288 int, /* suffix */
289 289 gss_OID_desc *); /* oid */
290 290
291 291 OM_uint32
292 292 generic_gss_oid_decompose(
293 293 OM_uint32 *, /* minor_status */
294 294 const char *, /*prefix */
295 295 size_t, /* prefix_len */
296 296 gss_OID_desc *, /* oid */
297 297 int *); /* suffix */
298 298
299 299 #endif /* 0 */
300 300
301 301 #ifndef _KERNEL
302 302 int gssint_mecherrmap_init(void);
303 303 void gssint_mecherrmap_destroy(void);
304 304 OM_uint32 gssint_mecherrmap_map(OM_uint32 minor, const gss_OID_desc *oid);
305 305 int gssint_mecherrmap_get(OM_uint32 minor, gss_OID mech_oid,
306 306 OM_uint32 *mech_minor);
307 307 OM_uint32 gssint_mecherrmap_map_errcode(OM_uint32 errcode);
308 308 #endif
309 309
310 310 #endif /* _GSSAPIP_GENERIC_H_ */
↓ open down ↓ |
131 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX