diff options
| author | Frederic Peters <fpeters@entrouvert.com> | 2005-03-15 17:29:14 +0000 |
|---|---|---|
| committer | Frederic Peters <fpeters@entrouvert.com> | 2005-03-15 17:29:14 +0000 |
| commit | 522740c130be1c63bfeca089bca3350d00b0a5e6 (patch) | |
| tree | b0ca6e0709ffdb99aee28e0319efd8b4dc00603b | |
| parent | 98b4703cef601165b9642bf40644ddf7d46946a5 (diff) | |
detect liberty QName and add appropriate namespace (closes: #416)
| -rw-r--r-- | lasso/xml/samlp_response.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lasso/xml/samlp_response.c b/lasso/xml/samlp_response.c index be66c5ed..f530c74a 100644 --- a/lasso/xml/samlp_response.c +++ b/lasso/xml/samlp_response.c @@ -53,6 +53,17 @@ static struct XmlSnippet schema_snippets[] = { static LassoNodeClass *parent_class = NULL; + +static gboolean +has_lib_status(LassoSamlpStatusCode *status_code) +{ + if (status_code == NULL) + return FALSE; + if (strncmp(status_code->Value, "lib", 3) == 0) + return TRUE; + return has_lib_status(status_code->StatusCode); +} + static xmlNode* get_xmlNode(LassoNode *node, gboolean lasso_dump) { @@ -60,6 +71,13 @@ get_xmlNode(LassoNode *node, gboolean lasso_dump) xmlnode = parent_class->get_xmlNode(node, lasso_dump); + if (LASSO_SAMLP_RESPONSE(node)->Status && + has_lib_status(LASSO_SAMLP_RESPONSE(node)->Status->StatusCode)) { + /* liberty QName, add liberty namespace */ + xmlNewNs(xmlnode, LASSO_LIB_HREF, LASSO_LIB_PREFIX); + } + + for (t = xmlnode->children; t && strcmp(t->name, "Assertion"); t = t->next) ; if (t && strcmp(t->ns->href, LASSO_LIB_HREF) == 0) { |
