rpcsec_gss_utils.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 1996-1997,2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <rpc/rpcsec_defs.h>
#ifdef RPCGSS_DEBUG
/*
* Kernel rpcsec_gss module debugging aid. The global variable "rpcgss_log"
* is a bit mask which allows various types of debugging messages to be printed
* out.
*
* rpcgss_log & 1 will cause actual failures to be printed.
* rpcgss_log & 2 will cause informational messages to be
* printed on the client side of rpcsec_gss.
* rpcgss_log & 4 will cause informational messages to be
* printed on the server side of rpcsec_gss.
* rpcgss_log & 8 will cause informational messages to be
* printed on both client and server side of rpcsec_gss.
*/
uint_t rpcgss_log = 0;
#endif /* RPCGSS_DEBUG */
/*
* Internal utility routines.
*/
/*
* Duplicate a gss_OID value.
*/
void
{
return;
}
if (tmp) {
} else {
}
}
/*
* Check if 2 gss_OID are the same.
*/
{
return (TRUE);
return (FALSE);
}
void
{
char *cp;
if (*(int *)cp == 0)
else {
}
else
}
/*
* Make a client principal name from a flat exported gss name.
*/
{
int plen;
char *s;
return (FALSE);
return (TRUE);
}
/*
* Make a copy of a principal name.
*/
{
int len;
return (NULL);
return (NULL);
return (pdup);
}
/*
* Returns highest and lowest versions of RPCSEC_GSS flavor supported.
*/
{
return (TRUE);
}
void
char *gss_function_name;
{
int message_context;
int major_stat;
/*
* Before we return let us see
* whether we can log more meaningful error
* string using kgss_display_status
* If we can not just log the gssstat in hex
* and return.
*/
message_context = 0;
/*
* First get the status string out of gss_major_code
*/
do {
/*
* If we failed just log the original error codes
*/
if (major_stat != GSS_S_COMPLETE &&
major != GSS_S_CONTINUE_NEEDED) {
return;
} else {
(char *)gss_function_name,
(char *)status_string.value);
}
} while (message_context != 0);
/*
* Now get the status string out of gss_minor_code
* This is mechanism specific error which is most
* useful
*/
message_context = 0;
do {
if (major_stat != GSS_S_COMPLETE &&
return;
} else {
RPCGSS_LOG1(1,
"%s GSS Minor Error %s\n",
(void) gss_release_buffer(&minor_stat,
}
} while (message_context != 0);
}