Blame SOURCES/0007-test13_test_lasso_server_load_metadata-Don-t-verify-.patch

db363b
From 1b0000e0163edc9d831894bf4aac7503f0294062 Mon Sep 17 00:00:00 2001
db363b
From: Jakub Hrozek <jhrozek@redhat.com>
db363b
Date: Fri, 18 Jun 2021 18:45:38 +0200
db363b
Subject: [PATCH 7/7] test13_test_lasso_server_load_metadata: Don't verify
db363b
 signature if lasso is not configured with sha-1 (#54037)
db363b
db363b
---
db363b
 tests/basic_tests.c | 10 +++++++++-
db363b
 1 file changed, 9 insertions(+), 1 deletion(-)
db363b
db363b
diff --git a/tests/basic_tests.c b/tests/basic_tests.c
db363b
index 0652abc28..470d64fc6 100644
db363b
--- a/tests/basic_tests.c
db363b
+++ b/tests/basic_tests.c
db363b
@@ -1974,6 +1974,14 @@ START_TEST(test13_test_lasso_server_load_metadata)
db363b
 	LassoServer *server = NULL;
db363b
 	GList *loaded_entity_ids = NULL;
db363b
 	GList blacklisted_1 = { .data = "https://identities.univ-jfc.fr/idp/prod", .next = NULL };
db363b
+	const gchar *trusted_roots = TESTSDATADIR "/rootCA.crt";
db363b
+
db363b
+	/* The IDP metadata file is signed with rsa-sha1, so verifying it would
db363b
+	 * fail incase sha1 is not available
db363b
+	 */
db363b
+	if (lasso_get_default_signature_method() != LASSO_SIGNATURE_METHOD_RSA_SHA1) {
db363b
+		trusted_roots = NULL;
db363b
+	}
db363b
 
db363b
 	check_not_null(server = lasso_server_new(
db363b
 			TESTSDATADIR "/idp5-saml2/metadata.xml",
db363b
@@ -1983,7 +1991,7 @@ START_TEST(test13_test_lasso_server_load_metadata)
db363b
 	block_lasso_logs;
db363b
 	check_good_rc(lasso_server_load_metadata(server, LASSO_PROVIDER_ROLE_IDP,
db363b
 				TESTSDATADIR "/metadata/renater-metadata.xml",
db363b
-				TESTSDATADIR "/rootCA.crt",
db363b
+				trusted_roots,
db363b
 				&blacklisted_1, &loaded_entity_ids,
db363b
 				LASSO_SERVER_LOAD_METADATA_FLAG_DEFAULT));
db363b
 	unblock_lasso_logs;
db363b
-- 
db363b
2.26.3
db363b