Merge branch 'master' into tlv-mic
authorLuke Howard <lukeh@padl.com>
Sun, 27 Mar 2011 11:31:12 +0000 (22:31 +1100)
committerLuke Howard <lukeh@padl.com>
Sun, 27 Mar 2011 11:31:12 +0000 (22:31 +1100)
mech_eap/util_attr.cpp

index a59ff80..3350978 100644 (file)
@@ -333,6 +333,9 @@ gss_eap_attr_ctx::initFromBuffer(const gss_buffer_t buffer)
         didInit[type] = true;
     }
 
+    if (ret == false)
+        return ret;
+
     /*
      * The call the initFromGssContext methods for attribute
      * providers that can initialize themselves from other
@@ -341,7 +344,7 @@ gss_eap_attr_ctx::initFromBuffer(const gss_buffer_t buffer)
     for (type = ATTR_TYPE_MIN; type <= ATTR_TYPE_MAX; type++) {
         gss_eap_attr_provider *provider;
 
-        if (didInit[type])
+        if (didInit[type] || !providerEnabled(type))
             continue;
 
         provider = m_providers[type];
@@ -351,11 +354,11 @@ gss_eap_attr_ctx::initFromBuffer(const gss_buffer_t buffer)
                                            GSS_C_NO_CONTEXT);
         if (ret == false) {
             releaseProvider(type);
-            break;
+            return false;
         }
     }
 
-    return ret;
+    return true;
 }
 
 gss_eap_attr_ctx::~gss_eap_attr_ctx(void)