From 1269a95613f1c653190a91aa8af7d1ffdfe35437 Mon Sep 17 00:00:00 2001 From: Johan Lundberg Date: Wed, 5 Jun 2024 16:19:17 +0200 Subject: [PATCH 1/2] add xenc-schema-11.xsd to schema validator original url: https://www.w3.org/TR/xmlenc-core1/xenc-schema-11.xsd --- src/saml2/data/schemas/xenc-schema-11.xsd | 117 ++++++++++++++++++++++ src/saml2/xml/schema/__init__.py | 2 + 2 files changed, 119 insertions(+) create mode 100644 src/saml2/data/schemas/xenc-schema-11.xsd diff --git a/src/saml2/data/schemas/xenc-schema-11.xsd b/src/saml2/data/schemas/xenc-schema-11.xsd new file mode 100644 index 000000000..8d0af5afe --- /dev/null +++ b/src/saml2/data/schemas/xenc-schema-11.xsd @@ -0,0 +1,117 @@ + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/saml2/xml/schema/__init__.py b/src/saml2/xml/schema/__init__.py index 7a9464425..08e56ce63 100644 --- a/src/saml2/xml/schema/__init__.py +++ b/src/saml2/xml/schema/__init__.py @@ -23,6 +23,7 @@ def _create_xml_schema_validator(source=None, **kwargs): path_schema_xml = str(schema_resources.joinpath("xml.xsd")) path_schema_envelope = str(schema_resources.joinpath("envelope.xsd")) path_schema_xenc = str(schema_resources.joinpath("xenc-schema.xsd")) + path_schema_xenc_11 = str(schema_resources.joinpath("xenc-schema-11.xsd")) path_schema_xmldsig_core = str(schema_resources.joinpath("xmldsig-core-schema.xsd")) path_schema_saml_assertion = str(schema_resources.joinpath("saml-schema-assertion-2.0.xsd")) path_schema_saml_metadata = str(schema_resources.joinpath("saml-schema-metadata-2.0.xsd")) @@ -39,6 +40,7 @@ def _create_xml_schema_validator(source=None, **kwargs): "http://www.w3.org/XML/1998/namespace": path_schema_xml, "http://schemas.xmlsoap.org/soap/envelope/": path_schema_envelope, "http://www.w3.org/2001/04/xmlenc#": path_schema_xenc, + "http://www.w3.org/2009/xmlenc11#": path_schema_xenc_11, "http://www.w3.org/2000/09/xmldsig#": path_schema_xmldsig_core, "urn:oasis:names:tc:SAML:2.0:assertion": path_schema_saml_assertion, "urn:oasis:names:tc:SAML:2.0:metadata": path_schema_saml_metadata, From 32763b6c0b9837b6376e6cd52359406dacbb8cd6 Mon Sep 17 00:00:00 2001 From: Johan Lundberg Date: Wed, 5 Jun 2024 16:48:14 +0200 Subject: [PATCH 2/2] test that xenc-schema-11.xsd is used in schema validator --- tests/encrypted_attribute_statement.xml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tests/encrypted_attribute_statement.xml b/tests/encrypted_attribute_statement.xml index 9727d3c98..65860bc2a 100644 --- a/tests/encrypted_attribute_statement.xml +++ b/tests/encrypted_attribute_statement.xml @@ -1,7 +1,8 @@ + xmlns:ns2="http://www.w3.org/2000/09/xmldsig#" + xmlns:ns3="http://www.w3.org/2009/xmlenc11#"> @@ -25,8 +26,9 @@ - + + + @@ -48,8 +50,9 @@ Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/> - + + + @@ -82,8 +85,9 @@ Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/> - + + + @@ -116,8 +120,9 @@ Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/> - + + +