summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValery Febvre <vfebvre at easter-eggs.com>2004-07-14 19:00:44 +0000
committerValery Febvre <vfebvre at easter-eggs.com>2004-07-14 19:00:44 +0000
commitff182b1bf4342d51690e82f2bf0c5034339f7542 (patch)
treeb9a36878dc22c0bc3594f6106ba274bab8bbe3fa
parent85be85192ea7ce2e4a8836a2921802e505c4efff (diff)
*** empty log message ***
-rw-r--r--lasso/id-ff/login.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/lasso/id-ff/login.c b/lasso/id-ff/login.c
index 2251cf3b..ccc87c9c 100644
--- a/lasso/id-ff/login.c
+++ b/lasso/id-ff/login.c
@@ -86,6 +86,7 @@ lasso_login_process_response_status_and_assertion(LassoLogin *login) {
LassoNode *assertion, *status, *statusCode;
LassoProvider *idp;
gchar *statusCode_value;
+ xmlChar *ni, *idp_ni;
/* verify signature */
assertion = lasso_node_get_child(LASSO_PROFILE_CONTEXT(login)->response,
@@ -122,6 +123,22 @@ lasso_login_process_response_status_and_assertion(LassoLogin *login) {
else {
return (-4);
}
+
+ /* store NameIdentifier */
+ ni = lasso_node_get_child_content(LASSO_NODE(assertion), "NameIdentifier", NULL);
+ idp_ni = lasso_node_get_child_content(LASSO_NODE(assertion), "IDPProvidedNameIdentifier", NULL);
+ if (xmlStrEqual(ni, idp_ni) && idp_ni != NULL) {
+ login->nameIdentifier = idp_ni;
+ xmlFree(ni);
+ }
+ else {
+ login->nameIdentifier = ni;
+ xmlFree(idp_ni);
+ if (ni == NULL) {
+ return (-5);
+ }
+ }
+
return (0);
}
@@ -147,7 +164,7 @@ lasso_login_add_response_assertion(LassoLogin *login,
ni = lasso_node_get_child_content(LASSO_NODE(authentication_statement), "NameIdentifier", NULL);
idp_ni = lasso_node_get_child_content(LASSO_NODE(authentication_statement), "IDPProvidedNameIdentifier", NULL);
/* store NameIdentifier */
- if (xmlStrEqual(ni, idp_ni)) {
+ if (xmlStrEqual(ni, idp_ni) && idp_ni != NULL) {
login->nameIdentifier = idp_ni;
xmlFree(ni);
}
@@ -155,12 +172,9 @@ lasso_login_add_response_assertion(LassoLogin *login,
login->nameIdentifier = ni;
xmlFree(idp_ni);
}
- printf("Start add_authenticationStatement 0x%x, 0x%x\n", assertion, authentication_statement);
- printf("%s\n", lasso_node_export(assertion));
- printf("%s\n", lasso_node_export(authentication_statement));
+
lasso_saml_assertion_add_authenticationStatement(LASSO_SAML_ASSERTION(assertion),
LASSO_SAML_AUTHENTICATION_STATEMENT(authentication_statement));
- printf("Finish add_authenticationStatement\n");
lasso_saml_assertion_set_signature(LASSO_SAML_ASSERTION(assertion),
LASSO_PROFILE_CONTEXT(login)->server->signature_method,
LASSO_PROFILE_CONTEXT(login)->server->private_key,