From 07c1454be1d1ed5ffaf3f5494c90a75e2b937f0b Mon Sep 17 00:00:00 2001 From: cantor Date: Mon, 21 May 2007 04:00:43 +0000 Subject: [PATCH] Add a RP-based key name to credential lookup. git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@2255 cb58f699-b61c-0410-a6fe-9272a202ed29 --- configs/shibboleth.xml.in | 35 ++++- schemas/shibboleth-2.0-native-sp-config.xsd | 7 +- shibsp/binding/impl/SOAPClient.cpp | 6 + shibsp/handler/impl/SAML2SessionInitiator.cpp | 3 + shibsp/shibsp.vcproj | 200 +++++++++++++------------- 5 files changed, 145 insertions(+), 106 deletions(-) diff --git a/configs/shibboleth.xml.in b/configs/shibboleth.xml.in index 462d902..93b6bb7 100644 --- a/configs/shibboleth.xml.in +++ b/configs/shibboleth.xml.in @@ -207,8 +207,13 @@ logoLocation="/shibboleth-sp/logo.jpg" styleSheet="/shibboleth-sp/main.css"/> - - + + + + + @@ -231,7 +236,7 @@ - + @-PKGSYSCONFDIR-@/sp-example.key @@ -240,6 +245,30 @@ @-PKGSYSCONFDIR-@/sp-example.crt + + + diff --git a/schemas/shibboleth-2.0-native-sp-config.xsd b/schemas/shibboleth-2.0-native-sp-config.xsd index 9f1a0f5..5d9118d 100644 --- a/schemas/shibboleth-2.0-native-sp-config.xsd +++ b/schemas/shibboleth-2.0-native-sp-config.xsd @@ -504,14 +504,15 @@ - + - + - + + diff --git a/shibsp/binding/impl/SOAPClient.cpp b/shibsp/binding/impl/SOAPClient.cpp index 3b11ade..9e1158f 100644 --- a/shibsp/binding/impl/SOAPClient.cpp +++ b/shibsp/binding/impl/SOAPClient.cpp @@ -59,6 +59,9 @@ void SOAPClient::send(const soap11::Envelope& env, MetadataCredentialCriteria& p m_credResolver->lock(); // Fill in criteria to use. peer.setUsage(CredentialCriteria::SIGNING_CREDENTIAL); + pair keyName = m_relyingParty->getString("keyName"); + if (keyName.first) + peer.getKeyNames().insert(keyName.second); pair sigalg = m_relyingParty->getXMLString("signatureAlg"); if (sigalg.first) peer.setXMLAlgorithm(sigalg.second); @@ -128,6 +131,9 @@ void SOAPClient::prepareTransport(SOAPTransport& transport) } if (m_credResolver) { m_criteria->setUsage(CredentialCriteria::TLS_CREDENTIAL); + authType = m_relyingParty->getString("keyName"); + if (authType.first) + m_criteria->getKeyNames().insert(authType.second); const Credential* cred = m_credResolver->resolve(m_criteria); if (cred) { if (!transport.setCredential(cred)) diff --git a/shibsp/handler/impl/SAML2SessionInitiator.cpp b/shibsp/handler/impl/SAML2SessionInitiator.cpp index 57ee0e5..c904614 100644 --- a/shibsp/handler/impl/SAML2SessionInitiator.cpp +++ b/shibsp/handler/impl/SAML2SessionInitiator.cpp @@ -491,6 +491,9 @@ pair SAML2SessionInitiator::doRequest( // Fill in criteria to use. MetadataCredentialCriteria mcc(*role); mcc.setUsage(CredentialCriteria::SIGNING_CREDENTIAL); + pair keyName = relyingParty->getString("keyName"); + if (keyName.first) + mcc.getKeyNames().insert(keyName.second); pair sigalg = relyingParty->getXMLString("signatureAlg"); if (sigalg.first) mcc.setXMLAlgorithm(sigalg.second); diff --git a/shibsp/shibsp.vcproj b/shibsp/shibsp.vcproj index 715ca77..5f514b5 100644 --- a/shibsp/shibsp.vcproj +++ b/shibsp/shibsp.vcproj @@ -188,94 +188,10 @@ > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -287,10 +203,6 @@ RelativePath=".\SPConfig.cpp" > - - @@ -424,6 +336,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -518,26 +518,14 @@ > - - - - - - @@ -668,9 +656,21 @@ > + + + + + +