initial libradsec port
[mech_eap.orig] / inquire_attrs_for_mech.c
index 96f1a8c..fdd8893 100644 (file)
@@ -53,7 +53,15 @@ gss_inquire_attrs_for_mech(OM_uint32 *minor,
 {
     OM_uint32 major, tmpMinor;
 
-    if (mech_attrs != GSS_C_NO_OID_SET) {
+    if (mech_attrs != NULL)
+        *mech_attrs = GSS_C_NO_OID_SET;
+    if (known_mech_attrs != NULL)
+        *known_mech_attrs = GSS_C_NO_OID_SET;
+
+    if (!gssEapIsConcreteMechanismOid((const gss_OID)mech_oid))
+        return GSS_S_BAD_MECH;
+
+    if (mech_attrs != NULL) {
         major = gss_create_empty_oid_set(minor, mech_attrs);
         if (GSS_ERROR(major))
             goto cleanup;
@@ -67,7 +75,6 @@ gss_inquire_attrs_for_mech(OM_uint32 *minor,
         MA_SUPPORTED(GSS_C_MA_AUTH_INIT);
         MA_SUPPORTED(GSS_C_MA_AUTH_TARG);
         MA_SUPPORTED(GSS_C_MA_AUTH_INIT_INIT);
-        MA_SUPPORTED(GSS_C_MA_DELEG_CRED);
         MA_SUPPORTED(GSS_C_MA_INTEG_PROT);
         MA_SUPPORTED(GSS_C_MA_CONF_PROT);
         MA_SUPPORTED(GSS_C_MA_MIC);
@@ -79,7 +86,7 @@ gss_inquire_attrs_for_mech(OM_uint32 *minor,
 #endif
     }
 
-    if (known_mech_attrs != GSS_C_NO_OID_SET) {
+    if (known_mech_attrs != NULL) {
         major = gss_create_empty_oid_set(minor, known_mech_attrs);
         if (GSS_ERROR(major))
             goto cleanup;