Update to use IETF RADIUS attributes
[mech_eap.git] / mech_eap / util_mech.c
index 131ac0b..3e65c1e 100644 (file)
 #include "gssapiP_eap.h"
 
 /*
- * 1.3.6.1.4.1.5322(padl)
+ * Many OIDs are taken from 1.3.6.1.4.1.5322(padl)
  *      gssEap(22)
- *       mechanisms(1)
+ *       mechanisms(1) (no longer used)
  *        eap-aes128-cts-hmac-sha1-96(17)
  *        eap-aes256-cts-hmac-sha1-96(18)
- *       nameTypes(2)
+ *       nameTypes(2) (no longer used)
  *       apiExtensions(3)
  *        inquireSecContextByOid(1)
  *        inquireCredByOid(2)
  *        setSecContextOption(3)
  *        setCredOption(4)
  *        mechInvoke(5)
+ *        Mechanisms and name types are now taken from
+ *      http://www.iana.org/assignments/smi-numbers . See Prefix:
+ *      iso.org.dod.internet.security.mechanisms.abfab (1.3.6.1.5.5.15)
  */
 
 /*
  * canonicalized exported names.
  */
 static gss_OID_desc gssEapMechOids[] = {
-    /* 1.3.6.1.4.1.5322.22.1  */
-    { 9, "\x2B\x06\x01\x04\x01\xA9\x4A\x16\x01" },
-    /* 1.3.6.1.4.1.5322.22.1.17 */
-    { 10, "\x2B\x06\x01\x04\x01\xA9\x4A\x16\x01\x11" },
-    /* 1.3.6.1.4.1.5322.22.1.18 */
-    { 10, "\x2B\x06\x01\x04\x01\xA9\x4A\x16\x01\x12" }
+    /* 1.3.6.1.5.5.15.1.1  */
+    { 8, "\x2B\x06\x01\x05\x05\x0f\x01\x01" },
+    /* 1.3.6.1.5.5.15.1.1.17  */
+    { 9, "\x2B\x06\x01\x05\x05\x0f\x01\x01\x11" },
+    /* 1.3.6.1.5.5.15.1.1.18  */
+    { 9, "\x2B\x06\x01\x05\x05\x0f\x01\x01\x12" },
 };
 
 gss_OID GSS_EAP_MECHANISM                            = &gssEapMechOids[0];
@@ -183,7 +186,7 @@ gssEapIndicateMechs(OM_uint32 *minor,
                     gss_OID_set *mechs)
 {
     krb5_context krbContext;
-    OM_uint32 major, tmpMinor;
+    OM_uint32 major;
     krb5_enctype *etypes;
     int i;
 
@@ -202,6 +205,9 @@ gssEapIndicateMechs(OM_uint32 *minor,
 
     for (i = 0; etypes[i] != ENCTYPE_NULL; i++) {
         gss_OID mechOid;
+#ifndef HAVE_HEIMDAL_VERSION
+        OM_uint32 tmpMinor;
+#endif
 
         /* XXX currently we aren't equipped to encode these enctypes */
         if (etypes[i] < 0 || etypes[i] > 127)
@@ -215,7 +221,9 @@ gssEapIndicateMechs(OM_uint32 *minor,
         if (GSS_ERROR(major))
             break;
 
+#ifndef HAVE_HEIMDAL_VERSION
         gss_release_oid(&tmpMinor, &mechOid);
+#endif
     }
 
     GSSEAP_FREE(etypes);