+Tue Feb 6 23:55:45 1996 Theodore Y. Ts'o <tytso@dcl>
+
+ * pname_to_uid.c (krb5_pname_to_uid): Instead of using specialized
+ code to derive the username from a kerberos principal, use
+ krb5_aname_to_lname(). Added extra argument for the
+ context structure.
+
Fri Jan 26 03:09:32 1996 Sam Hartman <hartmans@tertius.mit.edu>
* init_sec_context.c (make_ap_req): Make sure we get a DES session key.
);
extern int krb5_pname_to_uid
- (char *, /* minor_status */
+ (void *, /* context */
+ char *, /* principal name */
gss_OID, /* name_type */
gss_OID, /* mech_type */
- uid_t * /* input_name */
+ uid_t * /* uid (OUT) */
);
/*
* krb5 mechanism specific routine for pname_to_uid
*
* Copyright 1995 Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
*/
+#include "gssapiP_krb5.h"
#include <gssapi/gssapi.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#include <pwd.h>
#include <sys/types.h>
-extern char *strpbrk(const char *s1, const char *s2);
-extern struct passwd *getpwnam(const char *name);
+/*
+ * This function will probably get replaced with the gsscred stuff...
+ */
int
-krb5_pname_to_uid(pname, name_type, mech_type, uid)
-
+krb5_pname_to_uid(context, pname, name_type, mech_type, uid)
+krb5_context context;
char * pname;
gss_OID name_type;
gss_OID mech_type;
{
struct passwd *pw;
- char *pname_copy, *prefix, *suffix, *default_realm = NULL,
- *temp;
static unsigned char krb5principalname[] =
- {"\052\206\110\206\367\022\001\002\002\001"};
+ {"\052\206\110\206\367\022\001\002\002\001"};
+ krb5_principal principal;
+ char lname[256];
+ krb5_error_code stat;
/*
* check that the name_type is the Kerberos Principal Name form
* [1.2.840.113554.1.2.2.1] or NULL.
*/
-
if(name_type->length !=0)
- if((name_type->length != 10)
- ||
+ if((name_type->length != 10) ||
(memcmp(name_type->elements, krb5principalname, 10) != 0))
return(0);
-/* take care of the special case of "root.<hostname>@realm */
-
- if(strncmp(pname, "root.", 5) == 0) {
- *uid = 0;
- return(1);
- }
-/* get the name and realm parts of the Kerberos Principal Name */
-
- pname_copy = (char *) malloc(strlen(pname)+1);
- strcpy(pname_copy, pname);
- prefix = pname_copy;
- suffix = pname_copy;
+ /* get the name and realm parts of the Kerberos Principal Name */
- /* find last occurance of "@" */
-
- temp = (char *) !NULL;
- while(temp != NULL)
- suffix = (((temp = strpbrk(suffix, "@")) == NULL) ?
- suffix : temp+1);
-
- if(suffix != pname_copy)
- *(suffix-1) = '\0';
+ if (krb5_parse_name(context, pname, &principal)) {
+ return(0);
+ }
-/* Make sure the name is in the local realm */
+ stat = krb5_aname_to_localname(context, principal,
+ sizeof(lname), lname);
+ krb5_free_principal(context, principal);
- if(suffix != pname_copy) {
- krb5_get_default_realm(&default_realm);
- if(default_realm == NULL ||
- strcmp(default_realm, suffix) != 0) {
- free(pname_copy);
- return(0);
- }
- }
+ if (stat)
+ return(0);
/*
* call getpwnam() and return uid result if successful.
* Otherwise, return failure.
*/
- if(pw = getpwnam(prefix)) {
+ if(pw = getpwnam(lname)) {
*uid = pw->pw_uid;
- free(pname_copy);
return(1);
} else {
- free(pname_copy);
return(0);
}
}
+Tue Feb 6 23:59:49 1996 Theodore Y. Ts'o <tytso@dcl>
+
+ * g_initialize.c (gss_initialize): Added code to try to
+ dynamically read in the GSSAPI mechanim library using
+ dlopen().
+
Wed Jan 24 20:49:13 1996 Tom Yu <tlyu@dragons-lair.MIT.EDU>
* g_compare_name.c, g_delete_sec_context.c, g_dsp_status.c,
SHLIB_LDFLAGS= $(LDFLAGS) @SHLIB_RPATH_DIRS@ \
$(LD_UNRESOLVED_PREFIX)krb5_gss_initialize
+
SHLIB_LIBDIRS= @SHLIB_LIBDIRS@
SRCS = $(srcdir)/g_acquire_cred.c \
$(srcdir)/g_inquire_context.c \
$(srcdir)/g_inquire_names.c \
$(srcdir)/g_initialize.c \
- $(srcdir)/get_mtype.c \
- $(srcdir)/get_mechanism.c \
- $(srcdir)/internal_name.c \
+ $(srcdir)/g_glue.c \
$(srcdir)/gssd_pname_to_uid.c \
- $(srcdir)/add_mechanism.c \
$(srcdir)/gen_oids.c \
$(srcdir)/oid_ops.c
g_inquire_context.$(OBJEXT) \
g_inquire_names.$(OBJEXT) \
g_initialize.$(OBJEXT) \
- get_mtype.$(OBJEXT) \
- get_mechanism.$(OBJEXT) \
- internal_name.$(OBJEXT) \
+ g_glue.$(OBJEXT) \
gssd_pname_to_uid.$(OBJEXT) \
- add_mechanism.$(OBJEXT) \
gen_oids.$(OBJEXT) \
oid_ops.$(OBJEXT)
+++ /dev/null
-#ident "@(#)add_mechanism.c 1.5 95/08/04 SMI"
-/*
- * This function will add a new mechanism to the mechs_array
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-#include "mglueP.h"
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#include <string.h>
-#include <errno.h>
-
-static struct gss_config null_mech = {
- {0,NULL}};
-
-gss_mechanism *mechs_array = NULL;
-
-OM_uint32 add_mechanism (gss_mechanism mech, int replace)
-{
- gss_mechanism *temp_array;
- int i;
-
- if (mech == NULL)
- return GSS_S_COMPLETE;
-
- /* initialize the mechs_array if it hasn't already been initialized */
- if (mechs_array == NULL) {
- mechs_array = (gss_mechanism *) malloc (sizeof(gss_mechanism));
-
- if (mechs_array == NULL)
- return ENOMEM;
-
- mechs_array[0] = &null_mech;
- }
-
- /*
- * Find the length of mechs_array, and look for an existing
- * entry for this OID
- */
- for (i=0; mechs_array[i]->mech_type.length != 0; i++) {
- if ((mechs_array[i]->mech_type.length == mech->mech_type.length) &&
- (memcmp (mechs_array[i]->mech_type.elements,
- mech->mech_type.elements,
- mech->mech_type.length) == 0)) {
-
- /* We found a match. Replace it? */
- if (!replace)
- return GSS_S_FAILURE;
-
- mechs_array[i] = mech;
- return GSS_S_COMPLETE;
- }
- }
-
- /* we didn't find it -- add it to the end of the mechs_array */
- temp_array = (gss_mechanism *) realloc(mechs_array,
- (i+2)*sizeof(gss_mechanism));
-
- if (temp_array == NULL)
- return ENOMEM;
-
- temp_array[i++] = mech;
- temp_array[i] = &null_mech;
-
- mechs_array = temp_array;
-
- return GSS_S_COMPLETE;
-}
#ident "@(#)gss_accept_sec_context.c 1.19 95/08/07 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine for gss_accept_sec_context
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
* and copy in the OID
*/
- get_mech_type(&token_mech_type, input_token_buffer);
+ __gss_get_mech_type(&token_mech_type, input_token_buffer);
union_ctx_id->mech_type->elements = (void *)
malloc(token_mech_type->length);
* call it.
*/
- mech = get_mechanism (token_mech_type);
+ mech = __gss_get_mechanism (token_mech_type);
if (mech && mech->gss_accept_sec_context) {
status = mech->gss_accept_sec_context(
* the union name struct cast to src_name
*/
- if(src_name != NULL) {
- temp_status = display_internal_name (
+ if(src_name != NULL && status == GSS_S_COMPLETE) {
+ temp_status = __gss_display_internal_name (
&temp_minor_status,
&mech->mech_type,
internal_name,
gss_release_buffer(
&temp_minor_status,
output_token);
- release_internal_name(&temp_minor_status,
+ __gss_release_internal_name(&temp_minor_status,
&mech->mech_type,
&internal_name);
return(GSS_S_FAILURE);
gss_release_buffer(
&temp_minor_status,
output_token);
- release_internal_name(
+ __gss_release_internal_name(
&temp_minor_status,
&mech->mech_type,
&internal_name);
return(GSS_S_FAILURE);
}
- release_internal_name(
+ __gss_release_internal_name(
&temp_minor_status,
&mech->mech_type,
&internal_name);
#ident "@(#)gss_acquire_cred.c 1.19 95/08/07 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine for gss_acquire_cred
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
*/
if(desired_mechs == GSS_C_NULL_OID_SET) {
- if ((mech = get_mechanism (NULL)) == NULL)
+ if ((mech = __gss_get_mechanism (NULL)) == NULL)
return (GSS_S_BAD_MECH);
desired_mechs = &default_OID_set;
creds_returned[j].available = 0;
- mech = get_mechanism (&desired_mechs->elements[j]);
+ mech = __gss_get_mechanism (&desired_mechs->elements[j]);
if (mech && mech->gss_acquire_cred) {
/*
* gss_acquire_cred() call.
*/
- if ((status = import_internal_name(
+ if ((status = __gss_import_internal_name(
minor_status,
&mech->mech_type,
union_name,
NULL,
&temp_time_rec);
- if ((temp_status = release_internal_name(
+ if ((temp_status = __gss_release_internal_name(
&temp_minor_status,
&mech->mech_type,
&internal_name))) {
#ident "@(#)gss_compare_name.c 1.13 95/08/02 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine for gss_compare_name
*
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
#ident "@(#)gss_context_time.c 1.8 95/08/07 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routines for gss_context_time
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
*/
ctx = (gss_union_ctx_id_t) context_handle;
- mech = get_mechanism (ctx->mech_type);
+ mech = __gss_get_mechanism (ctx->mech_type);
if (mech) {
#ident "@(#)gss_delete_sec_context.c 1.10 95/08/07 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine for gss_delete_sec_context
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
*/
ctx = (gss_union_ctx_id_t) *context_handle;
- mech = get_mechanism (ctx->mech_type);
+ mech = __gss_get_mechanism (ctx->mech_type);
if (mech) {
-#ident "%Z%%M% %I% %E% SMI"
+#ident "@(#)g_dsp_name.c 1.2 96/02/06 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine for gss_display_name()
*
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
#ident "@(#)gss_display_status.c 1.8 95/08/07 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine gss_display_status
*
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
* call it.
*/
- mech = get_mechanism (mech_type);
+ mech = __gss_get_mechanism (mech_type);
if (mech == NULL)
return (GSS_S_BAD_MECH);
#ident "@(#)g_exp_sec_context.c 1.2 96/01/18 SMI"
/*
- * glue routine gss_export_sec_context
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * glue routine for gss_export_sec_context
*/
#include "mglueP.h"
*/
ctx = (gss_union_ctx_id_t) *context_handle;
- mech = get_mechanism (ctx->mech_type);
+ mech = __gss_get_mechanism (ctx->mech_type);
if (mech) {
--- /dev/null
+
+#ident "@(#)g_glue.c 1.1 96/02/06 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "mglueP.h"
+extern gss_mechanism *__gss_mechs_array;
+
+/*
+ * This file contains the support routines for the glue layer.
+ */
+
+/*
+ * given the mechs_array and a mechanism OID, return the
+ * pointer to the mechanism, or NULL if that mechanism is
+ * not supported. If the requested OID is NULL, then return
+ * the first mechanism.
+ */
+
+gss_mechanism __gss_get_mechanism (gss_OID type)
+{
+ int i;
+
+ if (type == GSS_C_NULL_OID)
+ return (__gss_mechs_array[0]);
+
+ for (i=0; __gss_mechs_array[i]->mech_type.length != 0; i++) {
+ if ((__gss_mechs_array[i]->mech_type.length == type->length) &&
+ (memcmp (__gss_mechs_array[i]->mech_type.elements, type->elements,
+ type->length) == 0)) {
+
+ return (__gss_mechs_array[i]);
+ }
+ }
+ return NULL;
+}
+
+
+/*
+ * glue routine for get_mech_type
+ *
+ */
+
+OM_uint32 __gss_get_mech_type(OID, token)
+
+gss_OID * OID;
+gss_buffer_t token;
+
+{
+ unsigned char * buffer_ptr;
+
+ /*
+ * This routine reads the prefix of "token" in order to determine
+ * its mechanism type. It assumes the encoding suggested in
+ * Appendix B of RFC 1508. This format starts out as follows :
+ *
+ * tag for APPLICATION 0, Sequence[constructed, definite length]
+ * length of remainder of token
+ * tag of OBJECT IDENTIFIER
+ * length of mechanism OID
+ * encoding of mechanism OID
+ * <the rest of the token>
+ *
+ * Numerically, this looks like :
+ *
+ * 0x60
+ * <length> - could be multiple bytes
+ * 0x06
+ * <length> - assume only one byte, hence OID length < 127
+ * <mech OID bytes>
+ *
+ * The routine returns a pointer to the OID value. The return code is
+ * the length of the OID, if successful; otherwise it is 0.
+ */
+
+ if (OID == NULL || *OID == GSS_C_NULL_OID)
+ return (0);
+
+ /* if the token is a null pointer, return a zero length OID */
+
+ if(token == NULL) {
+ (*OID)->length = 0;
+ (*OID)->elements = NULL;
+ return (0);
+ }
+
+ /* Skip past the APP/Sequnce byte and the token length */
+
+ buffer_ptr = (unsigned char *) token->value;
+
+ while(*(++buffer_ptr) & (1<<7))
+ continue;
+
+ /* increment buffer_ptr to point to the OID and return its length */
+
+ (*OID)->length = (OM_uint32) *(buffer_ptr+3);
+ (*OID)->elements = (void *) (buffer_ptr+4);
+ return ((*OID)->length);
+}
+
+
+/*
+ * Internal routines to get and release an internal mechanism name
+ */
+
+#include "mglueP.h"
+
+OM_uint32 __gss_import_internal_name (minor_status, mech_type, union_name,
+ internal_name)
+OM_uint32 *minor_status;
+gss_OID mech_type;
+gss_union_name_t union_name;
+gss_name_t *internal_name;
+{
+ OM_uint32 status;
+ gss_mechanism mech;
+
+ mech = __gss_get_mechanism (mech_type);
+ if (mech) {
+ if (mech->gss_import_name)
+ status = mech->gss_import_name (
+ mech->context,
+ minor_status,
+ union_name->external_name,
+ union_name->name_type,
+ internal_name);
+ else
+ status = GSS_S_BAD_BINDINGS;
+
+ return (status);
+ }
+
+ return (GSS_S_BAD_MECH);
+}
+
+OM_uint32 __gss_display_internal_name (minor_status, mech_type, internal_name,
+ external_name, name_type)
+OM_uint32 *minor_status;
+gss_OID mech_type;
+gss_name_t internal_name;
+gss_buffer_t external_name;
+gss_OID *name_type;
+{
+ OM_uint32 status;
+ gss_mechanism mech;
+
+ mech = __gss_get_mechanism (mech_type);
+ if (mech) {
+ if (mech->gss_display_name)
+ status = mech->gss_display_name (
+ mech->context,
+ minor_status,
+ internal_name,
+ external_name,
+ name_type);
+ else
+ status = GSS_S_BAD_BINDINGS;
+
+ return (status);
+ }
+
+ return (GSS_S_BAD_MECH);
+}
+
+OM_uint32 __gss_release_internal_name (minor_status, mech_type, internal_name)
+OM_uint32 *minor_status;
+gss_OID mech_type;
+gss_name_t *internal_name;
+{
+ OM_uint32 status;
+ gss_mechanism mech;
+
+ mech = __gss_get_mechanism (mech_type);
+ if (mech) {
+ if (mech->gss_release_name)
+ status = mech->gss_release_name (
+ mech->context,
+ minor_status,
+ internal_name);
+ else
+ status = GSS_S_BAD_BINDINGS;
+
+ return (status);
+ }
+
+ return (GSS_S_BAD_MECH);
+}
+
+
-#ident "%Z%%M% %I% %E% SMI"
+#ident "@(#)g_imp_name.c 1.2 96/02/06 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine gss_import_name
*
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
return (GSS_S_BAD_NAME);
/*
- * First create the union name struct that will hold the internal
- * name and the mech_type. Then fill in the mech_type.
+ * First create the union name struct that will hold the external
+ * name and the name type.
*/
union_name = (gss_union_name_t) malloc (sizeof(gss_union_name_desc));
union_name->external_name =
(gss_buffer_t) malloc(sizeof(gss_buffer_desc));
union_name->external_name->length = input_name_buffer->length;
+ /* we malloc length+1 to stick a NULL on the end, just in case */
+ /* Note that this NULL is not included in ->length for a reason! */
union_name->external_name->value =
- (void *) malloc(input_name_buffer->length);
+ (void *) malloc(input_name_buffer->length+1);
memcpy(union_name->external_name->value, input_name_buffer->value,
input_name_buffer->length);
+ /* add NULL to end of external_name->value, just in case... */
+
+ ((char *)union_name->external_name->value)
+ [input_name_buffer->length] = '\0';
+
union_name->name_type = (gss_OID) input_name_type;
*output_name = (gss_name_t) union_name;
#ident "@(#)g_imp_sec_context.c 1.2 96/01/18 SMI"
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine gss_export_sec_context
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
*/
ctx = (gss_union_ctx_id_t) *context_handle;
- mech = get_mechanism (ctx->mech_type);
+ mech = __gss_get_mechanism (ctx->mech_type);
if (mech) {
#ident "@(#)gss_indicate_mechs.c 1.13 95/08/04 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine for gss_indicate_mechs
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
#endif
#include <string.h>
-extern gss_mechanism *mechs_array;
+extern gss_mechanism *__gss_mechs_array;
static gss_OID_set_desc supported_mechs_desc;
static gss_OID_set supported_mechs = NULL;
/* Build the mech_set from the OIDs in mechs_array. */
- for(i=0; mechs_array[i]->mech_type.length != 0; i++)
+ for(i=0; __gss_mechs_array[i]->mech_type.length != 0; i++)
supported_mechs->count++;
supported_mechs->elements =
for(i=0; i < supported_mechs->count; i++) {
supported_mechs->elements[i].length =
- mechs_array[i]->mech_type.length;
+ __gss_mechs_array[i]->mech_type.length;
supported_mechs->elements[i].elements = (void *)
- malloc(mechs_array[i]->mech_type.length);
+ malloc(__gss_mechs_array[i]->mech_type.length);
memcpy(supported_mechs->elements[i].elements,
- mechs_array[i]->mech_type.elements,
- mechs_array[i]->mech_type.length);
+ __gss_mechs_array[i]->mech_type.elements,
+ __gss_mechs_array[i]->mech_type.length);
}
}
#ident "@(#)gss_init_sec_context.c 1.20 95/08/07 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine for gss_init_sec_context
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
* mechanism. If mech_type is NULL, set it to the resultant
* mechanism
*/
- mech = get_mechanism (mech_type);
+ mech = __gss_get_mechanism (mech_type);
if (mech == NULL)
return (GSS_S_BAD_MECH);
union_name = (gss_union_name_t) target_name;
- if ((temp_status = import_internal_name (
+ if ((temp_status = __gss_import_internal_name (
minor_status,
mech_type,
union_name,
} else
status = GSS_S_BAD_BINDINGS;
- temp_status = release_internal_name(
+ temp_status = __gss_release_internal_name(
&temp_minor_status,
mech_type,
&internal_name);
-#ident "@(#)gss_initialize.c 1.5 95/09/11 SMI"
+#ident "@(#)g_initialize.c 1.2 96/02/06 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* This function will initialize the gssapi mechglue library
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
#include <stdlib.h>
#endif
+#ifdef USE_SOLARIS_SHARED_LIBRARIES
+#include <stdio.h>
+#include <ctype.h>
+#include <dlfcn.h>
+#include <errno.h>
+
+#define MECH_CONF "/etc/mech.conf"
+#define MECH_SYM "gss_mech_initialize"
+
+static void solaris_initialize (void);
+#endif /* USE_SOLARIS_SHARED_LIBRARIES */
+
extern gss_mechanism krb5_gss_initialize();
static int _gss_initialized = 0;
+static struct gss_config null_mech = {
+ {0,NULL}};
+
+gss_mechanism *__gss_mechs_array = NULL;
+
+/*
+ * This function will add a new mechanism to the mechs_array
+ */
+
+static OM_uint32
+add_mechanism (gss_mechanism mech, int replace)
+{
+ gss_mechanism *temp_array;
+ int i;
+
+ if (mech == NULL)
+ return GSS_S_COMPLETE;
+
+ /* initialize the mechs_array if it hasn't already been initialized */
+ if (__gss_mechs_array == NULL) {
+ __gss_mechs_array = (gss_mechanism *) malloc (sizeof(gss_mechanism));
+
+ if (__gss_mechs_array == NULL)
+ return ENOMEM;
+
+ __gss_mechs_array[0] = &null_mech;
+ }
+
+ /*
+ * Find the length of __gss_mechs_array, and look for an existing
+ * entry for this OID
+ */
+ for (i=0; __gss_mechs_array[i]->mech_type.length != 0; i++) {
+ if ((__gss_mechs_array[i]->mech_type.length ==
+ mech->mech_type.length) &&
+ (memcmp (__gss_mechs_array[i]->mech_type.elements,
+ mech->mech_type.elements,
+ mech->mech_type.length) == 0)) {
+
+ /* We found a match. Replace it? */
+ if (!replace)
+ return GSS_S_FAILURE;
+
+ __gss_mechs_array[i] = mech;
+ return GSS_S_COMPLETE;
+ }
+ }
+
+ /* we didn't find it -- add it to the end of the __gss_mechs_array */
+ temp_array = (gss_mechanism *) realloc(__gss_mechs_array,
+ (i+2)*sizeof(gss_mechanism));
+
+ if (temp_array == NULL)
+ return ENOMEM;
+
+ temp_array[i++] = mech;
+ temp_array[i] = &null_mech;
+
+ __gss_mechs_array = temp_array;
+
+ return GSS_S_COMPLETE;
+}
+
void gss_initialize (void)
{
gss_mechanism mech;
return;
_gss_initialized = 1;
+#ifdef USE_SOLARIS_SHARED_LIBRARIES
+ solaris_initialize();
+
+#else
/*
* Use hard-coded in mechanisms... I need to know what mechanisms
* are supported... As more mechanisms become supported, they
if (mech)
add_mechanism (mech, 1);
+#endif /* USE_SOLARIS_SHARED_LIBRARIES */
+
+ if (__gss_mechs_array == NULL) { /* this is very bad! */
+ fprintf(stderr,"gss_initialize fatal error: no mechanisms loaded!\n");
+ exit(-1);
+ }
+
+ return;
+}
+
+#ifdef USE_SOLARIS_SHARED_LIBRARIES
+/*
+ * read the configuration file to find out what mechanisms to
+ * load, load them, and then load the mechanism defitions in
+ * and add the mechanisms
+ */
+static void solaris_initialize (void)
+{
+ char buffer[BUFSIZ], *filename, *symname, *endp;
+ FILE *conffile;
+ void *dl;
+ gss_mechanism (*sym)(void), mech;
+
+ if ((filename = getenv("GSSAPI_MECH_CONF")) == NULL)
+ filename = MECH_CONF;
+
+ if ((conffile = fopen(filename, "r")) == NULL)
+ return;
+
+ while (fgets (buffer, BUFSIZ, conffile) != NULL) {
+ /* ignore lines beginning with # */
+ if (*buffer == '#')
+ continue;
+
+ /* find the first white-space character after the filename */
+ for (symname = buffer; *symname && !isspace(*symname); symname++);
+
+ /* Now find the first non-white-space character */
+ if (*symname) {
+ *symname = '\0';
+ symname++;
+ while (*symname && isspace(*symname))
+ symname++;
+ }
+
+ if (! *symname)
+ symname = MECH_SYM;
+ else {
+ /* Find the end of the symname and make sure it is NULL-terminated */
+ for (endp = symname; *endp && !isspace(*endp); endp++);
+ if (*endp)
+ *endp = '\0';
+ }
+
+ if ((dl = dlopen(buffer, RTLD_NOW)) == NULL) {
+ /* for debugging only */
+ fprintf(stderr,"can't open %s: %s\n",buffer, dlerror());
+ continue;
+ }
+
+ if ((sym = (gss_mechanism (*)(void))dlsym(dl, symname)) == NULL) {
+ dlclose(dl);
+ continue;
+ }
+
+ /* Call the symbol to get the mechanism table */
+ mech = sym();
+
+ /* And add the mechanism (or close the shared library) */
+ if (mech)
+ add_mechanism (mech, 1);
+ else
+ dlclose(dl);
+
+ } /* while */
+
return;
}
+#endif /* USE_SOLARIS_SHARED_LIBRARIES */
#ident "@(#)g_inquire_context.c 1.2 96/01/18 SMI"
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine for gss_inquire_context
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
*/
ctx = (gss_union_ctx_id_t) context_handle;
- mech = get_mechanism (ctx->mech_type);
+ mech = __gss_get_mechanism (ctx->mech_type);
if (!mech || !mech->gss_inquire_context || !mech->gss_display_name) {
return(GSS_S_NO_CONTEXT);
#ident "@(#)gss_inquire_cred.c 1.9 95/08/02 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine for gss_inquire_cred
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
#ident "@(#)g_inquire_names.c 1.1 95/12/19 SMI"
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine for gss_inquire_context
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
* call it.
*/
- mech = get_mechanism (mechanism);
+ mech = __gss_get_mechanism (mechanism);
if (mech) {
#include "mglueP.h"
/* should include to get protos #include "../generic/gssapiP_generic.h" */
-extern gss_mechanism *mechs_array;
+extern gss_mechanism *__gss_mechs_array;
OM_uint32
gss_release_oid(minor_status, oid)
* if no mechanisms recognize the OID, then call the generic version.
*/
- for(i=0; mechs_array[i]->mech_type.length !=0; i++) {
- if (mechs_array[i]->gss_internal_release_oid) {
- major_status = mechs_array[i]->gss_internal_release_oid(
- mechs_array[i]->context,
+ for(i=0; __gss_mechs_array[i]->mech_type.length !=0; i++) {
+ if (__gss_mechs_array[i]->gss_internal_release_oid) {
+ major_status = __gss_mechs_array[i]->gss_internal_release_oid(
+ __gss_mechs_array[i]->context,
minor_status,
oid);
if (major_status == GSS_S_COMPLETE) {
#ident "@(#)gss_process_context.c 1.9 95/08/07 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine gss_process_context
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
*/
ctx = (gss_union_ctx_id_t) context_handle;
- mech = get_mechanism (ctx->mech_type);
+ mech = __gss_get_mechanism (ctx->mech_type);
if (mech) {
-#ident "%Z%%M% %I% %E% SMI"
+#ident "@(#)g_rel_buffer.c 1.2 96/02/06 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine for gss_release_buffer
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
#ident "@(#)gss_release_cred.c 1.15 95/08/07 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine for gss_release_cred
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
for(j=0; j < union_cred->count; j++) {
- mech = get_mechanism (&union_cred->mechs_array[j]);
+ mech = __gss_get_mechanism (&union_cred->mechs_array[j]);
if (union_cred->mechs_array[j].elements)
free(union_cred->mechs_array[j].elements);
#ident "@(#)gss_release_name.c 1.2 95/05/09 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine for gss_release_name
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
#ident "@(#)gss_release_oid_set.c 1.12 95/08/23 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine for gss_release_oid_set
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
gss_OID_set * set;
{
size_t index;
- OM_uint32 status;
-
+ OM_uint32 temp_minor;
+ gss_OID oid;
if (minor_status)
*minor_status = 0;
if (*set == GSS_C_NULL_OID_SET)
return(GSS_S_COMPLETE);
- for (index=0; index<(*set)->count; index++)
- free((*set)->elements[index].elements);
+ for (index=0; index<(*set)->count; index++) {
+ oid = &(*set)->elements[index];
+ gss_release_oid(&temp_minor, &oid);
+ }
free((*set)->elements);
free(*set);
#ident "@(#)gss_seal.c 1.10 95/08/07 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine for gss_seal
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
*/
ctx = (gss_union_ctx_id_t) context_handle;
- mech = get_mechanism (ctx->mech_type);
+ mech = __gss_get_mechanism (ctx->mech_type);
if (mech) {
if (mech->gss_seal)
#ident "@(#)gss_sign.c 1.10 95/08/07 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine gss_sign
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
*/
ctx = (gss_union_ctx_id_t) context_handle;
- mech = get_mechanism (ctx->mech_type);
+ mech = __gss_get_mechanism (ctx->mech_type);
if (mech) {
if (mech->gss_sign)
#ident "@(#)gss_unseal.c 1.10 95/08/07 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine gss_unseal
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
*/
ctx = (gss_union_ctx_id_t) context_handle;
- mech = get_mechanism (ctx->mech_type);
+ mech = __gss_get_mechanism (ctx->mech_type);
if (mech) {
if (mech->gss_unseal)
#ident "@(#)gss_verify.c 1.9 95/08/07 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routine for gss_verify
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
*/
ctx = (gss_union_ctx_id_t) context_handle;
- mech = get_mechanism (ctx->mech_type);
+ mech = __gss_get_mechanism (ctx->mech_type);
if (mech) {
if (mech->gss_verify)
+++ /dev/null
-#ident "@(#)get_mechanism.c 1.10 95/08/04 SMI"
-/*
- * given the mechs_array and a mechanism OID, return the
- * pointer to the mechanism, or NULL if that mechanism is
- * not supported. If the requested OID is NULL, then return
- * the first mechanism.
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-#include "mglueP.h"
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#include <string.h>
-
-extern gss_mechanism *mechs_array;
-
-gss_mechanism get_mechanism (gss_OID type)
-{
- int i;
-
- if (type == GSS_C_NULL_OID)
- return (mechs_array[0]);
-
- for (i=0; mechs_array[i]->mech_type.length != 0; i++) {
- if ((mechs_array[i]->mech_type.length == type->length) &&
- (memcmp (mechs_array[i]->mech_type.elements, type->elements,
- type->length) == 0)) {
-
- return (mechs_array[i]);
- }
- }
- return NULL;
-}
+++ /dev/null
-#ident "@(#)get_mech_type.c 1.4 95/06/08 SMI"
-/*
- * glue routine for get_mech_type
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-#include "mglueP.h"
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-OM_uint32 get_mech_type(OID, token)
-
-gss_OID * OID;
-gss_buffer_t token;
-
-{
- unsigned char * buffer_ptr;
-
- /*
- * This routine reads the prefix of "token" in order to determine
- * its mechanism type. It assumes the encoding suggested in
- * Appendix B of RFC 1508. This format starts out as follows :
- *
- * tag for APPLICATION 0, Sequence[constructed, definite length]
- * length of remainder of token
- * tag of OBJECT IDENTIFIER
- * length of mechanism OID
- * encoding of mechanism OID
- * <the rest of the token>
- *
- * Numerically, this looks like :
- *
- * 0x60
- * <length> - could be multiple bytes
- * 0x06
- * <length> - assume only one byte, hence OID length < 127
- * <mech OID bytes>
- *
- * The routine returns a pointer to the OID value. The return code is
- * the length of the OID, if successful; otherwise it is 0.
- */
-
- if (OID == NULL || *OID == GSS_C_NULL_OID)
- return (0);
-
- /* if the token is a null pointer, return a zero length OID */
-
- if(token == NULL) {
- (*OID)->length = 0;
- (*OID)->elements = NULL;
- return (0);
- }
-
- /* Skip past the APP/Sequnce byte and the token length */
-
- buffer_ptr = (unsigned char *) token->value;
-
- while(*(++buffer_ptr) & (1<<7))
- continue;
-
- /* increment buffer_ptr to point to the OID and return its length */
-
- (*OID)->length = (OM_uint32) *(buffer_ptr+3);
- (*OID)->elements = (void *) (buffer_ptr+4);
- return ((*OID)->length);
-}
#ident "@(#)gssd_pname_to_uid.c 1.5 95/08/02 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* glue routines that test the mech id either passed in to
* gss_init_sec_contex() or gss_accept_sec_context() or within the glue
* routine supported version of the security context and then call
* the appropriate underlying mechanism library procedure.
*
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#include "mglueP.h"
* call it.
*/
- mech = get_mechanism (mech_type);
+ mech = __gss_get_mechanism (mech_type);
if (mech) {
if (mech_type == GSS_C_NULL_OID)
mech_type = &mech->mech_type;
if (mech->pname_to_uid)
- status = mech->pname_to_uid(pname, name_type, mech_type, uid);
+ status = mech->pname_to_uid(mech->context,
+ pname, name_type, mech_type, uid);
else
status = GSS_S_BAD_MECH;
} else
+++ /dev/null
-#ident "@(#)internal_name.c 1.5 95/08/07 SMI"
-/*
- * Internal routines to get and release an internal mechanism name
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-#include "mglueP.h"
-
-OM_uint32 import_internal_name (minor_status, mech_type, union_name,
- internal_name)
-OM_uint32 *minor_status;
-gss_OID mech_type;
-gss_union_name_t union_name;
-gss_name_t *internal_name;
-{
- OM_uint32 status;
- gss_mechanism mech;
-
- mech = get_mechanism (mech_type);
- if (mech) {
- if (mech->gss_import_name)
- status = mech->gss_import_name (
- mech->context,
- minor_status,
- union_name->external_name,
- union_name->name_type,
- internal_name);
- else
- status = GSS_S_BAD_BINDINGS;
-
- return (status);
- }
-
- return (GSS_S_BAD_MECH);
-}
-
-OM_uint32 display_internal_name (minor_status, mech_type, internal_name,
- external_name, name_type)
-OM_uint32 *minor_status;
-gss_OID mech_type;
-gss_name_t internal_name;
-gss_buffer_t external_name;
-gss_OID *name_type;
-{
- OM_uint32 status;
- gss_mechanism mech;
-
- mech = get_mechanism (mech_type);
- if (mech) {
- if (mech->gss_display_name)
- status = mech->gss_display_name (
- mech->context,
- minor_status,
- internal_name,
- external_name,
- name_type);
- else
- status = GSS_S_BAD_BINDINGS;
-
- return (status);
- }
-
- return (GSS_S_BAD_MECH);
-}
-
-OM_uint32 release_internal_name (minor_status, mech_type, internal_name)
-OM_uint32 *minor_status;
-gss_OID mech_type;
-gss_name_t *internal_name;
-{
- OM_uint32 status;
- gss_mechanism mech;
-
- mech = get_mechanism (mech_type);
- if (mech) {
- if (mech->gss_release_name)
- status = mech->gss_release_name (
- mech->context,
- minor_status,
- internal_name);
- else
- status = GSS_S_BAD_BINDINGS;
-
- return (status);
- }
-
- return (GSS_S_BAD_MECH);
-}
--- /dev/null
+#
+#
+# GSSAPI Mechanism Definitions
+#
+# library function
+/opt/SUNWgss/lib/mech_krb5.so krb5_gss_initialize
+#mech_krb5.so krb5_gss_initialize
#ident "@(#)mechglue.h 1.13 95/08/07 SMI"
+
+/*
+ * Copyright 1996 by Sun Microsystems, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Sun Microsystems not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. Sun Microsystems makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
/*
* This header contains the mechglue definitions.
- *
- * Copyright (c) 1995, by Sun Microsystems, Inc.
- * All rights reserved.
*/
#ifndef _GSS_MECHGLUE_H
));
int (*pname_to_uid)
NPROTOTYPE((
+ void *, /* context */
char *, /* pname */
gss_OID, /* name type */
gss_OID, /* mech type */
/********************************************************/
/* Internal mechglue routines */
-gss_mechanism get_mechanism
+gss_mechanism __gss_get_mechanism
PROTOTYPE((gss_OID));
-OM_uint32 add_mechanism
-PROTOTYPE((gss_mechanism, int));
-OM_uint32 get_mech_type
+OM_uint32 __gss_get_mech_type
PROTOTYPE((gss_OID *, gss_buffer_t));
-OM_uint32 import_internal_name
+OM_uint32 __gss_import_internal_name
PROTOTYPE((OM_uint32 *, gss_OID, gss_union_name_t,
gss_name_t *));
-OM_uint32 display_internal_name
+OM_uint32 __gss_display_internal_name
PROTOTYPE((OM_uint32 *, gss_OID, gss_name_t,
gss_buffer_t, gss_OID *));
-OM_uint32 release_internal_name
+OM_uint32 __gss_release_internal_name
PROTOTYPE((OM_uint32 *, gss_OID, gss_name_t *));
OM_uint32 generic_gss_release_oid