From: Tom Yu Date: Fri, 10 Mar 2006 20:05:28 +0000 (+0000) Subject: Rename symbols for namespace purity X-Git-Tag: ms-bug-test-20060525~14 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a5828e6c5015151287ea41304f77d7d8ebf04a52;p=krb5.git Rename symbols for namespace purity git-svn-id: svn://anonsvn.mit.edu/krb5/users/tlyu/branches/mechglue@17727 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/gssapi/krb5/ChangeLog b/src/lib/gssapi/krb5/ChangeLog index 0e6c3a471..bd8285b4c 100644 --- a/src/lib/gssapi/krb5/ChangeLog +++ b/src/lib/gssapi/krb5/ChangeLog @@ -1,3 +1,7 @@ +2006-03-10 Tom Yu + + * krb5_gss_glue.c: Rename symbols for namespace purity. + 2005-11-14 Jeffrey Altman * gssapi_krb5.hin: include k5-int.h instead of krb5.h diff --git a/src/lib/gssapi/krb5/krb5_gss_glue.c b/src/lib/gssapi/krb5/krb5_gss_glue.c index e4a9618ba..40925d182 100644 --- a/src/lib/gssapi/krb5/krb5_gss_glue.c +++ b/src/lib/gssapi/krb5/krb5_gss_glue.c @@ -1014,7 +1014,7 @@ gss_krb5_copy_ccache( gss_cred_id_t mcred; ucred = (gss_union_cred_t)cred_handle; - mcred = __gss_get_mechanism_cred(ucred, &krb5_mechanism.mech_type); + mcred = gssint_get_mechanism_cred(ucred, &krb5_mechanism.mech_type); if (mcred == NULL) return GSS_S_DEFECTIVE_CREDENTIAL; return gss_krb5int_copy_ccache(minor_status, mcred, out_ccache); @@ -1049,7 +1049,7 @@ gss_krb5_set_allowable_enctypes( gss_cred_id_t mcred; ucred = (gss_union_cred_t)cred; - mcred = __gss_get_mechanism_cred(ucred, &krb5_mechanism.mech_type); + mcred = gssint_get_mechanism_cred(ucred, &krb5_mechanism.mech_type); if (mcred == NULL) return GSS_S_DEFECTIVE_CREDENTIAL; return gss_krb5int_set_allowable_enctypes(minor_status, mcred, diff --git a/src/lib/gssapi/mechglue/ChangeLog b/src/lib/gssapi/mechglue/ChangeLog index 10f07ee6d..22a6f461d 100644 --- a/src/lib/gssapi/mechglue/ChangeLog +++ b/src/lib/gssapi/mechglue/ChangeLog @@ -1,3 +1,16 @@ +2006-03-10 Tom Yu + + * g_accept_sec_context.c, g_acquire_cred.c, g_compare_name.c, + * g_canon_name.c, g_context_time.c, g_delete_sec_context.c: + * g_dsp_name.c, g_dsp_status.c, g_dup_name.c, g_exp_sec_context.c: + * g_export_name.c, g_glue.c, g_imp_name.c, g_imp_sec_context.c: + * g_indicate_mechs.c, g_init_sec_context.c, g_initialize.c: + * g_inq_context.c, g_inq_cred.c, g_inq_names.c, g_oid_ops.c: + * g_process_context.c, g_rel_cred.c, g_rel_name.c, g_seal.c: + * g_sign.c, g_store_cred.c, g_unseal.c, g_userok.c, g_utils.c: + * g_verify.c, gssd_pname_to_uid.c, mglueP.h: Rename symbols for + namespace purity. + 2006-03-06 Tom Yu * g_acquire_cred.c (gss_add_cred): Maintain old default-cred diff --git a/src/lib/gssapi/mechglue/g_accept_sec_context.c b/src/lib/gssapi/mechglue/g_accept_sec_context.c index b2a21e6de..e0be15093 100644 --- a/src/lib/gssapi/mechglue/g_accept_sec_context.c +++ b/src/lib/gssapi/mechglue/g_accept_sec_context.c @@ -102,7 +102,7 @@ gss_cred_id_t * d_cred; return (GSS_S_CALL_INACCESSIBLE_READ); /* Get the token mech type */ - status = __gss_get_mech_type(token_mech_type, input_token_buffer); + status = gssint_get_mech_type(token_mech_type, input_token_buffer); if (status) return status; @@ -134,14 +134,14 @@ gss_cred_id_t * d_cred; * use the default credential. */ union_cred = (gss_union_cred_t) verifier_cred_handle; - input_cred_handle = __gss_get_mechanism_cred(union_cred, token_mech_type); + input_cred_handle = gssint_get_mechanism_cred(union_cred, token_mech_type); /* * now select the approprate underlying mechanism routine and * call it. */ - mech = __gss_get_mechanism (token_mech_type); + mech = gssint_get_mechanism (token_mech_type); if (mech && mech->gss_accept_sec_context) { status = mech->gss_accept_sec_context( @@ -174,7 +174,7 @@ gss_cred_id_t * d_cred; * the union name struct cast to src_name */ if (internal_name != NULL) { - temp_status = __gss_convert_name_to_union_name( + temp_status = gssint_convert_name_to_union_name( &temp_minor_status, mech, internal_name, &tmp_src_name); if (temp_status != GSS_S_COMPLETE) { @@ -251,7 +251,7 @@ gss_cred_id_t * d_cred; } if (internal_name != NULL) { - temp_status = __gss_convert_name_to_union_name( + temp_status = gssint_convert_name_to_union_name( &temp_minor_status, mech, internal_name, &tmp_src_name); if (temp_status != GSS_S_COMPLETE) { diff --git a/src/lib/gssapi/mechglue/g_acquire_cred.c b/src/lib/gssapi/mechglue/g_acquire_cred.c index be3c105fe..ca3060791 100644 --- a/src/lib/gssapi/mechglue/g_acquire_cred.c +++ b/src/lib/gssapi/mechglue/g_acquire_cred.c @@ -125,7 +125,7 @@ OM_uint32 * time_rec; * statics thus needs not be freed */ if(desired_mechs == GSS_C_NULL_OID_SET) { - mech = __gss_get_mechanism(NULL); + mech = gssint_get_mechanism(NULL); if (mech == NULL) return (GSS_S_BAD_MECH); @@ -257,7 +257,7 @@ gss_add_cred(minor_status, input_cred_handle, if (initiator_time_rec) *initiator_time_rec = 0; - mech = __gss_get_mechanism(desired_mech); + mech = gssint_get_mechanism(desired_mech); if (!mech) return GSS_S_BAD_MECH; else if (!mech->gss_acquire_cred) @@ -274,7 +274,7 @@ gss_add_cred(minor_status, input_cred_handle, internal_name = GSS_C_NO_NAME; } else { union_cred = (gss_union_cred_t)input_cred_handle; - if (__gss_get_mechanism_cred(union_cred, desired_mech) != + if (gssint_get_mechanism_cred(union_cred, desired_mech) != GSS_C_NO_CREDENTIAL) return (GSS_S_DUPLICATE_ELEMENT); @@ -286,7 +286,7 @@ gss_add_cred(minor_status, input_cred_handle, &mech->mech_type)) internal_name = union_name->mech_name; else { - if (__gss_import_internal_name(minor_status, + if (gssint_import_internal_name(minor_status, &mech->mech_type, union_name, &allocated_name) != GSS_S_COMPLETE) return (GSS_S_BAD_NAME); @@ -409,7 +409,7 @@ gss_add_cred(minor_status, input_cred_handle, /* We're done with the internal name. Free it if we allocated it. */ if (allocated_name) - (void) __gss_release_internal_name(&temp_minor_status, + (void) gssint_release_internal_name(&temp_minor_status, &mech->mech_type, &allocated_name); @@ -426,7 +426,7 @@ errout: &temp_minor_status, &cred); if (allocated_name) - (void) __gss_release_internal_name(&temp_minor_status, + (void) gssint_release_internal_name(&temp_minor_status, &mech->mech_type, &allocated_name); diff --git a/src/lib/gssapi/mechglue/g_canon_name.c b/src/lib/gssapi/mechglue/g_canon_name.c index c786d4d04..ff166da68 100644 --- a/src/lib/gssapi/mechglue/g_canon_name.c +++ b/src/lib/gssapi/mechglue/g_canon_name.c @@ -72,7 +72,7 @@ gss_name_t *output_name; out_union->external_name = 0; /* Allocate the buffer for the user specified representation */ - if (__gss_create_copy_buffer(in_union->external_name, + if (gssint_create_copy_buffer(in_union->external_name, &out_union->external_name, 1)) goto allocation_failure; @@ -90,7 +90,7 @@ gss_name_t *output_name; */ if (!output_name) { if (in_union->mech_type) { - (void) __gss_release_internal_name(minor_status, + (void) gssint_release_internal_name(minor_status, in_union->mech_type, &in_union->mech_name); (void) gss_release_oid(minor_status, @@ -107,7 +107,7 @@ gss_name_t *output_name; goto allocation_failure; if (major_status = - __gss_import_internal_name(minor_status, mech_type, + gssint_import_internal_name(minor_status, mech_type, dest_union, &dest_union->mech_name)) goto allocation_failure; @@ -139,7 +139,7 @@ allocation_failure: */ if (dest_union->mech_name) { - (void) __gss_release_internal_name(minor_status, + (void) gssint_release_internal_name(minor_status, dest_union->mech_type, &dest_union->mech_name); } diff --git a/src/lib/gssapi/mechglue/g_compare_name.c b/src/lib/gssapi/mechglue/g_compare_name.c index 9cd50d9de..0a6db1c16 100644 --- a/src/lib/gssapi/mechglue/g_compare_name.c +++ b/src/lib/gssapi/mechglue/g_compare_name.c @@ -76,7 +76,7 @@ int * name_equal; * information. */ if (union_name1->mech_type) { - mech = __gss_get_mechanism (union_name1->mech_type); + mech = gssint_get_mechanism (union_name1->mech_type); if (!mech) return (GSS_S_BAD_MECH); if (!mech->gss_compare_name) @@ -160,7 +160,7 @@ int * name_equal; union_name1 = (gss_union_name_t) name2; union_name2 = (gss_union_name_t) name1; } - major_status = __gss_import_internal_name(minor_status, + major_status = gssint_import_internal_name(minor_status, union_name1->mech_type, union_name2, &internal_name); @@ -170,7 +170,7 @@ int * name_equal; major_status = mech->gss_compare_name(mech->context, minor_status, union_name1->mech_name, internal_name, name_equal); - __gss_release_internal_name(&temp_minor, union_name1->mech_type, + gssint_release_internal_name(&temp_minor, union_name1->mech_type, &internal_name); return (major_status); diff --git a/src/lib/gssapi/mechglue/g_context_time.c b/src/lib/gssapi/mechglue/g_context_time.c index 82262a06e..5ce6b56d8 100644 --- a/src/lib/gssapi/mechglue/g_context_time.c +++ b/src/lib/gssapi/mechglue/g_context_time.c @@ -58,7 +58,7 @@ OM_uint32 * time_rec; */ ctx = (gss_union_ctx_id_t) context_handle; - mech = __gss_get_mechanism (ctx->mech_type); + mech = gssint_get_mechanism (ctx->mech_type); if (mech) { diff --git a/src/lib/gssapi/mechglue/g_delete_sec_context.c b/src/lib/gssapi/mechglue/g_delete_sec_context.c index 9678bd083..de70b8fb7 100644 --- a/src/lib/gssapi/mechglue/g_delete_sec_context.c +++ b/src/lib/gssapi/mechglue/g_delete_sec_context.c @@ -64,7 +64,7 @@ gss_buffer_t output_token; */ ctx = (gss_union_ctx_id_t) *context_handle; - mech = __gss_get_mechanism (ctx->mech_type); + mech = gssint_get_mechanism (ctx->mech_type); if (mech) { diff --git a/src/lib/gssapi/mechglue/g_dsp_name.c b/src/lib/gssapi/mechglue/g_dsp_name.c index f90c87669..161b2707e 100644 --- a/src/lib/gssapi/mechglue/g_dsp_name.c +++ b/src/lib/gssapi/mechglue/g_dsp_name.c @@ -68,7 +68,7 @@ gss_OID * output_name_type; /* * OK, we have a mechanism-specific name; let's use it! */ - return (__gss_display_internal_name(minor_status, + return (gssint_display_internal_name(minor_status, union_name->mech_type, union_name->mech_name, output_name_buffer, diff --git a/src/lib/gssapi/mechglue/g_dsp_status.c b/src/lib/gssapi/mechglue/g_dsp_status.c index 51d552e56..83583035f 100644 --- a/src/lib/gssapi/mechglue/g_dsp_status.c +++ b/src/lib/gssapi/mechglue/g_dsp_status.c @@ -77,7 +77,7 @@ gss_buffer_t status_string; * call it. */ - mech = __gss_get_mechanism (mech_type); + mech = gssint_get_mechanism (mech_type); if (mech && mech->gss_display_status) { if (mech_type == GSS_C_NULL_OID) diff --git a/src/lib/gssapi/mechglue/g_dup_name.c b/src/lib/gssapi/mechglue/g_dup_name.c index d8508202c..8bd813d28 100644 --- a/src/lib/gssapi/mechglue/g_dup_name.c +++ b/src/lib/gssapi/mechglue/g_dup_name.c @@ -61,7 +61,7 @@ gss_name_t *dest_name; dest_union->external_name = 0; /* Now copy the external representaion */ - if (__gss_create_copy_buffer(src_union->external_name, + if (gssint_create_copy_buffer(src_union->external_name, &dest_union->external_name, 0)) goto allocation_failure; @@ -83,7 +83,7 @@ gss_name_t *dest_name; if (major_status != GSS_S_COMPLETE) goto allocation_failure; - major_status = __gss_import_internal_name(minor_status, + major_status = gssint_import_internal_name(minor_status, dest_union->mech_type, dest_union, &dest_union->mech_name); @@ -106,7 +106,7 @@ allocation_failure: (void) generic_gss_release_oid(minor_status, &dest_union->name_type); if (dest_union->mech_name) - (void) __gss_release_internal_name(minor_status, + (void) gssint_release_internal_name(minor_status, dest_union->mech_type, &dest_union->mech_name); if (dest_union->mech_type) diff --git a/src/lib/gssapi/mechglue/g_exp_sec_context.c b/src/lib/gssapi/mechglue/g_exp_sec_context.c index a9a244366..539920b49 100644 --- a/src/lib/gssapi/mechglue/g_exp_sec_context.c +++ b/src/lib/gssapi/mechglue/g_exp_sec_context.c @@ -67,7 +67,7 @@ gss_buffer_t interprocess_token; */ ctx = (gss_union_ctx_id_t) *context_handle; - mech = __gss_get_mechanism (ctx->mech_type); + mech = gssint_get_mechanism (ctx->mech_type); if (!mech) return GSS_S_BAD_MECH; if (!mech->gss_export_sec_context) diff --git a/src/lib/gssapi/mechglue/g_export_name.c b/src/lib/gssapi/mechglue/g_export_name.c index 6b5780c2a..778cfdeec 100644 --- a/src/lib/gssapi/mechglue/g_export_name.c +++ b/src/lib/gssapi/mechglue/g_export_name.c @@ -50,6 +50,6 @@ gss_buffer_t exported_name; if (!union_name->mech_type) return (GSS_S_NAME_NOT_MN); - return __gss_export_internal_name(minor_status, union_name->mech_type, + return gssint_export_internal_name(minor_status, union_name->mech_type, union_name->mech_name, exported_name); } diff --git a/src/lib/gssapi/mechglue/g_glue.c b/src/lib/gssapi/mechglue/g_glue.c index d807ff070..030fbfdfa 100644 --- a/src/lib/gssapi/mechglue/g_glue.c +++ b/src/lib/gssapi/mechglue/g_glue.c @@ -32,7 +32,7 @@ #define MSO_BIT (8*(sizeof (int) - 1)) /* Most significant octet bit */ -extern gss_mechanism *__gss_mechs_array; +extern gss_mechanism *gssint_mechs_array; /* * This file contains the support routines for the glue layer. @@ -46,7 +46,7 @@ extern gss_mechanism *__gss_mechs_array; * by the buffer. Note we return -1 on error. */ int -get_der_length(unsigned char **buf, unsigned int buf_len, unsigned int *bytes) +gssint_get_der_length(unsigned char **buf, unsigned int buf_len, unsigned int *bytes) { /* p points to the beginning of the buffer */ unsigned char *p = *buf; @@ -100,7 +100,7 @@ get_der_length(unsigned char **buf, unsigned int buf_len, unsigned int *bytes) * der_length_size: Return the number of bytes to encode a given length. */ unsigned int -der_length_size(unsigned int len) +gssint_der_length_size(unsigned int len) { int i; @@ -122,7 +122,7 @@ der_length_size(unsigned int len) * be encoded in max_len characters. */ int -put_der_length(unsigned int length, unsigned char **buf, unsigned int max_len) +gssint_put_der_length(unsigned int length, unsigned char **buf, unsigned int max_len) { unsigned char *s = *buf, *p; unsigned int buf_len = 0; @@ -182,7 +182,7 @@ put_der_length(unsigned int length, unsigned char **buf, unsigned int max_len) * */ -OM_uint32 __gss_get_mech_type(OID, token) +OM_uint32 gssint_get_mech_type(OID, token) gss_OID OID; gss_buffer_t token; { @@ -251,7 +251,7 @@ OM_uint32 __gss_get_mech_type(OID, token) #include "mglueP.h" -OM_uint32 __gss_import_internal_name (minor_status, mech_type, union_name, +OM_uint32 gssint_import_internal_name (minor_status, mech_type, union_name, internal_name) OM_uint32 *minor_status; gss_OID mech_type; @@ -261,7 +261,7 @@ gss_name_t *internal_name; OM_uint32 status; gss_mechanism mech; - mech = __gss_get_mechanism (mech_type); + mech = gssint_get_mechanism (mech_type); if (mech) { if (mech->gss_import_name) status = mech->gss_import_name ( @@ -279,7 +279,7 @@ gss_name_t *internal_name; return (GSS_S_BAD_MECH); } -OM_uint32 __gss_export_internal_name(minor_status, mech_type, +OM_uint32 gssint_export_internal_name(minor_status, mech_type, internal_name, name_buf) OM_uint32 *minor_status; const gss_OID mech_type; @@ -297,7 +297,7 @@ OM_uint32 __gss_export_internal_name(minor_status, mech_type, int mechOidDERLen = 0; int mechOidLen = 0; - mech = __gss_get_mechanism(mech_type); + mech = gssint_get_mechanism(mech_type); if (!mech) return (GSS_S_BAD_MECH); @@ -343,7 +343,7 @@ OM_uint32 __gss_export_internal_name(minor_status, mech_type, return (status); /* determine the size of the buffer needed */ - mechOidDERLen = der_length_size(mech_type->length); + mechOidDERLen = gssint_der_length_size(mech_type->length); name_buf->length = tokIdLen + mechOidLenLen + mechOidTagLen + mechOidDERLen + mech_type->length + @@ -371,7 +371,7 @@ OM_uint32 __gss_export_internal_name(minor_status, mech_type, * mech OID value */ *buf++ = 0x06; - if (put_der_length(mech_type->length, &buf, + if (gssint_put_der_length(mech_type->length, &buf, (name_buf->length - tokIdLen -2)) != 0) { name_buf->length = 0; free(name_buf->value); @@ -394,9 +394,9 @@ OM_uint32 __gss_export_internal_name(minor_status, mech_type, /* release the buffer obtained from gss_display_name */ (void) gss_release_buffer(minor_status, &dispName); return (GSS_S_COMPLETE); -} /* __gss_export_internal_name */ +} /* gssint_export_internal_name */ -OM_uint32 __gss_display_internal_name (minor_status, mech_type, internal_name, +OM_uint32 gssint_display_internal_name (minor_status, mech_type, internal_name, external_name, name_type) OM_uint32 *minor_status; gss_OID mech_type; @@ -407,7 +407,7 @@ gss_OID *name_type; OM_uint32 status; gss_mechanism mech; - mech = __gss_get_mechanism (mech_type); + mech = gssint_get_mechanism (mech_type); if (mech) { if (mech->gss_display_name) status = mech->gss_display_name ( @@ -425,7 +425,7 @@ gss_OID *name_type; return (GSS_S_BAD_MECH); } -OM_uint32 __gss_release_internal_name (minor_status, mech_type, internal_name) +OM_uint32 gssint_release_internal_name (minor_status, mech_type, internal_name) OM_uint32 *minor_status; gss_OID mech_type; gss_name_t *internal_name; @@ -433,7 +433,7 @@ gss_name_t *internal_name; OM_uint32 status; gss_mechanism mech; - mech = __gss_get_mechanism (mech_type); + mech = gssint_get_mechanism (mech_type); if (mech) { if (mech->gss_release_name) status = mech->gss_release_name ( @@ -455,7 +455,7 @@ gss_name_t *internal_name; * name. Note that internal_name should be considered "consumed" by * this call, whether or not we return an error. */ -OM_uint32 __gss_convert_name_to_union_name(minor_status, mech, +OM_uint32 gssint_convert_name_to_union_name(minor_status, mech, internal_name, external_name) OM_uint32 *minor_status; gss_mechanism mech; @@ -513,7 +513,7 @@ allocation_failure: * internal_name, we must clean it up */ if (internal_name) - (void) __gss_release_internal_name(&tmp, &mech->mech_type, + (void) gssint_release_internal_name(&tmp, &mech->mech_type, &internal_name); return (major_status); } @@ -523,7 +523,7 @@ allocation_failure: * external union credential. */ gss_cred_id_t -__gss_get_mechanism_cred(union_cred, mech_type) +gssint_get_mechanism_cred(union_cred, mech_type) gss_union_cred_t union_cred; gss_OID mech_type; { @@ -544,7 +544,7 @@ __gss_get_mechanism_cred(union_cred, mech_type) * Both space for the structure and the data is allocated. */ OM_uint32 -__gss_create_copy_buffer(srcBuf, destBuf, addNullChar) +gssint_create_copy_buffer(srcBuf, destBuf, addNullChar) const gss_buffer_t srcBuf; gss_buffer_t *destBuf; int addNullChar; @@ -581,4 +581,4 @@ __gss_create_copy_buffer(srcBuf, destBuf, addNullChar) ((char *)aBuf->value)[aBuf->length] = '\0'; return (GSS_S_COMPLETE); -} /* ****** __gss_create_copy_buffer ****** */ +} /* ****** gssint_create_copy_buffer ****** */ diff --git a/src/lib/gssapi/mechglue/g_imp_name.c b/src/lib/gssapi/mechglue/g_imp_name.c index e68b3e24e..b1a64fd2d 100644 --- a/src/lib/gssapi/mechglue/g_imp_name.c +++ b/src/lib/gssapi/mechglue/g_imp_name.c @@ -90,7 +90,7 @@ gss_name_t * output_name; * rule is when the name of GSS_C_NT_EXPORT_NAME type. If that is * the case, then we make it MN in this call. */ - major_status = __gss_create_copy_buffer(input_name_buffer, + major_status = gssint_create_copy_buffer(input_name_buffer, &union_name->external_name, 0); if (major_status != GSS_S_COMPLETE) { free(union_name); @@ -134,7 +134,7 @@ allocation_failure: if (union_name->name_type) generic_gss_release_oid(&tmp, &union_name->name_type); if (union_name->mech_name) - __gss_release_internal_name(minor_status, union_name->mech_type, + gssint_release_internal_name(minor_status, union_name->mech_type, &union_name->mech_name); if (union_name->mech_type) generic_gss_release_oid(&tmp, &union_name->mech_type); @@ -197,7 +197,7 @@ importExportName(minor, unionName) * We verify both lengths. */ - mechOid.length = get_der_length(&buf, + mechOid.length = gssint_get_der_length(&buf, (expName.length - curLength), &bytes); mechOid.elements = (void *)buf; @@ -209,7 +209,7 @@ importExportName(minor, unionName) return (GSS_S_DEFECTIVE_TOKEN); buf += mechOid.length; - if ((mech = __gss_get_mechanism(&mechOid)) == NULL) + if ((mech = gssint_get_mechanism(&mechOid)) == NULL) return (GSS_S_BAD_MECH); if (mech->gss_import_name == NULL) @@ -236,13 +236,13 @@ importExportName(minor, unionName) * we must have exported the name - so we now need to reconstruct it * and call the mechanism to create it * - * WARNING: Older versions of __gss_export_internal_name() did + * WARNING: Older versions of gssint_export_internal_name() did * not export names correctly, but now it does. In * order to stay compatible with existing exported * names we must support names exported the broken * way. * - * Specifically, __gss_export_internal_name() used to include + * Specifically, gssint_export_internal_name() used to include * the name type OID in the encoding of the exported MN. * Additionally, the Kerberos V mech used to make display names * that included a null terminator which was counted in the diff --git a/src/lib/gssapi/mechglue/g_imp_sec_context.c b/src/lib/gssapi/mechglue/g_imp_sec_context.c index fd3a3af43..533b0175c 100644 --- a/src/lib/gssapi/mechglue/g_imp_sec_context.c +++ b/src/lib/gssapi/mechglue/g_imp_sec_context.c @@ -104,7 +104,7 @@ gss_ctx_id_t * context_handle; * call it. */ - mech = __gss_get_mechanism (ctx->mech_type); + mech = gssint_get_mechanism (ctx->mech_type); if (!mech) { status = GSS_S_BAD_MECH; goto error_out; diff --git a/src/lib/gssapi/mechglue/g_indicate_mechs.c b/src/lib/gssapi/mechglue/g_indicate_mechs.c index 334f7c1b9..e2c8d414f 100644 --- a/src/lib/gssapi/mechglue/g_indicate_mechs.c +++ b/src/lib/gssapi/mechglue/g_indicate_mechs.c @@ -33,7 +33,7 @@ #endif #include -extern gss_mechanism *__gss_mechs_array; +extern gss_mechanism *gssint_mechs_array; static gss_OID_set_desc supported_mechs_desc; static gss_OID_set supported_mechs = NULL; @@ -65,7 +65,7 @@ gss_OID_set * mech_set; /* Build the mech_set from the OIDs in mechs_array. */ - for(i=0; __gss_mechs_array[i]->mech_type.length != 0; i++) + for(i=0; gssint_mechs_array[i]->mech_type.length != 0; i++) supported_mechs->count++; supported_mechs->elements = @@ -74,12 +74,12 @@ gss_OID_set * mech_set; for(i=0; i < supported_mechs->count; i++) { supported_mechs->elements[i].length = - __gss_mechs_array[i]->mech_type.length; + gssint_mechs_array[i]->mech_type.length; supported_mechs->elements[i].elements = (void *) - malloc(__gss_mechs_array[i]->mech_type.length); + malloc(gssint_mechs_array[i]->mech_type.length); memcpy(supported_mechs->elements[i].elements, - __gss_mechs_array[i]->mech_type.elements, - __gss_mechs_array[i]->mech_type.length); + gssint_mechs_array[i]->mech_type.elements, + gssint_mechs_array[i]->mech_type.length); } } diff --git a/src/lib/gssapi/mechglue/g_init_sec_context.c b/src/lib/gssapi/mechglue/g_init_sec_context.c index 78e0553d8..1824b6349 100644 --- a/src/lib/gssapi/mechglue/g_init_sec_context.c +++ b/src/lib/gssapi/mechglue/g_init_sec_context.c @@ -105,7 +105,7 @@ OM_uint32 * time_rec; * mechanism. If mech_type is NULL, set it to the resultant * mechanism */ - mech = __gss_get_mechanism (mech_type); + mech = gssint_get_mechanism (mech_type); if (mech == NULL) return (GSS_S_BAD_MECH); @@ -124,7 +124,7 @@ OM_uint32 * time_rec; g_OID_equal(union_name->mech_type, mech_type)) { internal_name = union_name->mech_name; } else { - if ((status = __gss_import_internal_name(minor_status, mech_type, + if ((status = gssint_import_internal_name(minor_status, mech_type, union_name, &internal_name)) != GSS_S_COMPLETE) return (status); @@ -164,7 +164,7 @@ OM_uint32 * time_rec; * use the default credential. */ union_cred = (gss_union_cred_t) claimant_cred_handle; - input_cred_handle = __gss_get_mechanism_cred(union_cred, mech_type); + input_cred_handle = gssint_get_mechanism_cred(union_cred, mech_type); /* * now call the approprate underlying mechanism routine @@ -204,7 +204,7 @@ OM_uint32 * time_rec; end: if (union_name->mech_name == NULL || union_name->mech_name != internal_name) { - (void) __gss_release_internal_name(&temp_minor_status, + (void) gssint_release_internal_name(&temp_minor_status, mech_type, &internal_name); } diff --git a/src/lib/gssapi/mechglue/g_initialize.c b/src/lib/gssapi/mechglue/g_initialize.c index 41bbb78ac..e3984221b 100644 --- a/src/lib/gssapi/mechglue/g_initialize.c +++ b/src/lib/gssapi/mechglue/g_initialize.c @@ -63,7 +63,7 @@ static int _gss_initialized = 0; static struct gss_config null_mech = { {0,NULL}}; -gss_mechanism *__gss_mechs_array = NULL; +gss_mechanism *gssint_mechs_array = NULL; /* Local functions */ static gss_mech_info searchMechList(const gss_OID); @@ -198,7 +198,7 @@ gss_OID_set *mechSet; * this checks for the case when we need to re-construct the * g_mechSet structure, but the mechanism list is upto date * (because it has been read by someone calling - * __gss_get_mechanism) + * gssint_get_mechanism) */ if (fileInfo.st_mtime > g_confFileModTime) { @@ -343,7 +343,7 @@ gss_OID_set *mechSet; * caller is responsible for freeing the memory */ char * -__gss_get_modOptions(oid) +gssint_get_modOptions(oid) const gss_OID oid; { gss_mech_info aMech; @@ -370,13 +370,13 @@ const gss_OID oid; (void) k5_mutex_unlock(&g_mechListLock); return (modOptions); -} /* __gss_get_modOptions */ +} /* gssint_get_modOptions */ /* * given a mechanism string return the mechanism oid */ OM_uint32 -__gss_mech_to_oid(const char *mechStr, gss_OID* oid) +gssint_mech_to_oid(const char *mechStr, gss_OID* oid) { gss_mech_info aMech; @@ -406,7 +406,7 @@ __gss_mech_to_oid(const char *mechStr, gss_OID* oid) aMech = aMech->next; } return (GSS_S_FAILURE); -} /* __gss_mech_to_oid */ +} /* gssint_mech_to_oid */ /* @@ -415,7 +415,7 @@ __gss_mech_to_oid(const char *mechStr, gss_OID* oid) * (/etc/gss/mech). */ const char * -__gss_oid_to_mech(const gss_OID oid) +gssint_oid_to_mech(const gss_OID oid) { gss_mech_info aMech; @@ -431,7 +431,7 @@ __gss_oid_to_mech(const gss_OID oid) return (NULL); return (aMech->mechNameStr); -} /* __gss_oid_to_mech */ +} /* gssint_oid_to_mech */ /* @@ -439,7 +439,7 @@ __gss_oid_to_mech(const gss_OID oid) * upon return the array is terminated with a NULL entry */ OM_uint32 -__gss_get_mechanisms(char *mechArray[], int arrayLen) +gssint_get_mechanisms(char *mechArray[], int arrayLen) { gss_mech_info aMech; int i; @@ -522,7 +522,7 @@ init_hardcoded(void) * module if it has not been already loaded. */ gss_mechanism -__gss_get_mechanism(oid) +gssint_get_mechanism(oid) const gss_OID oid; { gss_mech_info aMech; @@ -596,10 +596,10 @@ const gss_OID oid; (void) k5_mutex_unlock(&g_mechListLock); return (aMech->mech); -} /* __gss_get_mechanism */ +} /* gssint_get_mechanism */ gss_mechanism_ext -__gss_get_mechanism_ext(oid) +gssint_get_mechanism_ext(oid) const gss_OID oid; { gss_mech_info aMech; @@ -609,7 +609,7 @@ const gss_OID oid; if ((aMech = searchMechList(oid)) != NULL && aMech->mech_ext != NULL) return (aMech->mech_ext); - if (__gss_get_mechanism(oid) == NULL) + if (gssint_get_mechanism(oid) == NULL) return (NULL); if (aMech->dl_handle == NULL) @@ -648,7 +648,7 @@ const gss_OID oid; return (aMech->mech_ext); -} /* __gss_get_mechanism_ext */ +} /* gssint_get_mechanism_ext */ /* diff --git a/src/lib/gssapi/mechglue/g_inq_context.c b/src/lib/gssapi/mechglue/g_inq_context.c index ec1ace62b..e717aa347 100644 --- a/src/lib/gssapi/mechglue/g_inq_context.c +++ b/src/lib/gssapi/mechglue/g_inq_context.c @@ -86,7 +86,7 @@ int * open; */ ctx = (gss_union_ctx_id_t) context_handle; - mech = __gss_get_mechanism (ctx->mech_type); + mech = gssint_get_mechanism (ctx->mech_type); if (!mech || !mech->gss_inquire_context || !mech->gss_display_name || !mech->gss_release_name) { @@ -112,7 +112,7 @@ int * open; /* need to convert names */ if (src_name) { - status = __gss_convert_name_to_union_name(minor_status, mech, + status = gssint_convert_name_to_union_name(minor_status, mech, localSourceName, src_name); if (status != GSS_S_COMPLETE) { @@ -125,7 +125,7 @@ int * open; } if (targ_name) { - status = __gss_convert_name_to_union_name(minor_status, mech, + status = gssint_convert_name_to_union_name(minor_status, mech, localTargName, targ_name); if (status != GSS_S_COMPLETE) { diff --git a/src/lib/gssapi/mechglue/g_inq_cred.c b/src/lib/gssapi/mechglue/g_inq_cred.c index 812fd9dab..3afbd94d8 100644 --- a/src/lib/gssapi/mechglue/g_inq_cred.c +++ b/src/lib/gssapi/mechglue/g_inq_cred.c @@ -76,7 +76,7 @@ gss_OID_set * mechanisms; * array, which becomes the default mechanism. */ - if ((mech = __gss_get_mechanism(GSS_C_NULL_OID)) == NULL) + if ((mech = gssint_get_mechanism(GSS_C_NULL_OID)) == NULL) return (GSS_S_DEFECTIVE_CREDENTIAL); if (!mech->gss_inquire_cred) @@ -94,7 +94,7 @@ gss_OID_set * mechanisms; /* * Convert internal_name into a union_name equivalent. */ - status = __gss_convert_name_to_union_name(&temp_minor_status, + status = gssint_convert_name_to_union_name(&temp_minor_status, mech, internal_name, name); if (status != GSS_S_COMPLETE) { @@ -217,14 +217,14 @@ gss_inquire_cred_by_mech(minor_status, cred_handle, mech_type, name, gss_name_t internal_name; - mech = __gss_get_mechanism (mech_type); + mech = gssint_get_mechanism (mech_type); if (!mech) return (GSS_S_BAD_MECH); if (!mech->gss_inquire_cred_by_mech) return (GSS_S_BAD_BINDINGS); union_cred = (gss_union_cred_t) cred_handle; - mech_cred = __gss_get_mechanism_cred(union_cred, mech_type); + mech_cred = gssint_get_mechanism_cred(union_cred, mech_type); if (mech_cred == NULL) return (GSS_S_DEFECTIVE_CREDENTIAL); @@ -241,7 +241,7 @@ gss_inquire_cred_by_mech(minor_status, cred_handle, mech_type, name, /* * Convert internal_name into a union_name equivalent. */ - status = __gss_convert_name_to_union_name( + status = gssint_convert_name_to_union_name( &temp_minor_status, mech, internal_name, name); if (status != GSS_S_COMPLETE) { diff --git a/src/lib/gssapi/mechglue/g_inq_names.c b/src/lib/gssapi/mechglue/g_inq_names.c index b1592bd44..a6e214f25 100644 --- a/src/lib/gssapi/mechglue/g_inq_names.c +++ b/src/lib/gssapi/mechglue/g_inq_names.c @@ -54,7 +54,7 @@ gss_OID_set * name_types; * call it. */ - mech = __gss_get_mechanism (mechanism); + mech = gssint_get_mechanism (mechanism); if (mech) { @@ -101,12 +101,12 @@ gss_inquire_mechs_for_name(minor_status, input_name, mech_set) if (status != GSS_S_COMPLETE) return (status); *mech_list = NULL; - status = __gss_get_mechanisms(mech_list, MAX_MECH_OID_PAIRS+1); + status = gssint_get_mechanisms(mech_list, MAX_MECH_OID_PAIRS+1); if (status != GSS_S_COMPLETE) return (status); for (i = 0; i < MAX_MECH_OID_PAIRS && mech_list[i] != NULL; i++) { mechanism = mech_list[i]; - if (__gss_mech_to_oid(mechanism, &mechOid) == GSS_S_COMPLETE) { + if (gssint_mech_to_oid(mechanism, &mechOid) == GSS_S_COMPLETE) { status = gss_inquire_names_for_mech( minor_status, mechOid, diff --git a/src/lib/gssapi/mechglue/g_oid_ops.c b/src/lib/gssapi/mechglue/g_oid_ops.c index a036d8763..86e57972d 100644 --- a/src/lib/gssapi/mechglue/g_oid_ops.c +++ b/src/lib/gssapi/mechglue/g_oid_ops.c @@ -33,7 +33,7 @@ #include "mglueP.h" /* should include to get protos #include "../generic/gssapiP_generic.h" */ -extern gss_mechanism *__gss_mechs_array; +extern gss_mechanism *gssint_mechs_array; /* * gss_release_oid has been moved to g_initialize, becasue it requires access diff --git a/src/lib/gssapi/mechglue/g_process_context.c b/src/lib/gssapi/mechglue/g_process_context.c index 83687df3e..beb65a141 100644 --- a/src/lib/gssapi/mechglue/g_process_context.c +++ b/src/lib/gssapi/mechglue/g_process_context.c @@ -58,7 +58,7 @@ gss_buffer_t token_buffer; */ ctx = (gss_union_ctx_id_t) context_handle; - mech = __gss_get_mechanism (ctx->mech_type); + mech = gssint_get_mechanism (ctx->mech_type); if (mech) { diff --git a/src/lib/gssapi/mechglue/g_rel_cred.c b/src/lib/gssapi/mechglue/g_rel_cred.c index e289f591c..ffcce2d7e 100644 --- a/src/lib/gssapi/mechglue/g_rel_cred.c +++ b/src/lib/gssapi/mechglue/g_rel_cred.c @@ -69,7 +69,7 @@ gss_cred_id_t * cred_handle; for(j=0; j < union_cred->count; j++) { - mech = __gss_get_mechanism (&union_cred->mechs_array[j]); + mech = gssint_get_mechanism (&union_cred->mechs_array[j]); if (union_cred->mechs_array[j].elements) free(union_cred->mechs_array[j].elements); diff --git a/src/lib/gssapi/mechglue/g_rel_name.c b/src/lib/gssapi/mechglue/g_rel_name.c index ffa678c26..ff3c4a10a 100644 --- a/src/lib/gssapi/mechglue/g_rel_name.c +++ b/src/lib/gssapi/mechglue/g_rel_name.c @@ -70,7 +70,7 @@ gss_name_t * input_name; free(union_name->external_name); if (union_name->mech_type) { - __gss_release_internal_name(minor_status, union_name->mech_type, + gssint_release_internal_name(minor_status, union_name->mech_type, &union_name->mech_name); gss_release_oid(minor_status, &union_name->mech_type); } diff --git a/src/lib/gssapi/mechglue/g_seal.c b/src/lib/gssapi/mechglue/g_seal.c index c68a6b031..2bc809621 100644 --- a/src/lib/gssapi/mechglue/g_seal.c +++ b/src/lib/gssapi/mechglue/g_seal.c @@ -70,7 +70,7 @@ gss_buffer_t output_message_buffer; */ ctx = (gss_union_ctx_id_t) context_handle; - mech = __gss_get_mechanism (ctx->mech_type); + mech = gssint_get_mechanism (ctx->mech_type); if (mech) { if (mech->gss_seal) @@ -149,7 +149,7 @@ gss_wrap_size_limit(minor_status, context_handle, conf_req_flag, */ ctx = (gss_union_ctx_id_t) context_handle; - mech = __gss_get_mechanism (ctx->mech_type); + mech = gssint_get_mechanism (ctx->mech_type); if (!mech) return (GSS_S_BAD_MECH); diff --git a/src/lib/gssapi/mechglue/g_sign.c b/src/lib/gssapi/mechglue/g_sign.c index f1f883f52..72e0ce742 100644 --- a/src/lib/gssapi/mechglue/g_sign.c +++ b/src/lib/gssapi/mechglue/g_sign.c @@ -67,7 +67,7 @@ gss_buffer_t msg_token; */ ctx = (gss_union_ctx_id_t) context_handle; - mech = __gss_get_mechanism (ctx->mech_type); + mech = gssint_get_mechanism (ctx->mech_type); if (mech) { if (mech->gss_sign) diff --git a/src/lib/gssapi/mechglue/g_store_cred.c b/src/lib/gssapi/mechglue/g_store_cred.c index 7ccbfcd7e..92581be85 100644 --- a/src/lib/gssapi/mechglue/g_store_cred.c +++ b/src/lib/gssapi/mechglue/g_store_cred.c @@ -55,14 +55,14 @@ gss_cred_usage_t *cred_usage_stored; /* desired_mech != GSS_C_NULL_OID -> store one element */ if (desired_mech != GSS_C_NULL_OID) { - mech = __gss_get_mechanism(desired_mech); + mech = gssint_get_mechanism(desired_mech); if (mech == NULL) return (GSS_S_BAD_MECH); if (mech->gss_store_cred == NULL) return (major_status); - mech_cred = __gss_get_mechanism_cred(union_cred, desired_mech); + mech_cred = gssint_get_mechanism_cred(union_cred, desired_mech); if (mech_cred == GSS_C_NO_CREDENTIAL) return (GSS_S_NO_CRED); @@ -84,14 +84,14 @@ gss_cred_usage_t *cred_usage_stored; for (i = 0; i < union_cred->count; i++) { /* Get mech and cred element */ dmech = &union_cred->mechs_array[i]; - mech = __gss_get_mechanism(dmech); + mech = gssint_get_mechanism(dmech); if (mech == NULL) continue; if (mech->gss_store_cred == NULL) continue; - mech_cred = __gss_get_mechanism_cred(union_cred, dmech); + mech_cred = gssint_get_mechanism_cred(union_cred, dmech); if (mech_cred == GSS_C_NO_CREDENTIAL) continue; /* can't happen, but safe to ignore */ diff --git a/src/lib/gssapi/mechglue/g_unseal.c b/src/lib/gssapi/mechglue/g_unseal.c index 8e975827f..c70c59beb 100644 --- a/src/lib/gssapi/mechglue/g_unseal.c +++ b/src/lib/gssapi/mechglue/g_unseal.c @@ -71,7 +71,7 @@ int * qop_state; */ ctx = (gss_union_ctx_id_t) context_handle; - mech = __gss_get_mechanism (ctx->mech_type); + mech = gssint_get_mechanism (ctx->mech_type); if (mech) { if (mech->gss_unseal) diff --git a/src/lib/gssapi/mechglue/g_userok.c b/src/lib/gssapi/mechglue/g_userok.c index eaf376ea8..ecd822430 100644 --- a/src/lib/gssapi/mechglue/g_userok.c +++ b/src/lib/gssapi/mechglue/g_userok.c @@ -69,7 +69,7 @@ out: OM_uint32 -__gss_userok(OM_uint32 *minor, +gssint_userok(OM_uint32 *minor, const gss_name_t name, const char *user, int *user_ok) @@ -91,7 +91,7 @@ __gss_userok(OM_uint32 *minor, intName = (gss_union_name_t)name; - mech = __gss_get_mechanism(intName->mech_type); + mech = gssint_get_mechanism(intName->mech_type); if (mech == NULL) return (GSS_S_UNAVAILABLE); @@ -101,8 +101,8 @@ __gss_userok(OM_uint32 *minor, } else mechName = intName->mech_name; - if (mech->__gss_userok) - major = mech->__gss_userok(mech->context, minor, mechName, + if (mech->gssint_userok) + major = mech->gssint_userok(mech->context, minor, mechName, user, user_ok); else major = compare_names(minor, intName->mech_type, diff --git a/src/lib/gssapi/mechglue/g_utils.c b/src/lib/gssapi/mechglue/g_utils.c index 875e159f7..b26335382 100644 --- a/src/lib/gssapi/mechglue/g_utils.c +++ b/src/lib/gssapi/mechglue/g_utils.c @@ -24,7 +24,7 @@ static const char QOP_NUM_FILE[] = "/etc/gss/qop"; static qop_num qop_num_pairs[MAX_QOP_NUM_PAIRS+1]; static mutex_t qopfile_lock = DEFAULTMUTEX; -static OM_uint32 __gss_read_qop_file(void); +static OM_uint32 gssint_read_qop_file(void); /* * This routine fetches qop and num from "/etc/gss/qop". @@ -35,7 +35,7 @@ static OM_uint32 __gss_read_qop_file(void); * we don't expect the qop file to be changed and reread often. */ static OM_uint32 -__gss_read_qop_file(void) +gssint_read_qop_file(void) { char buf[BUFLEN]; /* one line from the file */ char *name, *next; @@ -141,7 +141,7 @@ done: } OM_uint32 -__gss_qop_to_num( +gssint_qop_to_num( char *qop, char *mech, OM_uint32 *num @@ -159,7 +159,7 @@ __gss_qop_to_num( return (GSS_S_COMPLETE); } - if ((major = __gss_read_qop_file()) != GSS_S_COMPLETE) + if ((major = gssint_read_qop_file()) != GSS_S_COMPLETE) return (major); for (i = 0; i < qop_num_pair_cnt; i++) { @@ -174,7 +174,7 @@ __gss_qop_to_num( } OM_uint32 -__gss_num_to_qop( +gssint_num_to_qop( char *mech, OM_uint32 num, char **qop @@ -195,7 +195,7 @@ __gss_num_to_qop( if (mech == NULL) return (GSS_S_CALL_INACCESSIBLE_READ); - if ((major = __gss_read_qop_file()) != GSS_S_COMPLETE) + if ((major = gssint_read_qop_file()) != GSS_S_COMPLETE) return (major); for (i = 0; i < qop_num_pair_cnt; i++) { @@ -213,7 +213,7 @@ __gss_num_to_qop( * of size MAX_QOPS_PER_MECH+1. */ OM_uint32 -__gss_get_mech_info( +gssint_get_mech_info( char *mech, char **qops ) @@ -228,7 +228,7 @@ __gss_get_mech_info( if (!mech) return (GSS_S_CALL_INACCESSIBLE_READ); - if ((major = __gss_read_qop_file()) != GSS_S_COMPLETE) + if ((major = gssint_read_qop_file()) != GSS_S_COMPLETE) return (major); for (i = 0; i < qop_num_pair_cnt; i++) { @@ -248,7 +248,7 @@ __gss_get_mech_info( * buffer of size MAX_QOPS_PER_MECH provided by the caller. */ OM_uint32 -__gss_mech_qops( +gssint_mech_qops( char *mech, qop_num *mechqops, int *numqop @@ -265,7 +265,7 @@ __gss_mech_qops( if (!mech) return (GSS_S_CALL_INACCESSIBLE_READ); - if ((major = __gss_read_qop_file()) != GSS_S_COMPLETE) + if ((major = gssint_read_qop_file()) != GSS_S_COMPLETE) return (major); for (i = 0; i < qop_num_pair_cnt; i++) { diff --git a/src/lib/gssapi/mechglue/g_verify.c b/src/lib/gssapi/mechglue/g_verify.c index 4f2415566..e6a01282a 100644 --- a/src/lib/gssapi/mechglue/g_verify.c +++ b/src/lib/gssapi/mechglue/g_verify.c @@ -63,7 +63,7 @@ int * qop_state; */ ctx = (gss_union_ctx_id_t) context_handle; - mech = __gss_get_mechanism (ctx->mech_type); + mech = gssint_get_mechanism (ctx->mech_type); if (mech) { if (mech->gss_verify) diff --git a/src/lib/gssapi/mechglue/gssd_pname_to_uid.c b/src/lib/gssapi/mechglue/gssd_pname_to_uid.c index 036ae904f..f15b16c5d 100644 --- a/src/lib/gssapi/mechglue/gssd_pname_to_uid.c +++ b/src/lib/gssapi/mechglue/gssd_pname_to_uid.c @@ -47,7 +47,7 @@ uid_t * uid; * call it. */ - mech = __gss_get_mechanism (mech_type); + mech = gssint_get_mechanism (mech_type); if (mech) { if (mech_type == GSS_C_NULL_OID) diff --git a/src/lib/gssapi/mechglue/mglueP.h b/src/lib/gssapi/mechglue/mglueP.h index 20f5ea655..704c22d50 100644 --- a/src/lib/gssapi/mechglue/mglueP.h +++ b/src/lib/gssapi/mechglue/mglueP.h @@ -360,7 +360,7 @@ typedef struct gss_config { gss_OID, /* mech type */ uid_t * /* uid */ ); - OM_uint32 (*__gss_userok) + OM_uint32 (*gssint_userok) ( void *, /* context */ OM_uint32 *, /* minor_status */ @@ -419,31 +419,31 @@ typedef struct gss_mech_config { int gssint_mechglue_init(void); void gssint_mechglue_fini(void); -gss_mechanism __gss_get_mechanism (gss_OID); -gss_mechanism_ext __gss_get_mechanism_ext(const gss_OID); -OM_uint32 __gss_get_mech_type (gss_OID, gss_buffer_t); -char *__gss_get_kmodName(const gss_OID); -char *__gss_get_modOptions(const gss_OID); -OM_uint32 __gss_import_internal_name (OM_uint32 *, gss_OID, gss_union_name_t, +gss_mechanism gssint_get_mechanism (gss_OID); +gss_mechanism_ext gssint_get_mechanism_ext(const gss_OID); +OM_uint32 gssint_get_mech_type (gss_OID, gss_buffer_t); +char *gssint_get_kmodName(const gss_OID); +char *gssint_get_modOptions(const gss_OID); +OM_uint32 gssint_import_internal_name (OM_uint32 *, gss_OID, gss_union_name_t, gss_name_t *); -OM_uint32 __gss_export_internal_name(OM_uint32 *, const gss_OID, +OM_uint32 gssint_export_internal_name(OM_uint32 *, const gss_OID, const gss_name_t, gss_buffer_t); -OM_uint32 __gss_display_internal_name (OM_uint32 *, gss_OID, gss_name_t, +OM_uint32 gssint_display_internal_name (OM_uint32 *, gss_OID, gss_name_t, gss_buffer_t, gss_OID *); -OM_uint32 __gss_release_internal_name (OM_uint32 *, gss_OID, gss_name_t *); +OM_uint32 gssint_release_internal_name (OM_uint32 *, gss_OID, gss_name_t *); -OM_uint32 __gss_convert_name_to_union_name +OM_uint32 gssint_convert_name_to_union_name (OM_uint32 *, /* minor_status */ gss_mechanism, /* mech */ gss_name_t, /* internal_name */ gss_name_t * /* external_name */ ); -gss_cred_id_t __gss_get_mechanism_cred +gss_cred_id_t gssint_get_mechanism_cred (gss_union_cred_t, /* union_cred */ gss_OID /* mech_type */ ); -OM_uint32 __gss_create_copy_buffer( +OM_uint32 gssint_create_copy_buffer( const gss_buffer_t, /* src buffer */ gss_buffer_t *, /* destination buffer */ int /* NULL terminate buffer ? */ @@ -509,24 +509,24 @@ OM_uint32 gss_add_mech_name_type */ OM_uint32 -__gss_mech_to_oid( +gssint_mech_to_oid( const char *mech, /* mechanism string name */ gss_OID *oid /* mechanism oid */ ); const char * -__gss_oid_to_mech( +gssint_oid_to_mech( const gss_OID oid /* mechanism oid */ ); OM_uint32 -__gss_get_mechanisms( +gssint_get_mechanisms( char *mechArray[], /* array to populate with mechs */ int arrayLen /* length of passed in array */ ); OM_uint32 -__gss_userok( +gssint_userok( OM_uint32 *, /* minor */ const gss_name_t, /* name */ const char *, /* user */ @@ -546,17 +546,17 @@ gss_store_cred( ); int -get_der_length( +gssint_get_der_length( unsigned char **, /* buf */ unsigned int, /* buf_len */ unsigned int * /* bytes */ ); unsigned int -der_length_size(unsigned int /* len */); +gssint_der_length_size(unsigned int /* len */); int -put_der_length( +gssint_put_der_length( unsigned int, /* length */ unsigned char **, /* buf */ unsigned int /* max_len */ diff --git a/src/lib/gssapi/spnego/ChangeLog b/src/lib/gssapi/spnego/ChangeLog new file mode 100644 index 000000000..25da0b256 --- /dev/null +++ b/src/lib/gssapi/spnego/ChangeLog @@ -0,0 +1,4 @@ +2006-03-10 Tom Yu + + * gssapiP_spnego.h, spnego_mech.c: Rename symbols for namespace + purity. diff --git a/src/lib/gssapi/spnego/spnego_mech.c b/src/lib/gssapi/spnego/spnego_mech.c index 0f165ee5e..17433312f 100644 --- a/src/lib/gssapi/spnego/spnego_mech.c +++ b/src/lib/gssapi/spnego/spnego_mech.c @@ -12,16 +12,15 @@ #include #include +#include #include "gssapiP_spnego.h" #include #include -#include -#include /* der routines defined in libgss */ -extern unsigned int der_length_size(OM_uint32); -extern int get_der_length(uchar_t **, OM_uint32, OM_uint32*); -extern int put_der_length(OM_uint32, uchar_t **, OM_uint32); +extern unsigned int gssint_der_length_size(OM_uint32); +extern int gssint_get_der_length(uchar_t **, OM_uint32, OM_uint32*); +extern int gssint_put_der_length(OM_uint32, uchar_t **, OM_uint32); /* private routines for spnego_mechanism */ @@ -49,7 +48,7 @@ static int put_negResult(uchar_t **, OM_uint32, int); static gss_OID negotiate_mech_type(OM_uint32 *, gss_OID_set, gss_OID_set, - OM_uint32 *, bool_t *); + OM_uint32 *, krb5_boolean *); static int g_get_tag_and_length(unsigned char **, uchar_t, int, int *); @@ -99,7 +98,7 @@ static struct gss_config spnego_mechanism = NULL, /* gss_internal_release_oid */ spnego_gss_wrap_size_limit, /* gss_wrap_size_limit */ NULL, /* gss_pname_to_uid */ - NULL, /* __gss_userok */ + NULL, /* gssint_userok */ NULL, /* gss_export_name */ /* EXPORT DELETE START */ /* CRYPT DELETE START */ @@ -212,7 +211,7 @@ spnego_gss_release_cred(void *ctx, static void check_spnego_options(spnego_gss_ctx_id_t spnego_ctx) { - spnego_ctx->optionStr = __gss_get_modOptions( + spnego_ctx->optionStr = gssint_get_modOptions( (const gss_OID)&spnego_oids[0]); if (spnego_ctx->optionStr != NULL && strstr(spnego_ctx->optionStr, "msinterop")) { @@ -700,8 +699,8 @@ spnego_gss_accept_sec_context(void *ct, OM_uint32 mechsetlen; gss_qop_t qop_state; send_token_flag return_token = NO_TOKEN_SEND; - bool_t firstMech; - bool_t Need_Cred = FALSE; + krb5_boolean firstMech; + krb5_boolean Need_Cred = FALSE; OM_uint32 local_ret_flags = 0; uchar_t *buf, *tmp; @@ -1112,23 +1111,23 @@ spnego_gss_display_status(void *ctx, switch (status_value) { case ERR_SPNEGO_NO_MECHS_AVAILABLE: /* CSTYLED */ - *status_string = make_err_msg(gettext("SPNEGO cannot find mechanisms to negotiate")); + *status_string = make_err_msg("SPNEGO cannot find mechanisms to negotiate"); break; case ERR_SPNEGO_NO_CREDS_ACQUIRED: /* CSTYLED */ - *status_string = make_err_msg(gettext("SPNEGO failed to acquire creds")); + *status_string = make_err_msg("SPNEGO failed to acquire creds"); break; case ERR_SPNEGO_NO_MECH_FROM_ACCEPTOR: /* CSTYLED */ - *status_string = make_err_msg(gettext("SPNEGO acceptor did not select a mechanism")); + *status_string = make_err_msg("SPNEGO acceptor did not select a mechanism"); break; case ERR_SPNEGO_NEGOTIATION_FAILED: /* CSTYLED */ - *status_string = make_err_msg(gettext("SPNEGO failed to negotiate a mechanism")); + *status_string = make_err_msg("SPNEGO failed to negotiate a mechanism"); break; case ERR_SPNEGO_NO_TOKEN_FROM_ACCEPTOR: /* CSTYLED */ - *status_string = make_err_msg(gettext("SPNEGO acceptor did not return a valid token")); + *status_string = make_err_msg("SPNEGO acceptor did not return a valid token"); break; default: status_string->length = 0; @@ -1627,7 +1626,7 @@ get_input_token(unsigned char **buff_in, int buff_length) if (input_token == NULL) return (NULL); - input_token->length = get_der_length(buff_in, buff_length, &bytes); + input_token->length = gssint_get_der_length(buff_in, buff_length, &bytes); if ((int)input_token->length == -1) { free(input_token); return (NULL); @@ -1664,7 +1663,7 @@ put_input_token(unsigned char **buf_out, gss_buffer_t input_token, return (-1); *(*buf_out)++ = OCTET_STRING; - if ((ret = put_der_length(input_token->length, buf_out, + if ((ret = gssint_put_der_length(input_token->length, buf_out, input_token->length))) return (ret); TWRITE_STR(*buf_out, input_token->value, ((int)input_token->length)); @@ -1694,7 +1693,7 @@ get_mech_set(OM_uint32 *minor_status, unsigned char **buff_in, int buff_length) start = *buff_in; (*buff_in)++; - length = get_der_length(buff_in, buff_length, &bytes); + length = gssint_get_der_length(buff_in, buff_length, &bytes); major_status = gss_create_empty_oid_set(minor_status, &returned_mechSet); @@ -1741,13 +1740,13 @@ put_mech_set(uchar_t **buf_out, gss_OID_set mechSet, int buflen) * 1 = 0x06, 1 for length of OID * typically, less than 128, so only 1 byte needed. */ - length += 1 + der_length_size(mechSet->elements[i].length) + + length += 1 + gssint_der_length_size(mechSet->elements[i].length) + mechSet->elements[i].length; } if (length > (buflen-1)) return (-1); - if (put_der_length(length, buf_out, buflen-1) < 0) + if (gssint_put_der_length(length, buf_out, buflen-1) < 0) return (-1); for (i = 0; i < mechSet->count; i++) { @@ -1803,7 +1802,7 @@ put_req_flags(unsigned char **buf_out, OM_uint32 req_flags, int buflen) return (-1); *(*buf_out)++ = CONTEXT | 0x01; - if ((ret = put_der_length(4, buf_out, buflen-1)) != 0) + if ((ret = gssint_put_der_length(4, buf_out, buflen-1)) != 0) return (ret); *(*buf_out)++ = BIT_STRING; @@ -1832,7 +1831,7 @@ get_negResult(unsigned char **buff_in, int bodysize) return (ACCEPT_DEFECTIVE_TOKEN); if (*(*buff_in)++ == SEQUENCE) { - if ((len = get_der_length(buff_in, + if ((len = gssint_get_der_length(buff_in, bodysize - (*buff_in - iptr), &bytes)) < 0) return (ACCEPT_DEFECTIVE_TOKEN); @@ -1846,7 +1845,7 @@ get_negResult(unsigned char **buff_in, int bodysize) * Anything else unexpected, we reject. */ if (*(*buff_in)++ == CONTEXT) { - if ((len = get_der_length(buff_in, bodysize - + if ((len = gssint_get_der_length(buff_in, bodysize - (*buff_in - iptr), &bytes)) < 0) return (ACCEPT_DEFECTIVE_TOKEN); } else { @@ -1907,7 +1906,7 @@ negotiate_mech_type(OM_uint32 *minor_status, gss_OID_set supported_mechSet, gss_OID_set mechset, OM_uint32 *negResult, - bool_t *firstMech) + krb5_boolean *firstMech) { gss_OID returned_mech; OM_uint32 status; @@ -2026,11 +2025,11 @@ make_spnego_tokenInit_msg(spnego_gss_ctx_id_t spnego_ctx, */ for (i = 0; i < mechSet->count; i++) MechSetLen += 1 + - der_length_size(mechSet->elements[i].length) + + gssint_der_length_size(mechSet->elements[i].length) + mechSet->elements[i].length; - MechSetLen += 1 + der_length_size(MechSetLen); - dataLen += 1 + der_length_size(MechSetLen) + MechSetLen; + MechSetLen += 1 + gssint_der_length_size(MechSetLen); + dataLen += 1 + gssint_der_length_size(MechSetLen) + MechSetLen; MechListPtr = (uchar_t *)malloc(dataLen); ptr = (uchar_t *)MechListPtr; @@ -2079,10 +2078,10 @@ make_spnego_tokenInit_msg(spnego_gss_ctx_id_t spnego_ctx, * 0xa3 [DER LEN] 0x04 [DER LEN] [DATA] * --s-- -------tlen------------ */ - tlen = 1 + der_length_size(MICbuff.length) + + tlen = 1 + gssint_der_length_size(MICbuff.length) + MICbuff.length; - dataLen += 1 + der_length_size(tlen) + tlen; + dataLen += 1 + gssint_der_length_size(tlen) + tlen; } } @@ -2105,9 +2104,9 @@ make_spnego_tokenInit_msg(spnego_gss_ctx_id_t spnego_ctx, * 0xa2 [DER LEN] 0x04 [DER LEN] [DATA] * -----s--------|--------s2---------- */ - tlen = 1 + der_length_size(data->length) + data->length; + tlen = 1 + gssint_der_length_size(data->length) + data->length; - dataLen += 1 + der_length_size(tlen) + tlen; + dataLen += 1 + gssint_der_length_size(tlen) + tlen; } /* @@ -2116,7 +2115,7 @@ make_spnego_tokenInit_msg(spnego_gss_ctx_id_t spnego_ctx, * 0x30 [DER_LEN] [data] * */ - dataLen += 1 + der_length_size(dataLen); + dataLen += 1 + gssint_der_length_size(dataLen); /* * negTokenInitSize indicates the bytes needed to @@ -2129,7 +2128,7 @@ make_spnego_tokenInit_msg(spnego_gss_ctx_id_t spnego_ctx, tlen = g_token_size((gss_OID)gss_mech_spnego, negTokenInitSize + 1 + - der_length_size(negTokenInitSize)); + gssint_der_length_size(negTokenInitSize)); t = (unsigned char *) malloc(tlen); @@ -2142,22 +2141,22 @@ make_spnego_tokenInit_msg(spnego_gss_ctx_id_t spnego_ctx, /* create the message */ if ((ret = g_make_token_header((gss_OID)gss_mech_spnego, 1 + negTokenInitSize + - der_length_size(negTokenInitSize), + gssint_der_length_size(negTokenInitSize), &ptr, tlen))) goto errout; if (sendtoken == INIT_TOKEN_SEND) { *ptr++ = CONTEXT; /* NegotiationToken identifier */ - if ((ret = put_der_length(negTokenInitSize, &ptr, tlen))) + if ((ret = gssint_put_der_length(negTokenInitSize, &ptr, tlen))) goto errout; *ptr++ = SEQUENCE; - if ((ret = put_der_length(negTokenInitSize - 4, &ptr, + if ((ret = gssint_put_der_length(negTokenInitSize - 4, &ptr, tlen - (int)(ptr-t)))) goto errout; *ptr++ = CONTEXT; /* MechTypeList identifier */ - if ((ret = put_der_length(spnego_ctx->DER_mechTypes.length, + if ((ret = gssint_put_der_length(spnego_ctx->DER_mechTypes.length, &ptr, tlen - (int)(ptr-t)))) goto errout; @@ -2176,7 +2175,7 @@ make_spnego_tokenInit_msg(spnego_gss_ctx_id_t spnego_ctx, if (data != NULL) { *ptr++ = CONTEXT | 0x02; - if ((ret = put_der_length(data->length + 4, + if ((ret = gssint_put_der_length(data->length + 4, &ptr, tlen - (int)(ptr - t)))) goto errout; @@ -2194,7 +2193,7 @@ make_spnego_tokenInit_msg(spnego_gss_ctx_id_t spnego_ctx, if (!spnego_ctx->MS_Interop && MICbuff.length > 0) { /* We already calculated the MechListMIC above */ *ptr++ = CONTEXT | 0x03; - if ((ret = put_der_length(MICbuff.length, + if ((ret = gssint_put_der_length(MICbuff.length, &ptr, tlen - (int)(ptr - t)))) goto errout; @@ -2271,7 +2270,7 @@ make_spnego_tokenTarg_msg(OM_uint32 status, gss_OID mech_wanted, * Plus the rest... (OID Length, OID value) */ mechlistTokenSize = 3 + mech_wanted->length + - der_length_size(mech_wanted->length); + gssint_der_length_size(mech_wanted->length); dataLen = negresultTokenSize + mechlistTokenSize; } @@ -2285,27 +2284,27 @@ make_spnego_tokenTarg_msg(OM_uint32 status, gss_OID mech_wanted, } if (data != NULL && data->length > 0) { /* Length of the inner token */ - rspTokenSize = 1 + der_length_size(data->length) + + rspTokenSize = 1 + gssint_der_length_size(data->length) + data->length; dataLen += rspTokenSize; /* Length of the outer token */ - dataLen += 1 + der_length_size(rspTokenSize); + dataLen += 1 + gssint_der_length_size(rspTokenSize); } if (mechListMIC != NULL) { /* Length of the inner token */ - micTokenSize = 1 + der_length_size(mechListMIC->length) + + micTokenSize = 1 + gssint_der_length_size(mechListMIC->length) + mechListMIC->length; dataLen += micTokenSize; /* Length of the outer token */ - dataLen += 1 + der_length_size(micTokenSize); + dataLen += 1 + gssint_der_length_size(micTokenSize); } else if (data != NULL && data->length > 0 && MS_Flag) { dataLen += rspTokenSize; - dataLen += 1 + der_length_size(rspTokenSize); + dataLen += 1 + gssint_der_length_size(rspTokenSize); } /* @@ -2323,7 +2322,7 @@ make_spnego_tokenTarg_msg(OM_uint32 status, gss_OID mech_wanted, * Result Length + ASN.1 overhead */ NegTokenTargSize = dataLen; - dataLen += 1 + der_length_size(NegTokenTargSize); + dataLen += 1 + gssint_der_length_size(NegTokenTargSize); /* * NegotiationToken [ CHOICE ]{ @@ -2331,7 +2330,7 @@ make_spnego_tokenTarg_msg(OM_uint32 status, gss_OID mech_wanted, * negTokenTarg [1] NegTokenTarg } */ NegTokenSize = dataLen; - dataLen += 1 + der_length_size(NegTokenSize); + dataLen += 1 + gssint_der_length_size(NegTokenSize); tlen = dataLen; t = (unsigned char *) malloc(tlen); @@ -2350,13 +2349,13 @@ make_spnego_tokenTarg_msg(OM_uint32 status, gss_OID mech_wanted, * (NegTokenTarg) */ *ptr++ = CONTEXT | 0x01; - if ((ret = put_der_length(NegTokenSize, &ptr, dataLen))) { + if ((ret = gssint_put_der_length(NegTokenSize, &ptr, dataLen))) { ret = GSS_S_DEFECTIVE_TOKEN; goto errout; } *ptr++ = SEQUENCE; - if ((ret = put_der_length(NegTokenTargSize, &ptr, + if ((ret = gssint_put_der_length(NegTokenTargSize, &ptr, tlen - (int)(ptr-t)))) { ret = GSS_S_DEFECTIVE_TOKEN; goto errout; @@ -2367,7 +2366,7 @@ make_spnego_tokenTarg_msg(OM_uint32 status, gss_OID mech_wanted, * is the ENUMERATED NegResult. */ *ptr++ = CONTEXT; - if ((ret = put_der_length(3, &ptr, + if ((ret = gssint_put_der_length(3, &ptr, tlen - (int)(ptr-t)))) { ret = GSS_S_DEFECTIVE_TOKEN; goto errout; @@ -2383,7 +2382,7 @@ make_spnego_tokenTarg_msg(OM_uint32 status, gss_OID mech_wanted, * Next, is the Supported MechType */ *ptr++ = CONTEXT | 0x01; - if ((ret = put_der_length(mech_wanted->length + 2, + if ((ret = gssint_put_der_length(mech_wanted->length + 2, &ptr, tlen - (int)(ptr - t)))) { ret = GSS_S_DEFECTIVE_TOKEN; goto errout; @@ -2398,7 +2397,7 @@ make_spnego_tokenTarg_msg(OM_uint32 status, gss_OID mech_wanted, if (data != NULL && data->length > 0) { *ptr++ = CONTEXT | 0x02; - if ((ret = put_der_length(rspTokenSize, &ptr, + if ((ret = gssint_put_der_length(rspTokenSize, &ptr, tlen - (int)(ptr - t)))) { ret = GSS_S_DEFECTIVE_TOKEN; goto errout; @@ -2411,7 +2410,7 @@ make_spnego_tokenTarg_msg(OM_uint32 status, gss_OID mech_wanted, } if (mechListMIC != NULL) { *ptr++ = CONTEXT | 0x03; - if ((ret = put_der_length(micTokenSize, &ptr, + if ((ret = gssint_put_der_length(micTokenSize, &ptr, tlen - (int)(ptr - t)))) { ret = GSS_S_DEFECTIVE_TOKEN; goto errout; @@ -2423,7 +2422,7 @@ make_spnego_tokenTarg_msg(OM_uint32 status, gss_OID mech_wanted, } } else if (data != NULL && data->length > 0 && MS_Flag) { *ptr++ = CONTEXT | 0x03; - if ((ret = put_der_length(rspTokenSize, &ptr, + if ((ret = gssint_put_der_length(rspTokenSize, &ptr, tlen - (int)(ptr - t)))) { ret = GSS_S_DEFECTIVE_TOKEN; goto errout; @@ -2458,14 +2457,14 @@ g_token_size(gss_OID mech, unsigned int body_size) * * 0x06 [MECHLENFIELD] MECHDATA */ - hdrsize = 1 + der_length_size(mech->length) + mech->length; + hdrsize = 1 + gssint_der_length_size(mech->length) + mech->length; /* * Now add the bytes needed for the initial header * token bytes: * 0x60 + [DER_LEN] + HDRSIZE */ - hdrsize += 1 + der_length_size(body_size + hdrsize); + hdrsize += 1 + gssint_der_length_size(body_size + hdrsize); return (hdrsize + body_size); } @@ -2486,14 +2485,14 @@ g_make_token_header(gss_OID mech, int hdrsize, ret = 0; unsigned char *p = *buf; - hdrsize = 1 + der_length_size(mech->length) + mech->length; + hdrsize = 1 + gssint_der_length_size(mech->length) + mech->length; *(*buf)++ = HEADER_ID; - if ((ret = put_der_length(hdrsize + body_size, buf, totallen))) + if ((ret = gssint_put_der_length(hdrsize + body_size, buf, totallen))) return (ret); *(*buf)++ = MECH_OID; - if ((ret = put_der_length(mech->length, buf, + if ((ret = gssint_put_der_length(mech->length, buf, totallen - (int)(p - *buf)))) return (ret); TWRITE_STR(*buf, mech->elements, ((int)mech->length)); @@ -2509,7 +2508,7 @@ g_get_tag_and_length(unsigned char **buf, uchar_t tag, int buflen, int *outlen) if (buflen > 0 && *ptr == tag) { ptr++; - *outlen = get_der_length(&ptr, buflen, &encoded_len); + *outlen = gssint_get_der_length(&ptr, buflen, &encoded_len); if (*outlen < 0) ret = *outlen; if ((ptr + *outlen) > (*buf + buflen)) @@ -2546,7 +2545,7 @@ g_verify_neg_token_init(unsigned char **buf_in, int cur_size) * a strucure of type NegTokenInit. */ if (*buf++ == SEQUENCE) { - if ((seqsize = get_der_length(&buf, cur_size, &bytes)) < 0) + if ((seqsize = gssint_get_der_length(&buf, cur_size, &bytes)) < 0) return (G_BAD_TOK_HEADER); /* * Make sure we have the entire buffer as described @@ -2563,7 +2562,7 @@ g_verify_neg_token_init(unsigned char **buf_in, int cur_size) * Verify that the first blob is a sequence of mechTypes */ if (*buf++ == CONTEXT) { - if ((seqsize = get_der_length(&buf, cur_size, &bytes)) < 0) + if ((seqsize = gssint_get_der_length(&buf, cur_size, &bytes)) < 0) return (G_BAD_TOK_HEADER); /* * Make sure we have the entire buffer as described @@ -2604,7 +2603,7 @@ g_verify_token_header(gss_OID mech, if (*buf++ != HEADER_ID) return (G_BAD_TOK_HEADER); - if ((seqsize = get_der_length(&buf, toksize, &bytes)) < 0) + if ((seqsize = gssint_get_der_length(&buf, toksize, &bytes)) < 0) return (G_BAD_TOK_HEADER); if ((seqsize + bytes) != toksize)