krb5 commit: Delete unused internal mechglue functions
Greg Hudson
ghudson at MIT.EDU
Mon Sep 17 15:22:37 EDT 2012
https://github.com/krb5/krb5/commit/5b7a01a8a57449f20cb01e490e3b1e9dbc8b8661
commit 5b7a01a8a57449f20cb01e490e3b1e9dbc8b8661
Author: Greg Hudson <ghudson at mit.edu>
Date: Mon Sep 17 15:12:29 2012 -0400
Delete unused internal mechglue functions
Get rid of gssint_get_mechanisms, gssint_mech_to_oid, and
gssint_oid_to_mech, which constructed a list of mechanism names and
mapped between mech names and OIDs. These functions were only used by
gss_inquire_mechs_for_name, which now uses gss_indicate_mechs instead.
src/lib/gssapi/mechglue/g_initialize.c | 108 --------------------------------
src/lib/gssapi/mechglue/mglueP.h | 17 -----
2 files changed, 0 insertions(+), 125 deletions(-)
diff --git a/src/lib/gssapi/mechglue/g_initialize.c b/src/lib/gssapi/mechglue/g_initialize.c
index abba914..9749cf7 100644
--- a/src/lib/gssapi/mechglue/g_initialize.c
+++ b/src/lib/gssapi/mechglue/g_initialize.c
@@ -414,114 +414,6 @@ const gss_OID oid;
} /* gssint_get_modOptions */
/*
- * given a mechanism string return the mechanism oid
- */
-OM_uint32
-gssint_mech_to_oid(const char *mechStr, gss_OID* oid)
-{
- gss_mech_info aMech;
-
- if (oid == NULL)
- return (GSS_S_CALL_INACCESSIBLE_WRITE);
-
- *oid = GSS_C_NULL_OID;
-
- if (gssint_mechglue_initialize_library() != 0)
- return (GSS_S_FAILURE);
-
- if ((mechStr == NULL) || (strlen(mechStr) == 0) ||
- (strcasecmp(mechStr, M_DEFAULT) == 0))
- return (GSS_S_COMPLETE);
-
- /* ensure we have fresh data */
- if (k5_mutex_lock(&g_mechListLock) != 0)
- return GSS_S_FAILURE;
- updateMechList();
- (void) k5_mutex_unlock(&g_mechListLock);
-
- aMech = g_mechList;
-
- /* no lock required - only looking at fields that are not updated */
- while (aMech != NULL) {
- if ((aMech->mechNameStr) &&
- strcmp(aMech->mechNameStr, mechStr) == 0) {
- *oid = aMech->mech_type;
- return (GSS_S_COMPLETE);
- }
- aMech = aMech->next;
- }
- return (GSS_S_FAILURE);
-} /* gssint_mech_to_oid */
-
-
-/*
- * Given the mechanism oid, return the readable mechanism name
- * associated with that oid from the mech config file
- * (/etc/gss/mech).
- */
-const char *
-gssint_oid_to_mech(const gss_OID oid)
-{
- gss_mech_info aMech;
-
- if (oid == GSS_C_NULL_OID)
- return (M_DEFAULT);
-
- if (gssint_mechglue_initialize_library() != 0)
- return (NULL);
-
- /* ensure we have fresh data */
- if (k5_mutex_lock(&g_mechListLock) != 0)
- return NULL;
- updateMechList();
- aMech = searchMechList(oid);
- (void) k5_mutex_unlock(&g_mechListLock);
-
- if (aMech == NULL)
- return (NULL);
-
- return (aMech->mechNameStr);
-} /* gssint_oid_to_mech */
-
-
-/*
- * return a list of mechanism strings supported
- * upon return the array is terminated with a NULL entry
- */
-OM_uint32
-gssint_get_mechanisms(char *mechArray[], int arrayLen)
-{
- gss_mech_info aMech;
- int i;
-
- if (mechArray == NULL || arrayLen < 1)
- return (GSS_S_CALL_INACCESSIBLE_WRITE);
-
- if (gssint_mechglue_initialize_library() != 0)
- return (GSS_S_FAILURE);
-
- /* ensure we have fresh data */
- if (k5_mutex_lock(&g_mechListLock) != 0)
- return GSS_S_FAILURE;
- updateMechList();
- (void) k5_mutex_unlock(&g_mechListLock);
-
- aMech = g_mechList;
-
- /* no lock required - only looking at fields that are not updated */
- for (i = 1; i < arrayLen; i++) {
- if (aMech != NULL) {
- *mechArray = aMech->mechNameStr;
- mechArray++;
- aMech = aMech->next;
- } else
- break;
- }
- *mechArray = NULL;
- return (GSS_S_COMPLETE);
-} /* gss_get_mechanisms */
-
-/*
* determines if the mechList needs to be updated from file
* and performs the update.
* this functions must be called with a lock of g_mechListLock
diff --git a/src/lib/gssapi/mechglue/mglueP.h b/src/lib/gssapi/mechglue/mglueP.h
index 02a7d79..ad0fdf5 100644
--- a/src/lib/gssapi/mechglue/mglueP.h
+++ b/src/lib/gssapi/mechglue/mglueP.h
@@ -730,23 +730,6 @@ OM_uint32 gss_add_mech_name_type
* Sun extensions to GSS-API v2
*/
-OM_uint32
-gssint_mech_to_oid(
- const char *mech, /* mechanism string name */
- gss_OID *oid /* mechanism oid */
-);
-
-const char *
-gssint_oid_to_mech(
- const gss_OID oid /* mechanism oid */
-);
-
-OM_uint32
-gssint_get_mechanisms(
- char *mechArray[], /* array to populate with mechs */
- int arrayLen /* length of passed in array */
-);
-
int
gssint_get_der_length(
unsigned char **, /* buf */
More information about the cvs-krb5
mailing list