remove debugging statement
[moonshot.git] / mech_eap / util_mech.c
index e12fa54..131ac0b 100644 (file)
  */
 
 /*
- * Note: the enctype-less OID is used as the mechanism OID in exported
- * names. There is no public symbol for it. This is consistent with
- * the krb5 mechanism which, whilst known by many OIDs, always uses a
- * canonical OID for exported names. (This OID is also returned by
- * gss_inquire_name.)
+ * Note: the enctype-less OID is used as the mechanism OID in non-
+ * canonicalized exported names.
  */
 static gss_OID_desc gssEapMechOids[] = {
     /* 1.3.6.1.4.1.5322.22.1  */
@@ -274,8 +271,8 @@ internalizeOid(const gss_OID oid,
     }
 
     if (*pInternalizedOid == GSS_C_NO_OID) {
-        if (oidEqual(oid, GSS_EAP_NT_PRINCIPAL_NAME))
-            *pInternalizedOid = (const gss_OID)GSS_EAP_NT_PRINCIPAL_NAME;
+        if (oidEqual(oid, GSS_EAP_NT_EAP_NAME))
+            *pInternalizedOid = (const gss_OID)GSS_EAP_NT_EAP_NAME;
     }
 
     if (*pInternalizedOid == GSS_C_NO_OID) {
@@ -322,6 +319,8 @@ gssEapCanonicalizeOid(OM_uint32 *minor,
             return GSS_S_BAD_MECH;
         } else if (flags & OID_FLAG_MAP_NULL_TO_DEFAULT_MECH) {
             return gssEapDefaultMech(minor, pOid);
+        } else {
+            mapToNull = 1;
         }
     } else if (oidEqual(oid, GSS_EAP_MECHANISM)) {
         if ((flags & OID_FLAG_FAMILY_MECH_VALID) == 0) {
@@ -335,12 +334,11 @@ gssEapCanonicalizeOid(OM_uint32 *minor,
         return GSS_S_BAD_MECH;
     }
 
-    if (!mapToNull && oid != GSS_C_NO_OID) {
+    if (!mapToNull) {
         if (!internalizeOid(oid, pOid))
             major = duplicateOid(minor, oid, pOid);
     }
 
-    assert(!GSS_ERROR(major));
     return major;
 }