X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=saml%2Fsaml2%2Fmetadata%2FMetadataCredentialCriteria.h;h=7d5781088fe5bc9ea4c1a16b682a82cc8148716b;hb=a674332b26800573103818eb0b3522ce47151714;hp=f23be2791863480759dd2e05b7e363ca32f8b109;hpb=37bd681d9935d6fd27177b33b055303ebeb72d11;p=shibboleth%2Fopensaml2.git diff --git a/saml/saml2/metadata/MetadataCredentialCriteria.h b/saml/saml2/metadata/MetadataCredentialCriteria.h index f23be27..7d57810 100644 --- a/saml/saml2/metadata/MetadataCredentialCriteria.h +++ b/saml/saml2/metadata/MetadataCredentialCriteria.h @@ -60,14 +60,14 @@ namespace opensaml { return m_role; } - bool matches(xmltooling::Credential& credential) const { + bool matches(const xmltooling::Credential& credential) const { const MetadataCredentialContext* context = dynamic_cast(credential.getCredentalContext()); if (context) { // Check for a usage mismatch. - if ((getUsage()==CredentialCriteria::SIGNING_CREDENTIAL || getUsage()==CredentialCriteria::TLS_CREDENTIAL) && + if ((getUsage() | (xmltooling::Credential::SIGNING_CREDENTIAL & xmltooling::Credential::TLS_CREDENTIAL)) && XMLString::equals(context->getKeyDescriptor().getUse(),KeyDescriptor::KEYTYPE_ENCRYPTION)) return false; - else if (getUsage()==CredentialCriteria::ENCRYPTION_CREDENTIAL && + else if ((getUsage() | xmltooling::Credential::ENCRYPTION_CREDENTIAL) && XMLString::equals(context->getKeyDescriptor().getUse(),KeyDescriptor::KEYTYPE_SIGNING)) return false; }