g_canon_name.c revision ab9b2e153c3a9a2b1141fefa87925b1a9beb1236
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* routine gss_canonicalize_name
*
* This routine is used to produce a mechanism specific
* representation of name that has been previously
* imported with gss_import_name. The routine uses the mechanism
* specific implementation of gss_import_name to implement this
* function.
*
* We allow a NULL output_name, in which case we modify the
* input_name to include the mechanism specific name.
*/
#include <mechglueP.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <string.h>
#include <errno.h>
const gss_name_t input_name;
{
if (minor_status == NULL)
return (GSS_S_CALL_INACCESSIBLE_WRITE);
*minor_status = 0;
if (output_name)
*output_name = 0;
/* check the input parameters */
return (GSS_S_CALL_INACCESSIBLE_READ);
/*
* If the caller wants to reuse the name, and the name has already
* been converted, then there is nothing for us to do.
*/
return (GSS_S_COMPLETE);
/* ok, then we need to do something - start by creating data struct */
if (output_name) {
if (!out_union)
goto allocation_failure;
out_union->external_name = 0;
/* Allocate the buffer for the user specified representation */
goto allocation_failure;
goto allocation_failure;
}
}
/*
* might need to delete any old mechanism names if we are
* reusing the buffer.
*/
if (!output_name) {
(void) gss_release_oid(minor_status,
}
} else
/* now let's create the new mech name */
&dest_union->mech_type))
goto allocation_failure;
if (major_status =
&dest_union->mech_name))
goto allocation_failure;
if (output_name)
return (GSS_S_COMPLETE);
/* do not delete the src name external name format */
if (output_name) {
if (out_union->external_name) {
}
(void) gss_release_oid(minor_status,
} else
/*
* delete the partially created mech specific name
* applies for both src and dest which ever is being used for output
*/
if (dest_union->mech_name) {
&dest_union->mech_name);
}
if (dest_union->mech_type)
if (output_name)
return (major_status);
} /********** gss_canonicalize_name ********/