diff options
| -rw-r--r-- | lasso/xml/lib_authn_request.c | 2 | ||||
| -rw-r--r-- | lasso/xml/lib_scoping.c | 4 | ||||
| -rw-r--r-- | lasso/xml/private.h | 3 | ||||
| -rw-r--r-- | lasso/xml/xml.c | 4 |
4 files changed, 9 insertions, 4 deletions
diff --git a/lasso/xml/lib_authn_request.c b/lasso/xml/lib_authn_request.c index bd4f067d..6444c57f 100644 --- a/lasso/xml/lib_authn_request.c +++ b/lasso/xml/lib_authn_request.c @@ -168,7 +168,7 @@ instance_init(LassoLibAuthnRequest *node) node->AssertionConsumerServiceID = NULL; node->RequestAuthnContext = NULL; node->RelayState = NULL; - node->Scoping = NULL; + node->Scoping = lasso_lib_scoping_new(); node->consent = NULL; } diff --git a/lasso/xml/lib_scoping.c b/lasso/xml/lib_scoping.c index a992fd74..110083bb 100644 --- a/lasso/xml/lib_scoping.c +++ b/lasso/xml/lib_scoping.c @@ -42,7 +42,7 @@ /*****************************************************************************/ static struct XmlSnippet schema_snippets[] = { - { "ProxyCount", SNIPPET_CONTENT | SNIPPET_INTEGER, + { "ProxyCount", SNIPPET_CONTENT | SNIPPET_INTEGER | SNIPPET_OPTIONAL_NEG, G_STRUCT_OFFSET(LassoLibScoping, ProxyCount) }, { "IDPList", SNIPPET_NODE, G_STRUCT_OFFSET(LassoLibScoping, IDPList) }, { NULL, 0, 0} @@ -55,7 +55,7 @@ static struct XmlSnippet schema_snippets[] = { static void instance_init(LassoLibScoping *node) { - node->ProxyCount = 0; + node->ProxyCount = -1; node->IDPList = NULL; } diff --git a/lasso/xml/private.h b/lasso/xml/private.h index b93fdc13..3dea6ffa 100644 --- a/lasso/xml/private.h +++ b/lasso/xml/private.h @@ -51,7 +51,8 @@ typedef enum { SNIPPET_BOOLEAN = 1 << 20, SNIPPET_INTEGER = 1 << 21, SNIPPET_LASSO_DUMP = 1 << 22, - SNIPPET_OPTIONAL = 1 << 23, + SNIPPET_OPTIONAL = 1 << 23, /* optional, ignored if 0 */ + SNIPPET_OPTIONAL_NEG = 1 << 24, /* optional, ignored if -1 */ } SnippetType; struct XmlSnippet { diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index 3dc60ad3..b6c16795 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -910,6 +910,9 @@ lasso_node_build_xmlNode_from_snippets(LassoNode *node, xmlNode *xmlnode, snippet->type & SNIPPET_INTEGER) || snippet->type & SNIPPET_OPTIONAL)) continue; + + if (snippet->type & SNIPPET_OPTIONAL_NEG && GPOINTER_TO_INT(value) == -1) + continue; /* XXX: not sure it is 64-bits clean */ if (snippet->type & SNIPPET_BOOLEAN) @@ -978,6 +981,7 @@ lasso_node_build_xmlNode_from_snippets(LassoNode *node, xmlNode *xmlnode, case SNIPPET_BOOLEAN: case SNIPPET_LASSO_DUMP: case SNIPPET_OPTIONAL: + case SNIPPET_OPTIONAL_NEG: g_assert_not_reached(); } if (snippet->type & SNIPPET_INTEGER) |
