diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3dfb968 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/lasso-2.5.1.tar.gz diff --git a/.lasso.metadata b/.lasso.metadata new file mode 100644 index 0000000..06ef001 --- /dev/null +++ b/.lasso.metadata @@ -0,0 +1 @@ +fe0e68010bab6e11383003b5cf869c0447ed7a6e SOURCES/lasso-2.5.1.tar.gz diff --git a/SOURCES/0003-Choose-the-Reference-transform-based-on-the-chosen-S.patch b/SOURCES/0003-Choose-the-Reference-transform-based-on-the-chosen-S.patch new file mode 100644 index 0000000..93ec571 --- /dev/null +++ b/SOURCES/0003-Choose-the-Reference-transform-based-on-the-chosen-S.patch @@ -0,0 +1,154 @@ +From 9525237236eef4097300d9b6e93d2178a7a72267 Mon Sep 17 00:00:00 2001 +From: Benjamin Dauvergne +Date: Fri, 4 Mar 2016 10:38:07 +0100 +Subject: [PATCH] Choose the Reference transform based on the chosen Signature + transform (fixes #10155) + +i.e. if the signature use SHA2 then use SHA2 of the same strength for digesting +references. +--- + lasso/xml/tools.c | 41 +++++++++++++++++++++++++++++++++-------- + tests/login_tests_saml2.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- + 2 files changed, 76 insertions(+), 10 deletions(-) + +diff --git a/lasso/xml/tools.c b/lasso/xml/tools.c +index 0405592..cf9fe65 100644 +--- a/lasso/xml/tools.c ++++ b/lasso/xml/tools.c +@@ -2823,14 +2823,39 @@ lasso_xmlnode_add_saml2_signature_template(xmlNode *node, LassoSignatureContext + xmlAddChild(node, signature); + } + +- /* Normally the signature is son of the signed node, which holds an Id attribute, but in +- * other cases, set snippet->offset to 0 and use xmlSecTmpSignatureAddReference from another +- * node get_xmlNode virtual method to add the needed reference. +- */ +- uri = g_strdup_printf("#%s", id); +- reference = xmlSecTmplSignatureAddReference(signature, +- xmlSecTransformSha1Id, NULL, (xmlChar*)uri, NULL); +- lasso_release(uri); ++ /* choose a digest for handling references based on the chosen signature algorithm */ ++ { ++ xmlSecTransformId digest_method_id; ++ switch (context.signature_method) { ++ case LASSO_SIGNATURE_METHOD_RSA_SHA1: ++ case LASSO_SIGNATURE_METHOD_DSA_SHA1: ++ case LASSO_SIGNATURE_METHOD_HMAC_SHA1: ++ digest_method_id = xmlSecTransformSha1Id; ++ break; ++ case LASSO_SIGNATURE_METHOD_RSA_SHA256: ++ case LASSO_SIGNATURE_METHOD_HMAC_SHA256: ++ digest_method_id = xmlSecTransformSha256Id; ++ break; ++ case LASSO_SIGNATURE_METHOD_RSA_SHA384: ++ case LASSO_SIGNATURE_METHOD_HMAC_SHA384: ++ digest_method_id = xmlSecTransformSha384Id; ++ break; ++ case LASSO_SIGNATURE_METHOD_RSA_SHA512: ++ case LASSO_SIGNATURE_METHOD_HMAC_SHA512: ++ digest_method_id = xmlSecTransformSha384Id; ++ break; ++ default: ++ g_assert_not_reached(); ++ } ++ /* Normally the signature is son of the signed node, which holds an Id attribute, but in ++ * other cases, set snippet->offset to 0 and use xmlSecTmpSignatureAddReference from another ++ * node get_xmlNode virtual method to add the needed reference. ++ */ ++ uri = g_strdup_printf("#%s", id); ++ reference = xmlSecTmplSignatureAddReference(signature, digest_method_id, NULL, ++ (xmlChar*)uri, NULL); ++ lasso_release(uri); ++ } + + /* add enveloped transform */ + xmlSecTmplReferenceAddTransform(reference, xmlSecTransformEnvelopedId); +diff --git a/tests/login_tests_saml2.c b/tests/login_tests_saml2.c +index 9cd04ce..7f45099 100644 +--- a/tests/login_tests_saml2.c ++++ b/tests/login_tests_saml2.c +@@ -925,8 +925,10 @@ END_TEST + lasso_provider_add_key(LASSO_PROVIDER(providers->data), key, FALSE); \ + g_list_free(providers); + ++typedef void (*SsoCallback)(LassoLogin *idp_login_context, LassoLogin *sp_login_context); ++ + static void +-sso_initiated_by_sp(LassoServer *idp_context, LassoServer *sp_context) ++sso_initiated_by_sp(LassoServer *idp_context, LassoServer *sp_context, SsoCallback sso_callback) + { + LassoLogin *idp_login_context; + LassoLogin *sp_login_context; +@@ -970,6 +972,10 @@ sso_initiated_by_sp(LassoServer *idp_context, LassoServer *sp_context) + idp_login_context->parent.msg_body)); + check_good_rc(lasso_login_accept_sso(sp_login_context)); + ++ if (sso_callback) { ++ sso_callback(idp_login_context, sp_login_context); ++ } ++ + /* Cleanup */ + lasso_release_gobject(idp_login_context); + lasso_release_gobject(sp_login_context); +@@ -991,8 +997,9 @@ START_TEST(test07_sso_sp_with_hmac_sha1_signatures) + test07_make_context(idp_context, "idp6-saml2", LASSO_PROVIDER_ROLE_SP, "sp6-saml2", key) + test07_make_context(sp_context, "sp6-saml2", LASSO_PROVIDER_ROLE_IDP, "idp6-saml2", key) + ++ + block_lasso_logs; +- sso_initiated_by_sp(idp_context, sp_context); ++ sso_initiated_by_sp(idp_context, sp_context, NULL); + unblock_lasso_logs; + + /* Cleanup */ +@@ -1514,6 +1521,39 @@ START_TEST(test11_ecp) + } + END_TEST + ++void check_digest_method(LassoLogin *idp_login_context, LassoLogin *sp_login_context) ++{ ++ char *dump = lasso_node_debug((LassoNode*)sp_login_context->parent.response, 10); ++ check_true(strstr(dump, "") != NULL); ++ lasso_release_string(dump) ++} ++ ++START_TEST(test12_sso_sp_with_rsa_sha256_signatures) ++{ ++ LassoServer *idp_context = NULL; ++ LassoServer *sp_context = NULL; ++ GList *providers; ++ LassoKey *key = NULL; ++ ++ /* Create a key for signature algorithm RSA_SHA256 */ ++ key = lasso_key_new_for_signature_from_file(TESTSDATADIR "idp6-saml2/private-key.pem", NULL, ++ LASSO_SIGNATURE_METHOD_RSA_SHA256, NULL); ++ check_true(LASSO_IS_KEY(key)); ++ ++ test07_make_context(idp_context, "idp6-saml2", LASSO_PROVIDER_ROLE_SP, "sp6-saml2", key) ++ test07_make_context(sp_context, "sp6-saml2", LASSO_PROVIDER_ROLE_IDP, "idp6-saml2", key) ++ ++ block_lasso_logs; ++ sso_initiated_by_sp(idp_context, sp_context, check_digest_method); ++ unblock_lasso_logs; ++ ++ /* Cleanup */ ++ lasso_release_gobject(idp_context); ++ lasso_release_gobject(sp_context); ++ lasso_release_gobject(key); ++} ++END_TEST ++ + Suite* + login_saml2_suite() + { +@@ -1545,6 +1585,7 @@ login_saml2_suite() + tcase_add_test(tc_ecp, test09_ecp); + tcase_add_test(tc_ecp, test10_ecp); + tcase_add_test(tc_ecp, test11_ecp); ++ tcase_add_test(tc_spLogin, test12_sso_sp_with_rsa_sha256_signatures); + return s; + } + +-- +1.8.3.1 + diff --git a/SOURCES/0004-Fix-ECP-signature-not-found-error-when-only-assertio.patch b/SOURCES/0004-Fix-ECP-signature-not-found-error-when-only-assertio.patch new file mode 100644 index 0000000..2fca38f --- /dev/null +++ b/SOURCES/0004-Fix-ECP-signature-not-found-error-when-only-assertio.patch @@ -0,0 +1,329 @@ +From 642182bdf49c9c93a86b093ad7335c8a7a5ae8cc Mon Sep 17 00:00:00 2001 +From: John Dennis +Date: Wed, 9 Jan 2019 17:23:09 -0500 +Subject: [PATCH] Fix ECP signature not found error when only assertion is + signed (#26828) + +With a SAML Authn Response either the message or the assertion +contained in the response message or both can be signed. Most IdP's +sign the message. This fixes a bug when processing an ECP authn +response when only the assertion is signed. + +lasso_saml20_profile_process_soap_response_with_headers() performs a +signature check on the SAML message. A signature can also appear on +the assertion which is checked by +lasso_saml20_login_process_response_status_and_assertion() The problem +occurred when the message was not signed and +lasso_saml20_profile_process_soap_response_with_headers() returned +LASSO_DS_ERROR_SIGNATURE_NOT_FOUND as an error code which is not +actually an error because we haven't checked the signature on the +assertion yet. We were returning the first +LASSO_DS_ERROR_SIGNATURE_NOT_FOUND error when in fact the subsequent +signature check in +lasso_saml20_login_process_response_status_and_assertion() succeeded. + +The ECP unit tests were enhanced to cover these cases. + +The enhanced unit test revealed a problem in two switch statements +operating on the return value of +lasso_profile_get_signature_verify_hint() which were missing a case +statement for LASSO_PROFILE_SIGNATURE_VERIFY_HINT_FORCE which caused +an abort due to an unknown enumeration value. + +Fixes Bug: 26828 +License: MIT +Signed-off-by: John Dennis +--- + lasso/saml-2.0/login.c | 29 +++++++++----- + lasso/saml-2.0/profile.c | 2 + + tests/login_tests_saml2.c | 97 ++++++++++++++++++++++++++++++++++++----------- + 3 files changed, 95 insertions(+), 33 deletions(-) + +diff --git a/lasso/saml-2.0/login.c b/lasso/saml-2.0/login.c +index 028ffb3..91ff302 100644 +--- a/lasso/saml-2.0/login.c ++++ b/lasso/saml-2.0/login.c +@@ -1107,18 +1107,31 @@ lasso_saml20_login_process_paos_response_msg(LassoLogin *login, gchar *msg) + { + LassoSoapHeader *header = NULL; + LassoProfile *profile; +- int rc1, rc2; ++ int rc; + + lasso_null_param(msg); + + profile = LASSO_PROFILE(login); + +- rc1 = lasso_saml20_profile_process_soap_response_with_headers(profile, msg, &header); ++ /* ++ * lasso_saml20_profile_process_soap_response_with_headers() ++ * performs a signature check on the SAML message. A signature ++ * can also appear on the assertion which is checked by ++ * lasso_saml20_login_process_response_status_and_assertion() ++ * (below). Therefore if the error is SIGNATURE_NOT_FOUND we ++ * proceed because ++ * lasso_saml20_login_process_response_status_and_assertion() ++ * will test the signature on the assertion. ++ */ ++ rc = lasso_saml20_profile_process_soap_response_with_headers(profile, msg, &header); ++ if (rc != 0 && rc != LASSO_DS_ERROR_SIGNATURE_NOT_FOUND) { ++ return rc; ++ } + + /* + * If the SOAP message contained a header check for the optional +- * paos:Response and ecp:RelayState elements, if they exist extract their +- * values into the profile. ++ * paos:Response and ecp:RelayState elements, if they exist extract their ++ * values into the profile. + */ + if (header) { + GList *i = NULL; +@@ -1142,12 +1155,8 @@ lasso_saml20_login_process_paos_response_msg(LassoLogin *login, gchar *msg) + lasso_release_gobject(header); + } + +- rc2 = lasso_saml20_login_process_response_status_and_assertion(login); +- if (rc1) { +- return rc1; +- } +- return rc2; +- ++ rc = lasso_saml20_login_process_response_status_and_assertion(login); ++ return rc; + } + + /** +diff --git a/lasso/saml-2.0/profile.c b/lasso/saml-2.0/profile.c +index 8171e79..22a4e08 100644 +--- a/lasso/saml-2.0/profile.c ++++ b/lasso/saml-2.0/profile.c +@@ -398,6 +398,7 @@ lasso_saml20_profile_process_artifact_resolve(LassoProfile *profile, const char + + switch (lasso_profile_get_signature_verify_hint(profile)) { + case LASSO_PROFILE_SIGNATURE_VERIFY_HINT_MAYBE: ++ case LASSO_PROFILE_SIGNATURE_VERIFY_HINT_FORCE: + rc = profile->signature_status; + break; + case LASSO_PROFILE_SIGNATURE_VERIFY_HINT_IGNORE: +@@ -1559,6 +1560,7 @@ lasso_saml20_profile_process_soap_response_with_headers(LassoProfile *profile, + remote_provider, response_msg, "ID", LASSO_MESSAGE_FORMAT_SOAP); + switch (lasso_profile_get_signature_verify_hint(profile)) { + case LASSO_PROFILE_SIGNATURE_VERIFY_HINT_MAYBE: ++ case LASSO_PROFILE_SIGNATURE_VERIFY_HINT_FORCE: + rc = profile->signature_status; + break; + case LASSO_PROFILE_SIGNATURE_VERIFY_HINT_IGNORE: +diff --git a/tests/login_tests_saml2.c b/tests/login_tests_saml2.c +index 54c7fb6..e331c07 100644 +--- a/tests/login_tests_saml2.c ++++ b/tests/login_tests_saml2.c +@@ -1090,42 +1090,42 @@ START_TEST(test08_test_authnrequest_flags) + make_context(sp_context, "sp5-saml2", "", LASSO_PROVIDER_ROLE_IDP, "idp5-saml2", "") + + block_lasso_logs; +- sso_initiated_by_sp2(idp_context, sp_context, +- (SsoSettings) { ++ sso_initiated_by_sp2(idp_context, sp_context, ++ (SsoSettings) { + .use_assertion_consumer_service_idx = 1, + .assertion_consumer_service_idx = 0, + .stop_after_build_assertion = 1, + }); +- sso_initiated_by_sp2(idp_context, sp_context, +- (SsoSettings) { ++ sso_initiated_by_sp2(idp_context, sp_context, ++ (SsoSettings) { + .assertion_consumer_service_url = "http://sp5/singleSignOnPost", + .stop_after_build_assertion = 1, + }); +- sso_initiated_by_sp2(idp_context, sp_context, +- (SsoSettings) { ++ sso_initiated_by_sp2(idp_context, sp_context, ++ (SsoSettings) { + .protocol_binding = LASSO_SAML2_METADATA_BINDING_ARTIFACT, + .stop_after_build_assertion = 1, + }); +- sso_initiated_by_sp2(idp_context, sp_context, +- (SsoSettings) { ++ sso_initiated_by_sp2(idp_context, sp_context, ++ (SsoSettings) { + .assertion_consumer_service_url = "http://sp5/singleSignOnPost", + .protocol_binding = LASSO_SAML2_METADATA_BINDING_POST, + .stop_after_build_assertion = 1, + }); +- sso_initiated_by_sp2(idp_context, sp_context, +- (SsoSettings) { ++ sso_initiated_by_sp2(idp_context, sp_context, ++ (SsoSettings) { + .assertion_consumer_service_url = "http://sp5/singleSignOnArtifact", + .protocol_binding = LASSO_SAML2_METADATA_BINDING_ARTIFACT, + .stop_after_build_assertion = 1, + }); +- sso_initiated_by_sp2(idp_context, sp_context, +- (SsoSettings) { ++ sso_initiated_by_sp2(idp_context, sp_context, ++ (SsoSettings) { + .assertion_consumer_service_url = "http://sp5/singleSignOnPostAndArtifact", + .protocol_binding = LASSO_SAML2_METADATA_BINDING_ARTIFACT, + .stop_after_build_assertion = 1, + }); +- sso_initiated_by_sp2(idp_context, sp_context, +- (SsoSettings) { ++ sso_initiated_by_sp2(idp_context, sp_context, ++ (SsoSettings) { + .assertion_consumer_service_url = "http://sp5/singleSignOnPostAndArtifact", + .protocol_binding = LASSO_SAML2_METADATA_BINDING_POST, + .stop_after_build_assertion = 1, +@@ -1278,7 +1278,9 @@ static void validate_idp_list(LassoEcp *ecp, EcpIdpListVariant ecpIDPListVariant + check_str_equals((char*)g_list_nth(ecp->known_idp_entity_ids_supporting_ecp, 0)->data, "http://idp5/metadata"); + } + +-void test_ecp(EcpIdpListVariant ecpIDPListVariant) ++void test_ecp(EcpIdpListVariant ecpIDPListVariant, ++ LassoProfileSignatureHint signature_hint, ++ LassoProfileSignatureVerifyHint signature_verify_hint) + { + char *serviceProviderContextDump = NULL, *identityProviderContextDump = NULL; + LassoServer *spContext = NULL, *ecpContext=NULL, *idpContext = NULL; +@@ -1286,7 +1288,7 @@ void test_ecp(EcpIdpListVariant ecpIDPListVariant) + LassoEcp *ecp = NULL; + LassoSamlp2AuthnRequest *request = NULL; + gboolean is_passive = FALSE; +- char *provider_name = NULL; ++ char *provider_name = NULL; + char *relayState = NULL; + char *messageID = NULL; + char *extracted_messageID = NULL; +@@ -1296,7 +1298,7 @@ void test_ecp(EcpIdpListVariant ecpIDPListVariant) + char *ecpPaosResponseMsg = NULL; + char *spLoginDump = NULL; + LassoSaml2Assertion *assertion; +- LassoSamlp2IDPList *idp_list = NULL; ++ LassoSamlp2IDPList *idp_list = NULL; + + /* + * SAML2 Profile for ECP (Section 4.2) defines these steps for an ECP +@@ -1322,6 +1324,8 @@ void test_ecp(EcpIdpListVariant ecpIDPListVariant) + spContext = lasso_server_new_from_dump(serviceProviderContextDump); + spLoginContext = lasso_login_new(spContext); + check_not_null(spLoginContext); ++ lasso_profile_set_signature_hint(LASSO_PROFILE(spLoginContext), signature_hint); ++ lasso_profile_set_signature_verify_hint(LASSO_PROFILE(spLoginContext), signature_verify_hint); + + check_good_rc(lasso_login_init_authn_request(spLoginContext, "http://idp5/metadata", + LASSO_HTTP_METHOD_PAOS)); +@@ -1419,6 +1423,8 @@ void test_ecp(EcpIdpListVariant ecpIDPListVariant) + idpContext = lasso_server_new_from_dump(identityProviderContextDump); + idpLoginContext = lasso_login_new(idpContext); + check_not_null(idpLoginContext); ++ lasso_profile_set_signature_hint(LASSO_PROFILE(idpLoginContext), signature_hint); ++ lasso_profile_set_signature_verify_hint(LASSO_PROFILE(idpLoginContext), signature_verify_hint); + + /* Parse the ecpSoapRequestMsg */ + check_good_rc(lasso_login_process_authn_request_msg(idpLoginContext, ecpSoapRequestMsg)); +@@ -1465,7 +1471,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 */ + validate_idp_list(ecp, ecpIDPListVariant, idp_list); +@@ -1480,6 +1486,8 @@ void test_ecp(EcpIdpListVariant ecpIDPListVariant) + spContext = lasso_server_new_from_dump(serviceProviderContextDump); + spLoginContext = lasso_login_new(spContext); + check_not_null(spLoginContext); ++ lasso_profile_set_signature_hint(LASSO_PROFILE(spLoginContext), signature_hint); ++ lasso_profile_set_signature_verify_hint(LASSO_PROFILE(spLoginContext), signature_verify_hint); + + /* Parse the ecpPaosResponseMsg */ + check_good_rc(lasso_login_process_paos_response_msg(spLoginContext, ecpPaosResponseMsg)); +@@ -1515,19 +1523,61 @@ void test_ecp(EcpIdpListVariant ecpIDPListVariant) + + START_TEST(test09_ecp) + { +- test_ecp(ECP_IDP_LIST_NONE); ++ test_ecp(ECP_IDP_LIST_NONE, ++ LASSO_PROFILE_SIGNATURE_HINT_MAYBE, ++ LASSO_PROFILE_SIGNATURE_VERIFY_HINT_MAYBE); + } + END_TEST + + START_TEST(test10_ecp) + { +- test_ecp(ECP_IDP_LIST_ECP); ++ test_ecp(ECP_IDP_LIST_ECP, ++ LASSO_PROFILE_SIGNATURE_HINT_MAYBE, ++ LASSO_PROFILE_SIGNATURE_VERIFY_HINT_MAYBE); + } + END_TEST + + START_TEST(test11_ecp) + { +- test_ecp(ECP_IDP_LIST_BOGUS); ++ test_ecp(ECP_IDP_LIST_BOGUS, ++ LASSO_PROFILE_SIGNATURE_HINT_MAYBE, ++ LASSO_PROFILE_SIGNATURE_VERIFY_HINT_MAYBE); ++} ++END_TEST ++ ++START_TEST(test12_ecp) ++{ ++ /* Maybe Sign */ ++ test_ecp(ECP_IDP_LIST_NONE, ++ LASSO_PROFILE_SIGNATURE_HINT_MAYBE, ++ LASSO_PROFILE_SIGNATURE_VERIFY_HINT_MAYBE); ++ ++ test_ecp(ECP_IDP_LIST_NONE, ++ LASSO_PROFILE_SIGNATURE_HINT_MAYBE, ++ LASSO_PROFILE_SIGNATURE_VERIFY_HINT_FORCE); ++ ++ test_ecp(ECP_IDP_LIST_NONE, ++ LASSO_PROFILE_SIGNATURE_HINT_MAYBE, ++ LASSO_PROFILE_SIGNATURE_VERIFY_HINT_IGNORE); ++ ++ /* Force Sign */ ++ test_ecp(ECP_IDP_LIST_NONE, ++ LASSO_PROFILE_SIGNATURE_HINT_FORCE, ++ LASSO_PROFILE_SIGNATURE_VERIFY_HINT_MAYBE); ++ ++ test_ecp(ECP_IDP_LIST_NONE, ++ LASSO_PROFILE_SIGNATURE_HINT_FORCE, ++ LASSO_PROFILE_SIGNATURE_VERIFY_HINT_FORCE); ++ ++ test_ecp(ECP_IDP_LIST_NONE, ++ LASSO_PROFILE_SIGNATURE_HINT_FORCE, ++ LASSO_PROFILE_SIGNATURE_VERIFY_HINT_IGNORE); ++ ++ /* Forbid Sign */ ++ test_ecp(ECP_IDP_LIST_NONE, ++ LASSO_PROFILE_SIGNATURE_HINT_FORBID, ++ LASSO_PROFILE_SIGNATURE_VERIFY_HINT_IGNORE); ++ + } + END_TEST + +@@ -1538,7 +1588,7 @@ void check_digest_method(G_GNUC_UNUSED LassoLogin *idp_login_context, LassoLogin + lasso_release_string(dump) + } + +-START_TEST(test12_sso_sp_with_rsa_sha256_signatures) ++START_TEST(test13_sso_sp_with_rsa_sha256_signatures) + { + LassoServer *idp_context = NULL; + LassoServer *sp_context = NULL; +@@ -1595,7 +1645,8 @@ login_saml2_suite() + tcase_add_test(tc_ecp, test09_ecp); + tcase_add_test(tc_ecp, test10_ecp); + tcase_add_test(tc_ecp, test11_ecp); +- tcase_add_test(tc_spLogin, test12_sso_sp_with_rsa_sha256_signatures); ++ tcase_add_test(tc_ecp, test12_ecp); ++ tcase_add_test(tc_spLogin, test13_sso_sp_with_rsa_sha256_signatures); + return s; + } + +-- +1.8.3.1 + diff --git a/SOURCES/0005-PAOS-Do-not-populate-Destination-attribute.patch b/SOURCES/0005-PAOS-Do-not-populate-Destination-attribute.patch new file mode 100644 index 0000000..63eead1 --- /dev/null +++ b/SOURCES/0005-PAOS-Do-not-populate-Destination-attribute.patch @@ -0,0 +1,99 @@ +From 1e85f1b2bd30c0d93b4a2ef37b35abeae3d15b56 Mon Sep 17 00:00:00 2001 +From: Dmitrii Shcherbakov +Date: Fri, 28 Jun 2019 02:36:19 +0300 +Subject: [PATCH] PAOS: Do not populate "Destination" attribute + +When ECP profile (saml-ecp-v2.0-cs01) is used with PAOS binding Lasso +populates an AuthnRequest with the "Destination" attribute set to +AssertionConsumerURL of an SP - this leads to IdP-side errors because +the destination attribute in the request does not match the IdP URL. + +The "Destination" attribute is mandatory only for HTTP Redirect and HTTP +Post bindings when AuthRequests are signed per saml-bindings-2.0-os +(sections 3.4.5.2 and 3.5.5.2). Specifically for PAOS it makes sense to +avoid setting that optional attribute because an ECP decides which IdP +to use, not the SP. + +Fixes Bug: 34409 +License: MIT +Signed-off-by: Dmitrii Shcherbakov +--- + lasso/saml-2.0/login.c | 18 +++++++++--------- + lasso/saml-2.0/profile.c | 10 +++++++++- + 2 files changed, 18 insertions(+), 10 deletions(-) + +diff --git a/lasso/saml-2.0/login.c b/lasso/saml-2.0/login.c +index 6e8f7553..0d4bb1da 100644 +--- a/lasso/saml-2.0/login.c ++++ b/lasso/saml-2.0/login.c +@@ -222,7 +222,7 @@ _lasso_login_must_verify_signature(LassoProfile *profile) { + gint + lasso_saml20_login_build_authn_request_msg(LassoLogin *login) + { +- char *url = NULL; ++ char *assertionConsumerServiceURL = NULL; + gboolean must_sign = TRUE; + LassoProfile *profile; + LassoSamlp2AuthnRequest *authn_request; +@@ -247,29 +247,29 @@ lasso_saml20_login_build_authn_request_msg(LassoLogin *login) + } + + if (login->http_method == LASSO_HTTP_METHOD_PAOS) { +- + /* + * PAOS is special, the url passed to build_request is the + * AssertionConsumerServiceURL of this SP, not the +- * destination. ++ * destination IdP URL. This is done to fill paos:responseConsumerURL ++ * appropriately down the line in build_request_msg. ++ * See https://dev.entrouvert.org/issues/34409 for more information. + */ + if (authn_request->AssertionConsumerServiceURL) { +- url = authn_request->AssertionConsumerServiceURL; ++ assertionConsumerServiceURL = authn_request->AssertionConsumerServiceURL; + if (!lasso_saml20_provider_check_assertion_consumer_service_url( +- LASSO_PROVIDER(profile->server), url, LASSO_SAML2_METADATA_BINDING_PAOS)) { ++ LASSO_PROVIDER(profile->server), assertionConsumerServiceURL, LASSO_SAML2_METADATA_BINDING_PAOS)) { + rc = LASSO_PROFILE_ERROR_INVALID_REQUEST; + goto cleanup; + } + } else { +- url = lasso_saml20_provider_get_assertion_consumer_service_url_by_binding( ++ assertionConsumerServiceURL = lasso_saml20_provider_get_assertion_consumer_service_url_by_binding( + LASSO_PROVIDER(profile->server), LASSO_SAML2_METADATA_BINDING_PAOS); +- lasso_assign_new_string(authn_request->AssertionConsumerServiceURL, url); ++ lasso_assign_new_string(authn_request->AssertionConsumerServiceURL, assertionConsumerServiceURL); + } + } + +- + lasso_check_good_rc(lasso_saml20_profile_build_request_msg(profile, "SingleSignOnService", +- login->http_method, url)); ++ login->http_method, assertionConsumerServiceURL)); + + cleanup: + return rc; +diff --git a/lasso/saml-2.0/profile.c b/lasso/saml-2.0/profile.c +index 22a4e08c..85f535ae 100644 +--- a/lasso/saml-2.0/profile.c ++++ b/lasso/saml-2.0/profile.c +@@ -968,7 +968,15 @@ lasso_saml20_profile_build_request_msg(LassoProfile *profile, const char *servic + made_url = url = get_url(provider, service, http_method_to_binding(method)); + } + +- if (url) { ++ ++ // Usage of the Destination attribute on a request is mandated only ++ // in "3.4.5.2" and "3.5.5.2" in saml-bindings-2.0-os for signed requests ++ // and is marked as optional in the XSD schema otherwise. ++ // PAOS is a special case because an SP does not select an IdP - ECP does ++ // it instead. Therefore, this attribute needs to be left unpopulated. ++ if (method == LASSO_HTTP_METHOD_PAOS) { ++ lasso_release_string(((LassoSamlp2RequestAbstract*)profile->request)->Destination); ++ } else if (url) { + lasso_assign_string(((LassoSamlp2RequestAbstract*)profile->request)->Destination, + url); + } else { +-- +2.20.1 + diff --git a/SOURCES/0006-tests-use-self-generated-certificate-to-sign-federat.patch b/SOURCES/0006-tests-use-self-generated-certificate-to-sign-federat.patch new file mode 100644 index 0000000..e53d685 --- /dev/null +++ b/SOURCES/0006-tests-use-self-generated-certificate-to-sign-federat.patch @@ -0,0 +1,382 @@ +From 12a3f6c10ee3d5f321a751cf6c4cb7f63313582e Mon Sep 17 00:00:00 2001 +From: Jakub Hrozek +Date: Thu, 13 Jun 2019 13:03:04 +0200 +Subject: [PATCH] tests: use self-generated certificate to sign federation + metadata file (#33823) + +--- + tests/basic_tests.c | 13 +--- + tests/data/lasso.crt | 23 +++++++ + tests/data/lasso.csr | 15 ++++ + tests/data/lasso.key | 27 ++++++++ + .../metadata/metadata-federation-renater.crt | 15 ---- + tests/data/metadata/renater-metadata.xml | 69 +++++++++++-------- + tests/data/rootCA.crt | 32 +++++++++ + tests/data/rootCA.key | 51 ++++++++++++++ + tests/data/rootCA.srl | 1 + + 9 files changed, 192 insertions(+), 54 deletions(-) + create mode 100644 tests/data/lasso.crt + create mode 100644 tests/data/lasso.csr + create mode 100644 tests/data/lasso.key + delete mode 100644 tests/data/metadata/metadata-federation-renater.crt + create mode 100644 tests/data/rootCA.crt + create mode 100644 tests/data/rootCA.key + create mode 100644 tests/data/rootCA.srl + +diff --git a/tests/basic_tests.c b/tests/basic_tests.c +index c08cab69..84999a17 100644 +--- a/tests/basic_tests.c ++++ b/tests/basic_tests.c +@@ -1983,24 +1983,13 @@ START_TEST(test13_test_lasso_server_load_metadata) + block_lasso_logs; + check_good_rc(lasso_server_load_metadata(server, LASSO_PROVIDER_ROLE_IDP, + TESTSDATADIR "/metadata/renater-metadata.xml", +- TESTSDATADIR "/metadata/metadata-federation-renater.crt", ++ TESTSDATADIR "/rootCA.crt", + &blacklisted_1, &loaded_entity_ids, + LASSO_SERVER_LOAD_METADATA_FLAG_DEFAULT)); + unblock_lasso_logs; + check_equals(g_hash_table_size(server->providers), 110); + check_equals(g_list_length(loaded_entity_ids), 110); + +-#if 0 +- /* UK federation file are too big to distribute (and I don't even known if it's right to do +- * it, disable this test for now ) */ +- check_good_rc(lasso_server_load_metadata(server, LASSO_PROVIDER_ROLE_IDP, +- TESTSDATADIR "/ukfederation-metadata.xml", +- TESTSDATADIR "/ukfederation.pem", +- &blacklisted_1, &loaded_entity_ids, +- LASSO_SERVER_LOAD_METADATA_FLAG_DEFAULT)); +- check_equals(g_list_length(loaded_entity_ids), 283); +- check_equals(g_hash_table_size(server->providers), 393); +-#endif + lasso_release_list_of_strings(loaded_entity_ids); + + lasso_release_gobject(server); +diff --git a/tests/data/lasso.crt b/tests/data/lasso.crt +new file mode 100644 +index 00000000..568a0b9c +--- /dev/null ++++ b/tests/data/lasso.crt +@@ -0,0 +1,23 @@ ++-----BEGIN CERTIFICATE----- ++MIID6zCCAdMCFALT+lN2uLJWF7p2xOo65/5KwxixMA0GCSqGSIb3DQEBCwUAMEUx ++CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl ++cm5ldCBXaWRnaXRzIFB0eSBMdGQwIBcNMTkwNjExMDc0NTU2WhgPMjI5MzAzMjUw ++NzQ1NTZaMB0xCzAJBgNVBAYTAkZSMQ4wDAYDVQQDDAVMYXNzbzCCASIwDQYJKoZI ++hvcNAQEBBQADggEPADCCAQoCggEBAOIS/WATGMJsv7OvgrjpYmAW3RmojVp4cHi0 ++17HelWVZ5adX3zSljecmpb1UQcBNzEDb15tOnNO708O94fFLWiWRfjYWa1QYOLkZ ++6kHAR2yJTkhBNQl326K6BnJkWoCsErkXa1608+6+rXR+9KchB/lLSY3Dqh8L6N7s ++qE+xyD1Z8HM3mHs9CM4crIpCPaZ80/yNfBPqPA2Zv4uIBrwSF32rPnh1ciJuIKQg ++jnCQOaKC2j+VsytgthriI0PVRzC7WPAJReQa65N/i721jG6rPecwVcCS9G6cmG+s ++pq6GERUe7nFVdNZ5sRzNsGuDpEdmeCS1pCPtW2hufm8vqvtw9ZkCAwEAATANBgkq ++hkiG9w0BAQsFAAOCAgEAfbHk+QNvLYDNlqwwlu5+88/3CcEx+s1voXOBTxgyIAR2 ++NVKkO7dAW5me51jPPZhy+xC4i+AAeLW5JGwirM5LDgU+9P02JBsZ4OoZI3pBAZ5m ++GrmxrMm6q+9mJ+6bMHolfBNN6hoaWeJiknvc1Id7o0Dh4PbdV7r6ISuXisDb/1je ++tmzxoFuXhmDwwHMTG7eUORVFEgS8V5NNKMv16BeWNDohJVP6icxwoi5JswUl+vfO ++rvIwx2GAJ2EQAbSZv5ADFQ4/vxeopULgLnblc3BwVG4RTT7plNgT2iXP8YwmEGKb ++JDHRVFUo1tX6EKkBUI9AgETrdUnLq6XxP11JmrqNL9oOHw+hGb5vT1wyn6FFxZo2 ++BVgfqdiGbjcs1bTKeQAZKuhaW90oV6+yYD6WtWn/LfHnftAJivALkmUk+XaSqqbO ++FxuyRsz9C/yq0azr6IkCWhGwBYoLvf2CrvovSYpPXefeQ+1yXNDW7bvfAQfOO9xk ++SqQi4cYJw9hNqTk2f61x6UX/o8wKVhXEHyaCr9lVLNpCK0Uy07f3zkubx1mW5PST ++ITSnD8sPD7iMyGOJa5tQJ8W5u2NJT6qo52Jubgc8PapkOoYyEhUaTQEb8RN6D3oD ++xc8cCKn4HUtpkJKgxYhQDtsomJp2RK7lzjVPXAlFUmld88WgqdJwp9GSvMEktA0= ++-----END CERTIFICATE----- +diff --git a/tests/data/lasso.csr b/tests/data/lasso.csr +new file mode 100644 +index 00000000..c450e1b4 +--- /dev/null ++++ b/tests/data/lasso.csr +@@ -0,0 +1,15 @@ ++-----BEGIN CERTIFICATE REQUEST----- ++MIICYjCCAUoCAQAwHTELMAkGA1UEBhMCRlIxDjAMBgNVBAMMBUxhc3NvMIIBIjAN ++BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4hL9YBMYwmy/s6+CuOliYBbdGaiN ++WnhweLTXsd6VZVnlp1ffNKWN5yalvVRBwE3MQNvXm06c07vTw73h8UtaJZF+NhZr ++VBg4uRnqQcBHbIlOSEE1CXfboroGcmRagKwSuRdrXrTz7r6tdH70pyEH+UtJjcOq ++Hwvo3uyoT7HIPVnwczeYez0IzhysikI9pnzT/I18E+o8DZm/i4gGvBIXfas+eHVy ++Im4gpCCOcJA5ooLaP5WzK2C2GuIjQ9VHMLtY8AlF5Brrk3+LvbWMbqs95zBVwJL0 ++bpyYb6ymroYRFR7ucVV01nmxHM2wa4OkR2Z4JLWkI+1baG5+by+q+3D1mQIDAQAB ++oAAwDQYJKoZIhvcNAQELBQADggEBAJcoM7bn2yEElJjpX8mYuawWwlNdLOCyIPCc ++tr6b61CmVDVntWw61fExrg+n1b5uOVuUAEaYNutw6nypzrfvr4wjGKxbl/jTSJCM ++WHLl0/+IGQgr41SbRaySA1Y1hdJEd1ummH07sd7FfQNN/T/zLGaM0CI2/yj89VRk ++BJwiSwbFp1zqntoITQPjo/vpWAqahqNpSKR+C5l1f870wVI2wPg89McRw35EACdx ++Pys8g15+3eKBRTD24eOSWDAL4iDz1jh8ejwtuPjZCQRgg7pkV7uK9Qq4XbStW8AR ++JftZ9BBmUOkpdTY0ml6uNojI5u3J/A8KL0UHeiOGLzEy6l64qjE= ++-----END CERTIFICATE REQUEST----- +diff --git a/tests/data/lasso.key b/tests/data/lasso.key +new file mode 100644 +index 00000000..d6ee4142 +--- /dev/null ++++ b/tests/data/lasso.key +@@ -0,0 +1,27 @@ ++-----BEGIN RSA PRIVATE KEY----- ++MIIEpAIBAAKCAQEA4hL9YBMYwmy/s6+CuOliYBbdGaiNWnhweLTXsd6VZVnlp1ff ++NKWN5yalvVRBwE3MQNvXm06c07vTw73h8UtaJZF+NhZrVBg4uRnqQcBHbIlOSEE1 ++CXfboroGcmRagKwSuRdrXrTz7r6tdH70pyEH+UtJjcOqHwvo3uyoT7HIPVnwczeY ++ez0IzhysikI9pnzT/I18E+o8DZm/i4gGvBIXfas+eHVyIm4gpCCOcJA5ooLaP5Wz ++K2C2GuIjQ9VHMLtY8AlF5Brrk3+LvbWMbqs95zBVwJL0bpyYb6ymroYRFR7ucVV0 ++1nmxHM2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/pOHzJfwkvlCFfKF+23dlDFBrRuQ35d2a ++/M93XQKBgQCmAatw/7+z/CS6HinOW7W4k77eQ4wHb8XwzTl8T/5mf6KzejDUuEpZ ++hi4ZMAZqNywiJo7UOu6APVzRU7qF6Dbg4eIZWtIocMhp19kUArAPz7NcrghXsTIZ ++UdBWeG3kgUa5Q6d/D2OpWHK9S8LRdUL4/H0WZoqDOoDpJwKpljevyg== ++-----END RSA PRIVATE KEY----- +diff --git a/tests/data/metadata/metadata-federation-renater.crt b/tests/data/metadata/metadata-federation-renater.crt +deleted file mode 100644 +index b6117441..00000000 +--- a/tests/data/metadata/metadata-federation-renater.crt ++++ /dev/null +@@ -1,15 +0,0 @@ +------BEGIN CERTIFICATE----- +-MIICZTCCAc6gAwIBAgIEScn+qTANBgkqhkiG9w0BAQUFADB3MQswCQYDVQQGEwJG +-UjEQMA4GA1UEChMHUkVOQVRFUjFWMFQGA1UEAxNNQ2VydGlmaWNhdCBkZSBzaWdu +-YXR1cmUgZGVzIG1ldGEgZG9ubmVlcyBkZSBsYSBmZWRlcmF0aW9uIEVkdWNhdGlv +-bi1SZWNoZXJjaGUwHhcNMDkwMzI1MDk1MTM3WhcNMTkwMzIzMDk1MTM3WjB3MQsw +-CQYDVQQGEwJGUjEQMA4GA1UEChMHUkVOQVRFUjFWMFQGA1UEAxNNQ2VydGlmaWNh +-dCBkZSBzaWduYXR1cmUgZGVzIG1ldGEgZG9ubmVlcyBkZSBsYSBmZWRlcmF0aW9u +-IEVkdWNhdGlvbi1SZWNoZXJjaGUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB +-AJBXcLIguokGiytYSOrgmU6fN+1DXK4eaquvFGMaswuhcRPD4tXtSs8CGxPP8/VF +-Mpcry04lfPA3mpwDis47hsvmLqGJVmfSuvkDsPx+I325h4WqGzEV8kfttkJSi8D0 +-QLKk9wseA+BHzoBpU6e5uWmGqfWJgbZlcUuYKCIE2nL/AgMBAAEwDQYJKoZIhvcN +-AQEFBQADgYEAT0rUS5GTtqW9a0pAv0PjieSS6bW3KG3Mtn0jC1dmav6X9fbhhmFL +-1XSC9WnCU2UD3986EWWYKhN2INHghHE/fQGveVwdcVSSt601OpAsUF18tx0vHqkf +-Shcj7mteq59Gv4hOE8U1Urd/pSRaIO3G42X6/L/AlXeDkicfGZHhq7Q= +------END CERTIFICATE----- +diff --git a/tests/data/metadata/renater-metadata.xml b/tests/data/metadata/renater-metadata.xml +index 868f9259..70517100 100644 +--- a/tests/data/metadata/renater-metadata.xml ++++ b/tests/data/metadata/renater-metadata.xml +@@ -1,4 +1,5 @@ +- ++ ++ + + + +@@ -11,36 +12,50 @@ + AIDrFyG3G6IpXdapls2LeP2Awt8= + + +- +-Mb7C8CsvA6UNnLN+LHCoOG7+c1CYQtUMm+o3p31niDfRcDcCDtuZ521FGM6p6ki6fS8HlncK0Q+h +-7rpXNeD2dY12FU94vI5wfF6m89pRs6QYE4O13HPDDZvhRZY+BX4+fqg6tsRz8NRaFS/xvxSzzPzO +-dsOrE6R2/QhrcaF1PnA= +- ++a47ZynaE+fXQFr2QkjjNsPoWhG0Lbed36MZ2/1jNygD2Ck3zYNSBxFTNI0bhZSi+ ++sYefYhnYDqpz785/90Ym3hVL+olMZ8z7NLlkeDKCScNCi1436j/W4voR0jez3BkA ++IrMW2p4eUtSwfTHRazMtRacQrwTk3JAbShXuWU7fVnRI4t8oa8t43rf2hz+rRG8F ++SizMOyyHMak13jaVCmX5qoaO4OWmqs2GhXsx8hRfzJ8o6w417InTLWcuIRNw1/zm ++6O6H1as6nmKv34SppCiwdGrTpT6i3/zB3j9Hw7iyuvTF5bbaF+7MMsW/pjw5VOF8 ++lmNqhsCFdu+JsaTFBIB2Fg== + + + + +-kFdwsiC6iQaLK1hI6uCZTp837UNcrh5qq68UYxqzC6FxE8Pi1e1KzwIbE8/z9UUylyvLTiV88Dea +-nAOKzjuGy+YuoYlWZ9K6+QOw/H4jfbmHhaobMRXyR+22QlKLwPRAsqT3Cx4D4EfOgG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eUORVFEgS8V5NNKMv16BeWNDohJVP6icxwoi5JswUl+vfO ++rvIwx2GAJ2EQAbSZv5ADFQ4/vxeopULgLnblc3BwVG4RTT7plNgT2iXP8YwmEGKb ++JDHRVFUo1tX6EKkBUI9AgETrdUnLq6XxP11JmrqNL9oOHw+hGb5vT1wyn6FFxZo2 ++BVgfqdiGbjcs1bTKeQAZKuhaW90oV6+yYD6WtWn/LfHnftAJivALkmUk+XaSqqbO ++FxuyRsz9C/yq0azr6IkCWhGwBYoLvf2CrvovSYpPXefeQ+1yXNDW7bvfAQfOO9xk ++SqQi4cYJw9hNqTk2f61x6UX/o8wKVhXEHyaCr9lVLNpCK0Uy07f3zkubx1mW5PST ++ITSnD8sPD7iMyGOJa5tQJ8W5u2NJT6qo52Jubgc8PapkOoYyEhUaTQEb8RN6D3oD ++xc8cCKn4HUtpkJKgxYhQDtsomJp2RK7lzjVPXAlFUmld88WgqdJwp9GSvMEktA0= + + + +@@ -1277,7 +1292,7 @@ Ugr24VE4pUTqq2xGSOazVN0EKSqULXvM9ZHupGDCJmRH4P3H/X4w8Cq5Y6c0pDtJ + + + +- ++ + + + +@@ -8584,7 +8599,7 @@ f6ou5oRTltOZOUJfXI1XMhAUNnU7zQvrFeoGrRzGv3zq8AieXbRyWhXY1Eo1mPpS + $Id: renater.xml,v 1.4 2011/03/30 13:23:00 rdc Exp $ + generated at Wed Mar 30 14:18:20 2011 + by %Id: shib-config,v 1.6 2010/09/10 15:10:15 pmh Exp % +- --> ++ --> + + + +@@ -15545,7 +15560,7 @@ oZQx + + + +- ++ + + + +@@ -30065,4 +30080,4 @@ ihb/MX5UR6g83EMmqZsFt57ANEORMNQywxFa4Q== + + + +- +\ No newline at end of file ++ +diff --git a/tests/data/rootCA.crt b/tests/data/rootCA.crt +new file mode 100644 +index 00000000..a31c99a2 +--- /dev/null ++++ b/tests/data/rootCA.crt +@@ -0,0 +1,32 @@ ++-----BEGIN CERTIFICATE----- ++MIIFbTCCA1WgAwIBAgIUJD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LKZfwGBeg1wiPjAfBgNV ++HSMEGDAWgBRWppx3mP/hCh9ZLKZfwGBeg1wiPjAPBgNVHRMBAf8EBTADAQH/MA0G ++CSqGSIb3DQEBCwUAA4ICAQAWfNrX65UUI55f0A8svSIUVy8c7YjX8P70xMWq7Cpe ++tRPo8C98JCr8MtUaAx6VFx4sjHyCPmEIIf+u7aDxRhrxpqAQAQl5me8OxqwmOxKu ++I7WeRrjAvOux52xfjqtm36fx9SUDu94ox5LdG+NNtG29AbLZeAs4pe4qVqH1GQb9 ++fw3lvxwKV+AovpVZ7eXyscfSvKWi4rgzVJl27me/rgLZsVYJ2gAjTI77vGN1G0ro ++q2iaTvEALHlzhKepVg1IAJAGJLSZegcK3zwWOqZzkL77De6Z3+zbxwNopcy/CGEs ++9v9gDyL1LeAJ3o/dehvPiqMWogTVO6X77sNIiiu41sdaWSTiFllmyO+hQqS69R68 ++NOe+uAP1+taLhD16kp7XHS0MIXEPaQbEgrXtqb163oMJSAaok3xXNyRJ7ZNMS4CT ++0QJE15PpnbRYoQOf4QrrsDmpl2ybU7MR9uOj64qVSvUtBcq1w7ljPStbkN7F7OOU ++pepVvNaWe820kgQ/l9tu1WY9D7PFGP6iWY4AwdxcpWwlJnIr104X3PQ0Y5/msYVs ++zEnqaNiEOnbmTZUvn5jJOwh8DWUo+LffRQx/PoZlhZ/L/L3RtpGUV2E+E5Gzqs7W ++gey9iG11CVcvK/wdCj0zhW/XpesQuwinIMawGS6G92igHo+AFjJoGaGiw3jYdep8 ++CA== ++-----END CERTIFICATE----- +diff --git a/tests/data/rootCA.key b/tests/data/rootCA.key +new file mode 100644 +index 00000000..6b39fb45 +--- /dev/null ++++ b/tests/data/rootCA.key +@@ -0,0 +1,51 @@ ++-----BEGIN RSA PRIVATE KEY----- ++MIIJJwIBAAKCAgEAm4+cfDGalGq4WQWiThWQ7f2Pk1PZrz5Z+nzNieGou3cIbegP ++IV+1bIX3s0lijEM9uKjZ9VgmIEq60M4xg+wl+t3hKipwM4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Twib58JQD4Mt9nuozndmlaOxpuvFd+wuS/FDZbDe2XNcapx7n ++Mzk3HptoKqvSC9GXtxTCClw27GshZqrwdIOXkL11bXyEgdxK5V4vxSyD+2APb//D ++EUT4vklxMe3SP5wOiIK1YkNaJvOlmY6jGQR4O/AyG9YAfbV0gunMGlrIwo8oXlN5 ++DH0+XtXFKtXlVrCOu+7SCWnC8kGIYBF8AhlgXJxKGeC0wshhq6QvK+mjIhkOtTHY ++nZvhAoIBAHbQBKcIAAKSRG3CpqHCjmz4OE6Zc1kplUBm7TPdXcWSeHFEwbAxiXr+ ++cirgCXOTy6z0E8InwQg1S0DgrSUB9+s8abjAicrjiHmr0GVCpC0RtPEYSHDiD/u1 ++kkMDwPyQytdF+sZ7VbFquUCSUFdvHv8QpUExgxieBBCBT+IVdpV7UTowboTHJhkT ++sXuR8waAjVQneZvJR00YjHxp+4sQvooLq44W3B/5wXjPGz2tc3+5+yN11au+d3is ++JAzae6L+I4jfCWhyMCikVA5T8HvUgCtmcJPoQP3Jh4BxzWVBks8HdV0DGbmBzVAS ++wi+2tuHNuYpwQv9EANuTFR5v4TrmE8ECggEAMXp5rfHt2hKLtkIwqYE7C8IVGQ9q ++BcjKAJSuDYkyBpfSp9uxkiyvnND5tEj0uOcMCVZlntSIxWx+HXFu5rL0Ax5ZmSal ++uoWpwDXbKYgHF9zlGXqYulsODqZC0cjJpUogXFC0B4pRDUVzuZXO9ACuS5azXYqh ++G6Rw0O6rDTHVgkmazJtxreO8v4NpfIbBbFfQgU5xeHdS6ky9LqG+yUKJ5FWkGWcU ++SqpZX3yxXM4q/cA1KBN31K3V2xvjVPcEwzkZDGDbLg33DASVF7RV/WYymhDuxE+w ++vHDz9Q7dk4pTzCdNiQgomBSjOkLDKWuOvaInQwYWJgavpPGWr31hDyi5Kw== ++-----END RSA PRIVATE KEY----- +diff --git a/tests/data/rootCA.srl b/tests/data/rootCA.srl +new file mode 100644 +index 00000000..8c619f27 +--- /dev/null ++++ b/tests/data/rootCA.srl +@@ -0,0 +1 @@ ++02D3FA5376B8B25617BA76C4EA3AE7FE4AC318B1 +-- +2.20.1 + diff --git a/SOURCES/cflags.patch b/SOURCES/cflags.patch new file mode 100644 index 0000000..38df48b --- /dev/null +++ b/SOURCES/cflags.patch @@ -0,0 +1,65 @@ +From 629e05d8dc795a70fd2bcd3d0301641105bf0b06 Mon Sep 17 00:00:00 2001 +From: John Dennis +Date: Wed, 15 Jun 2016 11:50:24 -0400 +Subject: [PATCH] enable user supplied CFLAGS +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit + +CFLAGS is initialized to the empty string in configure.ac, this +effectively turned off user supplied values for CFLAGS preventing site +specific values from being used. A further complicating factor was of +all the user supplied values documented in Automake only CFLAGS was +disabled allowing all other user supplied variables to take +effect. Some variables must be coordinated (e.g. CFLAGS with LDFLAGS), +the fact LDFLAGS was picked up from the environment but CFLAGS was +discarded caused build failures due to incompatible combination of +compiler and linker options. + +The problem was first introduced in commit: 73d9c98f "Reset CFLAGS +when --enable-debugging is used". This patch simply removes hardcoding +CFLAGS to the empty string and appends the debug options +(--enable-debugging) to the existing CFLAGS. + +Proper use of the variables is described in the Automake documentation +in the section "Flag Variables Ordering" +https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html + +Although the Automake documentation claims manipulating CFLAGS +directly is improper use there are many examples of this in the +existing configure.ac, this patch makes no attempt at addressing this +issue, rather it makes existing usage consistent. In the particular +case of debug flags appending to CFLAGS is probably the only valid +solution because the debug flags must appear at the end of the list of +flags in order to override earlier flags, CFLAGS always appears last +in the Makefile (see above Automake doc). + +Signed-off-by: John Dennis +License: MIT +--- + configure.ac | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 7c58870..cf86262 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -91,7 +91,6 @@ dnl + dnl Check for programs + dnl + AC_PROG_CC +-CFLAGS="" + AM_CFLAGS="" + AC_HEADER_STDC + LT_AC_PROG_RC +@@ -702,7 +701,7 @@ AC_ARG_ENABLE(debugging, [ --enable-debugging enable debuging optimizati + if test "z$enable_debugging" = "zyes" ; then + enable_debugging=yes + LASSO_DEFINES="$LASSO_DEFINES -DLASSO_DEBUG" +- AM_CFLAGS="-O0 -g -Wall -Wextra -Werror" ++ CFLAGS="$CFLAGS -O0 -g -Wall -Wextra -Werror" + else + enable_debugging=no + fi +-- +2.5.5 + diff --git a/SOURCES/validate_idp_list_test.patch b/SOURCES/validate_idp_list_test.patch new file mode 100644 index 0000000..9344fea --- /dev/null +++ b/SOURCES/validate_idp_list_test.patch @@ -0,0 +1,71 @@ +commit 11ebfeb62148a89e2ebae90d7c70be918cfdc244 +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. + + Signed-off-by: John Dennis + License: MIT + +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); diff --git a/SPECS/lasso.spec b/SPECS/lasso.spec new file mode 100644 index 0000000..52b2d91 --- /dev/null +++ b/SPECS/lasso.spec @@ -0,0 +1,333 @@ +%global with_java 0 +%global with_php 0 +%global with_perl 0 +%global with_python 1 +%global with_wsf 0 + +%if %{with_php} +%if "%{php_version}" < "5.6" +%global ini_name %{name}.ini +%else +%global ini_name 40-%{name}.ini +%endif +%endif + +Summary: Liberty Alliance Single Sign On +Name: lasso +Version: 2.5.1 +Release: 5%{?dist} +License: GPLv2+ +Group: System Environment/Libraries +Source: http://dev.entrouvert.org/lasso/lasso-%{version}.tar.gz +%if %{with_wsf} +BuildRequires: cyrus-sasl-devel +%endif +BuildRequires: gtk-doc, libtool-ltdl-devel +BuildRequires: glib2-devel >= 2.42, swig +Requires: glib2 >= 2.42 +BuildRequires: libxml2-devel, xmlsec1-devel, openssl-devel, xmlsec1-openssl-devel +BuildRequires: zlib-devel, check-devel +BuildRequires: libtool autoconf automake +BuildRequires: python-six +Url: http://lasso.entrouvert.org/ + +patch1: cflags.patch +patch2: validate_idp_list_test.patch +patch3: 0003-Choose-the-Reference-transform-based-on-the-chosen-S.patch +patch4: 0004-Fix-ECP-signature-not-found-error-when-only-assertio.patch +patch5: 0005-PAOS-Do-not-populate-Destination-attribute.patch +patch6: 0006-tests-use-self-generated-certificate-to-sign-federat.patch + +%description +Lasso is a library that implements the Liberty Alliance Single Sign On +standards, including the SAML and SAML2 specifications. It allows to handle +the whole life-cycle of SAML based Federations, and provides bindings +for multiple languages. + +%package devel +Summary: Lasso development headers and documentation +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +This package contains the header files, static libraries and development +documentation for Lasso. + +%if %{with_perl} +%package perl +Summary: Liberty Alliance Single Sign On (lasso) Perl bindings +Group: Development/Libraries +BuildRequires: perl(ExtUtils::MakeMaker) +BuildRequires: perl(Test::More) +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description perl +Perl language bindings for the lasso (Liberty Alliance Single Sign On) library. +%endif + +%if %{with_java} +%package java +Summary: Liberty Alliance Single Sign On (lasso) Java bindings +Group: Development/Libraries +BuildRequires: java-devel +BuildRequires: jpackage-utils +Requires: java-headless +Requires: jpackage-utils +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description java +Java language bindings for the lasso (Liberty Alliance Single Sign On) library. +%endif + +%if %{with_php} +%package php +Summary: Liberty Alliance Single Sign On (lasso) PHP bindings +Group: Development/Libraries +BuildRequires: php-devel, expat-devel +BuildRequires: python2 +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: php(zend-abi) = %{php_zend_api} +Requires: php(api) = %{php_core_api} +Provides: php-lasso = %{version}-%{release} +Provides: php-lasso%{?_isa} = %{version}-%{release} + +%description php +PHP language bindings for the lasso (Liberty Alliance Single Sign On) library. +%endif + +%if %{with_python} +%package python +Summary: Liberty Alliance Single Sign On (lasso) Python bindings +Group: Development/Libraries +BuildRequires: python2-devel +BuildRequires: python-lxml +Requires: python +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description python +Python language bindings for the lasso (Liberty Alliance Single Sign On) +library. +%endif + +%prep +%setup -q -n %{name}-%{version} +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 + +%build +autoreconf -vif +%configure --prefix=%{_prefix} \ +%if !%{with_java} + --disable-java \ +%endif +%if !%{with_python} + --disable-python \ +%endif +%if !%{with_perl} + --disable-perl \ +%endif +%if %{with_php} + --enable-php5=yes \ + --with-php5-config-dir=%{php_inidir} \ +%else + --enable-php5=no \ +%endif +%if %{with_wsf} + --enable-wsf \ + --with-sasl2=%{_prefix}/sasl2 \ +%endif +# --with-html-dir=%{_datadir}/gtk-doc/html + +make %{?_smp_mflags} CFLAGS="%{optflags}" + +%check +make check + +%install +#install -m 755 -d %{buildroot}%{_datadir}/gtk-doc/html + +make install exec_prefix=%{_prefix} DESTDIR=%{buildroot} +find %{buildroot} -type f -name '*.la' -exec rm -f {} \; +find %{buildroot} -type f -name '*.a' -exec rm -f {} \; + +# Perl subpackage +%if %{with_perl} +find %{buildroot} \( -name perllocal.pod -o -name .packlist \) -exec rm -v {} \; + +find %{buildroot}/usr/lib*/perl5 -type f -print | + sed "s@^%{buildroot}@@g" > %{name}-perl-filelist +if [ "$(cat %{name}-perl-filelist)X" = "X" ] ; then + echo "ERROR: EMPTY FILE LIST" + exit -1 +fi +%endif + +# PHP subpackage +%if %{with_php} +install -m 755 -d %{buildroot}%{_datadir}/php/%{name} +mv %{buildroot}%{_datadir}/php/lasso.php %{buildroot}%{_datadir}/php/%{name} + +# rename the PHP config file when needed (PHP 5.6+) +if [ "%{name}.ini" != "%{ini_name}" ]; then + mv %{buildroot}%{php_inidir}/%{name}.ini \ + %{buildroot}%{php_inidir}/%{ini_name} +fi +%endif + +# Remove bogus doc files +rm -fr %{buildroot}%{_defaultdocdir}/%{name} + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%{_libdir}/liblasso.so.* +%doc AUTHORS COPYING NEWS README + +%files devel +%defattr(-,root,root) +%{_libdir}/liblasso.so +%{_libdir}/pkgconfig/lasso.pc +%{_includedir}/%{name} + +%if %{with_perl} +%files perl -f %{name}-perl-filelist +%defattr(-,root,root) +%endif + +%if %{with_java} +%files java +%defattr(-,root,root) +%{_libdir}/java/libjnilasso.so +%{_javadir}/lasso.jar +%endif + +%if %{with_php} +%files php +%defattr(-,root,root) +%attr(755,root,root) %{php_extdir}/lasso.so +%config(noreplace) %attr(644,root,root) %{php_inidir}/%{ini_name} +%attr(755,root,root) %dir %{_datadir}/php/%{name} +%attr(644,root,root) %{_datadir}/php/%{name}/lasso.php +%endif + +%if %{with_python} +%files python +%defattr(-,root,root) +%{python_sitearch}/lasso.py* +%{python_sitearch}/_lasso.so +%endif + +%changelog +* Tue Aug 6 2019 Jakub Hrozek - 2.5.1-5 +- Resolves: #1719014 - Expired certificate prevents tests from running +- Actually apply the patch file for the previous build +- Related: #1730009 - lasso includes "Destination" attribute in SAML + AuthnRequest populated with SP + AssertionConsumerServiceURL when ECP workflow + is used which leads to IdP-side errors + +* Tue Jul 23 2019 Jakub Hrozek - 2.5.1-4 +- Resolves: #1730009 - lasso includes "Destination" attribute in SAML + AuthnRequest populated with SP + AssertionConsumerServiceURL when ECP workflow + is used which leads to IdP-side errors + +* Sun Feb 10 2019 Jakub Hrozek - 2.5.1-3 +- Resolves: #1634267 - ECP signature check fails with + LASSO_DS_ERROR_SIGNATURE_NOT_FOUND when assertion signed + instead of response + +* Fri Jun 17 2016 John Dennis - 2.5.1-2 +- Rebase to upstream 2.5.1 + Resolves: #1310860 +- add validate_idp_list_test patch + +* Thu Jun 9 2016 John Dennis - 2.5.1-1 +- Rebase to upstream 2.5.1 + Resolves: #1310860 + +* Thu Sep 3 2015 John Dennis - 2.5.0-1 +- Rebase to upstream, now includes our ECP patches, no need to patch any more + Resolves: #1205342 + +* Tue Sep 1 2015 John Dennis - 2.4.1-8 +- Add explicit minimum dependency on glib2 2.42, + for some reason RPM is not automatically detecting the dependency + Resolves: #1254989 + +* Wed Aug 19 2015 John Dennis - 2.4.1-7 +- Add ECP support, brings Lasso up to current upstream tip + revised ECP patches + Resolves: #1205342 + +* Mon Jun 22 2015 John Dennis - 2.4.1-6 +- Add ECP support, brings Lasso up to current upstream tip + ECP patches + Resolves: #1205342 + +* Fri Dec 5 2014 Simo Sorce - 2.4.1-5 +- Add support for ADFS interoperability +- Resolves: #1160803 + +* Thu Sep 11 2014 Simo Sorce - 2.4.1-4 +- Add missing covscan related patches previously sent upstream +- Related: #1120360 + +* Thu Sep 11 2014 Simo Sorce - 2.4.1-3 +- ppc4le fails to build without autoreconf being run first +- Resolves: #1140419 + +* Fri Sep 5 2014 Simo Sorce - 2.4.1-2 +- Import packge in RHEL7 +- Resolves: #1120360 + +* Thu Aug 28 2014 Simo Sorce - 2.4.1-1 +- New upstream relase 2.4.1 +- Drop patches as they have all been integrated upstream + +* Sun Aug 17 2014 Fedora Release Engineering - 2.4.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Fri Jun 20 2014 Remi Collet - 2.4.0-4 +- rebuild for https://fedoraproject.org/wiki/Changes/Php56 +- add numerical prefix to extension configuration file +- drop unneeded dependency on pecl +- add provides php-lasso + +* Sat Jun 07 2014 Fedora Release Engineering - 2.4.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Fri Apr 25 2014 Simo Sorce - 2.4.0-2 +- Fixes for arches where pointers and integers do not have the same size + (ppc64, s390, etc..) + +* Mon Apr 14 2014 Stanislav Ochotnicky - 2.4.0-1 +- Use OpenJDK instead of GCJ for java bindings + +* Sat Jan 11 2014 Simo Sorce 2.4.0-0 +- Update to final 2.4.0 version +- Drop all patches, they are now included in 2.4.0 +- Change Source URI + +* Mon Dec 9 2013 Simo Sorce 2.3.6-0.20131125.5 +- Add patches to fix rpmlint license issues +- Add upstream patches to fix some build issues + +* Thu Dec 5 2013 Simo Sorce 2.3.6-0.20131125.4 +- Add patch to support automake-1.14 for rawhide + +* Mon Nov 25 2013 Simo Sorce 2.3.6-0.20131125.3 +- Initial packaging +- Based on the spec file by Jean-Marc Liger +- Code is updated to latest master via a jumbo patch while waiting for + official upstream release. +- Jumbo patch includes also additional patches sent to upstream list) + to build on Fedora 20 +- Perl bindings are disabled as they fail to build +- Disable doc building as it doesn't ork correctly for now