[cpp-sp] branch master updated: SSPCPP-756 Signature fail test for MDQ

Rod Widdowson rdw at steadingsoftware.com
Thu Jan 18 09:07:48 EST 2018


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch master
in repository cpp-sp.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=c5a3c006c7a8a72b9679214f25d36083d82c3ffb

The following commit(s) were added to refs/heads/master by this push:
       new  c5a3c00   SSPCPP-756  Signature fail test for MDQ
c5a3c00 is described below

commit c5a3c006c7a8a72b9679214f25d36083d82c3ffb
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Fri Jan 12 14:28:51 2018 +0000

    SSPCPP-756  Signature fail test for MDQ
    
    https://issues.shibboleth.net/jira/browse/SSPCPP-756
---
 Projects/vc15/UnitTests/UnitTests.vcxproj         |  3 ++-
 Projects/vc15/UnitTests/UnitTests.vcxproj.filters |  3 +++
 unittests/DynamicMetadataProviderTest.h           | 25 +++++++++++++++++++++++
 unittests/config/etc/shibboleth/cert.pem          | 16 +++++++++++++++
 unittests/data/badSigMDQ.xml                      |  4 ++++
 5 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/Projects/vc15/UnitTests/UnitTests.vcxproj b/Projects/vc15/UnitTests/UnitTests.vcxproj
index f368c2c..9e5c29f 100644
--- a/Projects/vc15/UnitTests/UnitTests.vcxproj
+++ b/Projects/vc15/UnitTests/UnitTests.vcxproj
@@ -177,6 +177,7 @@
     <ClCompile Include="..\..\..\unittests\TestApplication.cpp" />
   </ItemGroup>
   <ItemGroup>
+    <Xml Include="..\..\..\unittests\data\badSigMDQ.xml" />
     <Xml Include="..\..\..\unittests\data\chainedFromURL.xml">
       <SubType>Designer</SubType>
     </Xml>
@@ -191,4 +192,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
+</Project>
\ No newline at end of file
diff --git a/Projects/vc15/UnitTests/UnitTests.vcxproj.filters b/Projects/vc15/UnitTests/UnitTests.vcxproj.filters
index b261e86..020c14e 100644
--- a/Projects/vc15/UnitTests/UnitTests.vcxproj.filters
+++ b/Projects/vc15/UnitTests/UnitTests.vcxproj.filters
@@ -59,6 +59,9 @@
     <Xml Include="..\..\..\unittests\data\localDynamic.xml">
       <Filter>Data</Filter>
     </Xml>
+    <Xml Include="..\..\..\unittests\data\badSigMDQ.xml">
+      <Filter>Data</Filter>
+    </Xml>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\unittests\BaseTestCase.h">
diff --git a/unittests/DynamicMetadataProviderTest.h b/unittests/DynamicMetadataProviderTest.h
index 92d1971..7c411fa 100644
--- a/unittests/DynamicMetadataProviderTest.h
+++ b/unittests/DynamicMetadataProviderTest.h
@@ -33,6 +33,7 @@
 #include <saml/saml2/binding/SAML2ArtifactType0004.h>
 #include <saml/saml2/binding/SAML2Artifact.h>
 #include <saml/saml2/metadata/Metadata.h>
+#include <saml/saml2/metadata/MetadataFilter.h>
 
 #include <shibsp/Application.h>
 #include <shibsp/SPConfig.h>
@@ -179,4 +180,28 @@ public:
         mdqTest(true);
     }
 
+    void testMDQBadSig()
+    {
+        string config = data_path + "badSigMDQ.xml";
+        ifstream in(config.c_str());
+        XMLToolingConfig& xcf = XMLToolingConfig::getConfig();
+        ParserPool& pool = xcf.getParser();
+        XercesJanitor<DOMDocument> janitor(pool.parse(in));
+        auto_ptr<MetadataProvider> metadataProvider(
+            opensaml::SAMLConfig::getConfig().MetadataProviderManager.newPlugin(DYNAMIC_METADATA_PROVIDER, janitor.get()->getDocumentElement())
+        );
+
+        ta::TestApplication testApp(SPConfig::getConfig().getServiceProvider(), metadataProvider.get());
+        const string testEntity("https://idp2.iay.org.uk/idp/shibboleth");
+        try {
+            metadataProvider->init();
+            MetadataProviderCriteria crit(testApp, testEntity.c_str());
+            pair<const EntityDescriptor*, const RoleDescriptor*>  thePair = metadataProvider->getEntityDescriptor(crit);
+            TS_ASSERT(nullptr == thePair.first);
+        } catch (XMLToolingException& ex) {
+            TS_TRACE(ex.what());
+            throw;
+        }
+    }
+
 };
diff --git a/unittests/config/etc/shibboleth/cert.pem b/unittests/config/etc/shibboleth/cert.pem
new file mode 100644
index 0000000..e8261f3
--- /dev/null
+++ b/unittests/config/etc/shibboleth/cert.pem
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIICjzCCAfigAwIBAgIJAKk8t1hYcMkhMA0GCSqGSIb3DQEBBAUAMDoxCzAJBgNV
+BAYTAlVTMRIwEAYDVQQKEwlJbnRlcm5ldDIxFzAVBgNVBAMTDnNwLmV4YW1wbGUu
+b3JnMB4XDTA1MDYyMDE1NDgzNFoXDTMyMTEwNTE1NDgzNFowOjELMAkGA1UEBhMC
+VVMxEjAQBgNVBAoTCUludGVybmV0MjEXMBUGA1UEAxMOc3AuZXhhbXBsZS5vcmcw
+gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANlZ1L1mKzYbUVKiMQLhZlfGDyYa
+/jjCiaXP0WhLNgvJpOTeajvsrApYNnFX5MLNzuC3NeQIjXUNLN2Yo2MCSthBIOL5
+qE5dka4z9W9zytoflW1LmJ8vXpx8Ay/meG4z//J5iCpYVEquA0xl28HUIlownZUF
+7w7bx0cF/02qrR23AgMBAAGjgZwwgZkwHQYDVR0OBBYEFJZiO1qsyAyc3HwMlL9p
+JpN6fbGwMGoGA1UdIwRjMGGAFJZiO1qsyAyc3HwMlL9pJpN6fbGwoT6kPDA6MQsw
+CQYDVQQGEwJVUzESMBAGA1UEChMJSW50ZXJuZXQyMRcwFQYDVQQDEw5zcC5leGFt
+cGxlLm9yZ4IJAKk8t1hYcMkhMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQAD
+gYEAMFq/UeSQyngE0GpZueyD2UW0M358uhseYOgGEIfm+qXIFQF6MYwNoX7WFzhC
+LJZ2E6mEvZZFHCHUtl7mGDvsRwgZ85YCtRbvleEpqfgNQToto9pLYe+X6vvH9Z6p
+gmYsTmak+kxO93JprrOd9xp8aZPMEprL7VCdrhbZEfyYER0=
+-----END CERTIFICATE-----
diff --git a/unittests/data/badSigMDQ.xml b/unittests/data/badSigMDQ.xml
new file mode 100644
index 0000000..12eb518
--- /dev/null
+++ b/unittests/data/badSigMDQ.xml
@@ -0,0 +1,4 @@
+<MetadataProvider type="MDQ" ignoreTransport="true"  cacheDirectory="dynamic/BadSig" backgroundInitialize="true" baseUrl="http://mdq-beta.incommon.org/global/">
+    <MetadataFilter type="Signature" certificate="cert.pem"/>
+</MetadataProvider>
+    
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list