4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
30 * glue routine for gss_release_name
33 #include <mechglueP.h>
41 gss_release_name(minor_status
,
44 OM_uint32
*minor_status
;
45 gss_name_t
*input_name
;
48 gss_union_name_t union_name
;
50 if (minor_status
== NULL
)
51 return (GSS_S_CALL_INACCESSIBLE_WRITE
);
54 /* if input_name is NULL, return error */
56 return (GSS_S_CALL_INACCESSIBLE_READ
| GSS_S_BAD_NAME
);
59 * free up the space for the external_name and then
60 * free the union_name descriptor
63 union_name
= (gss_union_name_t
)*input_name
;
67 if (union_name
->name_type
)
68 (void) gss_release_oid(minor_status
, &union_name
->name_type
);
70 free(union_name
->external_name
->value
);
71 free(union_name
->external_name
);
73 if (union_name
->mech_type
) {
74 (void) __gss_release_internal_name(minor_status
,
75 union_name
->mech_type
,
76 &union_name
->mech_name
);
77 (void) gss_release_oid(minor_status
, &union_name
->mech_type
);
82 return (GSS_S_COMPLETE
);