Home | History | Annotate | Download | only in gssapi
      1  0  stevel /*
      2  0  stevel  * CDDL HEADER START
      3  0  stevel  *
      4  0  stevel  * The contents of this file are subject to the terms of the
      5  0  stevel  * Common Development and Distribution License, Version 1.0 only
      6  0  stevel  * (the "License").  You may not use this file except in compliance
      7  0  stevel  * with the License.
      8  0  stevel  *
      9  0  stevel  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
     10  0  stevel  * or http://www.opensolaris.org/os/licensing.
     11  0  stevel  * See the License for the specific language governing permissions
     12  0  stevel  * and limitations under the License.
     13  0  stevel  *
     14  0  stevel  * When distributing Covered Code, include this CDDL HEADER in each
     15  0  stevel  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     16  0  stevel  * If applicable, add the following below this CDDL HEADER, with the
     17  0  stevel  * fields enclosed by brackets "[]" replaced with your own identifying
     18  0  stevel  * information: Portions Copyright [yyyy] [name of copyright owner]
     19  0  stevel  *
     20  0  stevel  * CDDL HEADER END
     21  0  stevel  */
     22  0  stevel /*
     23  0  stevel  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
     24  0  stevel  * Use is subject to license terms.
     25  0  stevel  */
     26  0  stevel 
     27  0  stevel #pragma ident	"%Z%%M%	%I%	%E% SMI"
     28  0  stevel 
     29  0  stevel /*
     30  0  stevel  *  glue routine for gss_display_name()
     31  0  stevel  */
     32  0  stevel 
     33  0  stevel #include <mechglueP.h>
     34  0  stevel #include <gssapi/kgssapi_defs.h>
     35  0  stevel 
     36  0  stevel OM_uint32
     37  0  stevel gss_display_name(OM_uint32 *minor_status,
     38  0  stevel 	const gss_name_t input_name,
     39  0  stevel 	gss_buffer_t output_name_buffer,
     40  0  stevel 	gss_OID *output_name_type)
     41  0  stevel {
     42  0  stevel 	gss_union_name_t	union_name;
     43  0  stevel 
     44  0  stevel 	if (input_name == 0)
     45  0  stevel 		return (GSS_S_BAD_NAME);
     46  0  stevel 
     47  0  stevel 	union_name = (gss_union_name_t) input_name;
     48  0  stevel 
     49  0  stevel 	GSSLOG(8, "union_name value %s\n",
     50  0  stevel 		(char *)union_name->external_name->value);
     51  0  stevel 
     52  0  stevel 	/*
     53  0  stevel 	 * copy the value of the external_name component of the union
     54  0  stevel 	 * name into the output_name_buffer and point the output_name_type
     55  0  stevel 	 * to the name_type component of union_name
     56  0  stevel 	 */
     57  0  stevel 	if (output_name_type != NULL)
     58  0  stevel 		*output_name_type = union_name->name_type;
     59  0  stevel 
     60  0  stevel 	if (output_name_buffer != NULL) {
     61  0  stevel 		output_name_buffer->length = union_name->external_name->length;
     62  0  stevel 
     63  0  stevel 		output_name_buffer->value =
     64  0  stevel 			(void *) MALLOC(output_name_buffer->length);
     65  0  stevel 
     66  0  stevel 		(void) memcpy(output_name_buffer->value,
     67  0  stevel 			union_name->external_name->value,
     68  0  stevel 			output_name_buffer->length);
     69  0  stevel 	}
     70  0  stevel 
     71  0  stevel 	if (minor_status)
     72  0  stevel 		*minor_status = 0;
     73  0  stevel 
     74  0  stevel 	return (GSS_S_COMPLETE);
     75  0  stevel }
     76