diff options
| author | Frederic Peters <fpeters@entrouvert.com> | 2005-08-08 15:18:38 +0000 |
|---|---|---|
| committer | Frederic Peters <fpeters@entrouvert.com> | 2005-08-08 15:18:38 +0000 |
| commit | f27e97a2361797894afa193563dc15408ebf7cd1 (patch) | |
| tree | a17e2f74d070fcc88553db1dd9321c7849624d80 | |
| parent | c848b6b6f792fd586c29c860edd758128b9e8b68 (diff) | |
get_assertions() called with NULL will return every assertions
| -rw-r--r-- | lasso/id-ff/session.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lasso/id-ff/session.c b/lasso/id-ff/session.c index d3712280..4a13a292 100644 --- a/lasso/id-ff/session.c +++ b/lasso/id-ff/session.c @@ -102,6 +102,12 @@ lasso_session_get_assertion(LassoSession *session, gchar *providerID) return g_hash_table_lookup(session->assertions, providerID); } +static void +add_assertion_to_list(gchar *key, LassoLibAssertion *value, GList **list) +{ + *list = g_list_append(*list, value); +} + /** * lasso_session_get_assertions @@ -117,9 +123,15 @@ GList* lasso_session_get_assertions(LassoSession *session, const char *provider_id) { GList *r = NULL; - LassoSamlAssertion *assertion = g_hash_table_lookup(session->assertions, provider_id); - if (assertion) - r = g_list_append(r, g_object_ref(assertion)); + LassoSamlAssertion *assertion; + + if (provider_id == NULL) { + g_hash_table_foreach(session->assertions, (GHFunc)add_assertion_to_list, &r); + } else { + assertion = g_hash_table_lookup(session->assertions, provider_id); + if (assertion) + r = g_list_append(r, g_object_ref(assertion)); + } return r; } |
