cleanup marshalling code
authorLuke Howard <lukeh@padl.com>
Sat, 18 Sep 2010 15:23:50 +0000 (17:23 +0200)
committerLuke Howard <lukeh@padl.com>
Sat, 18 Sep 2010 15:23:50 +0000 (17:23 +0200)
mech_eap/util_saml.cpp
mech_eap/util_shib.cpp

index 703fc38..9674a9d 100644 (file)
@@ -249,13 +249,16 @@ gss_eap_saml_assertion_provider::initFromBuffer(const gss_eap_attr_ctx *ctx,
     if (!gss_eap_attr_provider::initFromBuffer(ctx, buffer))
         return false;
 
-    assert(m_assertion == NULL);
-
     if (buffer->length == 0)
         return true;
 
+    assert(m_assertion == NULL);
+
     m_assertion = parseAssertion(buffer);
-    return (m_assertion != NULL);
+    if (m_assertion == NULL)
+        return false;
+
+    return true;
 }
 
 bool
@@ -435,7 +438,7 @@ bool
 gss_eap_saml_attr_provider::initFromBuffer(const gss_eap_attr_ctx *ctx,
                                            const gss_buffer_t buffer)
 {
-    return true;
+    return gss_eap_attr_provider::initFromBuffer(ctx, buffer);
 }
 
 bool
index 7e1bbdd..f1d68ac 100644 (file)
@@ -371,7 +371,9 @@ gss_eap_shib_attr_provider::initFromBuffer(const gss_eap_attr_ctx *ctx,
         return false;
 
     if (buffer->length == 0)
-        return false;
+        return true;
+
+    assert(m_attributes.size() == 0);
 
     DDF attrs(NULL);
     string str((const char *)buffer->value, buffer->length);