/*
* 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
*/
/*
*/
/*
* glue routine for gss_compare_name
*
*/
#include <mechglueP.h>
#include "gssapiP_generic.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <string.h>
static OM_uint32
int *name_equal)
{
/* Initialize outputs. */
if (minor_status != NULL)
*minor_status = 0;
/* Validate arguments. */
return (GSS_S_CALL_INACCESSIBLE_READ | GSS_S_BAD_NAME);
if (name_equal == NULL)
return (GSS_S_CALL_INACCESSIBLE_WRITE);
return (GSS_S_COMPLETE);
}
const gss_name_t name1;
const gss_name_t name2;
int *name_equal;
{
if (major_status != GSS_S_COMPLETE)
return (major_status);
/*
* Try our hardest to make union_name1 be the mechanism-specific
* name. (Of course we can't if both names aren't
* mechanism-specific.)
*/
if (union_name1->mech_type == 0) {
}
/*
* If union_name1 is mechanism specific, then fetch its mechanism
* information.
*/
if (union_name1->mech_type) {
if (!mech)
return (GSS_S_BAD_MECH);
if (!mech->gss_compare_name)
return (GSS_S_UNAVAILABLE);
}
*name_equal = 0; /* Default to *not* equal.... */
/*
* First case... both names are mechanism-specific
*/
return (GSS_S_COMPLETE);
if ((union_name1->mech_name == 0) ||
(union_name2->mech_name == 0))
/* should never happen */
return (GSS_S_BAD_NAME);
if (!mech)
return (GSS_S_BAD_MECH);
if (!mech->gss_compare_name)
return (GSS_S_UNAVAILABLE);
if (major_status != GSS_S_COMPLETE)
return major_status;
}
/*
* Second case... both names are NOT mechanism specific.
*
* All we do here is make sure the two name_types are equal and then
* that the external_names are equal. Note the we do not take care
* of the case where two different external names map to the same
* internal name. We cannot determine this, since we as yet do not
* know what mechanism to use for calling the underlying
* gss_import_name().
*/
/*
* Second case, first sub-case... one name has null
* name_type, the other doesn't.
*
* Not knowing a mech_type we can't import the name with
* null name_type so we can't compare.
*/
return (GSS_S_COMPLETE);
/*
* Second case, second sub-case... both names have
* name_types, but they are different.
*/
return (GSS_S_COMPLETE);
/*
* Second case, third sub-case... both names have equal
* name_types (and both have no mech_types) so we just
* compare the external_names.
*/
return (GSS_S_COMPLETE);
*name_equal = 1;
return (GSS_S_COMPLETE);
}
/*
* Final case... one name is mechanism specific, the other isn't.
*
* We attempt to convert the general name to the mechanism type of
* the mechanism-specific name, and then do the compare. If we
* can't import the general name, then we return that the name is
* _NOT_ equal.
*/
if (union_name2->mech_type) {
/* We make union_name1 the mechanism specific name. */
}
if (major_status != GSS_S_COMPLETE)
return (GSS_S_COMPLETE); /* return complete, but not equal */
if (!mech)
return (GSS_S_BAD_MECH);
if (!mech->gss_compare_name)
return (GSS_S_UNAVAILABLE);
if (major_status != GSS_S_COMPLETE)
return (major_status);
}