From 05e34e05e303ddc66c13efa92e448b654b68df5e Mon Sep 17 00:00:00 2001 From: cantor Date: Sun, 27 May 2007 03:27:51 +0000 Subject: [PATCH] Draft artifact resolver. Fixes and properties related to SOAP-based services. Client certificate bridging for Apache and IIS. git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@2263 cb58f699-b61c-0410-a6fe-9272a202ed29 --- apache/mod_apache.cpp | 17 +- configs/shibboleth.xml.in | 5 +- isapi_shib/isapi_shib.cpp | 39 ++- isapi_shib/isapi_shib.vcproj | 4 +- nsapi_shib/nsapi_shib.cpp | 2 +- schemas/shibboleth-2.0-native-sp-config.xsd | 2 + shibsp/Makefile.am | 1 + shibsp/handler/AbstractHandler.h | 18 +- shibsp/handler/AssertionConsumerService.h | 1 - shibsp/handler/impl/AbstractHandler.cpp | 27 +- shibsp/handler/impl/AssertionConsumerService.cpp | 6 +- shibsp/handler/impl/RemotedHandler.cpp | 26 +- shibsp/handler/impl/SAML1Consumer.cpp | 2 +- shibsp/handler/impl/SAML2ArtifactResolution.cpp | 369 +++++++++++++++++++++++ shibsp/handler/impl/SAML2Consumer.cpp | 2 +- shibsp/shibsp-lite.vcproj | 4 + shibsp/shibsp.vcproj | 4 + 17 files changed, 498 insertions(+), 31 deletions(-) create mode 100644 shibsp/handler/impl/SAML2ArtifactResolution.cpp diff --git a/apache/mod_apache.cpp b/apache/mod_apache.cpp index ccbc0c3..91e196f 100644 --- a/apache/mod_apache.cpp +++ b/apache/mod_apache.cpp @@ -271,7 +271,7 @@ class ShibTargetApache : public AbstractSPRequest { mutable string m_body; mutable bool m_gotBody; - vector m_certs; + mutable vector m_certs; public: request_rec* m_req; @@ -419,13 +419,26 @@ public: in.read(buf,1024); ap_rwrite(buf,in.gcount(),m_req); } - return ((status==XMLTOOLING_HTTP_STATUS_OK) ? DONE : status); + if (status!=XMLTOOLING_HTTP_STATUS_OK) + m_req->status = status; + return DONE; } long sendRedirect(const char* url) { ap_table_set(m_req->headers_out, "Location", url); return REDIRECT; } const vector& getClientCertificates() const { + if (m_certs.empty()) { + const char* cert = ap_table_get(m_req->subprocess_env, "SSL_CLIENT_CERT"); + if (cert) + m_certs.push_back(cert); + int i = 0; + do { + cert = ap_table_get(m_req->subprocess_env, ap_psprintf(m_req->pool, "SSL_CLIENT_CERT_CHAIN_%d", i++)); + if (cert) + m_certs.push_back(cert); + } while (cert); + } return m_certs; } long returnDecline(void) { return DECLINED; } diff --git a/configs/shibboleth.xml.in b/configs/shibboleth.xml.in index bceda8d..df65ed2 100644 --- a/configs/shibboleth.xml.in +++ b/configs/shibboleth.xml.in @@ -214,8 +214,9 @@ logoLocation="/shibboleth-sp/logo.jpg" styleSheet="/shibboleth-sp/main.css"/> - - + +