diff --git a/lasso.spec b/lasso.spec index 93d0407..c558764 100644 --- a/lasso.spec +++ b/lasso.spec @@ -22,6 +22,7 @@ Source: http://dev.entrouvert.org/lasso/lasso-%{version}.tar.gz patch1: java_binding_lasso_log.patch patch2: cflags.patch +patch3: validate_idp_list_test.patch %if %{with_wsf} BuildRequires: cyrus-sasl-devel @@ -112,6 +113,7 @@ library. %setup -q -n %{name}-%{version} %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build ./autogen.sh diff --git a/validate_idp_list_test.patch b/validate_idp_list_test.patch new file mode 100644 index 0000000..1992743 --- /dev/null +++ b/validate_idp_list_test.patch @@ -0,0 +1,68 @@ +commit c36777abe3927cf78f3d68e880440d16f0f61b49 +Author: John Dennis +Date: Fri Jun 17 11:58:24 2016 -0400 + + Fix ecp test validate_idp_list() + + validate_idp_list was not using the correct list elements when it + iterated over the known_sp_provided_idp_entries_supporting_ecp list. + It treated them as lists of strings instead of lists of + LassoSamlp2IDPEntry. + +diff --git a/tests/login_tests_saml2.c b/tests/login_tests_saml2.c +index 84011ec..54c7fb6 100644 +--- a/tests/login_tests_saml2.c ++++ b/tests/login_tests_saml2.c +@@ -1245,18 +1245,29 @@ static void validate_idp_list(LassoEcp *ecp, EcpIdpListVariant ecpIDPListVariant + + if (ecpIDPListVariant == ECP_IDP_LIST_ECP) { + check_not_null(ecp->known_sp_provided_idp_entries_supporting_ecp); ++ check_equals(g_list_length(ecp->known_sp_provided_idp_entries_supporting_ecp), ++ g_list_length(idp_list->IDPEntry)); ++ + for (ecp_iter = g_list_first(ecp->known_sp_provided_idp_entries_supporting_ecp), + src_iter = g_list_first(idp_list->IDPEntry); + ecp_iter && src_iter; + ecp_iter = g_list_next(ecp_iter), src_iter = g_list_next(src_iter)) { +- gchar *ecp_item, *src_item; ++ LassoSamlp2IDPEntry *ecp_item, *src_item; ++ ++ ecp_item = LASSO_SAMLP2_IDP_ENTRY(ecp_iter->data); ++ src_item = LASSO_SAMLP2_IDP_ENTRY(src_iter->data); ++ ++ check_not_null(ecp_item->ProviderID); ++ check_not_null(src_item->ProviderID); ++ check_str_equals(ecp_item->ProviderID, src_item->ProviderID); + +- ecp_item = ecp_iter->data; +- src_item = src_iter->data; ++ check_not_null(ecp_item->Name); ++ check_not_null(src_item->Name); ++ check_str_equals(ecp_item->Name, src_item->Name); + +- check_not_null(ecp_item); +- check_not_null(src_item); +- check_str_equals(ecp_item, src_item); ++ check_not_null(ecp_item->Loc); ++ check_not_null(src_item->Loc); ++ check_str_equals(ecp_item->Loc, src_item->Loc); + } + } else { + check_null(ecp->known_sp_provided_idp_entries_supporting_ecp); +@@ -1356,7 +1367,6 @@ void test_ecp(EcpIdpListVariant ecpIDPListVariant) + check_null(LASSO_PROFILE(spLoginContext)->msg_url); + check_not_null(strstr(spPaosRequestMsg, "RelayState")); + +- + /* Finished with SP Login Context, will create new one later */ + lasso_server_destroy(spContext); + spContext = NULL; +@@ -1388,7 +1398,7 @@ void test_ecp(EcpIdpListVariant ecpIDPListVariant) + check_str_equals(ecp->relaystate, relayState); + check_str_equals(ecp->issuer->content, "http://sp5/metadata"); + check_str_equals(ecp->provider_name, provider_name); +- check_equals(ecp->is_passive, is_passive); ++ check_equals(ecp->is_passive, is_passive); + + /* Validate ECP IdP list info & default IdP URL */ + validate_idp_list(ecp, ecpIDPListVariant, idp_list);