+2006-03-10 Tom Yu <tlyu@mit.edu>
+
+ * krb5_gss_glue.c: Rename symbols for namespace purity.
+
2005-11-14 Jeffrey Altman <jaltman@mit.edu>
* gssapi_krb5.hin: include k5-int.h instead of krb5.h
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);
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,
+2006-03-10 Tom Yu <tlyu@mit.edu>
+
+ * 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 <tlyu@mit.edu>
* g_acquire_cred.c (gss_add_cred): Maintain old default-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;
* 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(
* 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) {
}
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) {
* 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);
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)
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);
&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);
/* 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);
&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);
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;
*/
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,
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;
*/
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);
}
* 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)
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);
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);
*/
ctx = (gss_union_ctx_id_t) context_handle;
- mech = __gss_get_mechanism (ctx->mech_type);
+ mech = gssint_get_mechanism (ctx->mech_type);
if (mech) {
*/
ctx = (gss_union_ctx_id_t) *context_handle;
- mech = __gss_get_mechanism (ctx->mech_type);
+ mech = gssint_get_mechanism (ctx->mech_type);
if (mech) {
/*
* 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,
* 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)
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;
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);
(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)
*/
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)
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);
}
#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.
* 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;
* 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;
* 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;
*
*/
-OM_uint32 __gss_get_mech_type(OID, token)
+OM_uint32 gssint_get_mech_type(OID, token)
gss_OID OID;
gss_buffer_t 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;
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 (
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;
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);
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 +
* 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);
/* 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;
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 (
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;
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 (
* 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;
* 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);
}
* 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;
{
* 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;
((char *)aBuf->value)[aBuf->length] = '\0';
return (GSS_S_COMPLETE);
-} /* ****** __gss_create_copy_buffer ****** */
+} /* ****** gssint_create_copy_buffer ****** */
* 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);
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);
* 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;
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)
* 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
* 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;
#endif
#include <string.h>
-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;
/* 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 =
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);
}
}
* 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);
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);
* 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
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);
}
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);
* 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)
{
* caller is responsible for freeing the memory
*/
char *
-__gss_get_modOptions(oid)
+gssint_get_modOptions(oid)
const gss_OID oid;
{
gss_mech_info aMech;
(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;
aMech = aMech->next;
}
return (GSS_S_FAILURE);
-} /* __gss_mech_to_oid */
+} /* gssint_mech_to_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;
return (NULL);
return (aMech->mechNameStr);
-} /* __gss_oid_to_mech */
+} /* gssint_oid_to_mech */
/*
* 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;
* 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;
(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;
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)
return (aMech->mech_ext);
-} /* __gss_get_mechanism_ext */
+} /* gssint_get_mechanism_ext */
/*
*/
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) {
/* 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) {
}
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) {
* 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)
/*
* 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) {
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);
/*
* 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) {
* call it.
*/
- mech = __gss_get_mechanism (mechanism);
+ mech = gssint_get_mechanism (mechanism);
if (mech) {
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,
#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
*/
ctx = (gss_union_ctx_id_t) context_handle;
- mech = __gss_get_mechanism (ctx->mech_type);
+ mech = gssint_get_mechanism (ctx->mech_type);
if (mech) {
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);
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);
}
*/
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)
*/
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);
*/
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)
/* 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);
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 */
*/
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)
OM_uint32
-__gss_userok(OM_uint32 *minor,
+gssint_userok(OM_uint32 *minor,
const gss_name_t name,
const char *user,
int *user_ok)
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);
} 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,
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".
* 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;
}
OM_uint32
-__gss_qop_to_num(
+gssint_qop_to_num(
char *qop,
char *mech,
OM_uint32 *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++) {
}
OM_uint32
-__gss_num_to_qop(
+gssint_num_to_qop(
char *mech,
OM_uint32 num,
char **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++) {
* of size MAX_QOPS_PER_MECH+1.
*/
OM_uint32
-__gss_get_mech_info(
+gssint_get_mech_info(
char *mech,
char **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++) {
* 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
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++) {
*/
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)
* call it.
*/
- mech = __gss_get_mechanism (mech_type);
+ mech = gssint_get_mechanism (mech_type);
if (mech) {
if (mech_type == GSS_C_NULL_OID)
gss_OID, /* mech type */
uid_t * /* uid */
);
- OM_uint32 (*__gss_userok)
+ OM_uint32 (*gssint_userok)
(
void *, /* context */
OM_uint32 *, /* minor_status */
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 ? */
*/
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 */
);
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 */
--- /dev/null
+2006-03-10 Tom Yu <tlyu@mit.edu>
+
+ * gssapiP_spnego.h, spnego_mech.c: Rename symbols for namespace
+ purity.
#include <stdio.h>
#include <stdlib.h>
+#include <krb5.h>
#include "gssapiP_spnego.h"
#include <mglueP.h>
#include <gssapi_err_generic.h>
-#include <rpc/types.h>
-#include <libintl.h>
/* 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 */
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 *);
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 */
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")) {
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;
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;
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);
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));
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);
* 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++) {
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;
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);
* 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 {
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;
*/
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;
* 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;
}
}
* 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;
}
/*
* 0x30 [DER_LEN] [data]
*
*/
- dataLen += 1 + der_length_size(dataLen);
+ dataLen += 1 + gssint_der_length_size(dataLen);
/*
* negTokenInitSize indicates the bytes needed to
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);
/* 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;
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;
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;
* 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;
}
}
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);
}
/*
* Result Length + ASN.1 overhead
*/
NegTokenTargSize = dataLen;
- dataLen += 1 + der_length_size(NegTokenTargSize);
+ dataLen += 1 + gssint_der_length_size(NegTokenTargSize);
/*
* NegotiationToken [ CHOICE ]{
* 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);
* (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;
* 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;
* 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;
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;
}
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;
}
} 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;
*
* 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);
}
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));
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))
* 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
* 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
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)