From: Theodore Tso Date: Tue, 23 Jan 1996 08:36:27 +0000 (+0000) Subject: gssapiP_generic.h: Removed prototypes of functions that have been X-Git-Tag: krb5-1.0-beta6~584 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4250f62cddc162055bcd0e87409678de8d8efa8a;p=krb5.git gssapiP_generic.h: Removed prototypes of functions that have been moved to the mechglue layer. Makefile.in: Removed gssapi_generic.c, oid_ops.c, rel_buffer.c, and rel_oid_set.c --- these functions are now done in the mechglue layer. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7364 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/gssapi/generic/ChangeLog b/src/lib/gssapi/generic/ChangeLog index b69cfd1fa..f74ad1734 100644 --- a/src/lib/gssapi/generic/ChangeLog +++ b/src/lib/gssapi/generic/ChangeLog @@ -1,3 +1,12 @@ +Tue Jan 23 03:28:41 1996 Theodore Y. Ts'o + + * gssapiP_generic.h: Removed prototypes of functions that have + been moved to the mechglue layer. + + * Makefile.in: Removed gssapi_generic.c, oid_ops.c, rel_buffer.c, + and rel_oid_set.c --- these functions are now done in the + mechglue layer. + Wed Jan 10 21:31:42 1996 Theodore Y. Ts'o * Makefile.in (gssapi_err_generic.$(OBJEXT)): Added ##DOS diff --git a/src/lib/gssapi/generic/Makefile.in b/src/lib/gssapi/generic/Makefile.in index d1ac9792f..25150e38d 100644 --- a/src/lib/gssapi/generic/Makefile.in +++ b/src/lib/gssapi/generic/Makefile.in @@ -44,10 +44,6 @@ UTIL_VALIDATE_OBJ= utl_nohash_validate.$(OBJEXT) CCSRCS = \ $(srcdir)/disp_major_status.c \ $(srcdir)/disp_com_err_status.c \ - $(srcdir)/gssapi_generic.c \ - $(srcdir)/oid_ops.c \ - $(srcdir)/rel_buffer.c \ - $(srcdir)/rel_oid_set.c \ $(srcdir)/util_buffer.c \ $(srcdir)/util_canonhost.c \ $(srcdir)/util_dup.c \ @@ -58,10 +54,6 @@ CCSRCS = \ CCOBJS = \ disp_major_status.$(OBJEXT) \ disp_com_err_status.$(OBJEXT) \ - gssapi_generic.$(OBJEXT) \ - oid_ops.$(OBJEXT) \ - rel_buffer.$(OBJEXT) \ - rel_oid_set.$(OBJEXT) \ util_buffer.$(OBJEXT) \ util_canonhost.$(OBJEXT) \ util_dup.$(OBJEXT) \ diff --git a/src/lib/gssapi/generic/gssapiP_generic.h b/src/lib/gssapi/generic/gssapiP_generic.h index 37ccffd53..a882f6139 100644 --- a/src/lib/gssapi/generic/gssapiP_generic.h +++ b/src/lib/gssapi/generic/gssapiP_generic.h @@ -123,51 +123,4 @@ char * g_canonicalize_host PROTOTYPE((char *hostname)); char * g_strdup PROTOTYPE((char *str)); -/** declarations of internal name mechanism functions **/ - -OM_uint32 generic_gss_release_buffer -PROTOTYPE( (OM_uint32*, /* minor_status */ - gss_buffer_t /* buffer */ - )); - -OM_uint32 generic_gss_release_oid_set -PROTOTYPE( (OM_uint32*, /* minor_status */ - gss_OID_set* /* set */ - )); - -OM_uint32 generic_gss_release_oid -PROTOTYPE( (OM_uint32 *, /* minor_status */ - gss_OID * /* oid */ - )); - -OM_uint32 generic_gss_create_empty_oid_set -PROTOTYPE( (OM_uint32 *, /* minor_status */ - gss_OID_set * /* oid_set */ - )); - -OM_uint32 generic_gss_add_oid_set_member -PROTOTYPE( (OM_uint32 *, /* minor_status */ - gss_OID, /* member_oid */ - gss_OID_set * /* oid_set */ - )); - -OM_uint32 generic_gss_test_oid_set_member -PROTOTYPE( (OM_uint32 *, /* minor_status */ - gss_OID, /* member */ - gss_OID_set, /* set */ - int * /* present */ - )); - -OM_uint32 generic_gss_oid_to_str -PROTOTYPE( (OM_uint32 *, /* minor_status */ - gss_OID, /* oid */ - gss_buffer_t /* oid_str */ - )); - -OM_uint32 generic_gss_str_to_oid -PROTOTYPE( (OM_uint32 *, /* minor_status */ - gss_buffer_t, /* oid_str */ - gss_OID * /* oid */ - )); - #endif /* _GSSAPIP_GENERIC_H_ */ diff --git a/src/lib/gssapi/generic/gssapi_generic.c b/src/lib/gssapi/generic/gssapi_generic.c deleted file mode 100644 index f94e424cf..000000000 --- a/src/lib/gssapi/generic/gssapi_generic.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 1993 by OpenVision Technologies, 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 OpenVision not be used - * in advertising or publicity pertaining to distribution of the software - * without specific, written prior permission. OpenVision makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OPENVISION 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_generic.h" - -/* - * See krb5/gssapi_krb5.c for a description of the algorithm for - * encoding an object identifier. - */ - -/* - * The OID of user_name is: - * iso(1) member-body(2) US(840) mit(113554) infosys(1) gssapi(2) - * generic(1) user_name(1) = 1.2.840.113554.1.2.1.1 - * machine_uid_name: - * iso(1) member-body(2) US(840) mit(113554) infosys(1) gssapi(2) - * generic(1) machine_uid_name(2) = 1.2.840.113554.1.2.1.2 - * string_uid_name: - * iso(1) member-body(2) US(840) mit(113554) infosys(1) gssapi(2) - * generic(1) string_uid_name(3) = 1.2.840.113554.1.2.1.3 - * service_name: - * iso(1) member-body(2) US(840) mit(113554) infosys(1) gssapi(2) - * generic(1) service_name(4) = 1.2.840.113554.1.2.1.4 - */ - -static const gss_OID_desc oids[] = { - {10, "\052\206\110\206\367\022\001\002\001\001"}, - {10, "\052\206\110\206\367\022\001\002\001\002"}, - {10, "\052\206\110\206\367\022\001\002\001\003"}, - {10, "\052\206\110\206\367\022\001\002\001\004"}, -}; - -const gss_OID_desc * const gss_nt_user_name = oids+0; -const gss_OID_desc * const gss_nt_machine_uid_name = oids+1; -const gss_OID_desc * const gss_nt_string_uid_name = oids+2; -const gss_OID_desc * const gss_nt_service_name = oids+3; diff --git a/src/lib/gssapi/generic/oid_ops.c b/src/lib/gssapi/generic/oid_ops.c deleted file mode 100644 index c26a73f3b..000000000 --- a/src/lib/gssapi/generic/oid_ops.c +++ /dev/null @@ -1,351 +0,0 @@ -/* - * lib/gssapi/generic/oid_ops.c - * - * Copyright 1995 by the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * Export of this software from the United States of America may - * require a specific license from the United States Government. - * It is the responsibility of any person or organization contemplating - * export to obtain such a license before exporting. - * - * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and - * distribute this software and its documentation for any purpose and - * without fee is hereby granted, provided that the above copyright - * notice appear in all copies and that both that copyright notice and - * this permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity pertaining - * to distribution of the software without specific, written prior - * permission. M.I.T. makes no representations about the suitability of - * this software for any purpose. It is provided "as is" without express - * or implied warranty. - * - */ - -/* - * oid_ops.c - GSS-API V2 interfaces to manipulate OIDs - */ - -#include "gssapiP_generic.h" -#include "gssapi_generic.h" -#include - -OM_uint32 -generic_gss_release_oid(minor_status, oid) - OM_uint32 *minor_status; - gss_OID *oid; -{ - *minor_status = 0; - - if (*oid == GSS_C_NO_OID) - return(GSS_S_COMPLETE); - - /* - * The V2 API says the following! - * - * gss_release_oid[()] will recognize any of the GSSAPI's own OID values, - * and will silently ignore attempts to free these OIDs; for other OIDs - * it will call the C free() routine for both the OID data and the - * descriptor. This allows applications to freely mix their own heap- - * allocated OID values with OIDs returned by GSS-API. - */ - if ((*oid != gss_nt_user_name) && - (*oid != gss_nt_machine_uid_name) && - (*oid != gss_nt_string_uid_name) && - (*oid != gss_nt_service_name)) { - xfree((*oid)->elements); - xfree(*oid); - } - *oid = GSS_C_NO_OID; - return(GSS_S_COMPLETE); -} - -OM_uint32 -generic_gss_create_empty_oid_set(minor_status, oid_set) - OM_uint32 *minor_status; - gss_OID_set *oid_set; -{ - if ((*oid_set = (gss_OID_set) xmalloc(sizeof(gss_OID_set_desc)))) { - memset(*oid_set, 0, sizeof(gss_OID_set_desc)); - *minor_status = 0; - return(GSS_S_COMPLETE); - } - else { - *minor_status = ENOMEM; - return(GSS_S_FAILURE); - } -} - -OM_uint32 -generic_gss_add_oid_set_member(minor_status, member_oid, oid_set) - OM_uint32 *minor_status; - gss_OID member_oid; - gss_OID_set *oid_set; -{ - gss_OID elist; - gss_OID lastel; - - elist = (*oid_set)->elements; - /* Get an enlarged copy of the array */ - if (((*oid_set)->elements = (gss_OID) xmalloc(((*oid_set)->count+1) * - sizeof(gss_OID_desc)))) { - /* Copy in the old junk */ - if (elist) - memcpy((*oid_set)->elements, - elist, - ((*oid_set)->count * sizeof(gss_OID_desc))); - - /* Duplicate the input element */ - lastel = &(*oid_set)->elements[(*oid_set)->count]; - if ((lastel->elements = - (void *) xmalloc((size_t) member_oid->length))) { - /* Success - copy elements */ - memcpy(lastel->elements, member_oid->elements, - (size_t) member_oid->length); - /* Set length */ - lastel->length = member_oid->length; - - /* Update count */ - (*oid_set)->count++; - if (elist) - xfree(elist); - *minor_status = 0; - return(GSS_S_COMPLETE); - } - else - xfree((*oid_set)->elements); - } - /* Failure - restore old contents of list */ - (*oid_set)->elements = elist; - *minor_status = ENOMEM; - return(GSS_S_FAILURE); -} - -OM_uint32 -generic_gss_test_oid_set_member(minor_status, member, set, present) - OM_uint32 *minor_status; - gss_OID member; - gss_OID_set set; - int *present; -{ - size_t i; - int result; - - result = 0; - for (i=0; icount; i++) { - if ((set->elements[i].length == member->length) && - !memcmp(set->elements[i].elements, - member->elements, - (size_t) member->length)) { - result = 1; - break; - } - } - *present = result; - *minor_status = 0; - return(GSS_S_COMPLETE); -} - -/* - * OID<->string routines. These are uuuuugly. - */ -OM_uint32 -generic_gss_oid_to_str(minor_status, oid, oid_str) - OM_uint32 *minor_status; - gss_OID oid; - gss_buffer_t oid_str; -{ - char numstr[128]; - unsigned long number; - int numshift; - size_t string_length; - size_t i; - unsigned char *cp; - char *bp; - - /* Decoded according to krb5/gssapi_krb5.c */ - - /* First determine the size of the string */ - string_length = 0; - number = 0; - numshift = 0; - cp = (unsigned char *) oid->elements; - number = (unsigned long) cp[0]; - sprintf(numstr, "%d ", number/40); - string_length += strlen(numstr); - sprintf(numstr, "%d ", number%40); - string_length += strlen(numstr); - for (i=1; ilength; i++) { - if ((numshift+7) < (sizeof(unsigned long)*8)) { - number = (number << 7) | (cp[i] & 0x7f); - numshift += 7; - } - else { - *minor_status = EINVAL; - return(GSS_S_FAILURE); - } - if ((cp[i] & 0x80) == 0) { - sprintf(numstr, "%d ", number); - string_length += strlen(numstr); - number = 0; - numshift = 0; - } - } - /* - * If we get here, we've calculated the length of "n n n ... n ". Add 4 - * here for "{ " and "}\0". - */ - string_length += 4; - if ((bp = (char *) xmalloc(string_length))) { - strcpy(bp, "{ "); - number = (unsigned long) cp[0]; - sprintf(numstr, "%d ", number/40); - strcat(bp, numstr); - sprintf(numstr, "%d ", number%40); - strcat(bp, numstr); - number = 0; - cp = (unsigned char *) oid->elements; - for (i=1; ilength; i++) { - number = (number << 7) | (cp[i] & 0x7f); - if ((cp[i] & 0x80) == 0) { - sprintf(numstr, "%d ", number); - strcat(bp, numstr); - number = 0; - } - } - strcat(bp, "}"); - oid_str->length = strlen(bp)+1; - oid_str->value = (void *) bp; - *minor_status = 0; - return(GSS_S_COMPLETE); - } - *minor_status = ENOMEM; - return(GSS_S_FAILURE); -} - -OM_uint32 -generic_gss_str_to_oid(minor_status, oid_str, oid) - OM_uint32 *minor_status; - gss_buffer_t oid_str; - gss_OID *oid; -{ - char *cp, *bp, *startp; - int brace; - long numbuf; - long onumbuf; - OM_uint32 nbytes; - int index; - unsigned char *op; - - brace = 0; - bp = (char *) oid_str->value; - cp = bp; - /* Skip over leading space */ - while ((bp < &cp[oid_str->length]) && isspace(*bp)) - bp++; - if (*bp == '{') { - brace = 1; - bp++; - } - while ((bp < &cp[oid_str->length]) && isspace(*bp)) - bp++; - startp = bp; - nbytes = 0; - - /* - * The first two numbers are chewed up by the first octet. - */ - if (sscanf(bp, "%ld", &numbuf) != 1) { - *minor_status = EINVAL; - return(GSS_S_FAILURE); - } - while ((bp < &cp[oid_str->length]) && isdigit(*bp)) - bp++; - while ((bp < &cp[oid_str->length]) && isspace(*bp)) - bp++; - if (sscanf(bp, "%ld", &numbuf) != 1) { - *minor_status = EINVAL; - return(GSS_S_FAILURE); - } - while ((bp < &cp[oid_str->length]) && isdigit(*bp)) - bp++; - while ((bp < &cp[oid_str->length]) && isspace(*bp)) - bp++; - nbytes++; - while (isdigit(*bp)) { - if (sscanf(bp, "%ld", &numbuf) != 1) { - *minor_status = EINVAL; - return(GSS_S_FAILURE); - } - while (numbuf) { - nbytes++; - numbuf >>= 7; - } - while ((bp < &cp[oid_str->length]) && isdigit(*bp)) - bp++; - while ((bp < &cp[oid_str->length]) && isspace(*bp)) - bp++; - } - if (brace && (*bp != '}')) { - *minor_status = EINVAL; - return(GSS_S_FAILURE); - } - - /* - * Phew! We've come this far, so the syntax is good. - */ - if ((*oid = (gss_OID) malloc(sizeof(gss_OID_desc)))) { - if ((*oid)->elements = (void *) malloc((size_t) nbytes)) { - (*oid)->length = nbytes; - op = (unsigned char *) (*oid)->elements; - bp = startp; - sscanf(bp, "%ld", &numbuf); - while (isdigit(*bp)) - bp++; - while (isspace(*bp)) - bp++; - onumbuf = 40*numbuf; - sscanf(bp, "%ld", &numbuf); - onumbuf += numbuf; - *op = (unsigned char) onumbuf; - op++; - while (isdigit(*bp)) - bp++; - while (isspace(*bp)) - bp++; - while (isdigit(*bp)) { - sscanf(bp, "%ld", &numbuf); - nbytes = 0; - /* Have to fill in the bytes msb-first */ - onumbuf = numbuf; - while (numbuf) { - nbytes++; - numbuf >>= 7; - } - numbuf = onumbuf; - op += nbytes; - index = -1; - while (numbuf) { - op[index] = (unsigned char) numbuf & 0x7f; - if (index != -1) - op[index] |= 0x80; - index--; - numbuf >>= 7; - } - while (isdigit(*bp)) - bp++; - while (isspace(*bp)) - bp++; - } - *minor_status = 0; - return(GSS_S_COMPLETE); - } - else { - xfree(*oid); - *oid = GSS_C_NO_OID; - } - } - *minor_status = ENOMEM; - return(GSS_S_FAILURE); -} - diff --git a/src/lib/gssapi/generic/rel_buffer.c b/src/lib/gssapi/generic/rel_buffer.c deleted file mode 100644 index b764a5b5f..000000000 --- a/src/lib/gssapi/generic/rel_buffer.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 1993 by OpenVision Technologies, 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 OpenVision not be used - * in advertising or publicity pertaining to distribution of the software - * without specific, written prior permission. OpenVision makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OPENVISION 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_generic.h" - -OM_uint32 generic_gss_release_buffer(minor_status, buffer) - OM_uint32 *minor_status; - gss_buffer_t buffer; -{ - if ((buffer->length) && - (buffer->value)) { - xfree(buffer->value); - buffer->length = 0; - buffer->value = NULL; - } - - *minor_status = 0; - return(GSS_S_COMPLETE); -} diff --git a/src/lib/gssapi/generic/rel_oid_set.c b/src/lib/gssapi/generic/rel_oid_set.c deleted file mode 100644 index 96f6f8d15..000000000 --- a/src/lib/gssapi/generic/rel_oid_set.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 1993 by OpenVision Technologies, 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 OpenVision not be used - * in advertising or publicity pertaining to distribution of the software - * without specific, written prior permission. OpenVision makes no - * representations about the suitability of this software for any - * purpose. It is provided "as is" without express or implied warranty. - * - * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL OPENVISION 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_generic.h" - -OM_uint32 generic_gss_release_oid_set(minor_status, set) - OM_uint32 *minor_status; - gss_OID_set *set; -{ - size_t index; - - *minor_status = 0; - - if (*set == GSS_C_NULL_OID_SET) - return(GSS_S_COMPLETE); - - for (index=0; index<(*set)->count; index++) - xfree((*set)->elements[index].elements); - xfree((*set)->elements); - xfree(*set); - - *set = GSS_C_NULL_OID_SET; - - return(GSS_S_COMPLETE); -}