]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Delete unused internal mechglue functions
authorGreg Hudson <ghudson@mit.edu>
Mon, 17 Sep 2012 19:12:29 +0000 (15:12 -0400)
committerGreg Hudson <ghudson@mit.edu>
Mon, 17 Sep 2012 19:12:29 +0000 (15:12 -0400)
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
src/lib/gssapi/mechglue/mglueP.h

index abba914da475c0f14397ebbdcae0ee9426909d64..9749cf72b1db6b4784db4c89f8438149a86cfa5e 100644 (file)
@@ -413,114 +413,6 @@ const gss_OID oid;
        return (modOptions);
 } /* 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.
index 02a7d795306ebc225a95e018e7b5ace13e597af3..ad0fdf5d0b0dec1e118741e903ac74afea434336 100644 (file)
@@ -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 */