1 /* #ident "@(#)g_dsp_name.c 1.2 96/02/06 SMI" */
4 * Copyright 1996 by Sun Microsystems, Inc.
6 * Permission to use, copy, modify, distribute, and sell this software
7 * and its documentation for any purpose is hereby granted without fee,
8 * provided that the above copyright notice appears in all copies and
9 * that both that copyright notice and this permission notice appear in
10 * supporting documentation, and that the name of Sun Microsystems not be used
11 * in advertising or publicity pertaining to distribution of the software
12 * without specific, written prior permission. Sun Microsystems makes no
13 * representations about the suitability of this software for any
14 * purpose. It is provided "as is" without express or implied warranty.
16 * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18 * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
20 * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
21 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22 * PERFORMANCE OF THIS SOFTWARE.
26 * glue routine for gss_display_name()
37 OM_uint32 KRB5_CALLCONV
38 gss_display_name (minor_status,
43 OM_uint32 * minor_status;
44 gss_name_t input_name;
45 gss_buffer_t output_name_buffer;
46 gss_OID * output_name_type;
49 OM_uint32 major_status;
50 gss_union_name_t union_name;
53 return GSS_S_BAD_NAME;
55 union_name = (gss_union_name_t) input_name;
57 if (union_name->mech_type) {
59 * OK, we have a mechanism-specific name; let's use it!
61 return (__gss_display_internal_name(minor_status,
62 union_name->mech_type,
63 union_name->mech_name,
69 * copy the value of the external_name component of the union
70 * name into the output_name_buffer and point the output_name_type
71 * to the name_type component of union_name
73 if (output_name_type != NULL) {
74 major_status = generic_gss_copy_oid(minor_status,
75 union_name->name_type,
78 return (major_status);
81 if (output_name_buffer != NULL) {
82 output_name_buffer->length = union_name->external_name->length;
84 output_name_buffer->value =
85 (void *) malloc(output_name_buffer->length);
87 memcpy(output_name_buffer->value,
88 union_name->external_name->value,
89 output_name_buffer->length);
95 return(GSS_S_COMPLETE);