X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=blobdiff_plain;f=samltest%2Fsaml2%2Fbinding%2FSAML2POSTTest.h;h=aed926cb4433c8d34e7aa89859a976ef2b0cddbf;hp=814873ee3fcdd69402d7c653c6d5234b22451224;hb=5d4b679f292a46494e822e9634f0ffa06f8f421c;hpb=bd9231e66414ec239402ab809ae46fa3be97ca3b diff --git a/samltest/saml2/binding/SAML2POSTTest.h b/samltest/saml2/binding/SAML2POSTTest.h index 814873e..aed926c 100644 --- a/samltest/saml2/binding/SAML2POSTTest.h +++ b/samltest/saml2/binding/SAML2POSTTest.h @@ -46,11 +46,11 @@ public: ); janitor.release(); - CredentialCriteria cc; - cc.setUsage(CredentialCriteria::SIGNING_CREDENTIAL); - Locker clocker(m_creds); - const Credential* cred = m_creds->resolve(&cc); - TSM_ASSERT("Retrieved credential was null", cred!=NULL); + CredentialCriteria cc; + cc.setUsage(CredentialCriteria::SIGNING_CREDENTIAL); + Locker clocker(m_creds); + const Credential* cred = m_creds->resolve(&cc); + TSM_ASSERT("Retrieved credential was null", cred!=NULL); // Freshen timestamp and ID. toSend->setIssueInstant(time(NULL)); @@ -70,7 +70,10 @@ public: samlconstants::SAML20_BINDING_HTTP_POST, encoder_config->getDocumentElement() ) ); - encoder->encode(*this,toSend.get(),"https://sp.example.org/SAML/SSO","https://sp.example.org/","state",cred); + Locker locker(m_metadata); + encoder->encode( + *this,toSend.get(),"https://sp.example.org/SAML/SSO",m_metadata->getEntityDescriptor("https://sp.example.org/"),"state",cred + ); toSend.release(); // Decode message. @@ -78,7 +81,6 @@ public: auto_ptr decoder( SAMLConfig::getConfig().MessageDecoderManager.newPlugin(samlconstants::SAML20_BINDING_HTTP_POST, NULL) ); - Locker locker(m_metadata); auto_ptr response(dynamic_cast(decoder->decode(relayState,*this,policy))); // Test the results. @@ -114,11 +116,11 @@ public: ); janitor.release(); - CredentialCriteria cc; - cc.setUsage(CredentialCriteria::SIGNING_CREDENTIAL); - Locker clocker(m_creds); - const Credential* cred = m_creds->resolve(&cc); - TSM_ASSERT("Retrieved credential was null", cred!=NULL); + CredentialCriteria cc; + cc.setUsage(CredentialCriteria::SIGNING_CREDENTIAL); + Locker clocker(m_creds); + const Credential* cred = m_creds->resolve(&cc); + TSM_ASSERT("Retrieved credential was null", cred!=NULL); // Freshen timestamp and ID. toSend->setIssueInstant(time(NULL)); @@ -138,7 +140,10 @@ public: samlconstants::SAML20_BINDING_HTTP_POST_SIMPLESIGN, encoder_config->getDocumentElement() ) ); - encoder->encode(*this,toSend.get(),"https://sp.example.org/SAML/SSO","https://sp.example.org/","state",cred); + Locker locker(m_metadata); + encoder->encode( + *this,toSend.get(),"https://sp.example.org/SAML/SSO",m_metadata->getEntityDescriptor("https://sp.example.org/"),"state",cred + ); toSend.release(); // Decode message. @@ -146,7 +151,6 @@ public: auto_ptr decoder( SAMLConfig::getConfig().MessageDecoderManager.newPlugin(samlconstants::SAML20_BINDING_HTTP_POST_SIMPLESIGN, NULL) ); - Locker locker(m_metadata); auto_ptr response(dynamic_cast(decoder->decode(relayState,*this,policy))); // Test the results.